Function arm_quantize_f32_s16¶
Defined in File arm_nnfunctions.h
Function Documentation¶
-
arm_cmsis_nn_status arm_quantize_f32_s16(const float *input, int16_t *output, int32_t size, int32_t zero_point, float scale)¶
Quantize a floating-point array into int16_t format.
- Parameters:
input – [in] Pointer to the input float array.
output – [out] Pointer to the output int16_t array.
size – [in] Number of elements in the arrays.
zero_point – [in] Zero point (offset) to apply during quantization.
scale – [in] Scale factor to apply during quantization. Must be a positive finite number. A scale that is zero, negative, NaN, Inf, or small enough that its reciprocal overflows is unsupported, and the result is then unspecified: the scalar and Helium legs are not guaranteed to agree for such a scale. Denormal inputs are likewise unspecified: the Helium leg flushes them to zero, so the two legs are not guaranteed to agree for a denormal input at any scale. Screen denormals if you need them to match.
- Returns:
ARM_CMSIS_NN_SUCCESS, or ARM_CMSIS_NN_ARG_ERROR when
zero_pointlies outside the int16_t range. Values round half away from zero and saturate to the int16_t range after the zero point is applied; NaN maps tozero_point.