Loading...
Implement Rotary Position Embedding (RoPE).
RoPE rotates pairs of embedding dimensions by position-dependent angles. For a vector x of dimension D at position pos:
Input:
Output: Rotated vector, values rounded to 4 decimal places.
1 4 1.0 0.0 1.0 0.0
0.5403 0.8415 0.9999 0.0100