G.in_degrees() parameters require int32

torch version: 1.12.1
dgl version: 1.0.1

The graph in my dataset has 35208 nodes and 4076542 edges

when I call graph.in_degrees(node_idx.long()) in my train loop
This will cause
dgl._ffi.base.DGLError: Expect argument "v" to have data type torch.int32. But got torch.int64. python-BaseException

graph and node_idx are put on GPU

However, if I create a new graph with same numbers of nodes and edges or create a smaller graph separately,
it won’t cause BUG

thx in advance

did you specify idtype=torch.int32 when creating the DGLGraph? Please see the notes in dgl.graph — DGL 1.1 documentation

I specify int32, and forget it during training.
Thanks a lot! :kissing_heart:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.