The output shape formula uses the input height and width, not the depth.
Also some minor errors are in the formula, i.e. the dilation is missing as well as some constant factors.
Have a look at the docs for the complete formula.



 snip3r77:

so basically at line 1 the input depth is 3 and the output is 10


Yes, this conv uses 3 input channels and 10 filters, which create one output channel each.



 snip3r77:

From what I read the depth will be increasing ( from 3 to 20 ) and the image size will reduce ( divide by 4 and 2 )
Image will reduce due to MaxPool downscaling.


Yes, that would be the case.



 snip3r77:

So when we see nn.MaxPool2d(4, 4) , the image will be divided by 4 . Is there a chance that the tuple of (4,4) will be a different value ?


I don’t understand this question. You could pass non-square kernels, e.g. (4, 2), if you want.



 snip3r77:

Also, if we want to maintain the image size with known kernel size and use padding to compensate we just use the following formula right?


Yeah, but with the formula from the docs.