Skip to main content

rope_dynamic

Function rope_dynamic 

Source
pub fn rope_dynamic<'a>(
    array: impl AsRef<Array>,
    dimensions: i32,
    traditional: bool,
    base: impl Into<Option<f32>>,
    scale: f32,
    offset: impl AsRef<Array>,
    freqs: impl Into<Option<&'a Array>>,
) -> Result<Array>
Expand description

Optimized implementation of NN.RoPE with dynamic (array) offset.

This variant allows specifying the offset as an array, enabling different offsets for different positions in the input.

ยงParams

  • array: Input array
  • dimensions: The feature dimensions to apply rope to
  • traditional: If true, uses the traditional rope implementation
  • base: The base used to compute angular frequency for each dimension
  • scale: The scale to apply to the positions
  • offset: An array of position offsets
  • freqs: Optional precomputed frequencies
  • stream: Stream to evaluate on