Skip to content

Commit 43c5045

Browse files
committed
added unique test
1 parent 92082f9 commit 43c5045

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import torch
33
from torch.utils.cpp_extension import BuildExtension, CUDAExtension
44

5-
__version__ = '0.2.0'
5+
__version__ = '0.2.1'
66
url = 'https://github.com/rusty1s/pytorch_sparse'
77

88
install_requires = ['scipy']

test/test_coalesce.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22
from torch_sparse import coalesce
33

44

5+
def test_coalesce():
6+
row = torch.tensor([1, 0, 1, 0, 2, 1])
7+
col = torch.tensor([0, 1, 1, 1, 0, 0])
8+
index = torch.stack([row, col], dim=0)
9+
10+
index, _ = coalesce(index, None, m=3, n=2)
11+
assert index.tolist() == [[0, 1, 1, 2], [1, 0, 1, 0]]
12+
13+
514
def test_coalesce_add():
615
row = torch.tensor([1, 0, 1, 0, 2, 1])
716
col = torch.tensor([0, 1, 1, 1, 0, 0])

torch_sparse/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
from .spmm import spmm
55
from .spspmm import spspmm
66

7-
__version__ = '0.2.0'
7+
__version__ = '0.2.1'
88

99
__all__ = [
1010
'__version__',

0 commit comments

Comments
 (0)