39 const int32_t num_axis =
static_cast<int32_t
>(axis_order.size());
44 output_index.
resize(num_axis);
51 for (int32_t i = 0; i < num_axis; i++)
52 output_index.
at(i) = input_index.at(axis_order[i]);
54 output.at(output_index) = input.at(input_index);
61 dispatch<TransposeImpl>(input.getElementType(), input, op, output);
Index & resize(int32_t size)
resize index to given dimension number
int32_t & at(int32_t axis)
return position on given axis
const Shape & getOutputShape(std::size_t index) const
const Shape & getShape() const
Tensor transpose operation.
const std::vector< std::size_t > & getAxisOrder() const
const luci_interpreter::RuntimeShape output_shape
void Transpose(const mir::TensorVariant &input, const mir::ops::TransposeOp &op, mir::TensorVariant &output)
static void run(const mir::TensorVariant &input, const mir::ops::TransposeOp &op, mir::TensorVariant &output)