Skip to main content

quantize

Function quantize 

Source
pub fn quantize(x: f32, scale: f32, zero_point: i32, qmin: i32, qmax: i32) -> i8
Expand description

Quantize a real value to int8: round(x / scale) + zero_point, ties away from zero (as TFLite), saturated to [qmin, qmax] (C++ quantize<int8_t>).