Skip to main content

dynamic_quantize

Function dynamic_quantize 

Source
pub fn dynamic_quantize(
    input: &Tensor,
    qtype: QuantizationType,
    reduce_range: bool,
) -> Result<(Tensor, f32, i32)>
Expand description

Dynamic quantization with automatic scale/zero-point calculation

Automatically determines optimal scale and zero point based on input tensor statistics.

§Arguments

  • input - Input tensor to quantize
  • qtype - Target quantization type
  • reduce_range - Whether to reduce quantization range for better accuracy

§Returns

Tuple of (quantized_tensor, scale, zero_point)