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
2a8339db
Commit
2a8339db
authored
Mar 28, 2018
by
rusty1s
Browse files
test different sizes
parent
629213e4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
test/utils/test_consecutive.py
test/utils/test_consecutive.py
+4
-4
No files found.
test/utils/test_consecutive.py
View file @
2a8339db
...
...
@@ -4,11 +4,11 @@ from torch_cluster.functions.utils.consecutive import consecutive
def
test_consecutive_cpu
():
x
=
torch
.
LongTensor
([
0
,
3
,
2
,
2
,
3
])
assert
consecutive
(
x
).
tolist
()
==
[
0
,
2
,
1
,
1
,
2
]
x
=
torch
.
LongTensor
([
[
0
,
3
,
2
]
,
[
2
,
3
,
0
]
])
assert
consecutive
(
x
).
tolist
()
==
[
[
0
,
2
,
1
]
,
[
1
,
2
,
0
]
]
@
pytest
.
mark
.
skipif
(
not
torch
.
cuda
.
is_available
(),
reason
=
'no CUDA'
)
def
test_consecutive_gpu
():
# pragma: no cover
x
=
torch
.
cuda
.
LongTensor
([
0
,
3
,
2
,
2
,
3
])
assert
consecutive
(
x
).
cpu
().
tolist
()
==
[
0
,
2
,
1
,
1
,
2
]
x
=
torch
.
cuda
.
LongTensor
([
[
0
,
3
,
2
]
,
[
2
,
3
,
0
]
])
assert
consecutive
(
x
).
cpu
().
tolist
()
==
[
[
0
,
2
,
1
]
,
[
1
,
2
,
0
]
]
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