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
e9bc328b
Commit
e9bc328b
authored
Jan 31, 2018
by
rusty1s
Browse files
linting fixes
parent
16f9d666
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
.travis.yml
.travis.yml
+2
-2
test/test_grid.py
test/test_grid.py
+3
-2
No files found.
.travis.yml
View file @
e9bc328b
...
@@ -10,11 +10,11 @@ install:
...
@@ -10,11 +10,11 @@ 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 == 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.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
-
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 pycodestyle
-
pip install flake8
-
pip install flake8
-
pip install cffi
-
pip install codecov
-
pip install codecov
-
pip install cffi
-
pip install torch-unique
script
:
script
:
-
pycodestyle .
-
pycodestyle .
-
flake8 .
-
flake8 .
...
...
test/test_grid.py
View file @
e9bc328b
...
@@ -30,8 +30,9 @@ def test_grid_cluster_cpu(tensor):
...
@@ -30,8 +30,9 @@ def test_grid_cluster_cpu(tensor):
@
pytest
.
mark
.
parametrize
(
'tensor'
,
tensors
)
@
pytest
.
mark
.
parametrize
(
'tensor'
,
tensors
)
def
test_grid_cluster_gpu
(
tensor
):
# pragma: no cover
def
test_grid_cluster_gpu
(
tensor
):
# pragma: no cover
position
=
Tensor
(
tensor
,
[[
0
,
0
],
[
9
,
9
],
[
2
,
8
],
[
2
,
2
],
[
8
,
3
]]).
cuda
()
position
=
Tensor
(
tensor
,
[[
0
,
0
],
[
9
,
9
],
[
2
,
8
],
[
2
,
2
],
[
8
,
3
]]).
cuda
()
size
=
torch
.
cuda
.
LongTensor
([
5
,
5
])
print
(
position
)
expected
=
torch
.
LongTensor
([
0
,
3
,
1
,
0
,
2
])
# 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()
# assert output.cpu().tolist() == expected.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