AveragePool
Description
Performs average pooling.
Input
One input:
x: tensor of type float16 or float, in NCHW format.
Output
One output:
y: tensor of type float16 or float, in NCHW format.
Attribute
auto_pad: (optional) selected from NOTSET, SAME_UPPER, and VALID.
count_include_pad: int, not supported currently.
kernel_shape: (optional)
- kernel_shape[0]: int32, window size along the H dimension. Must be in the range of [1, 32768], defaults to 1.
- kernel_shape[1]: int32, window size along the W dimension. Must be in the range of [1, 32768], defaults to 1.
strides: (optional)
- strides[0]: int32, stride along the H dimension. Defaults to 1.
- strides[1]: int32, stride along the W dimension. Defaults to 1.
pads: (optional)
- pads[0]: int32, top padding. Defaults to 0.
- pads[1]: int32, bottom padding. Defaults to 0.
- pads[2]: int32, left padding. Defaults to 0.
- pads[3]: int32, right padding. Defaults to 0.
ceil_mode: (optional) int32, either 0 (floor mode) or 1 (ceil mode). Defaults to 0.
Constraints
When the strides[0] or strides[1] is greater than 63, the AI CPU is used for computing, which deteriorates the performance.
If the value of kernel_shape[0] or kernel_shape[1] exceeds the value of [1,255] or kernel_shape[0] * kernel_shape[1] > 256, the AI CPU is used for computing, which deteriorates the performance.
1 <= input_w <= 4096.
If N of the input tensor is a prime number, N must be less than 65535.
The ceil_mode parameter takes effect only when auto_pad is set to NOTSET.
The atc tool does not support the input of the float type when the --precision_mode=must_keep_origin_dtype parameter is used.
The auto_pad attribute supports SAME_UPPER but does not support SAME_LOWER because both SAME_LOWER and SAME_UPPER use the SAME attribute of TBE. However, TBE operators do not differentiate the padding position based on this attribute, which may result in accuracy issues.
If the window range exceeds the original width and height of the input feature map and count_include_pad is False, the divisor denominator in operator calculation may be 0, and the output may be 0, 65504, Nan, or INF. This scenario does not comply with the operator's normal service logic. You are advised to modify attributes such as ceil_mode or stride to ensure that the window always intersects with the input feature map.
ONNX Opset Support
Opset v8/v9/v10/v11/v12/v13/v14/v15/v16/v17/v18