Skip to content

Commit ef96f7a

Browse files
committed
better dense return type
1 parent d5c8a4d commit ef96f7a

File tree

4 files changed

+5
-10
lines changed

4 files changed

+5
-10
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from setuptools import setup, find_packages
44

5-
__version__ = '0.2.2'
5+
__version__ = '0.2.3'
66
url = 'https://github.com/rusty1s/pytorch_cluster'
77

88
install_requires = ['cffi', 'torch-unique']

test/dense_grid.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
"size": [5, 5],
3737
"batch": [0, 0, 0, 0, 0, 1, 1],
3838
"expected": [0, 5, 1, 0, 2, 6, 9],
39-
"expected_C": 6
39+
"expected_C": 12
4040
},
4141
{
4242
"name": "Batch with start/end parameter",
@@ -46,7 +46,7 @@
4646
"start": 0,
4747
"end": 20,
4848
"expected": [0, 9, 1, 0, 4, 16, 21],
49-
"expected_C": 16
49+
"expected_C": 32
5050
}
5151
]
5252

torch_cluster/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from .functions.grid import sparse_grid_cluster, dense_grid_cluster
22

3-
__version__ = '0.2.2'
3+
__version__ = '0.2.3'
44

55
__all__ = ['sparse_grid_cluster', 'dense_grid_cluster', '__version__']

torch_cluster/functions/grid.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,4 @@ def dense_grid_cluster(position, size, batch=None, start=None, end=None):
8888
position, size = _preprocess(position, size, batch, start)
8989
cluster_size = _fixed_cluster_size(position, size, batch, end)
9090
cluster, C = _grid_cluster(position, size, cluster_size)
91-
92-
if batch is None:
93-
return cluster, C
94-
else:
95-
C = C // cluster_size[0]
96-
return cluster, C
91+
return cluster, C

0 commit comments

Comments
 (0)