Problems about train_sampling_multi_gpu.py

after the for step, (input_nodes, seeds, blocks) in enumerate(dataloader):, we get the blocks which representaing the graph structure of every layer.
And then through batch_inputs, batch_labels = load_subtensor(train_g, train_g.ndata[‘labels’], seeds, input_nodes, dev_id) , we could get the node features and labels from the original graph.
But how could we get the edge data of the blocks?
I read through the source code of it, and only find that the block.edata is only a list of indexs.

The indices are the edge IDs in the original graph. For now you need to manually read it:

block.edata['feature'] = g.edata['feature'][block.edata[dgl.EID]]
1 Like

Thanks for your quick response!