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
c0e7bec9
Commit
c0e7bec9
authored
Jul 25, 2019
by
rusty1s
Browse files
add warning
parent
740c2364
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
torch_cluster/rw.py
torch_cluster/rw.py
+9
-2
No files found.
torch_cluster/rw.py
View file @
c0e7bec9
import
warnings
import
torch
import
torch
if
torch
.
cuda
.
is_available
():
if
torch
.
cuda
.
is_available
():
import
torch_cluster.rw_cuda
import
torch_cluster.rw_cuda
def
random_walk
(
row
,
col
,
start
,
walk_length
,
num_nodes
=
None
):
def
random_walk
(
row
,
col
,
start
,
walk_length
,
p
=
1
,
q
=
1
,
num_nodes
=
None
):
if
p
!=
1
or
q
!=
1
:
warnings
.
warn
(
'Parameters `p` and `q` are not supported yet and will'
'be restored to their default values `p=1` and `q=1`.'
)
p
=
q
=
1
num_nodes
=
row
.
max
().
item
()
+
1
if
num_nodes
is
None
else
num_nodes
num_nodes
=
row
.
max
().
item
()
+
1
if
num_nodes
is
None
else
num_nodes
if
row
.
is_cuda
:
if
row
.
is_cuda
:
return
torch_cluster
.
rw_cuda
.
rw
(
row
,
col
,
start
,
walk_length
,
1
,
1
,
return
torch_cluster
.
rw_cuda
.
rw
(
row
,
col
,
start
,
walk_length
,
p
,
q
,
num_nodes
)
num_nodes
)
else
:
else
:
raise
NotImplementedError
raise
NotImplementedError
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