Tensor.QuantizationParams

class Tensor.QuantizationParams

Quantization parameters that corresponds to the table, QuantizationParameters, in the TFLite Model schema file.

Since per-channel quantization does not apply to input and output tensors, scale and zero_point are both single values instead of arrays.

For tensor that are not quantized, the values of scale and zero_point are both 0.

Given a quantized value q, the corresponding float value f should be: f = scale * (q - zero_point)

Summary

Public constructors

QuantizationParams(scale: Float, zeroPoint: Int)

Creates a QuantizationParams with scale and zero_point.

Public properties

Float

The scale value used in quantization.

Int

The zero point value used in quantization.

Public constructors

QuantizationParams

QuantizationParams(scale: Float, zeroPoint: Int)

Creates a QuantizationParams with scale and zero_point.

Parameters
scale: Float

The scale value used in quantization.

zeroPoint: Int

The zero point value used in quantization.

Public properties

scale

val scaleFloat

The scale value used in quantization.

zeroPoint

val zeroPointInt

The zero point value used in quantization.