What does Pytorch's default padding in Conv2D signify?
In the Pytorch documentation for the MaxPool2D states: 


  padding (int or tuple, optional) – Zero-padding added to both sides of the input. Default: 0


Does it mean that the default values for padding would be 0 or that there will be no padding?

In my code: nn.Conv2d(input_channels, output_channels, kernel_size, stride), I didn't pass any padding parameter and when I printed it, it shows the following


  (0): Conv2d(4, 8, kernel_size=(3, 3), stride=(1, 1), padding=(2, 2))


So, I'm assuming it by default adds padding to match the input size with values 0.

Now, if that's the case, then how can I turn it off and/or add a different padding value?


  Does it mean that the default values for padding would be 0 or that
  there will be no padding?


It means that there will be no padding at all (because the parameter padding specifies the size of the padding for each dimension and by default it is padding=0, i.e. (0, 0)).

&gt;&gt;&gt; conv = torch.nn.Conv2d(4, 8, kernel_size=(3, 3), stride=(1, 1))
&gt;&gt;&gt; conv.padding
(0, 0)


The convolution layer is agnostic of the input height and width, it only expects the input to have 4 channels (in this particular example). The input height and weight are computed after you pass the input to it, and if the image size is smaller than the kernel size, then it will throw an error -- it will not pad the input automatically to match the size. It would help if you posted full code to see where the padding comes from.
