Skip to content

Commit ec3887a

Browse files
committed
comment
1 parent 29c460f commit ec3887a

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

operators/cuda/rotary.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@
88

99
namespace contrib {
1010

11+
/**
12+
* Y = Rotary(X) is equivalent to if side == LEFT:
13+
*
14+
* N = X.shape[-1]
15+
* Y = X.copy()
16+
* Y[...,:N/2] = X[...,N/2:]
17+
* Y[...,N/2:] = -X[...,:N/2]
18+
*
19+
* And the opposite if side == RIGHT.
20+
*/
1121
template <typename T>
1222
struct Rotary {
1323
template <typename TDict>

0 commit comments

Comments
 (0)