From d02826dc705c751deccd4133ee3398cc53c88fbe Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 18 Apr 2026 05:46:47 +0000 Subject: [PATCH] feat(quantized): add dequantize_i8_to_f32 https://claude.ai/code/session_01SbYsmmbPf9YQuYbHZN52Zh --- src/hpc/quantized.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/hpc/quantized.rs b/src/hpc/quantized.rs index c150c349..ffd228ca 100644 --- a/src/hpc/quantized.rs +++ b/src/hpc/quantized.rs @@ -229,6 +229,11 @@ pub fn quantize_f32_to_i8(data: &[f32]) -> (Vec, QuantParams) { (quantized, QuantParams { scale, zero_point: 0, min_val, max_val }) } +/// Dequantize i8 to f32. +pub fn dequantize_i8_to_f32(data: &[i8], params: &QuantParams, len: usize) -> Vec { + data.iter().take(len).map(|&q| q as f32 * params.scale).collect() +} + /// Per-channel i8 quantization (per row). pub fn quantize_per_channel_i8( data: &[f32],