When I try to construct heterograph using dgl by official website coding, I find this error:
import dgl
import torch as th
# Create a heterograph with 3 node types and 3 edges types.
graph_data = {
('drug', 'interacts', 'drug'): (th.tensor([0, 1]), th.tensor([1, 2])),
('drug', 'interacts', 'gene'): (th.tensor([0, 1]), th.tensor([2, 3])),
('drug', 'treats', 'disease'): (th.tensor([1]), th.tensor([2]))
}
g = dgl.heterograph(graph_data)
g.ntypes
g.etypes
g.canonical_etypes
The error is:
module 'dgl' has no attribute 'heterograph'
How to solve it? I update dgl into 1.1.0, still does not work