ONE - On-device Neural Engine
Loading...
Searching...
No Matches
mir::ops::TransposeOp Class Reference

Tensor transpose operation. More...

#include <TransposeOp.h>

Collaboration diagram for mir::ops::TransposeOp:

Public Member Functions

 TransposeOp (Output *arg, const std::vector< std::size_t > &axis_order)
 
const std::vector< std::size_t > & getAxisOrder () const
 
OperationcopyWithInputs (const std::vector< Output * > &arg) override
 
- Public Member Functions inherited from mir::Operation
virtual ~Operation ()=default
 
Type getType () const
 
std::size_t getId () const
 
void setId (std::size_t id)
 
std::size_t getNumInputs () const
 
std::size_t getNumOutputs () const
 
std::deque< Output * > & getInputs ()
 
const std::deque< Output * > & getInputs () const
 
std::deque< Output > & getOutputs ()
 
const std::deque< Output > & getOutputs () const
 
OutputgetInput (std::size_t index)
 
const OutputgetInput (std::size_t index) const
 
OutputgetOutput (std::size_t index)
 
const OutputgetOutput (std::size_t index) const
 
const ShapegetInputShape (std::size_t index) const
 
const ShapegetOutputShape (std::size_t index) const
 
void accept (IVisitor *v)
 

Additional Inherited Members

- Public Types inherited from mir::Operation
enum class  Type { HANDLE_OP }
 
- Protected Member Functions inherited from mir::Operation
 Operation (Type type, const std::vector< Output * > &inputs, std::size_t num_outputs=1)
 
void setOutputType (std::size_t index, const TensorType &type)
 

Detailed Description

Tensor transpose operation.

Rearranges axes of input tensor.

Definition at line 33 of file TransposeOp.h.

Constructor & Destructor Documentation

◆ TransposeOp()

mir::ops::TransposeOp::TransposeOp ( Output arg,
const std::vector< std::size_t > &  axis_order 
)

Definition at line 24 of file TransposeOp.cpp.

25 : Operation(Type::transpose, {arg}), _axis_order(axis_order)
26{
27 assert(_axis_order.size() == static_cast<std::size_t>(getInputShape(0).rank()));
28 inferOutputTypes();
29}
const Shape & getInputShape(std::size_t index) const
Definition Operation.h:161

Member Function Documentation

◆ copyWithInputs()

Operation * mir::ops::TransposeOp::copyWithInputs ( const std::vector< Output * > &  arg)
inlineoverridevirtual

Implements mir::Operation.

Definition at line 40 of file TransposeOp.h.

41 {
42 return new TransposeOp(arg[0], _axis_order);
43 }
TransposeOp(Output *arg, const std::vector< std::size_t > &axis_order)

◆ getAxisOrder()

const std::vector< std::size_t > & mir::ops::TransposeOp::getAxisOrder ( ) const
inline

The documentation for this class was generated from the following files: