# dgl.DGLHeteroGraph.edata¶

DGLHeteroGraph.edata

Return the data view of all the edges.

Only works if the graph has one edge type.

Examples

The following example uses PyTorch backend.

To set features of all edges in a heterogeneous graph with only one edge type:

>>> g = dgl.graph([(0, 1), (1, 2)], 'user', 'follows')
>>> g.edata['h'] = torch.zeros(2, 5)