Skip to main content

rescale_i32_to_i8

Function rescale_i32_to_i8 

Source
pub fn rescale_i32_to_i8(
    value: i32,
    multiplier: i32,
    shift: i8,
    output_zero_point: i8,
    double_round: bool,
) -> Result<i8, IntegerError>
Expand description

Rescale one INT32 accumulator into a signed INT8 tensor value.

The input zero point for an INT32 TOSA tensor is necessarily zero. output_zero_point is added after scaling and the final value is saturated to the signed INT8 storage range.