Gather from different graphs in batch by index #4488
Answered
by
rusty1s
antoni4040
asked this question in
Q&A
-
I want to pass some graphs through a model and then gather by index from each graph. I've been doing something like this:
Which is annoying as I need to create a dataset and then pad the tensors as torch.gather wants equal sized tensors and the graphs have different sizes. Is there an easier way to do this, preferably from a Batch? |
Beta Was this translation helpful? Give feedback.
Answered by
rusty1s
Apr 18, 2022
Replies: 1 comment 1 reply
-
How about using |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
antoni4040
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How about using
torch_geometric.utils.to_dense_batch
for this?