PadConv2dFusionPass
Description
Fuses the Pad/PadV3+Conv2D operators into the Conv2D operator.
Before:
After: 
Forward fusion applies only to the Pad/PadV3+Conv2D graph scenario.
Backward fusion applies only in the backward process corresponding to the forward scenario in the training network. Pad+Conv2DBackpropFilterD is fused into a new Conv2DBackpropFilterD while Pad is eliminated. Conv2DBackpropInputD+Slice is fused into a new Conv2DBackpropInputD while Slice is eliminated.
Restrictions
- Dynamic shapes are not supported.
- The Pad/PadV3 operator cannot be connected to multiple Conv2D structures. The first node of the structure before fusion is connected only to the next node. For example, the pad output is sent to only one Conv2D node.
- The value of paddings cannot be less than 0.
- The PadV3 operator supports fusion only when mode = constant and constant_values = 0 (dtype = fp32).
- The pad of the N/C dimension of the Pad/PadV3 operator can only be 0. The Pad/PadV3 operator supports padding only in the H or W dimension of Conv2D. After fusion, the padding size must be within the range of [0, 255], and the values of pad_top and pad_bottom must be less than kernel_h.
Availability
Parent topic: Graph Fusion Patterns