public static class Tensor.QuantizationParameters extends Object
QuantizationParameters
class represents the quantization parameters used by a MLInferenceEngine
.
scale
and zeroPoint
values are 0
when the tensor is not quantized.
Real values can be quantized using: quantized_value = real_value/scale + zero_point
.
Quantized values can be converted back to float using:
real_value = scale * (quantized_value - zero_point)
.
Constructor and Description |
---|
QuantizationParameters(int zeroPoint,
float scale)
Creates an instance of QuantizationParameters.
|
Modifier and Type | Method and Description |
---|---|
float |
getScale()
Gets the scale value of the quantization parameters.
|
int |
getZeroPoint()
Gets the zero point value of the quantization parameters.
|
public QuantizationParameters(int zeroPoint, float scale)
zeroPoint
- zero point of quantizationscale
- scale of quantizationpublic float getScale()
public int getZeroPoint()