Custom directed graph dataset using torch_geometric Data


I have directed graph and I want make a custom dataset to use with torch geometric.
I have JSON file with link[‘source’], link[‘target’] data

from import Data
edge_index = torch.tensor([edge[0],
                                   edge[1]], dtype=torch.long)
x = torch.tensor(x_feats_train, dtype=torch.float)
 y = torch.tensor((y_labels_train))
data = Data(x=x, edge_index=edge_index, y=y)

But when a dataset using this data object is made, isdirected is False.
How can I make it directed?

To create your own dataset from the data container.

from import Data, DataLoader

loader = DataLoader([data], batch_size=32)

The input to the DataLoader will be list. 
if you have more that one data container:

data_list = [Data(...), ..., Data(...)]
loader = DataLoader(data_list, batch_size=32)