transpose

Reorders the dimensions of output of an operation.

transpose
(,
size_t[] order
,
string mod = __MODULE__
,
size_t line = __LINE__
)

Parameters

input Operation

The operation that should have its dimensions reordered.

order size_t[]

Determines how the dimensions are permuted.

Notes: Currently only implemented for rank 2 tensors.

Return Value

Type: Operation

The new Operation.

Examples

import dopt.core : evaluate;

auto t1 = float32([2, 2], [1.0f, 2.0f, 3.0f, 4.0f]).transpose([1, 0]);

assert(t1.evaluate().get!float == [1.0f, 3.0f, 2.0f, 4.0f]);

Meta