Abdullah_Chand:

batch_size is static the output is (512,1024) 512 comes from flattening out the input.


I want to point out again, that I’m not familiar with GNNs, so I might be completely wrong, but in e.g. CNNs this would not be the case. You are flattening the feature dimensions, but keep the batch size static.
I.e. the output of the last conv layer could be [batch_size, a, b, c] and you would flatten it to [batch_size, a*b*c]. The assumption is that each input sample returns an output.
If you pass an input with a batch size of 5 (5 samples), you would expect to get 5 results. The same applies for 1, 10, 1000, … samples.
In your current model, the output shape depends on some internal conditions (or in general how many nodes are used). E.g. I could pass a single sample to the GNN and would get an output of [400, 1024] and an input with 10 samples could output [200, 1024]?
If that’s the case, how would you be able to map this output to the input?