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_2d
def transpose_2d[rank: Int, dtype: DType, //](output: TileTensor[dtype, Storage=output.Storage, linear_idx_type=output.linear_idx_type], input: TileTensor[dtype, Storage=input.Storage, linear_idx_type=input.linear_idx_type], perms: Pointer[Int, _safe=False], simplified_input_shape: IndexList[rank], simplified_rank: Int, offset: Int, ctx: Optional[DeviceContext] = None)
Transposes the inner two dimensions of a simplified rank-2 tensor.
Selects a serial tiled implementation or a parallel tiled implementation based on the problem size and available parallelism.
Parameters:
- βrank (
Int): Number of dimensions in thesimplified_input_shapearray (inferred). - βdtype (
DType): Element type of theinputandoutputbuffers (inferred).
Args:
- βoutput (
TileTensor[dtype, Storage=output.Storage, linear_idx_type=output.linear_idx_type]): The output buffer with the inner two dimensions swapped. - βinput (
TileTensor[dtype, Storage=input.Storage, linear_idx_type=input.linear_idx_type]): The input buffer. - βperms (
Pointer[Int, _safe=False]): Permutation of the input axes. - βsimplified_input_shape (
IndexList[rank]): Shape of the tensor after simplification. - βsimplified_rank (
Int): Effective rank after simplification. - βoffset (
Int): Flat offset added to both input and output pointers. - βctx (
Optional[DeviceContext]): The context to execute the work on.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!