pyg-team/pytorch_geometric

Get edge_index list of individual graphs from dataset.data.edge_index list.

Closed this issue · 2 comments

❓ Questions & Help

Hi!

I want to do some additional computations on the graphs when I have them loaded as a dataset object (e.g. TUDataset). However, I'm having trouble separating the edge_index (from dataset.data.edge_index) into the different graphs again. Is there an easy way to do this?

Thanks!

One can access individual edge indices by iterating over the dataset:

[data.edge_index for data in dataset]

Edit: For further computation/modification, I suggest to use dataset transforms.

Thanks a lot (you are always so fast in repyling, I really appreciate that)! I'll def a look at the transforms.