Skip to content
Discussion options

You must be logged in to vote

I'm really not sure to be honest. The following works for me:

import torch
from torch_geometric.data import Data

x = torch.randn(100, 128)
edge_index = torch.randint(0, 100, (2, 400), dtype=torch.long)
y = torch.randn(100)

data = Data(x=x, edge_index=edge_index, y=y)
torch.save(data, 'data.pt')

data = torch.load('data.pt')
print(data.x.shape)
print(data.edge_index.shape)
print(data.y.shape)

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@codyseally
Comment options

Answer selected by codyseally
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants