ONE - On-device Neural Engine
Loading...
Searching...
No Matches
onert::ir::operation::Permute Class Reference

Class to represent Permute operation. More...

#include <Permute.h>

Collaboration diagram for onert::ir::operation::Permute:

Public Member Functions

void accept (OperationVisitor &v) const override
 
OpCode opcode () const final
 
 Permute (const OperandIndex &input, const OperandIndex &output)
 
- Public Member Functions inherited from onert::ir::Operation
 Operation (OperandConstraint input_constr, const OperandIndexSequence &inputs, const OperandIndexSequence &outputs, OperandConstraint output_constr=OperandConstraint::createAny())
 
 Operation (OperandConstraint input_constr, OperandConstraint output_constr=OperandConstraint::createAny())
 
 Operation (const Operation &)=default
 
 Operation (Operation &&)=default
 
Operationoperator= (const Operation &)=default
 
Operationoperator= (Operation &&)=default
 
virtual ~Operation ()
 
void replaceInputs (const OperandIndex &from, const OperandIndex &to) override
 
void replaceOutputs (const OperandIndex &from, const OperandIndex &to) override
 
OperandIndexSequencegetInputs ()
 
const OperandIndexSequencegetInputs () const override
 
const OperandIndexSequencegetOutputs () const override
 
void setInputs (const OperandIndexSequence &indexes)
 
void setOutputs (const OperandIndexSequence &indexes)
 
- Public Member Functions inherited from onert::ir::IOperation
virtual ~IOperation ()=default
 
virtual std::string name () const
 

Detailed Description

Class to represent Permute operation.

Note
Permute operation reorders the dimensions of a tensor.
   This operation is virtual operation, which is not used on real model, but used internally.
   It was introduced to support various model layout (NHWC, NCHW, etc) and backend layout.
   But currently, model layout and backend layout are always same as NHWC.
   So this operation is used for below cases.
   1) Handle model output buffer's special case
     1-1) Model output is comes from model constant
     1-2) Model output is comes from model input
     1-3) Model output shares tensor with other model output(s)
   2) Handle shared tensor between different backend

   Q) Why name is still 'Permute'?
   A) It is handled as copy operation on compile phase,
      but it can be permute operation if output buffer layout is changed by API call

Definition at line 55 of file Permute.h.

Constructor & Destructor Documentation

◆ Permute()

onert::ir::operation::Permute::Permute ( const OperandIndex input,
const OperandIndex output 
)

Definition at line 29 of file Permute.cc.

31{
34}
static OperandConstraint createExact(uint32_t exact)
void setInputs(const OperandIndexSequence &indexes)
Definition Operation.cc:41
void setOutputs(const OperandIndexSequence &indexes)
Definition Operation.cc:48

References onert::ir::Operation::setInputs(), and onert::ir::Operation::setOutputs().

Member Function Documentation

◆ accept()

void onert::ir::operation::Permute::accept ( OperationVisitor v) const
overridevirtual

Implements onert::ir::IOperation.

Reimplemented in onert::ir::train::operation::Permute.

Definition at line 27 of file Permute.cc.

27{ v.visit(*this); }

◆ opcode()

OpCode onert::ir::operation::Permute::opcode ( ) const
inlinefinalvirtual

Implements onert::ir::IOperation.

Definition at line 59 of file Permute.h.

59{ return OpCode::Permute; }

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