Mojo function
transpose
transpose[dtype: DType, //](output: TileTensor[dtype, output.LayoutType, output.origin, linear_idx_type=output.linear_idx_type, element_size=output.element_size], input: TileTensor[dtype, input.LayoutType, input.origin, linear_idx_type=input.linear_idx_type, element_size=input.element_size], perms: UnsafePointer[Scalar[DType.int], perms.origin])
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): The output buffer. - βinput (
TileTensor): The input buffer. - βperms (
UnsafePointer): Permutation of the input axes.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!