I’m assuming that summary() outputs the tensor shapes in the default format.
For 2-dimensional layers, such as nn.Conv2d and nn.MaxPool2d, the expected shape is given as [batch_size, channels, height, width].
dim1 would therefore correspond to the channels, which are often chosen to be powers of 2 for performance reasons (“good” indexing is easier for powers of 2).
The -1 would therefore be the batch dimension, which is flexible in PyTorch. I.e. you don’t have to specify the batch size for your model and it will take variable batches as long as you have enough memory etc.



 erm:

I get weird results, and in addition, torch.summary shows that my layers lack that initial -1


Could you post your result and (if possible) your model definition, so that we could have a look?