ReduceMean
Description
Reduces a dimension of a tensor by calculating the mean value of elements in the specified dimension of the input tensor.
If keepdims is set to 1, the generated tensor has the same rank as the input. If keepdims is set to 0, the generated tensor has the dimension pruned.
Input
x: input tensor of type float16 or float.
Attribute
- axes: int list, specifying the dimension to be reduced.
- keepdims: int, indicating whether to retain the reduced dimension. The default value is 1.
Output
y: output tensor of the identical data type as input x.
Constraints
If the value of axes is empty, the full-dimension specification is not performed on the current output. In this case, you are advised to upgrade the ONNX operator to include all axes. Alternatively, before exporting the ONNX graph from Torch, use amax in the Torch model to reduce all axes. Example formula: x.amax(dim=[0, 1, 2])
ONNX Opset Support
Opset v8/v9/v10/v11/v12/v13/v14/v15/v16.
Parent topic: Supported ONNX Operators