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 tocols. - βcols (
Int): Number of columns in the tile, equal torows. - βdtype (
DType): Element type of the tile.
Args:
- βbuf (
TileTensor[dtype, Storage=buf.Storage, address_space=buf.address_space, linear_idx_type=buf.linear_idx_type]): The mutable square tile to transpose in place.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!