ONE - On-device Neural Engine
|
#include <mir2loco.h>
Public Member Functions | |
Transformer ()=default | |
~Transformer ()=default | |
void | visit (mir::ops::AddOp &op) override |
void | visit (mir::ops::AvgPool2DOp &op) override |
void | visit (mir::ops::ConcatOp &op) override |
void | visit (mir::ops::ConstantOp &op) override |
void | visit (mir::ops::Conv2DOp &op) override |
void | visit (mir::ops::DeConv2DOp &op) override |
void | visit (mir::ops::DepthwiseConv2DOp &op) override |
void | visit (mir::ops::DivOp &op) override |
void | visit (mir::ops::FullyConnectedOp &op) override |
void | visit (mir::ops::InputOp &op) override |
void | visit (mir::ops::MaxPool2DOp &op) override |
void | visit (mir::ops::MulOp &op) override |
void | visit (mir::ops::OutputOp &op) override |
void | visit (mir::ops::ReluOp &op) override |
void | visit (mir::ops::ReshapeOp &op) override |
void | visit (mir::ops::SoftmaxOp &op) override |
void | visit (mir::ops::SubOp &op) override |
void | visit (mir::ops::TransposeOp &op) override |
void | visit_fallback (mir::Operation &op) override |
std::unique_ptr< loco::Graph > | transform (mir::Graph *mir_graph) |
Public Member Functions inherited from mir::IVisitor | |
virtual | ~IVisitor ()=default |
Additional Inherited Members |
Definition at line 24 of file mir2loco.h.
|
default |
|
default |
std::unique_ptr< loco::Graph > mir2loco::Transformer::transform | ( | mir::Graph * | mir_graph | ) |
Definition at line 710 of file mir2loco.cpp.
References mir::Graph::accept(), loco::make_graph(), and loco::valid().
|
override |
Definition at line 266 of file mir2loco.cpp.
References mir::Operation::getInput(), and mir::Operation::getOutput().
|
override |
Definition at line 277 of file mir2loco.cpp.
References loco::AvgPool2D::Full, mir::ops::AvgPool2DOp::getDataFormat(), mir::ops::AvgPool2DOp::getIncludePad(), mir::Operation::getInput(), mir::Operation::getOutput(), mir::ops::AvgPool2DOp::getPaddingAfter(), mir::ops::AvgPool2DOp::getPaddingBefore(), mir::ops::AvgPool2DOp::getStrides(), mir::ops::AvgPool2DOp::getWindowSize(), loco::AvgPool2D::ifm(), loco::FeatureEncode::input(), and loco::AvgPool2D::Valid.
|
override |
Definition at line 300 of file mir2loco.cpp.
References mir::ops::ConcatOp::getAxis(), mir::Operation::getInput(), mir::Operation::getNumInputs(), mir::Operation::getOutput(), and loco::TensorConcat::lhs().
|
override |
Definition at line 332 of file mir2loco.cpp.
References mir::TensorVariant::at(), mir::Operation::getOutput(), mir::Operation::getOutputShape(), and mir::ops::ConstantOp::getValue().
|
override |
Definition at line 404 of file mir2loco.cpp.
References mir::Shape::dim(), mir::ops::Conv2DOp::getDataFormat(), mir::Operation::getInput(), mir::ops::Conv2DOp::getNumGroups(), mir::Operation::getOutput(), mir::ops::Conv2DOp::getPaddingAfter(), mir::ops::Conv2DOp::getPaddingBefore(), mir::Operation::Output::getShape(), mir::ops::Conv2DOp::getStrides(), loco::Conv2D::ifm(), loco::DepthwiseConv2D::ifm(), loco::FeatureEncode::input(), loco::FilterEncode::input(), and loco::DepthwiseFilterEncode::input().
|
override |
Definition at line 479 of file mir2loco.cpp.
References mir::ops::Explicit, mir::ops::DeConv2DOp::getDataFormat(), mir::Operation::getInput(), mir::Operation::getOutput(), mir::ops::DeConv2DOp::getPaddingAfter(), mir::ops::DeConv2DOp::getPaddingBefore(), mir::ops::DeConv2DOp::getPaddingType(), mir::ops::DeConv2DOp::getStrides(), loco::TransposedConv2D::ifm(), loco::FeatureEncode::input(), and loco::FilterEncode::input().
|
override |
Definition at line 511 of file mir2loco.cpp.
References mir::ops::DepthwiseConv2DOp::getDataFormat(), mir::Operation::getInput(), mir::Operation::getOutput(), mir::ops::DepthwiseConv2DOp::getPaddingAfter(), mir::ops::DepthwiseConv2DOp::getPaddingBefore(), mir::ops::DepthwiseConv2DOp::getStrides(), loco::DepthwiseConv2D::ifm(), loco::FeatureEncode::input(), and loco::DepthwiseFilterEncode::input().
|
override |
Definition at line 540 of file mir2loco.cpp.
References mir::Operation::getInput(), and mir::Operation::getOutput().
|
override |
Definition at line 551 of file mir2loco.cpp.
References mir::Operation::getInput(), mir::Operation::getOutput(), mir::Operation::Output::getShape(), loco::MatrixEncode::input(), loco::MatMul::lhs(), and mir::Shape::rank().
|
override |
Definition at line 581 of file mir2loco.cpp.
References loco::Mixin< Trait::DataTyped >::dtype(), mir::Operation::Output::getElementType(), mir::Operation::Output::getName(), mir::Operation::getOutput(), mir::Operation::Output::getShape(), and loco::link().
|
override |
Definition at line 597 of file mir2loco.cpp.
References mir::ops::MaxPool2DOp::getDataFormat(), mir::Operation::getInput(), mir::Operation::getOutput(), mir::ops::MaxPool2DOp::getPaddingAfter(), mir::ops::MaxPool2DOp::getPaddingBefore(), mir::ops::MaxPool2DOp::getStrides(), mir::ops::MaxPool2DOp::getWindowSize(), loco::MaxPool2D::ifm(), and loco::FeatureEncode::input().
|
override |
Definition at line 618 of file mir2loco.cpp.
References mir::Operation::getInput(), and mir::Operation::getOutput().
|
override |
Definition at line 629 of file mir2loco.cpp.
References loco::Mixin< Trait::DataTyped >::dtype(), loco::Push::from(), mir::Operation::Output::getElementType(), mir::Operation::getInput(), mir::Operation::Output::getName(), mir::Operation::Output::getShape(), loco::link(), and loco::Mixin< Trait::TensorShaped >::shape().
|
override |
Definition at line 645 of file mir2loco.cpp.
References mir::Operation::getInput(), mir::Operation::getOutput(), and loco::ReLU::input().
|
override |
Definition at line 656 of file mir2loco.cpp.
References mir::Operation::getInput(), mir::Operation::getOutput(), and mir::Operation::getOutputShape().
|
override |
Definition at line 669 of file mir2loco.cpp.
References mir::ops::SoftmaxOp::getAxis(), mir::Operation::getInput(), mir::Operation::getOutput(), and loco::Softmax< Domain::Tensor >::input().
|
override |
Definition at line 681 of file mir2loco.cpp.
References mir::Operation::getInput(), and mir::Operation::getOutput().
|
override |
Definition at line 692 of file mir2loco.cpp.
References mir::ops::TransposeOp::getAxisOrder(), mir::Operation::getInput(), mir::Operation::getOutput(), and loco::TensorTranspose::input().
|
overridevirtual |
Reimplemented from mir::Visitor.
Definition at line 708 of file mir2loco.cpp.