Functions§
- apply_
rope - Apply rotary position embeddings to
xalong its last dimension. - apply_
rope_ partial - Apply RoPE to only the rotation-active entries of the last dimension; the
remainder passes through unchanged. Falls back to
apply_ropewhenrope_dim == state_rank(full RoPE), and is the identity whenrope_dim == 0(RoPE disabled,rope_fraction = 0) —anglesis ignored. - wrap_
angle - Reduce angles modulo
2πinto[−π, π], leaving the autodiff graph intact.