CircularPad3d#
- class torch.nn.CircularPad3d(padding)[source]#
Pads the input tensor using circular padding of the input boundary.
Tensor values at the beginning of the dimension are used to pad the end, and values at the end are used to pad the beginning. If negative padding is applied then the ends of the tensor get removed.
For N-dimensional padding, use
torch.nn.functional.pad()
.- Parameters
padding (int, tuple) – the size of the padding. If is int, uses the same padding in all boundaries. If a 6-tuple, uses (, , , , , ) Note that padding size should be less than or equal to the corresponding input dimension.
- Shape:
Input: or .
Output: or , where
Examples:
>>> m = nn.CircularPad3d(3) >>> input = torch.randn(16, 3, 8, 320, 480) >>> output = m(input) >>> # using different paddings for different sides >>> m = nn.CircularPad3d((3, 3, 6, 6, 1, 1)) >>> output = m(input)