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 |
![]() | |
virtual | ~OperandPass ()=default |
void | run () override final |
Pass (ir::Graph &graph) | |
![]() | |
Pass (ir::Graph &graph) | |
virtual | ~Pass ()=default |
![]() | |
virtual | ~IPass ()=default |
Additional Inherited Members | |
![]() | |
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 43 of file ConstantOutputPass.h.
|
finalvirtual |
Implements onert::compiler::pass::OperandPass.
Definition at line 26 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 49 of file ConstantOutputPass.h.