Hi @Patrice, some explanation of conv2(x1):
Notes:

Padding: like adding some zero values on the edges of your image, ie. padding 1 in pytorch will change your x1 from 1x3x28x28 to 1x3x30x30 (1 pixel top-down and left-right), etc.


Dilation: is like you are expanding your kernel by 2x2 (like this 3), ie, you have kernel=3, which is 3x3 kernel. Then you add 2x2 = 5x5 kernel, etc.

To answer your question:



you do convolution with 3x3 kernel on 1x3x28x28, the output will be  1x3x26x26 IF the padding is not added (padding=0) and dilation is 1.




you do convolution with 3x3 kernel on 1x3x28x28, the output will be  1x3x24x24 IF the padding is not added (padding=0) and dilation is 2.




you do convolution with 3x3 kernel on 1x3x28x28, the output will be  1x3x26x26 IF the padding is  added (padding=1) and dilation is 2.




you do convolution with 3x3 kernel on 1x3x28x28, the output will be  1x3x28x28 IF the padding is added (padding=2) and dilation is 2.



Thanks for the welcome @harsha_g
Hope it helps, cheers ~