Skip to main content

quantize_tensor

Function quantize_tensor 

Source
pub fn quantize_tensor(
    name: &str,
    data: &[f32],
    shape: &[usize],
    scheme: Scheme,
    granularity: Granularity,
) -> Result<HashMap<String, OutputTensor>>
Expand description

Quantizes one tensor per scheme/granularity, returning the output tensors to insert (quantized weight, _scale, and – for asymmetric schemes – _zero_point), keyed by their final names. name is the original (unsuffixed) tensor name.