You could visualize it with some tools like ezyang’s convolution visualizer or calculate it with this formula:
o = outputp = paddingk = kernel_sizes = strided = dilation
o = [i + 2*p - k - (k-1)*(d-1)]/s + 1
In your case this gives o = [32 + 2 - 3 - 2*1]/1 +1 = [29] + 1 = 30.
Now, you could set all your parameters and “solve” the equation for p.
You will see, that p=2 will give you an output size of 32.