ReplicationPad2d

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

Pad input according to the last 2-dimensions by replicating boundary.

The padded dimension is computed as:

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

Examples:

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

__init__

ReplicationPad2d.__init__(padding)[source]

Create a ReplicationPad2d module.

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