Bidirectional graph with dgl.heterograph

please is it possible to create a heterogeneous bidirectional graph under DGL? containing nodes and edges of different types… if so? how can we do it? And thank you in advance.

You can do something as follows.

import dgl
import torch

data_dict = {
    ('user', 'follows', 'topic'): (torch.tensor([1, 1]), torch.tensor([1, 2])),
}
g = dgl.heterograph(data_dict)
transform = dgl.AddReverse()
new_g = transform(g)

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