dgl.DGLGraph.out_degree

DGLGraph.out_degree(v)[source]

Return the out-degree of node v.

Parameters:v (int) – The node ID.
Returns:The out-degree.
Return type:int

Examples

>>> G = dgl.DGLGraph()
>>> G.add_nodes(3)
>>> G.add_edges([0, 0, 1], [1, 2, 2])   # (0, 1), (0, 2), (1, 2)
>>> G.out_degree(0)
2

See also

out_degrees()