# dgl.DGLGraph.predecessors¶

DGLGraph.predecessors(v)

Return the predecessors of node v in the graph.

Node u is a predecessor of v if an edge (u, v) exist in the graph.

Parameters: v (int) – The node. Array of predecessor node IDs. tensor

Examples

The following example uses PyTorch backend.

>>> G = dgl.DGLGraph()