ltx23_apply_interleaved_rotary_emb

Apply interleaved rotary embeddings

Description

Rotates adjacent element pairs of the last dimension: out = x * cos + rotate_half(x) * sin with pairs interleaved (elements 1,2 form the first complex pair).

Usage

ltx23_apply_interleaved_rotary_emb(x, freqs)

Arguments

  • x: Tensor of shape [B, S, C].
  • freqs: List of two tensors (cos, sin), each [B, S, C].

Value

Tensor with the same shape and dtype as x.