(packed: &[u8], residual_norm: f32, dim: usize)
| 67 | /// `pack_signs`). |
| 68 | #[inline] |
| 69 | fn bbq_dequantize(packed: &[u8], residual_norm: f32, dim: usize) -> Vec<f32> { |
| 70 | let scale = if dim > 0 { |
| 71 | residual_norm / (dim as f32).sqrt() |
| 72 | } else { |
| 73 | 0.0 |
| 74 | }; |
| 75 | (0..dim) |
| 76 | .map(|i| { |
| 77 | let bit = (packed[i / 8] >> (7 - (i % 8))) & 1; |
| 78 | if bit != 0 { scale } else { -scale } |
| 79 | }) |
| 80 | .collect() |
| 81 | } |
| 82 | |
| 83 | // ── BbqRerank ───────────────────────────────────────────────────────────────── |
| 84 |
no test coverage detected