Function arm_quantize_f32_s8

Function Documentation

arm_cmsis_nn_status arm_quantize_f32_s8(const float *input, int8_t *output, int32_t size, int32_t zero_point, float scale)

Quantize a floating-point array into int8_t format.

Parameters:
  • input[in] Pointer to the input float array.

  • output[out] Pointer to the output int8_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_point lies outside the int8_t range. Values round half away from zero and saturate to the int8_t range after the zero point is applied; NaN maps to zero_point.