pyiqa.matlab_utils.padding ========================== .. py:module:: pyiqa.matlab_utils.padding Module Contents --------------- .. py:data:: to_1tuple .. py:data:: to_2tuple .. py:data:: to_3tuple .. py:data:: to_4tuple .. py:data:: to_ntuple .. py:function:: symm_pad(im: torch.Tensor, padding: Tuple[int, int, int, int]) Symmetric padding same as tensorflow. Ref: https://discuss.pytorch.org/t/symmetric-padding/19866/3 .. py:function:: exact_padding_2d(x, kernel, stride=1, dilation=1, mode='same') .. py:class:: ExactPadding2d(kernel, stride=1, dilation=1, mode='same') Bases: :py:obj:`torch.nn.Module` This function calculate exact padding values for 4D tensor inputs, and support the same padding mode as tensorflow. :param kernel: kernel size. :type kernel: int or tuple :param stride: stride size. :type stride: int or tuple :param dilation: dilation size, default with 1. :type dilation: int or tuple :param mode: padding mode can be ('same', 'symmetric', 'replicate', 'circular') :type mode: srt .. py:method:: forward(x)