Commit c0e7bec9 authored by rusty1s's avatar rusty1s
Browse files

add warning

parent 740c2364
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
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment