Hi,
I took this example from here: http://pytorch.org/docs/master/nn.html#torch.nn.ConvTranspose2d 90, at the end of the section.
For nn.Conv2d, I think no. You could calculate the appropriate padding depending on input size and kernel_size though.
For example, here is how it is done in the case of convTranspose:

  
      github.com
  
  
    pytorch/pytorch/blob/master/torch/nn/modules/conv.py#L366 7

    weight (Tensor): the learnable weights of the module of shape
                     (out_channels, in_channels, kernel_size[0], kernel_size[1], kernel_size[2])
    bias (Tensor):   the learnable bias of the module of shape (out_channels)


Examples::


    >>> # With square kernels and equal stride
    >>> m = nn.Conv3d(16, 33, 3, stride=2)
    >>> # non-square kernels and unequal stride and with padding
    >>> m = nn.Conv3d(16, 33, (3, 5, 2), stride=(2, 1, 1), padding=(4, 2, 0))
    >>> input = autograd.Variable(torch.randn(20, 16, 10, 50, 100))
    >>> output = m(input)


.. _cross-correlation:
    https://en.wikipedia.org/wiki/Cross-correlation


.. _link:
    https://github.com/vdumoulin/conv_arithmetic/blob/master/README.md
"""


def __init__(self, in_channels, out_channels, kernel_size, stride=1,