//clika-runtime/io.clika.runtime/Ops/rotaryEmbeddingVarlen
rotaryEmbeddingVarlen
[common]
fun rotaryEmbeddingVarlen(input: Tensor, cuSeqlens: Tensor, seqlens: Tensor? = null, positionIds: Tensor? = null, cos: Tensor? = null, sin: Tensor? = null, mode: RotaryMode? = null, rotaryDim: Long? = null, theta: Double? = null, scaling: RopeScaling? = null, scale: Double? = null, lowFreqFactor: Double? = null, highFreqFactor: Double? = null, originalMaxPos: Long? = null, betaFast: Double? = null, betaSlow: Double? = null, freqFactors: Tensor? = null): Tensor
rotaryEmbeddingVarlen(input: Tensor, cuSeqlens: Tensor, seqlens: Tensor? = null, positionIds: Tensor? = null, cos: Tensor? = null, sin: Tensor? = null, mode: RotaryMode? = null, rotaryDim: Long? = null, theta: Double? = null, scaling: RopeScaling? = null, scale: Double? = null, lowFreqFactor: Double? = null, highFreqFactor: Double? = null, originalMaxPos: Long? = null, betaFast: Double? = null, betaSlow: Double? = null, freqFactors: Tensor? = null): the rotary_embedding_varlen operator. Rotary position embedding over token-packed (variable-length) layouts. Packed [Sum(S), .., D] input with cu_seqlens``[B+1] Int32 prefix sums (per-sequence positions restart at 0 unless position_ids is given); seqlens optionally carries explicit per-sequence lengths. angles (RoPE). cos / sin are the precomputed angle planes [max_pos, rotary_dim/2] Float32; position_ids (Int32/Int64) selects each token's row; absent, positions run 0, 1, 2, … per sequence. mode picks the pair layout (interleaved vs half-split); rotary_dim absent rotates the whole head dim.