pytorch_sparse
pytorch_sparse copied to clipboard
Subgraph sampling output
Similar to https://github.com/rusty1s/pytorch_sparse/issues/94, the output of saint_subgraph has the same problem.
import torch
from torch_sparse import SparseTensor
import scipy.sparse as sp
dim = 2000
a = sp.rand(dim, dim, density=0.01, format='csr')
a = SparseTensor.from_scipy(a).type_as(torch.FloatTensor())
node_idx = torch.randint(0, dim, (100,))
sampled_adj, _ = a.saint_subgraph(node_idx)
sampled_adj.fill_diag(1) #Error
However when the node_idx is sorted, it's working fine.
node_idx, _ = torch.sort(node_idx)
sampled_adj, _ = a.saint_subgraph(node_idx)
sampled_adj.fill_diag(1)
Thanks for reporting. I will look into it.
This issue had no activity for 6 months. It will be closed in 2 weeks unless there is some new activity. Is this issue already resolved?