Skip to main content

reconstruct_kv

Function reconstruct_kv 

Source
pub fn reconstruct_kv(
    layer: usize,
    k_not_v: bool,
    proj: &mut [f32],
    n_kv: usize,
    head_dim: usize,
)
Expand description

Reconstruct each of the n_kv head vectors in proj (length ≥ n_kv * head_dim) through this layer’s dictionary, in place. No-op (one atomic load) when disabled, when the layer has no dictionary, or on a head_dim mismatch — so the caller stores the original vector unchanged.