Open xansar opened 2 years ago
Could you take a look? @BarclayII
I should have fixed the bug in #4732 . Could you try the nightly version?
This issue has been automatically marked as stale due to lack of activity. It will be closed if no further activity occurs. Thank you
🐛 Bug
when setting excluded_edges, this function will return a graph with edges less than fanout.
To Reproduce
Steps to reproduce the behavior:
u1 = torch.tensor([0, 0, 1, 1, 2, 3]) u2 = torch.tensor([1, 2, 3, 4, 5, 4]) g = dgl.graph((u1, u2), num_nodes=6) g.all_edges(form='all')
sg = dgl.sampling.sample_neighbors(g, nodes=[1], fanout=2, replace=True, edge_dir='out') sg.edges(order='eid'), sg.edata[dgl.EID], sg.num_edges()
((tensor([1, 1]), tensor([4, 4])), tensor([3, 3]), 2)
sg = dgl.sampling.sample_neighbors(g, nodes=[1], fanout=2, replace=True, edge_dir='out', exclude_edges=[3]) sg.edges(order='eid'), sg.edata[dgl.EID], sg.num_edges()
((tensor([], dtype=torch.int64), tensor([], dtype=torch.int64)),
sometimes with one edge:((tensor([1]), tensor([3])), tensor([2]), 1)
Expected behavior
fix this bug
Environment
conda
,pip
, source): pipAdditional context