Dear forum members,
When I tried making numpy.ndarray of DGL heterographs,
I got error msg below
File "/path/to/dgl/heterograph.py", line 2152, in __getitem__
raise DGLError('Invalid key "{}". Must be one of the edge types.'.format(orig_key))
dgl._ffi.base.DGLError: Invalid key "0". Must be one of the edge types.
Here is my sample code:
import dgl
import torch as th
import numpy as np
u, v = th.tensor([0, 0, 0, 1]), th.tensor([1, 2, 3, 3])
g = dgl.graph((u, v))
gnp = np.array( g )
What is wrong in my code??
Why DGLGraph.getitem is called??
Any help is appreciated.
Thank you.