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
987a1766
"git@developer.sourcefind.cn:renzhc/diffusers_dcu.git" did not exist on "b64c5227595f5eed10f6ff3ac7953de0bb07ab2d"
Commit
987a1766
authored
Oct 06, 2020
by
rusty1s
Browse files
typo
parent
c5045e2f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
10 deletions
+5
-10
torch_cluster/nearest.py
torch_cluster/nearest.py
+5
-10
No files found.
torch_cluster/nearest.py
View file @
987a1766
...
@@ -66,20 +66,15 @@ def nearest(x: torch.Tensor, y: torch.Tensor,
...
@@ -66,20 +66,15 @@ 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
:
if
batch_x
is
None
:
batch_x
=
x
.
new_zeros
(
x
.
size
(
0
),
dtype
=
torch
.
long
)
if
batch_y
is
None
:
batch_y
=
y
.
new_zeros
(
y
.
size
(
0
),
dtype
=
torch
.
long
)
assert
x
.
dim
()
==
2
and
batch_x
.
dim
()
==
1
assert
y
.
dim
()
==
2
and
batch_y
.
dim
()
==
1
assert
x
.
size
(
1
)
==
y
.
size
(
1
)
assert
x
.
size
(
1
)
==
y
.
size
(
1
)
assert
x
.
size
(
0
)
==
batch_x
.
size
(
0
)
assert
y
.
size
(
0
)
==
batch_y
.
size
(
0
)
# 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
y
.
dim
()
==
2
and
batch_y
.
dim
()
==
1
assert
x
.
size
(
0
)
==
batch_x
.
size
(
0
)
assert
y
.
size
(
0
)
==
batch_y
.
size
(
0
)
min_xy
=
min
(
x
.
min
().
item
(),
y
.
min
().
item
())
min_xy
=
min
(
x
.
min
().
item
(),
y
.
min
().
item
())
x
,
y
=
x
-
min_xy
,
y
-
min_xy
x
,
y
=
x
-
min_xy
,
y
-
min_xy
...
...
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