Replies: 2 comments 1 reply
-
from torch_scatter import scatter
num_nodes_per_example = scatter(torch.ones_like(data.batch), batch) |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
zcaicaros
-
More simply, |
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.
-
Say I have a
torch_geometric.data.batch.Batch
data, how can I get the number of nodes for each graph in this Batch?Beta Was this translation helpful? Give feedback.
All reactions