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
7d1dde9f
"src/vscode:/vscode.git/clone" did not exist on "27b008b9b1b1221ee911d8097b763127d7e987f0"
Commit
7d1dde9f
authored
Apr 07, 2018
by
rusty1s
Browse files
added pragmas
parent
b199bcb0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
test/test_graclus.py
test/test_graclus.py
+1
-1
torch_cluster/graclus.py
torch_cluster/graclus.py
+1
-1
No files found.
test/test_graclus.py
View file @
7d1dde9f
...
@@ -56,7 +56,7 @@ def test_graclus_cluster_cpu(tensor, i):
...
@@ -56,7 +56,7 @@ def test_graclus_cluster_cpu(tensor, i):
@
pytest
.
mark
.
skipif
(
not
torch
.
cuda
.
is_available
(),
reason
=
'no CUDA'
)
@
pytest
.
mark
.
skipif
(
not
torch
.
cuda
.
is_available
(),
reason
=
'no CUDA'
)
@
pytest
.
mark
.
parametrize
(
'tensor,i'
,
product
(
tensors
,
range
(
len
(
tests
))))
@
pytest
.
mark
.
parametrize
(
'tensor,i'
,
product
(
tensors
,
range
(
len
(
tests
))))
def
test_graclus_cluster_gpu
(
tensor
,
i
):
def
test_graclus_cluster_gpu
(
tensor
,
i
):
# pragma: no cover
data
=
tests
[
i
]
data
=
tests
[
i
]
row
=
torch
.
cuda
.
LongTensor
(
data
[
'row'
])
row
=
torch
.
cuda
.
LongTensor
(
data
[
'row'
])
...
...
torch_cluster/graclus.py
View file @
7d1dde9f
...
@@ -5,7 +5,7 @@ from .utils.ffi import graclus
...
@@ -5,7 +5,7 @@ from .utils.ffi import graclus
def
graclus_cluster
(
row
,
col
,
weight
=
None
,
num_nodes
=
None
):
def
graclus_cluster
(
row
,
col
,
weight
=
None
,
num_nodes
=
None
):
num_nodes
=
row
.
max
()
+
1
if
num_nodes
is
None
else
num_nodes
num_nodes
=
row
.
max
()
+
1
if
num_nodes
is
None
else
num_nodes
if
row
.
is_cuda
:
if
row
.
is_cuda
:
# pragma: no cover
row
,
col
=
sort_row
(
row
,
col
)
row
,
col
=
sort_row
(
row
,
col
)
else
:
else
:
row
,
col
=
randperm
(
row
,
col
)
row
,
col
=
randperm
(
row
,
col
)
...
...
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