ltx23_apply_split_rotary_emb

Apply split rotary embeddings

Description

Rotates element pairs formed by splitting the last dimension in half: element i pairs with element i + d/2. The cos/sin tensors carry half the head dimension.

Usage

ltx23_apply_split_rotary_emb(x, freqs)

Arguments

  • x: Tensor of shape [B, H, T, D] (per-head layout), or [B, T, H*D] which is reshaped per-head when freqs is 4D.
  • freqs: List of two tensors (cos, sin), each [B, H, T, D/2].

Value

Tensor with the same shape and dtype as x.