ONE - On-device Neural Engine
|
Namespaces | |
namespace | circle_detail |
namespace | test |
namespace | tflite_detail |
Data Structures | |
class | AvgPool2DConverter |
Convert loco::AvgPool2D to locoex::TFLAveragePool2D. More... | |
class | CanonicalNodeConverter |
Class to convert a canonical node to TFL node. More... | |
class | CircleExporter |
class | ConstGenConverter |
class | Conv2DConverter |
Convert loco::Conv2D to locoex::TFLConv2D. More... | |
class | DepthwiseConv2DConverter |
Convert loco::DepthwiseConv2D to locoex::TFLDepthwiseConv2D and auxiliary. More... | |
class | DomainConverter |
Class to handle domain conversion while converting a canonical node to TFL node(s) More... | |
class | EltwiseAddConverter |
Convert loco::EltwiseAdd to TFLAdd. More... | |
class | EltwiseDivConverter |
Convert loco::EltwiseDiv to TFLDiv. More... | |
class | EltwiseMaxConverter |
Convert loco::EltwiseMax to TFLMaximum. More... | |
class | EltwiseMulConverter |
Convert loco::EltwiseMul to TFLMul. More... | |
class | EltwiseSqrtConverter |
Convert loco::EltwiseSqrt to TFLSqrt. More... | |
class | EltwiseSubConverter |
Convert loco::EltwiseSub to TFLSub. More... | |
class | FeatureBiasAddConverter |
struct | FoldReshapeOfConstPass |
Class to fuse TFLReshape + TFLConst into one equivalent TFLConst. More... | |
struct | FoldTransposeOfConstPass |
Class to fuse TFLTranspose + TFLConst into one equivalent TFLConst. More... | |
struct | FuseBiasAddPass |
Class to fuse TFLAdd or TFLSub into Bias input of the following ops: More... | |
struct | FuseInstanceNormPass |
Class to fuse certain pattern of subgraph into CircleInstanceNorm with auxiliary nodes. More... | |
struct | FuseReluPass |
Class to fuse TFLRelu or TFLRelu6 into the TensorFlow Lite ops below: More... | |
struct | FuseRsqrtPass |
Class to fuse TFLSqrt that is divided(TFLDiv) by 1, into TFLRsqrt. More... | |
struct | FuseSquaredDifferencePass |
Class to fuse SquaredDifference pattern. More... | |
class | InputHandler |
Handles input(s) while converting a canonical node to TFL node(s). This class informs DomainConverter how to handle inputs of a specific canonical node. More... | |
struct | KnobTrait |
class | Logger |
Logger Implementation. More... | |
class | LoggerConfig |
Logger Configuration. More... | |
struct | LoggingContext |
Global logging context. More... | |
class | MatMulConverter |
Convert loco::MatMul to locoex::TFLFullyConnected. More... | |
class | MaxPool2DConverter |
Convert loco::MaxPool2D to locoex::TFLMaxPool2D. More... | |
class | MergeConcatNodesPass |
Merge concat nodes whose axis and fusedActivationFunction are same. More... | |
class | NodeSummaryBuilder |
class | NodeSummaryBuilderFactory |
class | ProgressReporter |
class | Relu6Converter |
Convert loco::Relu6 to TFLRelu6. More... | |
class | ReluConverter |
Convert loco::Relu to TFLRelu. More... | |
struct | ShapeDescription |
struct | ShapeInference |
Get the shape of each node as a node annotation. More... | |
class | ShapeInferencePass |
Pass to infer shape of nodes. More... | |
class | TensorBroadcastConverter |
Pass to resolve TensorBroadcast IR. More... | |
class | TensorConcatConverter |
Convert loco::TensorConcat to TFLConcatenate. More... | |
class | TensorReduceConverter |
Convert loco::TensorReduce to appropriate TFL reduce operation. More... | |
class | TensorTransposeConverter |
Convert loco::TensorTranspose to locoex::TFLTranspose. More... | |
class | TFLExporter |
class | TransposedConv2DConverter |
Convert loco::TransposedConv2D to locoex::TFLTransposeConv and auxiliary. More... | |
struct | TypeInference |
Get the type of each node as NodeAnnotation. More... | |
class | TypeInferencePass |
Pass to infer type of nodes. More... | |
Typedefs | |
using | FormattedGraph = locop::FormattedGraphImpl< locop::Formatter::LinearV1 > |
Enumerations | |
enum class | FeatureLayout { NHWC } |
feature layout of TFLITE file More... | |
enum class | FilterLayout { OHWI , HWIO } |
enum class | DepthwiseFilterLayout { HWCM } |
enum class | MatrixLayout { HW , WH } |
enum class | Dialect { TFLITE , CIRCLE } |
enum class | Knob { KNOB_BOOL } |
Some canonical nodes can have input of various loco::Domain, e.g., loco::Domain::Tensor, loco::Domain::Feature, etc. However, TFL node accepts only loco::Domain::Tensor. So, When converting such canonical node to TFL node and input(s) of a canonical node are not loco::Domain::Tensor, additional nodes need to be inserted.
The following two classes helps this insertion.
For example, in case of loco::Relu conversion,
Before:
A (output: feature) – loco::ReLU — B (input:feature)
After:
A – loco::FeatureDecode – locoex::TFLRelu – loco::FeatureEncode — B
loco::ReLU (dead node)
using exo::FormattedGraph = typedef locop::FormattedGraphImpl<locop::Formatter::LinearV1> |
Definition at line 62 of file LogHelper.h.
|
strong |
Enumerator | |
---|---|
HWCM |
Definition at line 54 of file GraphBlock.h.
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
Enumerator | |
---|---|
HW | |
WH |
Definition at line 63 of file GraphBlock.h.
void exo::convert_to_TFLNodes | ( | loco::Graph * | graph | ) |
Definition at line 40 of file Convert.cpp.
References loco::apply(), logo::Restart, and loco::ShapeInferenceSession::to().
bool exo::EltwiseBinaryConvert | ( | ELTWISEBIN * | origin | ) |
Definition at line 93 of file EltwiseBinaryConverter.h.
FormattedGraph exo::fmt | ( | loco::Graph * | g | ) |
Definition at line 73 of file LogHelper.cpp.
Referenced by exo::ProgressReporter::notify(), and exo::ProgressReporter::notify().
|
inline |
Definition at line 43 of file ExporterUtils.h.
References loco::Count, loco::Depth, loco::Height, and loco::Width.
|
inline |
Definition at line 49 of file ExporterUtils.h.
References loco::Count, loco::Depth, loco::Height, and loco::Width.
|
inline |
loco::DepthwiseFilterDecode * exo::make_dw_filter_decode | ( | loco::Node * | input_for_decode | ) |
Create a loco::DepthwiseFilterDecode of given layout.
Definition at line 177 of file GraphBlock.cpp.
References EXO_ASSERT, loco::Node::graph(), and loco::DepthwiseFilterDecode::input().
template loco::DepthwiseFilterDecode * exo::make_dw_filter_decode< DepthwiseFilterLayout::HWCM > | ( | loco::Node * | input_for_decode | ) |
Referenced by exo::DepthwiseConv2DConverter::convert().
loco::FeatureDecode * exo::make_feature_decode | ( | loco::Node * | input_for_decode | ) |
Creates a loco::FeatureDecode with T layout (NHWC for tflite) and add it to graph.
Definition at line 128 of file GraphBlock.cpp.
References EXO_ASSERT, loco::Node::graph(), and loco::FeatureDecode::input().
template loco::FeatureDecode * exo::make_feature_decode< FeatureLayout::NHWC > | ( | loco::Node * | input_for_encode | ) |
loco::FeatureEncode * exo::make_feature_encode | ( | loco::Node * | input_for_encode | ) |
Creates a loco::FeatureEncode with T layout (NHWC for tflite) and add it to graph.
Definition at line 112 of file GraphBlock.cpp.
References EXO_ASSERT, loco::Node::graph(), and loco::FeatureEncode::input().
template loco::FeatureEncode * exo::make_feature_encode< FeatureLayout::NHWC > | ( | loco::Node * | input_for_encode | ) |
loco::FilterDecode * exo::make_filter_decode | ( | loco::Node * | input_for_decode | ) |
Create a loco::FilterDecode of given layout.
Definition at line 160 of file GraphBlock.cpp.
References EXO_ASSERT, loco::Node::graph(), and loco::FilterDecode::input().
template loco::FilterDecode * exo::make_filter_decode< FilterLayout::OHWI > | ( | loco::Node * | input_for_decode | ) |
Referenced by exo::Conv2DConverter::convert(), and exo::TransposedConv2DConverter::convert().
loco::FilterEncode * exo::make_filter_encode | ( | loco::Node * | input_for_encode | ) |
Create a loco::FilterEncode of given layout.
Definition at line 144 of file GraphBlock.cpp.
References EXO_ASSERT, loco::Node::graph(), and loco::FilterEncode::input().
template loco::FilterEncode * exo::make_filter_encode< FilterLayout::HWIO > | ( | loco::Node * | input_for_encode | ) |
loco::MatrixDecode * exo::make_matrix_decode | ( | loco::Node * | input_for_decode | ) |
Create a loco::MatrixDecode of given layout.
Definition at line 209 of file GraphBlock.cpp.
References EXO_ASSERT, loco::Node::graph(), and loco::MatrixDecode::input().
template loco::MatrixDecode * exo::make_matrix_decode< MatrixLayout::HW > | ( | loco::Node * | input_for_decode | ) |
Referenced by exo::MatMulConverter::convert().
template loco::MatrixDecode * exo::make_matrix_decode< MatrixLayout::WH > | ( | loco::Node * | input_for_decode | ) |
Referenced by exo::MatMulConverter::convert().
loco::MatrixEncode * exo::make_matrix_encode | ( | loco::Node * | input_for_encode | ) |
Create a loco::MatrixEncode of given layout.
Definition at line 193 of file GraphBlock.cpp.
References EXO_ASSERT, loco::Node::graph(), and loco::MatrixEncode::input().
template loco::MatrixEncode * exo::make_matrix_encode< MatrixLayout::HW > | ( | loco::Node * | input_for_encode | ) |
Referenced by exo::MatMulConverter::convert().
template loco::MatrixEncode * exo::make_matrix_encode< MatrixLayout::WH > | ( | loco::Node * | input_for_encode | ) |
void exo::optimize | ( | loco::Graph * | ) |
Run passes for a graph after completion of converting canonical nodes into TFL nodes.
TODO Separate optimize pass dedicated to TFL and Circle dialect when necessary
Definition at line 30 of file ExoOptimize.cpp.
References logo::Restart.
void exo::set | ( | Dialect | d | ) |
Definition at line 100 of file Knob.cpp.
circle::ActivationFunctionType exo::to_circle_actfunc | ( | locoex::FusedActFunc | func | ) |
Definition at line 24 of file CircleExporterUtils.cpp.
References INTERNAL_EXN_V, locoex::NONE, locoex::RELU, locoex::RELU6, and oops::to_uint32().
ShapeDescription exo::to_shape_description | ( | const loco::BiasShape & | shape | ) |
Definition at line 91 of file ExporterUtils.cpp.
References exo::ShapeDescription::_dims, exo::ShapeDescription::_rank_known, loco::BiasShape::length(), and loco::Dimension::value().
ShapeDescription exo::to_shape_description | ( | const loco::DepthwiseFilterShape & | shape | ) |
Definition at line 75 of file ExporterUtils.cpp.
References exo::ShapeDescription::_dims, exo::ShapeDescription::_rank_known, loco::DepthwiseFilterShape::depth(), loco::DepthwiseFilterShape::height(), loco::DepthwiseFilterShape::multiplier(), loco::Dimension::value(), and loco::DepthwiseFilterShape::width().
ShapeDescription exo::to_shape_description | ( | const loco::FeatureShape & | shape | ) |
Definition at line 43 of file ExporterUtils.cpp.
References exo::ShapeDescription::_dims, exo::ShapeDescription::_rank_known, loco::FeatureShape::count(), loco::FeatureShape::depth(), loco::FeatureShape::height(), loco::Dimension::value(), and loco::FeatureShape::width().
ShapeDescription exo::to_shape_description | ( | const loco::FilterShape & | shape | ) |
Definition at line 59 of file ExporterUtils.cpp.
References exo::ShapeDescription::_dims, exo::ShapeDescription::_rank_known, loco::FilterShape::count(), loco::FilterShape::depth(), loco::FilterShape::height(), loco::Dimension::value(), and loco::FilterShape::width().
ShapeDescription exo::to_shape_description | ( | const loco::MatrixShape & | shape | ) |
Definition at line 103 of file ExporterUtils.cpp.
References exo::ShapeDescription::_dims, exo::ShapeDescription::_rank_known, loco::MatrixShape::height(), loco::Dimension::value(), and loco::MatrixShape::width().
ShapeDescription exo::to_shape_description | ( | const loco::NodeShape & | shape | ) |
Definition at line 116 of file ExporterUtils.cpp.
References loco::NodeShape::as(), loco::Bias, loco::DepthwiseFilter, loco::NodeShape::domain(), loco::Feature, loco::Filter, INTERNAL_EXN_V, loco::Matrix, loco::Tensor, to_shape_description(), and oops::to_uint32().
ShapeDescription exo::to_shape_description | ( | const loco::TensorShape & | shape | ) |
Definition at line 26 of file ExporterUtils.cpp.
References exo::ShapeDescription::_dims, exo::ShapeDescription::_rank_known, loco::TensorShape::dim(), loco::Dimension::known(), loco::TensorShape::rank(), and loco::Dimension::value().
Referenced by exo::ShapeInference::get(), and to_shape_description().
tflite::ActivationFunctionType exo::to_tflite_actfunc | ( | locoex::FusedActFunc | func | ) |
Definition at line 24 of file TFLExporterUtils.cpp.
References INTERNAL_EXN_V, locoex::NONE, locoex::RELU, locoex::RELU6, and oops::to_uint32().