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-sparse
Commits
43c50459
Commit
43c50459
authored
Oct 20, 2018
by
rusty1s
Browse files
added unique test
parent
92082f98
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
2 deletions
+11
-2
setup.py
setup.py
+1
-1
test/test_coalesce.py
test/test_coalesce.py
+9
-0
torch_sparse/__init__.py
torch_sparse/__init__.py
+1
-1
No files found.
setup.py
View file @
43c50459
...
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
...
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
import
torch
import
torch
from
torch.utils.cpp_extension
import
BuildExtension
,
CUDAExtension
from
torch.utils.cpp_extension
import
BuildExtension
,
CUDAExtension
__version__
=
'0.2.
0
'
__version__
=
'0.2.
1
'
url
=
'https://github.com/rusty1s/pytorch_sparse'
url
=
'https://github.com/rusty1s/pytorch_sparse'
install_requires
=
[
'scipy'
]
install_requires
=
[
'scipy'
]
...
...
test/test_coalesce.py
View file @
43c50459
...
@@ -2,6 +2,15 @@ import torch
...
@@ -2,6 +2,15 @@ import torch
from
torch_sparse
import
coalesce
from
torch_sparse
import
coalesce
def
test_coalesce
():
row
=
torch
.
tensor
([
1
,
0
,
1
,
0
,
2
,
1
])
col
=
torch
.
tensor
([
0
,
1
,
1
,
1
,
0
,
0
])
index
=
torch
.
stack
([
row
,
col
],
dim
=
0
)
index
,
_
=
coalesce
(
index
,
None
,
m
=
3
,
n
=
2
)
assert
index
.
tolist
()
==
[[
0
,
1
,
1
,
2
],
[
1
,
0
,
1
,
0
]]
def
test_coalesce_add
():
def
test_coalesce_add
():
row
=
torch
.
tensor
([
1
,
0
,
1
,
0
,
2
,
1
])
row
=
torch
.
tensor
([
1
,
0
,
1
,
0
,
2
,
1
])
col
=
torch
.
tensor
([
0
,
1
,
1
,
1
,
0
,
0
])
col
=
torch
.
tensor
([
0
,
1
,
1
,
1
,
0
,
0
])
...
...
torch_sparse/__init__.py
View file @
43c50459
...
@@ -4,7 +4,7 @@ from .eye import eye
...
@@ -4,7 +4,7 @@ from .eye import eye
from
.spmm
import
spmm
from
.spmm
import
spmm
from
.spspmm
import
spspmm
from
.spspmm
import
spspmm
__version__
=
'0.2.
0
'
__version__
=
'0.2.
1
'
__all__
=
[
__all__
=
[
'__version__'
,
'__version__'
,
...
...
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