mean
Classes
MeanOperator
MeanOperator(op: AirOperator, model: AirModel, platform: SocPlatform, prefix: str = 'aot', attributes: dict[str, str] = {})
MEAN operator.
This operator computes the mean of the input tensor along specified axes.
Parameters:
-
(opAirOperator) –The AIR operator to wrap.
-
(modelAirModel) –The AIR model.
-
(platformSocPlatform) –The target platform for code generation.
-
(prefixstr, default:'aot') –Prefix for generated code files. Defaults to "aot".
-
(attributesdict[str, str], default:{}) –Attributes for template values. Defaults to {}.
Functions
compute_values
emit
Generate the source code for the operator.
Parameters:
-
(save_pathPath) –Path to save the generated code.
Functions
fold_mean_multiplier
Fold 1 / count into base_multiplier and shift, such that the result is compatible with arm_nn_requantize().
Ensures shift is in [0, 31] and multiplier fits in Q31.
Parameters:
-
(base_fpAirFixedPointScale) –Base fixed-point scale.
-
(countint) –Count to fold into the multiplier.