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
14c7e1c5
Commit
14c7e1c5
authored
Apr 08, 2020
by
rusty1s
Browse files
fix empty col bug
parent
e8214d47
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
torch_cluster/radius.py
torch_cluster/radius.py
+2
-1
No files found.
torch_cluster/radius.py
View file @
14c7e1c5
...
...
@@ -92,7 +92,8 @@ def radius(x: torch.Tensor, y: torch.Tensor, r: float,
tree
=
scipy
.
spatial
.
cKDTree
(
x
.
detach
().
numpy
())
col
=
tree
.
query_ball_point
(
y
.
detach
().
numpy
(),
r
)
col
=
[
sample
(
torch
.
tensor
(
c
),
max_num_neighbors
)
for
c
in
col
]
col
=
[
torch
.
tensor
(
c
,
dtype
=
torch
.
long
)
for
c
in
col
]
col
=
[
sample
(
c
,
max_num_neighbors
)
for
c
in
col
]
row
=
[
torch
.
full_like
(
c
,
i
)
for
i
,
c
in
enumerate
(
col
)]
row
,
col
=
torch
.
cat
(
row
,
dim
=
0
),
torch
.
cat
(
col
,
dim
=
0
)
mask
=
col
<
int
(
tree
.
n
)
...
...
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