ReflectionPad2D¶
-
class
ReflectionPad2D(padding=0, **kwargs)¶ Pads the input tensor using the reflection of the input boundary.
Parameters: - padding: int
An integer padding size
- Inputs:
- data: input tensor with the shape \((N, C, H_{in}, W_{in})\).
- Outputs:
out: output tensor with the shape \((N, C, H_{out}, W_{out})\), where
(15)¶\[ \begin{align}\begin{aligned}H_{out} = H_{in} + 2 \cdot padding\\W_{out} = W_{in} + 2 \cdot padding\end{aligned}\end{align} \]
Examples
>>> m = nn.ReflectionPad2D(3) >>> input = mx.nd.random.normal(shape=(16, 3, 224, 224)) >>> output = m(input)