公共静态类 Tensor.QuantizationParams
与 TFLite 模型架构文件中的表 QuantizationParameters 对应的量化参数。
由于每通道量化不适用于输入和输出张量,因此 scale 和 zero_point 都是单个值,而不是数组。
对于未量化的张量,scale 和 zero_point 的值均为 0。
给定量化值 q,对应的浮点值 f 应为:
f = scale * (q -zero_point)
公共构造函数
|
QuantizationParams(float scale, int zeroPoint)
|
公共方法
| 浮点数 |
getScale()
返回缩放比例值。
|
| 整型 |
getZeroPoint()
返回零点值。
|
继承的方法
公共构造函数
public QuantizationParams (float scale, int zeroPoint)
使用 scale 和 zero_point 创建 Tensor.QuantizationParams。
参数
| 和 WAF | 量化中使用的缩放值。 |
|---|---|
| zeroPoint | 量化中使用的零点值。 |
公共方法
public float getScale ()
返回缩放比例值。
public int getZeroPoint ()
返回零点值。