g = dgl.graph([(0, 2), (0, 3), (1, 2)])
frontier = dgl.sampling.sample_neighbors(g, torch.tensor([3]), fanout=5)
block = dgl.to_block(frontier, torch.tensor([3]))
print(block.srcdata[dgl.NID])
print(block.dstdata[dgl.NID])
print(block.edata[dgl.EID])
print(block[’_E’].edata[dgl.EID])
I want to get the node indices and edge indices in the parent graph. In line 4 and line 5 I get [3, 0]
and [3]
, that’s right. But in line 6 and line 7 I get [0]
and [0]
, that’s not the edge indicies in parent graph. So how can I get the edge indices in the parent graph?