Globalavgpoolpass
Fusion Pattern
This fusion replaces the GlobalAveragePool operator in the graph with the ReduceMean operator, which computes the mean along the spatial dimensions (all dimensions from the second one onward), as shown in the following figure.

After the replacement, the attributes of ReduceMean are set to keep_dims=true and noop_with_empty_axes=true.
Constraints
- Version constraint: The fusion takes effect when the GE compiler version is not lower than 9.1.0.
- Input dimension constraint: The input
xofGlobalAveragePoolmust be 3D, 4D, or 5D. Inputs of other dimensions are not fused. - Data types and data formats follow the constraints of the underlying
GlobalAveragePool/ReduceMeanoperators.
Applicable Products
This fusion rule is platform-independent. For the specific supported models, see the Applicable Products of the underlying GlobalAveragePool and ReduceMean operators.