ONE - On-device Neural Engine
|
Pass to specially handle constant model outputs. More...
#include <ConstantOutputPass.h>
Public Member Functions | |
std::string | id () final |
void | callback (const ir::OperandIndex &i, ir::Operand &o) final |
Public Member Functions inherited from onert::compiler::pass::OperandPass | |
virtual | ~OperandPass ()=default |
void | run () override final |
Pass (ir::Graph &graph) | |
Public Member Functions inherited from onert::compiler::pass::Pass | |
Pass (ir::Graph &graph) | |
virtual | ~Pass ()=default |
Public Member Functions inherited from onert::compiler::pass::IPass | |
virtual | ~IPass ()=default |
Additional Inherited Members | |
Protected Attributes inherited from onert::compiler::pass::Pass | |
ir::Graph & | _graph |
Pass to specially handle constant model outputs.
As an output buffer is given right before an execution but constant initialization is done at prepare phase, the current runtime structure cannot handle when an output is constant. To resolve this problem, this pass inserts a Permute layer with a const input and make the model output tensor to be its output.
e.g.)
((Const Output))
becomes
(Const) -> [Permute] -> ((Output))
Note that this is a mandatory pass for Graph.
Definition at line 47 of file ConstantOutputPass.h.
|
finalvirtual |
Implements onert::compiler::pass::OperandPass.
Definition at line 30 of file ConstantOutputPass.cc.
References onert::compiler::pass::Pass::_graph, onert::ir::Graph::addOperand(), onert::util::ObjectManager< Index, Object >::at(), onert::ir::OperandIndexSequence::contains(), onert::ir::Graph::getOutputs(), onert::ir::Graph::operands(), onert::ir::Graph::operations(), onert::util::ObjectManager< Index, Object >::push(), and VERBOSE.
|
inlinefinalvirtual |
Implements onert::compiler::pass::OperandPass.
Definition at line 53 of file ConstantOutputPass.h.