You're reading the documentation for a development version.
For the latest stable release version, please have a look at master.

Function asym_affine_u8

Function Documentation

void asym_affine_u8(uint8_t *out_ptr, float value, float q_scale, int q_zero)

使用非对称仿射量化(Asymmetric Affine)将 float 值量化为 uint8

该函数将输入的浮点值 value 通过给定的缩放系数 q_scale 和零点 q_zero, 映射到 [0, 255] 范围的 uint8 整数,并写入 out_ptr 所指向的内存

参数:
  • out_ptr -- [OUT] 存放量化结果的 uint8 指针

  • value -- [IN] 原始的 float32 值

  • q_scale -- [IN] 缩放系数(scale)

  • q_zero -- [IN] 零点(zero-point)