topk_to_mask

Function topk_to_mask 

Source
pub fn topk_to_mask(
    topk: &[i32],
    q_rows: usize,
    width: usize,
    kv_len: usize,
) -> Vec<u8> ⓘ
Expand description

2026-09-25: Turn an index row into the boolean visibility mask the attention reads. Duplicate indices collapse, so a repeated token is attended once; out-of-range and INVALID entries are dropped.