Replies: 1 comment
-
This is what I get (which is expected behavior): import torch
from torch_geometric.data import Data
data = Data(y=2.0)
print(data)
data = Data(y=torch.tensor(2.0))
print(data)
data = Data(y=torch.tensor([2.0]))
print(data)
Note that if we display, we unwrap the element for zero-element tensors. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to convert my graphs data from graph tool to pyg, and actually it works. But when I map the graphs' label in pyg, the structure of Data object is not correct. After the label map I obtain something like that:
Data(x=[50000], edge_index=[2, 199992], y=1)
As you can see, y is not a tensor, even if I convert it to a tensor, it is still y=1 without square brackets.
Beta Was this translation helpful? Give feedback.
All reactions