For the complete documentation index, see llms.txt. Markdown versions of all pages are available by appending .md to any URL (e.g. /get-started.md).
Mojo function
transpose
def transpose[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], 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:
- βoutput (
TileTensor[dtype, Storage=output.Storage, linear_idx_type=output.linear_idx_type]): The output buffer. - βinput (
TileTensor[dtype, Storage=input.Storage, linear_idx_type=input.linear_idx_type]): The input buffer. - βperms (
Pointer[Int]): Permutation of the input axes. - βctx (
Optional[DeviceContext]): The context to execute the work on.