ConstantPad3d
- class torch.nn.modules.padding.ConstantPad3d(padding, value)
Pads the input tensor boundaries with a constant value.
For N-dimensional padding, use
torch.nn.functional.pad().- Parameters
Pads the input tensor boundaries with a constant value.
For N-dimensional padding, use torch.nn.functional.pad().
padding (int, tuple) – the size of the padding. If it is int, uses the same padding in all boundaries. If a 6-tuple, uses (, , , , , )
Input: or .
Output: or , where
Examples:
>>> m = nn.ConstantPad3d(3, 3.5)
>>> input = torch.randn(16, 3, 10, 20, 30)
>>> output = m(input)
>>> # using different paddings for different sides
>>> m = nn.ConstantPad3d((3, 3, 6, 6, 0, 1), 3.5)
>>> output = m(input)