# dgl.DGLGraph.all_edges¶

DGLGraph.all_edges(form='uv', order=None)

Return all the edges.

Parameters: form (str, optional) – The return form. Currently support: ’all’ : a tuple (u, v, eid) ’uv’ : a pair (u, v), default ’eid’ : one eid tensor order (string) – The order of the returned edges. Currently support: ’srcdst’ : sorted by their src and dst ids. ’eid’ : sorted by edge Ids. None : the arbitrary order. A tuple of Tensors (u, v, eid) if form == ‘all’ – eid[i] is the ID of an edge between u[i] and v[i]. All edges are returned. A pair of Tensors (u, v) if form == ‘uv’ – An edge exists between u[i] and v[i]. If n edges exist between u and v, then u and v as a pair will appear n times. One Tensor if form == ‘eid’ – eid[i] is the ID of an edge in the graph.

Examples

The following example uses PyTorch backend.

>>> G = dgl.DGLGraph()