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
2f84fce1
Commit
2f84fce1
authored
Aug 11, 2019
by
rusty1s
Browse files
torch1.2
parent
13b7fbaa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
1 deletion
+1
-1
torch_cluster/knn.py
torch_cluster/knn.py
+1
-1
No files found.
torch_cluster/knn.py
View file @
2f84fce1
...
@@ -79,7 +79,7 @@ def knn(x, y, k, batch_x=None, batch_y=None, cosine=False):
...
@@ -79,7 +79,7 @@ def knn(x, y, k, batch_x=None, batch_y=None, cosine=False):
dist
=
torch
.
from_numpy
(
dist
).
to
(
x
.
dtype
)
dist
=
torch
.
from_numpy
(
dist
).
to
(
x
.
dtype
)
col
=
torch
.
from_numpy
(
col
).
to
(
torch
.
long
)
col
=
torch
.
from_numpy
(
col
).
to
(
torch
.
long
)
row
=
torch
.
arange
(
col
.
size
(
0
),
dtype
=
torch
.
long
).
view
(
-
1
,
1
).
repeat
(
1
,
k
)
row
=
torch
.
arange
(
col
.
size
(
0
),
dtype
=
torch
.
long
).
view
(
-
1
,
1
).
repeat
(
1
,
k
)
mask
=
1
-
torch
.
isinf
(
dist
).
view
(
-
1
)
mask
=
~
torch
.
isinf
(
dist
).
view
(
-
1
)
row
,
col
=
row
.
view
(
-
1
)[
mask
],
col
.
view
(
-
1
)[
mask
]
row
,
col
=
row
.
view
(
-
1
)[
mask
],
col
.
view
(
-
1
)[
mask
]
return
torch
.
stack
([
row
,
col
],
dim
=
0
)
return
torch
.
stack
([
row
,
col
],
dim
=
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