Couting the nodes for a node type in heterogeneous graph

In the following code segment concerning heterogeneous graph creation, it seems to me that node 3 and 4 are of node type gene. So, g.nodes('gene') should return tensor([3, 4]). However, it returns tensor([0, 1, 2, 3, 4]) . I am not sure whether I am missing something or not.

graph_data = {   
   ('drug', 'interacts', 'gene'): (th.tensor([0, 1]), th.tensor([3, 4]))    
g = dgl.heterograph(graph_data)

DGL labels the nodes id from 0 consecutively for each node type. If you pass tensor([3,4]) as edges, dgl will consider it as node 0,1 has no edges, but node 0,1 exists.

You could also refer to the user guide chapter on heterograph for more details.

Thanks a lot for your response. However, my confusion still prevails. Let me rephrase the question.

I assume that g.nodes('gene') returns the set of nodes that are of type 'gene'. If that understanding is correct, the statement print(g.nodes('gene')) should return tensor([3,4]) but not tensor([0, 1, 2, 3, 4]). I suppose that nodes 0, 1, 2 do not belong to the category 'gene'.

Any explanation in this direction will be of great help.