-
I have adj matrix and features per node in NumPy format:
I want to convert it into Torch geometric dataset format. What I have tried: I am converting the data first into networkx format and then pyg format
is it correct? and is there any better way to do this? |
Beta Was this translation helpful? Give feedback.
Answered by
rusty1s
Jul 4, 2022
Replies: 1 comment
-
There is no real reason to go through networkx first: data = Data()
data.edge_index = torch.from_numpy(adj).nonzero().t()
data.x = torch.from_numpy(node_feats) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
monk1337
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
There is no real reason to go through networkx first: