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
8b30d1c7
Commit
8b30d1c7
authored
Oct 06, 2020
by
rusty1s
Browse files
update
parents
987a1766
eecbd236
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
1 addition
and
2 deletions
+1
-2
torch_cluster/nearest.py
torch_cluster/nearest.py
+1
-2
No files found.
torch_cluster/nearest.py
View file @
8b30d1c7
...
@@ -38,6 +38,7 @@ def nearest(x: torch.Tensor, y: torch.Tensor,
...
@@ -38,6 +38,7 @@ def nearest(x: torch.Tensor, y: torch.Tensor,
x
=
x
.
view
(
-
1
,
1
)
if
x
.
dim
()
==
1
else
x
x
=
x
.
view
(
-
1
,
1
)
if
x
.
dim
()
==
1
else
x
y
=
y
.
view
(
-
1
,
1
)
if
y
.
dim
()
==
1
else
y
y
=
y
.
view
(
-
1
,
1
)
if
y
.
dim
()
==
1
else
y
assert
x
.
size
(
1
)
==
y
.
size
(
1
)
if
x
.
is_cuda
:
if
x
.
is_cuda
:
if
batch_x
is
not
None
:
if
batch_x
is
not
None
:
...
@@ -66,8 +67,6 @@ def nearest(x: torch.Tensor, y: torch.Tensor,
...
@@ -66,8 +67,6 @@ def nearest(x: torch.Tensor, y: torch.Tensor,
return
torch
.
ops
.
torch_cluster
.
nearest
(
x
,
y
,
ptr_x
,
ptr_y
)
return
torch
.
ops
.
torch_cluster
.
nearest
(
x
,
y
,
ptr_x
,
ptr_y
)
else
:
else
:
assert
x
.
size
(
1
)
==
y
.
size
(
1
)
# Translate and rescale x and y to [0, 1].
# Translate and rescale x and y to [0, 1].
if
batch_x
is
not
None
and
batch_y
is
not
None
:
if
batch_x
is
not
None
and
batch_y
is
not
None
:
assert
x
.
dim
()
==
2
and
batch_x
.
dim
()
==
1
assert
x
.
dim
()
==
2
and
batch_x
.
dim
()
==
1
...
...
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