Skip to main content

ClikaRT::ops::mrope_rotary_embedding_varlen

function

mrope_rotary_embedding_varlen()

Tensor mrope_rotary_embedding_varlen(
    Tensor x0,
    Tensor position_ids,
    ClikaRT::Span<const std::int64_t> mrope_sections,
    std::optional<bool> interleaved_sections = std::nullopt,
    std::optional<double> theta = std::nullopt,
    std::optional<RopeScaling> scaling = std::nullopt,
    std::optional<RotaryMode> mode = std::nullopt,
    std::optional<int64_t> rotary_dim = std::nullopt,
    std::optional<double> scale = std::nullopt
)

Multi-section rotary position embedding over token-packed layouts (cu_seqlens [B+1] Int32, as in rotary_embedding_varlen).

Multi-section RoPE (the multimodal form): the head dimension is split into mrope_sections, and each section takes its angles from its OWN row of position_ids (e.g. temporal/height/width position streams). interleaved_sections picks the section layout; theta overrides the frequency base.

Throws

  • ClikaRT::Error: when the input's dtype/shape is not served for this operation (the machine-readable reason rides code_name()).

Returns: x0 rotated; same shape and dtype.

Declared in ClikaRT/compute/ops.h, line 2150