Tensor size of message in GraphSage

I tried printing the size of messages after aggregation:

And I got these results:

Can someone explain to me what exactly am I printing, so the second line printed in each step is [1000,16], where 16 is the hidden_neurons size and 1000 is the batch size and the first line printed is [x,602], where 602 is the embedding size, but what is x and why is it varying?

I assume your model consists of two GraphSAGE layers. Then the tensor of shape [x, 602] is the updated node representations after the first GraphSAGE layer and the tensor of shape [1000, 16] is the updated node representations after the second GraphSAGE layer. Are you using neighbor sampling for the training? If so, x is the total number of nodes sampled for the neighbors of the nodes in the batch.

1 Like