Skip to main content

dot_quant

Function dot_quant 

Source
pub fn dot_quant(query: &[f32], doc: &QuantizedVector) -> f32
Expand description

Asymmetric dot product: full-precision query · quantized doc.

Computes Σ query[i] · code[i] · scale without ever reconstructing the doc vector. For L2-normalized inputs this approximates cosine similarity; the quantization error is well within embedding-ranking tolerance.