Skip to main content

interleaved_complex_rope_qk

Function interleaved_complex_rope_qk 

Source
pub fn interleaved_complex_rope_qk(
    query: &mut [f32],
    key: &mut [f32],
    freqs: &[f32],
    config: InterleavedComplexRopeConfig,
)
Expand description

Applies interleaved complex-frequency RoPE to query and key tensors.

Query and key use [batch, seq_len, heads, head_dim] layout. Adjacent dimensions (0, 1), (2, 3), and so on are treated as real/imaginary pairs and multiplied by the [seq_len, head_dim] complex frequency table.