From ec3887a4dcee3984c009e59d67e4ea54e38f31f3 Mon Sep 17 00:00:00 2001 From: xadupre Date: Tue, 11 Jun 2024 10:05:58 +0000 Subject: [PATCH] comment --- operators/cuda/rotary.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/operators/cuda/rotary.h b/operators/cuda/rotary.h index a365c2470..b5e27b877 100644 --- a/operators/cuda/rotary.h +++ b/operators/cuda/rotary.h @@ -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 struct Rotary { template