ReflectionPad1d

class dragon.vm.torch.nn.ReflectionPad1d(padding)[source]

Pad input according to the last dimension by reflecting boundary.

The padded dimension is computed as:

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

Examples:

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

__init__

ReflectionPad1d.__init__(padding)[source]

Create a ReflectionPad1d module.

Parameters:
  • padding (Union[int, Sequence[int]]) – The 1d padding sizes.