How to calculate the output size after Conv2d in pytorch?

You could take a look at the different approaches in this thread.