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_inplace

def transpose_inplace[rows: Int, cols: Int, dtype: DType](buf: TileTensor[dtype, Storage=buf.Storage, address_space=buf.address_space, linear_idx_type=buf.linear_idx_type])

Transposes a square rows x cols tile in place.

Dispatches to a specialized SIMD shuffle kernel for 4x4, 8x8, and 16x16 tiles, falling back to an element-swap loop for other sizes.

Parameters:

  • ​rows (Int): Number of rows in the tile, equal to cols.
  • ​cols (Int): Number of columns in the tile, equal to rows.
  • ​dtype (DType): Element type of the tile.

Args:

Was this page helpful?