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
ae73ea73
Commit
ae73ea73
authored
Nov 14, 2018
by
rusty1s
Browse files
bugfix batch == None
parent
199be867
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
torch_cluster/fps.py
torch_cluster/fps.py
+3
-3
No files found.
torch_cluster/fps.py
View file @
ae73ea73
...
@@ -26,6 +26,9 @@ def fps(x, batch=None, ratio=0.5, random_start=True):
...
@@ -26,6 +26,9 @@ def fps(x, batch=None, ratio=0.5, random_start=True):
>>> sample = fps(pos, batch)
>>> sample = fps(pos, batch)
"""
"""
if
batch
is
None
:
batch
=
x
.
new_zeros
(
x
.
size
(
0
),
dtype
=
torch
.
long
)
assert
x
.
is_cuda
assert
x
.
is_cuda
assert
x
.
dim
()
<=
2
and
batch
.
dim
()
==
1
assert
x
.
dim
()
<=
2
and
batch
.
dim
()
==
1
assert
x
.
size
(
0
)
==
batch
.
size
(
0
)
assert
x
.
size
(
0
)
==
batch
.
size
(
0
)
...
@@ -33,9 +36,6 @@ def fps(x, batch=None, ratio=0.5, random_start=True):
...
@@ -33,9 +36,6 @@ def fps(x, batch=None, ratio=0.5, random_start=True):
x
=
x
.
view
(
-
1
,
1
)
if
x
.
dim
()
==
1
else
x
x
=
x
.
view
(
-
1
,
1
)
if
x
.
dim
()
==
1
else
x
if
batch
is
None
:
batch
=
x
.
new_zeros
(
x
.
size
(
0
),
dtype
=
torch
.
long
)
op
=
fps_cuda
.
fps
if
x
.
is_cuda
else
None
op
=
fps_cuda
.
fps
if
x
.
is_cuda
else
None
out
=
op
(
x
,
batch
,
ratio
,
random_start
)
out
=
op
(
x
,
batch
,
ratio
,
random_start
)
...
...
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