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 struct
Transpose
struct Transpose
Registers the mo.transpose graph op with the graph compiler.
Implemented traits
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[TypeList[#kgen.param_list.tabulate(len[IntTuple](output_static_shape), [idx: __mlir_type.index] ComptimeInt[SIMD[IntTuple](output_static_shape[Int(idx)])] if (xor identical(SIMD[IntTuple](output_static_shape[Int(idx)]), -1), True) else Int)](), TypeList[#kgen.param_list.tabulate(rank, [idx: __mlir_type.index] Int if identical(SIMD[IntTuple](static_permutations[Int(idx)]), -1) else input.static_spec.static_layout.__stride_types[SIMD[IntTuple](static_permutations[Int(idx)])])]()]]()]
Returns:
execute
static def execute[target: StringSpan[ImmStaticOrigin], _trace_name: StringSpan[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: