According to this page (https://docs.dgl.ai/en/0.9.x/generated/dgl.DGLGraph.nodes.html)
This code snippet
g = dgl.graph((torch.tensor([0, 1]), torch.tensor([1, 2])))
hg = dgl.heterograph({
('user', 'follows', 'user'): (torch.tensor([0, 1]), torch.tensor([1, 2])),
('user', 'plays', 'game'): (torch.tensor([3, 4]), torch.tensor([5, 6]))
})
indicates that there are 5 nodes of type user which are 0,1,2,3,4 and 2 nodes of type game which are 5 and 6. However, when I print hg.nodes('game') I get
tensor([0, 1, 2, 3, 4, 5, 6])
Am I missing something or is there a big error with the DGL API?