"git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "0ab63ff6478b7cc6b5ae0d46c7c386d476cfa87f"
Commit ef96f7a1 authored by rusty1s's avatar rusty1s
Browse files

better dense return type

parent d5c8a4df
...@@ -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']
......
...@@ -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
} }
] ]
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__']
...@@ -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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment