IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /max/get-started.md).

Python class

TransposedRotaryEmbedding

TransposedRotaryEmbedding

class max.experimental.nn.rope.TransposedRotaryEmbedding(weight)

source

Bases: RotaryEmbedding

Applies RoPE using a transposed head-dimension layout.

Parameters:

weight (Tensor)

forward()

forward(x, start_pos=0)

source

Defines the computation performed by the module.

Users must override this method in their subclass to define the module’s computation.

Parameters:

  • *args – Positional arguments for the computation.
  • **kwargs – Keyword arguments for the computation.
  • x (Tensor)
  • start_pos (int | str | Dim | integer | TypedAttr)

Returns:

The result of applying the module to the input.

Raises:

NotImplementedError – If the subclass does not override this method.

Return type:

Tensor