Skip to main content

quantize

Function quantize 

Source
pub fn quantize(v: &[f32]) -> Sq8Vector
Expand description

Quantize an f32 vector to SQ8 using per-vector affine mapping.

Empty input is allowed (returns an empty Sq8Vector with min=max=0). Non-finite components (NaN / ±∞) participate in the min/max scan but are then clamped at quantize time — recall is undefined when the caller passes them.