(x)
| 26 | return jt.sin(sinusoid_inp), jt.cos(sinusoid_inp) |
| 27 | |
| 28 | def rotate_every_two(x): |
| 29 | x1 = x[:, :, :, ::2] |
| 30 | x2 = x[:, :, :, 1::2] |
| 31 | x = jt.stack((-x2, x1), dim=-1) |
| 32 | return x.flatten(-2) # in einsum notation: rearrange(x, '... d j -> ... (d j)') |
| 33 | |
| 34 | def duplicate_interleave(m): |
| 35 | """ |
no outgoing calls
no test coverage detected