pytorch_sparse icon indicating copy to clipboard operation
pytorch_sparse copied to clipboard

Subgraph sampling output

Open MortezaRamezani opened this issue 3 years ago • 2 comments

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)

MortezaRamezani avatar Feb 27 '21 18:02 MortezaRamezani

Thanks for reporting. I will look into it.

rusty1s avatar Feb 28 '21 10:02 rusty1s

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?

github-actions[bot] avatar Sep 16 '21 06:09 github-actions[bot]