Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
torch-cluster
Commits
ef96f7a1
"git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "0ab63ff6478b7cc6b5ae0d46c7c386d476cfa87f"
Commit
ef96f7a1
authored
Feb 26, 2018
by
rusty1s
Browse files
better dense return type
parent
d5c8a4df
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
5 additions
and
10 deletions
+5
-10
setup.py
setup.py
+1
-1
test/dense_grid.json
test/dense_grid.json
+2
-2
torch_cluster/__init__.py
torch_cluster/__init__.py
+1
-1
torch_cluster/functions/grid.py
torch_cluster/functions/grid.py
+1
-6
No files found.
setup.py
View file @
ef96f7a1
...
@@ -2,7 +2,7 @@ from os import path as osp
...
@@ -2,7 +2,7 @@ from os import path as osp
from
setuptools
import
setup
,
find_packages
from
setuptools
import
setup
,
find_packages
__version__
=
'0.2.
2
'
__version__
=
'0.2.
3
'
url
=
'https://github.com/rusty1s/pytorch_cluster'
url
=
'https://github.com/rusty1s/pytorch_cluster'
install_requires
=
[
'cffi'
,
'torch-unique'
]
install_requires
=
[
'cffi'
,
'torch-unique'
]
...
...
test/dense_grid.json
View file @
ef96f7a1
...
@@ -36,7 +36,7 @@
...
@@ -36,7 +36,7 @@
"size"
:
[
5
,
5
],
"size"
:
[
5
,
5
],
"batch"
:
[
0
,
0
,
0
,
0
,
0
,
1
,
1
],
"batch"
:
[
0
,
0
,
0
,
0
,
0
,
1
,
1
],
"expected"
:
[
0
,
5
,
1
,
0
,
2
,
6
,
9
],
"expected"
:
[
0
,
5
,
1
,
0
,
2
,
6
,
9
],
"expected_C"
:
6
"expected_C"
:
12
},
},
{
{
"name"
:
"Batch with start/end parameter"
,
"name"
:
"Batch with start/end parameter"
,
...
@@ -46,7 +46,7 @@
...
@@ -46,7 +46,7 @@
"start"
:
0
,
"start"
:
0
,
"end"
:
20
,
"end"
:
20
,
"expected"
:
[
0
,
9
,
1
,
0
,
4
,
16
,
21
],
"expected"
:
[
0
,
9
,
1
,
0
,
4
,
16
,
21
],
"expected_C"
:
16
"expected_C"
:
32
}
}
]
]
torch_cluster/__init__.py
View file @
ef96f7a1
from
.functions.grid
import
sparse_grid_cluster
,
dense_grid_cluster
from
.functions.grid
import
sparse_grid_cluster
,
dense_grid_cluster
__version__
=
'0.2.
2
'
__version__
=
'0.2.
3
'
__all__
=
[
'sparse_grid_cluster'
,
'dense_grid_cluster'
,
'__version__'
]
__all__
=
[
'sparse_grid_cluster'
,
'dense_grid_cluster'
,
'__version__'
]
torch_cluster/functions/grid.py
View file @
ef96f7a1
...
@@ -88,9 +88,4 @@ def dense_grid_cluster(position, size, batch=None, start=None, end=None):
...
@@ -88,9 +88,4 @@ def dense_grid_cluster(position, size, batch=None, start=None, end=None):
position
,
size
=
_preprocess
(
position
,
size
,
batch
,
start
)
position
,
size
=
_preprocess
(
position
,
size
,
batch
,
start
)
cluster_size
=
_fixed_cluster_size
(
position
,
size
,
batch
,
end
)
cluster_size
=
_fixed_cluster_size
(
position
,
size
,
batch
,
end
)
cluster
,
C
=
_grid_cluster
(
position
,
size
,
cluster_size
)
cluster
,
C
=
_grid_cluster
(
position
,
size
,
cluster_size
)
return
cluster
,
C
if
batch
is
None
:
return
cluster
,
C
else
:
C
=
C
//
cluster_size
[
0
]
return
cluster
,
C
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment