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
e95d789b
Commit
e95d789b
authored
Feb 05, 2018
by
rusty1s
Browse files
test one-dimensional positions
parent
511f78e4
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
0 deletions
+7
-0
test/test_grid.py
test/test_grid.py
+7
-0
No files found.
test/test_grid.py
View file @
e95d789b
...
@@ -7,6 +7,13 @@ from .utils import tensors, Tensor
...
@@ -7,6 +7,13 @@ from .utils import tensors, Tensor
@
pytest
.
mark
.
parametrize
(
'tensor'
,
tensors
)
@
pytest
.
mark
.
parametrize
(
'tensor'
,
tensors
)
def
test_grid_cluster_cpu
(
tensor
):
def
test_grid_cluster_cpu
(
tensor
):
position
=
Tensor
(
tensor
,
[
0
,
9
,
2
,
8
,
3
])
size
=
torch
.
LongTensor
([
5
])
expected
=
torch
.
LongTensor
([
0
,
1
,
0
,
1
,
0
])
output
=
grid_cluster
(
position
,
size
)
assert
output
.
tolist
()
==
expected
.
tolist
()
position
=
Tensor
(
tensor
,
[[
0
,
0
],
[
9
,
9
],
[
2
,
8
],
[
2
,
2
],
[
8
,
3
]])
position
=
Tensor
(
tensor
,
[[
0
,
0
],
[
9
,
9
],
[
2
,
8
],
[
2
,
2
],
[
8
,
3
]])
size
=
torch
.
LongTensor
([
5
,
5
])
size
=
torch
.
LongTensor
([
5
,
5
])
expected
=
torch
.
LongTensor
([
0
,
3
,
1
,
0
,
2
])
expected
=
torch
.
LongTensor
([
0
,
3
,
1
,
0
,
2
])
...
...
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