pyiqa.matlab_utils.padding¶
Module Contents¶
- pyiqa.matlab_utils.padding.symm_pad(im: torch.Tensor, padding: Tuple[int, int, int, int])[source]¶
Symmetric padding same as tensorflow. Ref: https://discuss.pytorch.org/t/symmetric-padding/19866/3
- class pyiqa.matlab_utils.padding.ExactPadding2d(kernel, stride=1, dilation=1, mode='same')[source]¶
Bases:
torch.nn.ModuleThis function calculate exact padding values for 4D tensor inputs, and support the same padding mode as tensorflow.
- Parameters:
kernel (int or tuple) – kernel size.
stride (int or tuple) – stride size.
dilation (int or tuple) – dilation size, default with 1.
mode (srt) – padding mode can be (‘same’, ‘symmetric’, ‘replicate’, ‘circular’)