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
acbadd10
Commit
acbadd10
authored
Mar 01, 2018
by
rusty1s
Browse files
assertions
parent
74364643
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
torch_cluster/functions/grid.py
torch_cluster/functions/grid.py
+5
-0
No files found.
torch_cluster/functions/grid.py
View file @
acbadd10
...
...
@@ -23,6 +23,8 @@ def _preprocess(position, size, batch=None, start=None):
min
.
append
(
position
[:,
i
].
min
())
position
=
position
-
position
.
new
(
min
)
else
:
assert
start
.
numel
()
==
size
.
numel
(),
(
'Start tensor must have same size as size tensor'
)
position
=
position
-
start
.
type_as
(
position
)
# If given, append batch to position tensor.
...
...
@@ -49,6 +51,9 @@ def _fixed_cluster_size(position, size, batch=None, end=None):
if
end
is
None
:
return
_minimal_cluster_size
(
position
,
size
)
assert
end
.
numel
()
==
size
.
numel
(),
(
'End tensor must have same size as size tensor'
)
end
=
end
.
type_as
(
size
)
eps
=
0.000001
# Simulate [start, end) interval.
if
batch
is
None
:
...
...
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