Expand description
Affine (scale + zero-point) integer quantization, shared by the INT8 and INT4 schemes –
INT4 just runs this with bits: 4 and then nibble-packs the result (see
crate::quant::pack4).
Structs§
- Affine
Params - Per-group affine quantization parameters:
q = round(x / scale) + zero_point, clamped to the scheme’s[qmin, qmax]. - Quantized
Affine - A tensor quantized with one
AffineParamsper group.
Functions§
- dequantize_
affine - Reconstructs
f32values fromqvalues/params/groupsproduced byquantize_affine. - quantize_
affine - Quantizes
data(row-major, shapeshape) tobits-bit signed integers at the givengranularity, computing oneAffineParamsper group from that group’s own min/max.