AirFixedPointScale
PythonFixed-point form of a real-valued rescale factor.
AirFixedPointScale()Fixed-point form of a real-valued rescale factor.
The pair reproduces a real multiplier as
x * real ~ (x * multiplier) >> (31 - shift), where multiplier is a
Q31 value (see quantize_multiplier). Following the CMSIS-NN
convention, a positive shift is applied as a left shift before the Q31
multiply and a negative one as a right shift after it.
multiplier
Pythonmultiplier: int = Field(..., description='The fixed point multiplier')Q31 mantissa of the rescale factor.
shift
Pythonshift: int = Field(..., description='The fixed point shift')Power-of-two exponent, in [-31, 30].
from_real_multiplier
PythonCreate a fixed point scale from a real multiplier.
from_real_multiplier(real_multiplier: float)classmethod
Create a fixed point scale from a real multiplier.