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
303e889a
Commit
303e889a
authored
May 20, 2020
by
Alexander Liao
Browse files
fixed flake8 errors
parent
9016cdbf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
torch_cluster/radius.py
torch_cluster/radius.py
+2
-4
No files found.
torch_cluster/radius.py
View file @
303e889a
from
typing
import
Optional
from
typing
import
Optional
import
torch
import
torch
import
scipy.spatial
@
torch
.
jit
.
script
@
torch
.
jit
.
script
def
sample
(
col
:
torch
.
Tensor
,
count
:
int
)
->
torch
.
Tensor
:
def
sample
(
col
:
torch
.
Tensor
,
count
:
int
)
->
torch
.
Tensor
:
...
@@ -87,7 +85,6 @@ def radius(x: torch.Tensor, y: torch.Tensor, r: float,
...
@@ -87,7 +85,6 @@ def radius(x: torch.Tensor, y: torch.Tensor, r: float,
assert
x
.
size
(
0
)
==
batch_x
.
size
(
0
)
assert
x
.
size
(
0
)
==
batch_x
.
size
(
0
)
assert
y
.
size
(
0
)
==
batch_y
.
size
(
0
)
assert
y
.
size
(
0
)
==
batch_y
.
size
(
0
)
x
=
torch
.
cat
([
x
,
2
*
r
*
batch_x
.
view
(
-
1
,
1
).
to
(
x
.
dtype
)],
dim
=-
1
)
x
=
torch
.
cat
([
x
,
2
*
r
*
batch_x
.
view
(
-
1
,
1
).
to
(
x
.
dtype
)],
dim
=-
1
)
y
=
torch
.
cat
([
y
,
2
*
r
*
batch_y
.
view
(
-
1
,
1
).
to
(
y
.
dtype
)],
dim
=-
1
)
y
=
torch
.
cat
([
y
,
2
*
r
*
batch_y
.
view
(
-
1
,
1
).
to
(
y
.
dtype
)],
dim
=-
1
)
...
@@ -104,6 +101,7 @@ def radius(x: torch.Tensor, y: torch.Tensor, r: float,
...
@@ -104,6 +101,7 @@ def radius(x: torch.Tensor, y: torch.Tensor, r: float,
return torch.stack([row[mask], col[mask]], dim=0)
return torch.stack([row[mask], col[mask]], dim=0)
"""
"""
def
radius_graph
(
x
:
torch
.
Tensor
,
r
:
float
,
def
radius_graph
(
x
:
torch
.
Tensor
,
r
:
float
,
batch
:
Optional
[
torch
.
Tensor
]
=
None
,
loop
:
bool
=
False
,
batch
:
Optional
[
torch
.
Tensor
]
=
None
,
loop
:
bool
=
False
,
max_num_neighbors
:
int
=
32
,
max_num_neighbors
:
int
=
32
,
...
...
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