Skip to content

Commit

Permalink
comment
Browse files Browse the repository at this point in the history
  • Loading branch information
xadupre committed Jun 11, 2024
1 parent 29c460f commit ec3887a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions operators/cuda/rotary.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,16 @@

namespace contrib {

/**
* Y = Rotary(X) is equivalent to if side == LEFT:
*
* N = X.shape[-1]
* Y = X.copy()
* Y[...,:N/2] = X[...,N/2:]
* Y[...,N/2:] = -X[...,:N/2]
*
* And the opposite if side == RIGHT.
*/
template <typename T>
struct Rotary {
template <typename TDict>
Expand Down

0 comments on commit ec3887a

Please sign in to comment.