dgl.DGLHeteroGraph.ntypesΒΆ

DGLHeteroGraph.ntypesΒΆ

Return the list of node types of this graph.

Returns:
Return type:list of str

Examples

>>> follows_g = dgl.graph([(0, 1), (1, 2)], 'user', 'follows')
>>> plays_g = dgl.bipartite([(0, 0), (1, 0), (1, 1), (2, 1)], 'user', 'plays', 'game')
>>> g = dgl.hetero_from_relations([follows_g, plays_g])
>>> g.ntypes
['user', 'game']