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_strided
def transpose_strided[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], ctx: Optional[DeviceContext] = None)
Transposes a tensor with arbitrary strides via a generic strided copy.
Computes row-major strides for the input, permutes them according to
perms, and recursively copies data into the row-major output buffer.
Parameters:
- βrank (
Int): Number of dimensions in the tensor shape. - βdtype (
DType): Element type of theinputandoutputbuffers.
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, _safe=False]): Permutation of the input axes. - β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!