dgl.DGLHeteroGraph.edges

DGLHeteroGraph.edges

Return an edge view that can be used to set/get feature data of a single edge type.

Examples

The following example uses PyTorch backend.

To set features of all “play” relationships:

>>> g = dgl.bipartite([(0, 0), (1, 0), (1, 2)], 'user', 'plays', 'game')
>>> g.edges['plays'].data['h'] = torch.zeros(3, 4)

See also

edata