IMPORTANT: To view this page as Markdown, append `.md` to the URL (e.g. /max/get-started.md). For the complete documentation index, see llms.txt.
Skip to main content
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 struct

Transpose

struct Transpose

Registers the mo.transpose graph op with the graph compiler.

Implemented traits​

AnyType, ImplicitlyDeletable

Methods​

transpose_in_place​

static def transpose_in_place(input: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=input.static_spec], permutations: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=permutations.static_spec]) -> Tuple[IndexList[input.static_spec.rank], IndexList[input.static_spec.rank]]

Returns:

Tuple[IndexList[input.static_spec.rank], IndexList[input.static_spec.rank]]

update_input_view​

static def update_input_view[dtype: DType, rank: Int, //, output_static_shape: IntTuple, static_permutations: IntTuple](input: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=input.static_spec], permutations: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=permutations.static_spec]) -> ManagedTensorSlice[IOSpec[_, _].Input, static_spec=input.static_spec.with_tile_layout[rank, Layout[*?, *?]]()]

Returns:

ManagedTensorSlice[IOSpec[_, _].Input, static_spec=input.static_spec.with_tile_layout[rank, Layout[*?, *?]]()]

execute​

static def execute[target: StringSlice[ImmStaticOrigin], _trace_name: StringSlice[ImmStaticOrigin], static_permutations: IntTuple, dtype: DType, rank: Int](output: ManagedTensorSlice[IOSpec[_, _].Output, static_spec=output.static_spec], input: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=input.static_spec], permutations: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=permutations.static_spec], ctx: DeviceContext)

shape_impl​

static def shape_impl(input: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=input.static_spec], permutations: ManagedTensorSlice[IOSpec[_, _].Input, static_spec=permutations.static_spec]) -> IndexList[input.static_spec.rank]

Returns:

IndexList[input.static_spec.rank]

Was this page helpful?