"torch.nn.ReplicationPad2d" for concrete examples on how each of
      the padding modes works. Constant padding is implemented for
      arbitrary dimensions. Replicate and reflection padding are
      implemented for padding the last 3 dimensions of a 4D or 5D
      input tensor, the last 2 dimensions of a 3D or 4D input tensor,
      or the last dimension of a 2D or 3D input tensor.
Note:
 When using the CUDA backend, this operation may induce
 nondeterministic behaviour in its backward pass that is not
 easily switched off. Please see the notes on Reproducibility for
 background.

Parameters:
      * input (Tensor) -- N-dimensional tensor
  * **pad** (*tuple*) -- m-elements tuple, where \frac{m}{2} \leq
    input dimensions and m is even.

  * **mode** -- "'constant'", "'reflect'", "'replicate'" or
    "'circular'". Default: "'constant'"

  * **value** -- fill value for "'constant'" padding. Default: "0"

Examples: