ConstantPad3d

class dragon.vm.torch.nn.ConstantPad3d(
  padding,
  value
)[source]

Pad input according to the last 3-dimensions with a constant.

The padded dimension is computed as:

\[\text{Dim}_{out} = \text{Dim}_{in} + pad_l + pad_r \]

Examples:

m = torch.nn.ConstantPad3d(1, 2)
x = torch.randn(1, 2, 2, 2)
y = m(x)  # (1, 2, 2, 2) -> (1, 4, 4, 4)

__init__

ConstantPad3d.__init__(
  padding,
  value
)[source]

Create a ConstantPad3d module.

Parameters:
  • padding (Union[int, Sequence[int]]) The 3d padding sizes.
  • value (number) The constant padding value.