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
2ce0f235
You need to sign in or sign up before continuing.
Commit
2ce0f235
authored
Feb 22, 2021
by
rusty1s
Browse files
fix radius test
parent
e0e5a84c
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
test/test_radius.py
test/test_radius.py
+3
-3
No files found.
test/test_radius.py
View file @
2ce0f235
...
@@ -50,11 +50,11 @@ def test_radius_graph(dtype, device):
...
@@ -50,11 +50,11 @@ def test_radius_graph(dtype, device):
[
+
1
,
-
1
],
[
+
1
,
-
1
],
],
dtype
,
device
)
],
dtype
,
device
)
edge_index
=
radius_graph
(
x
,
r
=
2
,
flow
=
'target_to_source'
)
edge_index
=
radius_graph
(
x
,
r
=
2
.5
,
flow
=
'target_to_source'
)
assert
to_set
(
edge_index
)
==
set
([(
0
,
1
),
(
0
,
3
),
(
1
,
0
),
(
1
,
2
),
(
2
,
1
),
assert
to_set
(
edge_index
)
==
set
([(
0
,
1
),
(
0
,
3
),
(
1
,
0
),
(
1
,
2
),
(
2
,
1
),
(
2
,
3
),
(
3
,
0
),
(
3
,
2
)])
(
2
,
3
),
(
3
,
0
),
(
3
,
2
)])
edge_index
=
radius_graph
(
x
,
r
=
2
,
flow
=
'source_to_target'
)
edge_index
=
radius_graph
(
x
,
r
=
2
.5
,
flow
=
'source_to_target'
)
assert
to_set
(
edge_index
)
==
set
([(
1
,
0
),
(
3
,
0
),
(
0
,
1
),
(
2
,
1
),
(
1
,
2
),
assert
to_set
(
edge_index
)
==
set
([(
1
,
0
),
(
3
,
0
),
(
0
,
1
),
(
2
,
1
),
(
1
,
2
),
(
3
,
2
),
(
0
,
3
),
(
2
,
3
)])
(
3
,
2
),
(
0
,
3
),
(
2
,
3
)])
...
@@ -67,7 +67,7 @@ def test_radius_graph_large(dtype, device):
...
@@ -67,7 +67,7 @@ def test_radius_graph_large(dtype, device):
max_num_neighbors
=
2000
,
num_workers
=
6
)
max_num_neighbors
=
2000
,
num_workers
=
6
)
tree
=
scipy
.
spatial
.
cKDTree
(
x
.
numpy
())
tree
=
scipy
.
spatial
.
cKDTree
(
x
.
numpy
())
col
=
tree
.
query_ball_point
(
x
.
cpu
(),
r
=
0.5
+
0.00001
)
col
=
tree
.
query_ball_point
(
x
.
cpu
(),
r
=
0.5
)
truth
=
set
([(
i
,
j
)
for
i
,
ns
in
enumerate
(
col
)
for
j
in
ns
])
truth
=
set
([(
i
,
j
)
for
i
,
ns
in
enumerate
(
col
)
for
j
in
ns
])
assert
to_set
(
edge_index
)
==
truth
assert
to_set
(
edge_index
)
==
truth
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