ONE - On-device Neural Engine
|
#include <Operation.h>
Data Structures | |
class | Output |
Represents an output of a node. More... | |
struct | Use |
Represents a use of an operation output. More... | |
Public Types | |
enum class | Type { HANDLE_OP } |
Public Member Functions | |
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 |
Output * | getInput (std::size_t index) |
const Output * | getInput (std::size_t index) const |
Output * | getOutput (std::size_t index) |
const Output * | getOutput (std::size_t index) const |
const Shape & | getInputShape (std::size_t index) const |
const Shape & | getOutputShape (std::size_t index) const |
void | accept (IVisitor *v) |
virtual Operation * | copyWithInputs (const std::vector< Output * > &inputs)=0 |
Protected Member Functions | |
Operation (Type type, const std::vector< Output * > &inputs, std::size_t num_outputs=1) | |
void | setOutputType (std::size_t index, const TensorType &type) |
Definition at line 32 of file Operation.h.
|
strong |
Enumerator | |
---|---|
HANDLE_OP |
Definition at line 35 of file Operation.h.
|
virtualdefault |
|
protected |
Definition at line 42 of file Operation.cpp.
void Operation::accept | ( | IVisitor * | v | ) |
Definition at line 56 of file Operation.cpp.
References getType().
Referenced by mir::Graph::accept(), mir_onnx::foldConstants(), and nnc::Serializer::serialize().
|
pure virtual |
Implemented in mir::ops::ReluOp, mir::ops::TransposeOp, mir::ops::InputOp, mir::ops::AbsOp, mir::ops::AddOp, mir::ops::AvgPool2DOp, mir::ops::BroadcastOp, mir::ops::CappedReluOp, mir::ops::ConcatOp, mir::ops::Conv2DOp, mir::ops::DeConv2DOp, mir::ops::DepthwiseConv2DOp, mir::ops::DequantizeOp, mir::ops::DivOp, mir::ops::EluOp, mir::ops::EqualOp, mir::ops::FullyConnectedOp, mir::ops::GatherOp, mir::ops::GreaterOp, mir::ops::HardSwishOp, mir::ops::LeakyReluOp, mir::ops::LessOp, mir::ops::MaxOp, mir::ops::MaxPool2DOp, mir::ops::MulOp, mir::ops::OutputOp, mir::ops::PadOp, mir::ops::QuantizeOp, mir::ops::ReduceMeanOp, mir::ops::ReshapeOp, mir::ops::ResizeOp, mir::ops::SigmoidOp, mir::ops::SliceOp, mir::ops::SoftmaxOp, mir::ops::SqrtOp, mir::ops::SqueezeOp, mir::ops::SubOp, and mir::ops::TanhOp.
Referenced by mir::Graph::copyOpWithInputs().
|
inline |
Definition at line 125 of file Operation.h.
Referenced by mir::DotNodeBuilder::DotNodeBuilder(), nnc::DumpVisitor::visit(), nnc::DumpVisitor::visit(), nnc::DumpVisitor::visit(), nnc::DumpVisitor::visit(), nnc::DumpVisitor::visit(), nnc::DumpVisitor::visit(), nnc::DumpVisitor::visit(), nnc::DumpVisitor::visit(), nnc::DumpVisitor::visit(), and nnc::DumpVisitor::visit().
|
inline |
Definition at line 137 of file Operation.h.
Referenced by getInputShape(), mir::ops::SqueezeOp::inferOutputTypes(), mir::Graph::removeNode(), nnc::CombineTransposes::run(), mir2loco::Transformer::visit(), nnc::AclCppOpGenerator::visit(), mir2loco::Transformer::visit(), mir2loco::Transformer::visit(), mir2loco::Transformer::visit(), mir2loco::Transformer::visit(), mir2loco::Transformer::visit(), mir2loco::Transformer::visit(), mir2loco::Transformer::visit(), nnc::AclCppOpGenerator::visit(), mir2loco::Transformer::visit(), mir2loco::Transformer::visit(), nnc::AclCppOpGenerator::visit(), mir_interpreter::MIRInterpreter::visit(), mir2loco::Transformer::visit(), nnc::AclCppOpGenerator::visit(), mir2loco::Transformer::visit(), mir2loco::Transformer::visit(), nnc::AclCppOpGenerator::visit(), mir2loco::Transformer::visit(), nnc::AclCppOpGenerator::visit(), mir2loco::Transformer::visit(), mir2loco::Transformer::visit(), and nnc::AclCppOpGenerator::visit().
|
inline |
Definition at line 143 of file Operation.h.
|
inline |
Definition at line 131 of file Operation.h.
Referenced by mir_onnx::foldConstants(), nnc::opt_util::swapAdjacent(), and nnc::AclCppOpGenerator::visit().
|
inline |
Definition at line 132 of file Operation.h.
|
inline |
Definition at line 161 of file Operation.h.
References getInput(), and mir::Operation::Output::getShape().
Referenced by mir::DotNodeBuilder::DotNodeBuilder(), mir::ops::EqualOp::EqualOp(), mir::ops::ConcatOp::getAxis(), mir::ops::SoftmaxOp::getAxis(), mir::ops::GreaterOp::GreaterOp(), mir::ops::SqueezeOp::inferOutputTypes(), mir::ops::LessOp::LessOp(), mir_interpreter::AvgPool2DImpl< uint8_t >::run(), mir_interpreter::AvgPool2DImpl< T >::run(), mir_interpreter::DepthwiseConv2DImpl< T >::run(), mir_interpreter::MaxPool2DImpl< uint8_t >::run(), mir_interpreter::MaxPool2DImpl< T >::run(), mir_interpreter::PadImpl< T >::run(), mir_interpreter::ReduceMeanImpl< T >::run(), TEST(), nnc::ModelAnalyzer::visit(), nnc::ModelAnalyzer::visit(), nnc::Serializer::visit(), and nnc::ModelAnalyzer::visit().
|
inline |
Definition at line 128 of file Operation.h.
Referenced by mir::Graph::copyOpWithInputs(), mir::DotNodeBuilder::DotNodeBuilder(), mir::getSortedNodes(), mir::ops::SqueezeOp::inferOutputTypes(), mir::Graph::removeNode(), nnc::opt_util::swapAdjacent(), nnc::AclCppOpGenerator::visit(), mir2loco::Transformer::visit(), nnc::ModelAnalyzer::visit(), nnc::AclCppOpGenerator::visit(), nnc::ModelAnalyzer::visit(), nnc::AclCppOpGenerator::visit(), nnc::AclCppOpGenerator::visit(), nnc::AclCppOpGenerator::visit(), nnc::AclCppOpGenerator::visit(), and nnc::AclCppOpGenerator::visit().
|
inline |
Definition at line 129 of file Operation.h.
Referenced by mir::DotNodeBuilder::DotNodeBuilder(), mir_onnx::foldConstants(), and nnc::opt_util::swapAdjacent().
|
inline |
Definition at line 149 of file Operation.h.
Referenced by mir_onnx::foldConstants(), getOutputShape(), nnc::opt_util::removeNodeIfUnused(), mir_interpreter::AvgPool2DImpl< uint8_t >::run(), mir_interpreter::DepthwiseConv2DImpl< uint8_t >::run(), mir_interpreter::MaxPool2DImpl< uint8_t >::run(), mir_interpreter::FullyConnectedImpl< uint8_t >::run(), setOutputType(), TEST(), TEST(), TEST(), mir2loco::Transformer::visit(), nnc::AclCppOpGenerator::visit(), mir2loco::Transformer::visit(), mir2loco::Transformer::visit(), nnc::AclCppOpGenerator::visit(), mir_interpreter::MIRInterpreter::visit(), mir2loco::Transformer::visit(), nnc::AclCppOpGenerator::visit(), nnc::ModelAnalyzer::visit(), mir2loco::Transformer::visit(), mir2loco::Transformer::visit(), mir2loco::Transformer::visit(), mir2loco::Transformer::visit(), mir2loco::Transformer::visit(), nnc::AclCppOpGenerator::visit(), mir_interpreter::MIRInterpreter::visit(), mir2loco::Transformer::visit(), nnc::AclCppOpGenerator::visit(), mir2loco::Transformer::visit(), mir2loco::Transformer::visit(), nnc::AclCppOpGenerator::visit(), nnc::AclCppOpGenerator::visit(), mir2loco::Transformer::visit(), mir2loco::Transformer::visit(), nnc::AclCppOpGenerator::visit(), mir2loco::Transformer::visit(), nnc::AclCppOpGenerator::visit(), mir2loco::Transformer::visit(), mir2loco::Transformer::visit(), and nnc::AclCppOpGenerator::visit().
|
inline |
Definition at line 155 of file Operation.h.
|
inline |
Definition at line 134 of file Operation.h.
Referenced by nnc::ModelAnalyzer::analyze(), mir::getSortedNodes(), mir::Graph::removeNode(), and nnc::opt_util::swapAdjacent().
|
inline |
Definition at line 135 of file Operation.h.
|
inline |
Definition at line 163 of file Operation.h.
References getOutput(), and mir::Operation::Output::getShape().
Referenced by mir::ops::BroadcastOp::copyWithInputs(), mir::ops::DeConv2DOp::copyWithInputs(), mir::ops::ReshapeOp::copyWithInputs(), mir::ops::ResizeOp::copyWithInputs(), mir::DotNodeBuilder::DotNodeBuilder(), mir_interpreter::AvgPool2DImpl< uint8_t >::run(), mir_interpreter::AvgPool2DImpl< T >::run(), mir_interpreter::DepthwiseConv2DImpl< T >::run(), mir_interpreter::DepthwiseConv2DImpl< uint8_t >::run(), mir_interpreter::MaxPool2DImpl< uint8_t >::run(), mir_interpreter::TransposeImpl< T >::run(), mir_interpreter::MaxPool2DImpl< T >::run(), mir_interpreter::ReduceMeanImpl< T >::run(), mir_interpreter::FullyConnectedImpl< uint8_t >::run(), nnc::ConstantFoldTranspose::run(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), nnc::Serializer::visit(), nnc::Serializer::visit(), mir_interpreter::MIRInterpreter::visit(), nnc::Serializer::visit(), nnc::Serializer::visit(), mir2loco::Transformer::visit(), nnc::ModelAnalyzer::visit(), nnc::Serializer::visit(), nnc::ModelAnalyzer::visit(), nnc::Serializer::visit(), nnc::Serializer::visit(), nnc::Serializer::visit(), nnc::Serializer::visit(), nnc::Serializer::visit(), nnc::Serializer::visit(), nnc::Serializer::visit(), nnc::Serializer::visit(), nnc::Serializer::visit(), nnc::Serializer::visit(), nnc::Serializer::visit(), mir2loco::Transformer::visit(), nnc::Serializer::visit(), nnc::ModelAnalyzer::visit(), nnc::Serializer::visit(), nnc::Serializer::visit(), nnc::Serializer::visit(), nnc::Serializer::visit(), and nnc::Serializer::visit().
|
inline |
Definition at line 123 of file Operation.h.
Referenced by accept(), mir::DotNodeBuilder::DotNodeBuilder(), mir_onnx::foldConstants(), and mir::Graph::removeNode().
|
inline |
Definition at line 126 of file Operation.h.
Referenced by mir::Graph::copyOpWithInputs().
|
inlineprotected |
Definition at line 172 of file Operation.h.
References getOutput(), and mir::Operation::Output::setType().
Referenced by mir::ops::EqualOp::EqualOp(), mir::ops::GreaterOp::GreaterOp(), mir::ops::SqueezeOp::inferOutputTypes(), and mir::ops::LessOp::LessOp().