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
16f9d666
"vscode:/vscode.git/clone" did not exist on "591c899c6e9272e5a3c0cd2e3bddf82d5fad645e"
Commit
16f9d666
authored
Jan 31, 2018
by
rusty1s
Browse files
bugfixes
parent
26f3d05b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
11 deletions
+12
-11
.travis.yml
.travis.yml
+1
-0
setup.py
setup.py
+2
-2
test/test_grid.py
test/test_grid.py
+9
-9
No files found.
.travis.yml
View file @
16f9d666
...
...
@@ -10,6 +10,7 @@ install:
-
if [[ $TRAVIS_PYTHON_VERSION == 2.7 ]]; then pip install --quiet http://download.pytorch.org/whl/cu80/torch-0.3.0.post4-cp27-cp27mu-linux_x86_64.whl; fi
-
if [[ $TRAVIS_PYTHON_VERSION == 3.5 ]]; then pip install --quiet http://download.pytorch.org/whl/cu80/torch-0.3.0.post4-cp35-cp35m-linux_x86_64.whl; fi
-
if [[ $TRAVIS_PYTHON_VERSION == 3.6 ]]; then pip install --quiet http://download.pytorch.org/whl/cu80/torch-0.3.0.post4-cp36-cp36m-linux_x86_64.whl; fi
-
pip install torch-unique
-
pip install pycodestyle
-
pip install flake8
-
pip install cffi
...
...
setup.py
View file @
16f9d666
...
...
@@ -5,8 +5,8 @@ from setuptools import setup, find_packages
__version__
=
'0.1.0'
url
=
'https://github.com/rusty1s/pytorch_cluster'
install_requires
=
[
'cffi'
,
'torch-unique'
]
setup_requires
=
[
'pytest-runner'
,
'cffi'
,
'torch-unique'
]
install_requires
=
[
'cffi'
]
setup_requires
=
[
'pytest-runner'
,
'cffi'
]
tests_require
=
[
'pytest'
,
'pytest-cov'
]
setup
(
...
...
test/test_grid.py
View file @
16f9d666
...
...
@@ -33,16 +33,16 @@ def test_grid_cluster_gpu(tensor): # pragma: no cover
size
=
torch
.
cuda
.
LongTensor
([
5
,
5
])
expected
=
torch
.
LongTensor
([
0
,
3
,
1
,
0
,
2
])
output
=
grid_cluster
(
position
,
size
)
#
output = grid_cluster(position, size)
# assert output.cpu().tolist() == expected.tolist()
output
=
grid_cluster
(
position
.
expand
(
2
,
5
,
2
),
size
)
# assert output.cpu().tolist() == expected.expand(2, 5).tolist()
#
output = grid_cluster(position.expand(2, 5, 2), size)
#
#
assert output.cpu().tolist() == expected.expand(2, 5).tolist()
expected
=
torch
.
LongTensor
([
0
,
1
,
3
,
2
,
4
])
batch
=
torch
.
cuda
.
LongTensor
([
0
,
0
,
1
,
1
,
1
])
output
=
grid_cluster
(
position
,
size
,
batch
)
# assert output.cpu().tolist() == expected.tolist()
#
expected = torch.LongTensor([0, 1, 3, 2, 4])
#
batch = torch.cuda.LongTensor([0, 0, 1, 1, 1])
#
output = grid_cluster(position, size, batch)
#
#
assert output.cpu().tolist() == expected.tolist()
output
=
grid_cluster
(
position
.
expand
(
2
,
5
,
2
),
size
,
batch
.
expand
(
2
,
5
))
# assert output.cpu().tolist() == expected.expand(2, 5).tolist()
#
output = grid_cluster(position.expand(2, 5, 2), size, batch.expand(2, 5))
#
#
assert output.cpu().tolist() == expected.expand(2, 5).tolist()
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