TbeFullyconnectionElemwiseDequantFusionPass
Description
Performs UB fusion on the FullyConnection/MatMul/MatMulV2/BatchMatMul/BatchMatMulV2+ElemWise+AscendQuant+AscendDequant nodes in the following pattern subgraphs.
The dotted boxes in the fifth pattern indicate that these nodes may not be matched.

or

or

or

or

Restrictions
- The ElemWise2 node supports only: Elu, LeakyRelu, Gelu, Softsign, Relu6, Relu, Softplus, Sigmoid, Tanh, Selu, GeluGrad, Add, AddN, FastGelu, FastGeluV2, FastGeluGrad, Eltwise, PRelu, Mul, Muls, Power, Relu6D, and TanhGrad.
- The dynamic shape scenario is not supported.
- In the matmul, dequant, gelu, or quant scenario, the ElemWise1 node must be a Gelu node, and the data type must be fp32.
- If ElemWise2 is not empty, ElemWise1 must be Relu, LeakyRelu, Add, Muls, or AddN, and ElemWise2 must be Relu6.
- When ElemWise1 is Add, the input node of Add must be 2, the output node must be 1, and the previous node must be FullyConnection.
- When ElemWise1 is LeakyRelu, negative_slope is required. The absolute value of negative_slope must be greater than 1.19209e-07.
- MatMul+ElemWise1 cannot be AddN or Mul.
- In the BatchMatMul/BatchMatMulV2 scenario, ElemWise2 cannot be Add or Relu.
- When elemwise_node type is add, the output shape of fc cannot be smaller than the input shape of add.
Availability
Parent topic: SpaceToBatchConv2dBatchToSpacePass