dgl.DGLGraph.parent_nid

DGLGraph.parent_nid

Get the parent node ids.

The returned tensor can be used as a map from the node id in this subgraph to the node id in the parent graph.

Returns:The parent node id array.
Return type:Tensor

Notes

The parent node id information is stored in _ID field in the node frame of the graph, so please do not manually change this field.