how to understand dgl.block and dgl.EID and dgl.NID ? how to read and understand dgl project example code ?
In mini-batch training, the computing is applied on a subgraph sampled based on a bunch of destination nodes. The subgraph is called as block
in DGL. (3.2 DGL NN Module Forward Function — DGL 2.3 documentation)
dgl.EID and dgl.NID are keys for access internal edge ids and node ids in flatten heterogeneous graphs.
Here is an example in 1.5 Heterogeneous Graphs — DGL 2.3 documentation
# Order of node types in the heterograph
g.ntypes
# Original node types
hg.ndata[dgl.NTYPE]
# Original type-specific node IDs
hg.ndata[dgl.NID]
# Order of edge types in the heterograph
g.etypes
# Original edge types
hg.edata[dgl.ETYPE]
# Original type-specific edge IDs
hg.edata[dgl.EID]
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.