mlx.nn.RoPE
- class mlx.nn.RoPE(dims: int, traditional: bool = False)
Implements the rotary positional encoding [1].
The traditional implementation rotates consecutive pairs of elements in the feature dimension while the default implementation rotates pairs with stride half the feature dimensions for efficiency.