Skip to main content

quantize_affine

Function quantize_affine 

Source
pub fn quantize_affine(
    tensor: &str,
    data: &[f32],
    shape: &[usize],
    granularity: Granularity,
    symmetric: bool,
    bits: u8,
) -> Result<QuantizedAffine>
Expand description

Quantizes data (row-major, shape shape) to bits-bit signed integers at the given granularity, computing one AffineParams per group from that group’s own min/max.