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).

Mojo function

transpose

def transpose[dtype: DType, //](output: TileTensor[dtype, linear_idx_type=output.linear_idx_type, element_size=output.element_size], input: TileTensor[dtype, linear_idx_type=input.linear_idx_type, element_size=input.element_size], perms: UnsafePointer[Int], ctx: Optional[DeviceContext] = None)

Permute the axis of input based on perms, and place the result in output.

Example:

transpose(output, input, [2, 0, 1])
# guarantees output[x, y, z] = input[z, x, y]

Parameters:

  • ​dtype (DType): The dtype of buffer elements.

Args: