Does DGL renumber nodes in Heterograph?

Hi. I wanted to confirm that if I’m trying to create Heterograph containing nodes of two types using tensors like these

nodes_type_1 = torch.tensor([232, 145, 854, 646])
nodes_type_2 = torch.tensor([451, 434, 858, 352])

then I would need to first renumber them to 0…3 right? Heterograph doesn’t do the renumbering to 0…|V| automatically like cuGraph does, right?

DGL won’t relabel the numbers. You can use subgraph API, which will relabel the ID from zero, or preprocess it beforehand. Or you can use cugraph to do so and get the edge list from cugraph

1 Like