ONE - On-device Neural Engine
|
Namespaces | |
namespace | onnx |
namespace | test |
namespace | tf |
Data Structures | |
class | AddGraphBuilder |
GraphBuilder for Add node. More... | |
class | AvgPoolGraphBuilder |
class | BiasAddGraphBuilder |
struct | BinaryFunc |
class | ConcatV2GraphBuilder |
class | ConstantFoldAdd |
Constant folder for Const + Add -> Const. More... | |
class | ConstantFoldMul |
Constant folder for Const + Mul -> Const. More... | |
class | ConstantFoldPack |
Constant folder for Const + Pack -> Const. More... | |
class | ConstantFoldStridedSlice |
Constant folder for Const + StridedSlice -> Const. More... | |
class | ConstGraphBuilder |
class | Conv2DBackpropInputGraphBuilder |
GraphBuilder for Conv2DBackpropInput node. More... | |
class | Conv2DGraphBuilder |
class | DepthwiseConv2dNativeGraphBuilder |
GraphBuilder for DepthwiseConv2dNative node. More... | |
class | FakeQuantWithMinMaxVarsGraphBuilder |
GraphBuilder for FakeQuantWithMinMaxVars node. More... | |
class | FeatureShapeUpdater |
class | FixedArityNode |
Nodes with the fixed number of inputs. More... | |
class | FuseBinaryIntoPreceding |
Fuse TFAdd, TFMul to preceding TFConv2D or TFDepthWiseConv2D. More... | |
class | FusedBatchNormGraphBuilder |
GraphBuilder for FusedBatchNorm node. More... | |
class | GraphBuilder |
Interface of convert TF NodeDef to loco::Node (e.g., Conv2DGraphBuilder) More... | |
class | GraphBuilderContext |
Class to store context to build loco graph IR from TensorFlow. More... | |
class | GraphBuilderRegistry |
Class to return graph builder for TF nodes. More... | |
struct | GraphBuilderSource |
struct | GraphInputIndexAnnotation |
class | GraphUpdate |
Interface to connect the graph. More... | |
class | IdentityGraphBuilder |
class | Importer |
class | Logger |
Logger Implementation. More... | |
class | LoggerConfig |
Logger Configuration. More... | |
struct | LoggingContext |
Global logging context. More... | |
class | MaximumGraphBuilder |
GraphBuilder for Maximum node. More... | |
class | MaxPoolGraphBuilder |
class | MeanGraphBuilder |
GraphBuilder for Mean node. More... | |
struct | ModelSignature |
Class to store information to run a model. Normally this info comes from users via CLI params or configuration file. More... | |
class | MulGraphBuilder |
GraphBuilder for Mul node. More... | |
class | NodeDefTable |
Class to store and query tensorflow::NodeDef* with string name key. More... | |
class | PackGraphBuilder |
class | Padding2DInference |
class | PadGraphBuilder |
GraphBuilder for Pad node. More... | |
class | PlaceholderGraphBuilder |
GraphBuilder for Placeholder node. More... | |
class | PlaneInference |
struct | PlaneShape |
class | RealDivGraphBuilder |
GraphBuilder for RealDiv node. More... | |
class | Relu6GraphBuilder |
GraphBuilder for Relu6 node. More... | |
class | ReluGraphBuilder |
GraphBuilder for Relu node. More... | |
struct | RemoveTFIdentityNode |
Use the input of "TFIdentity" node instead. More... | |
class | ReshapeGraphBuilder |
GraphBuilder for Reshape node. More... | |
class | ResolveConstantShape |
Replace fully determined TFShape node into TFConst. More... | |
class | ResolveFusedBatchNorm |
Trasform TFFusedBatchNorm into TFAdd + TFRsqrt + TFMul + TFBatchNorm. More... | |
class | ResolveReshapeWildcardDim |
Determine wildcard dimension (denoted as -1) of Reshape's shape input if possible. More... | |
class | ResolveSquaredDifference |
Decompose TFSquaredDifference to TFSub, TFMul. More... | |
class | RsqrtGraphBuilder |
GraphBuilder for Rsqrt node. More... | |
class | ShapeGraphBuilder |
GraphBuilder for Shape node. More... | |
class | SoftmaxGraphBuilder |
GraphBuilder for Softmax node. More... | |
class | SqrtGraphBuilder |
GraphBuilder for Sqrt node. More... | |
class | SquaredDifferenceGraphBuilder |
GraphBuilder for SquaredDifference node. More... | |
class | SqueezeGraphBuilder |
GraphBuilder for Squeeze node. More... | |
class | SqueezeReduceNode |
If ReduceTypeOP don't keep dimensions, replace the ReduceTypeOp as new one to keep dimensions and insert TFSqueeze. More... | |
class | StopGradientGraphBuilder |
GraphBuilder for StopGradient node. More... | |
class | StridedSliceGraphBuilder |
class | SubGraphBuilder |
GraphBuilder for Sub node. More... | |
class | SymbolTable |
Class to store and query loco::Node* with string name key. More... | |
class | TanhGraphBuilder |
GraphBuilder for Tanh node. More... | |
struct | TensorName |
struct | TensorNameCompare |
To use TensorName as a key in std::map, this struct defines how to compare two TensorNames. More... | |
class | TensorPackEnumerator |
class | TensorSliceEnumerator |
class | TFAdd |
class | TFAvgPool |
class | TFBiasAdd |
class | TFConcatV2 |
class | TFConst |
IR for tf.constant. More... | |
class | TFConv2D |
class | TFConv2DBackpropInput |
class | TFDepthwiseConv2dNative |
class | TFDialect |
A singleton for TensorFlow Dialect. More... | |
class | TFFakeQuantWithMinMaxVars |
class | TFFusedBatchNorm |
class | TFIdentity |
class | TFMaximum |
class | TFMaxPool |
class | TFMean |
class | TFMul |
struct | TFNode |
struct | TFNodeImpl |
struct | TFNodeMutableVisitor |
struct | TFNodeMutableVisitorBase |
struct | TFNodeVisitor |
struct | TFNodeVisitorBase |
class | TFPack |
class | TFPad |
class | TFPlaceholder |
IR for tf.placeholder. More... | |
class | TFPush |
Make a value visible to user. More... | |
class | TFRealDiv |
class | TFRelu |
class | TFRelu6 |
class | TFReshape |
class | TFRsqrt |
class | TFShape |
struct | TFShapeInferenceRule |
Shape inference rule for TensorFlow dialect. More... | |
class | TFSoftmax |
class | TFSqrt |
class | TFSquaredDifference |
class | TFSqueeze |
class | TFStopGradient |
class | TFStridedSlice |
class | TFSub |
class | TFTanh |
struct | TFTypeInferenceRule |
Type Inference Rule for TFDialect. More... | |
class | UpdateQueue |
Class to store GraphUpdate objects. More... | |
class | VariadicArityNode |
Nodes with the variadic inputs. More... | |
Typedefs | |
using | TFDataLayout = std::string |
using | NodeName = std::string |
using | TFPadding = std::string |
using | u32v_t = std::vector< uint32_t > |
using | TFStrides = std::vector< int64_t > |
using | TFKSize = std::vector< int64_t > |
Enumerations | |
enum class | TFOpcode { TENSORFLOW_NODE } |
TensorFlow Node Opcode. More... | |
Functions | |
std::string | str_toupper (std::string s) |
template<typename T > | |
T * | find_node_byname (loco::Graph *g, const char *name) |
find_node_byname() will return a node with type T with given name in graph g | |
bool | indexed (const TFPlaceholder *node) |
loco::GraphInputIndex | index (const TFPlaceholder *node) |
void | index (TFPlaceholder *node, const loco::GraphInputIndex index) |
loco::TensorShape | tensor_shape (const TFPlaceholder *node) |
TFPlaceholder * | placeholder_node (loco::Graph *g, const loco::GraphInputIndex &idx) |
TFPush * | push_node (loco::Graph *g, const loco::GraphOutputIndex &index) |
Find a TFPush node with a given output index. | |
INSTANTIATE (loco::DataType::S8) | |
INSTANTIATE (loco::DataType::S32) | |
INSTANTIATE (loco::DataType::FLOAT32) | |
TFConst * | new_const (loco::Graph *graph, loco::TensorShape &tensor_shape, const loco::DataType &dtype) |
template<> | |
int32_t | scalar_from_const< int32_t > (const TFConst *tfconst) |
template<> | |
float | scalar_from_const< float > (const TFConst *tfconst) |
bool | valid_shape_for_constfold_binary_op (const loco::TensorShape &lhs, const loco::TensorShape &rhs) |
template<> | |
void | apply_binary< int32_t > (const moco::TFConst *x_const, const moco::TFConst *y_const, moco::TFConst *output_const, const moco::BinaryFunc &f) |
template<> | |
void | apply_binary< float > (const moco::TFConst *x_const, const moco::TFConst *y_const, moco::TFConst *output_const, const moco::BinaryFunc &f) |
template<typename T > | |
T | scalar_from_const (const TFConst *tfconst) |
template<> | |
int32_t | scalar_from_const< int32_t > (const TFConst *tfconst) |
template<> | |
float | scalar_from_const< float > (const TFConst *tfconst) |
template<typename T > | |
void | apply_binary (const moco::TFConst *x_const, const moco::TFConst *y_const, moco::TFConst *output_const, const moco::BinaryFunc &f) |
template<> | |
void | apply_binary< int32_t > (const moco::TFConst *x_const, const moco::TFConst *y_const, moco::TFConst *output_const, const moco::BinaryFunc &f) |
template<> | |
void | apply_binary< float > (const moco::TFConst *x_const, const moco::TFConst *y_const, moco::TFConst *output_const, const moco::BinaryFunc &f) |
template<typename DERIVED > | |
DERIVED * | as (loco::Node *node) |
loco::TensorShape | broadcast_shape (const loco::TensorShape &x, const loco::TensorShape &y) |
bool | shape_inference_done (const loco::Node *node) |
Return true if node has shape inference data for checking shape inference is done or not. | |
loco::NodeShape | node_shape (const loco::Node *node) |
bool | node_shape (const loco::Node *node, loco::NodeShape &nodeshape) |
loco::TensorShape | as_tensor_shape (const loco::FeatureShape &feature_shape, const TFDataLayout &data_layout) |
loco::FeatureShape | as_feature_shape (const loco::NodeShape &nodeshape, const TFDataLayout &data_layout) |
PlaneShape | make_plane_shape (const loco::FeatureShape &feature_shape) |
FeatureShapeUpdater | update (loco::FeatureShape &feature_shape) |
loco::Stride< 2 > | stride_of (const TFStrides &strides, const TFDataLayout &datalayout) |
loco::Window< 2 > | window_of (const TFKSize &ksize, const TFDataLayout &datalayout) |
loco::Window< 2 > | window_of (const loco::TensorShape &shape, const TFDataLayout &datalayout) |
using moco::NodeName = typedef std::string |
Definition at line 38 of file TFNodeDecl.h.
using moco::TFDataLayout = typedef std::string |
Definition at line 25 of file TFDataLayout.h.
using moco::TFKSize = typedef std::vector<int64_t> |
Definition at line 213 of file TFShapeInferenceHelper.h.
using moco::TFPadding = typedef std::string |
Definition at line 25 of file TFPadding.h.
using moco::TFStrides = typedef std::vector<int64_t> |
Definition at line 212 of file TFShapeInferenceHelper.h.
typedef std::vector< uint32_t > moco::u32v_t |
Definition at line 27 of file TensorPackEnumerator.h.
|
strong |
TensorFlow Node Opcode.
Enumerator | |
---|---|
TENSORFLOW_NODE |
Definition at line 26 of file TFOpcode.h.
void moco::apply_binary | ( | const moco::TFConst * | x_const, |
const moco::TFConst * | y_const, | ||
moco::TFConst * | output_const, | ||
const moco::BinaryFunc & | f | ||
) |
void moco::apply_binary< float > | ( | const moco::TFConst * | x_const, |
const moco::TFConst * | y_const, | ||
moco::TFConst * | output_const, | ||
const moco::BinaryFunc & | f | ||
) |
Definition at line 216 of file ConstantFoldHelper.cpp.
References scalar_from_const< float >().
void moco::apply_binary< float > | ( | const moco::TFConst * | x_const, |
const moco::TFConst * | y_const, | ||
moco::TFConst * | output_const, | ||
const moco::BinaryFunc & | f | ||
) |
Definition at line 216 of file ConstantFoldHelper.cpp.
References scalar_from_const< float >().
void moco::apply_binary< int32_t > | ( | const moco::TFConst * | x_const, |
const moco::TFConst * | y_const, | ||
moco::TFConst * | output_const, | ||
const moco::BinaryFunc & | f | ||
) |
Definition at line 193 of file ConstantFoldHelper.cpp.
References scalar_from_const< int32_t >().
void moco::apply_binary< int32_t > | ( | const moco::TFConst * | x_const, |
const moco::TFConst * | y_const, | ||
moco::TFConst * | output_const, | ||
const moco::BinaryFunc & | f | ||
) |
Definition at line 193 of file ConstantFoldHelper.cpp.
References scalar_from_const< int32_t >().
DERIVED * moco::as | ( | loco::Node * | node | ) |
loco::FeatureShape moco::as_feature_shape | ( | const loco::NodeShape & | nodeshape, |
const TFDataLayout & | data_layout | ||
) |
Definition at line 189 of file TFShapeInferenceHelper.cpp.
References loco::NodeShape::as(), loco::TensorShape::dim(), loco::NodeShape::domain(), loco::Feature, INTERNAL_EXN, INTERNAL_EXN_V, loco::TensorShape::rank(), and loco::Tensor.
loco::TensorShape moco::as_tensor_shape | ( | const loco::FeatureShape & | feature_shape, |
const TFDataLayout & | data_layout | ||
) |
Definition at line 160 of file TFShapeInferenceHelper.cpp.
References loco::FeatureShape::count(), loco::FeatureShape::depth(), loco::TensorShape::dim(), loco::FeatureShape::height(), INTERNAL_EXN_V, loco::TensorShape::rank(), and loco::FeatureShape::width().
loco::TensorShape moco::broadcast_shape | ( | const loco::TensorShape & | x, |
const loco::TensorShape & | y | ||
) |
Definition at line 125 of file TFShapeInferenceHelper.cpp.
References output_shape.
T * moco::find_node_byname | ( | loco::Graph * | g, |
const char * | name | ||
) |
find_node_byname() will return a node with type T with given name in graph g
Definition at line 34 of file GraphHelper.h.
References loco::ObjectPool< T >::at(), and loco::ObjectPool< T >::size().
loco::GraphInputIndex moco::index | ( | const TFPlaceholder * | node | ) |
Definition at line 54 of file TFNode.cpp.
References loco::AnnotatedItem< Annotation >::annot(), index(), and indexed().
Referenced by moco::ConstGraphBuilder::build(), index(), index(), moco::onnx::SymbolTable::name(), moco::TensorName::nodeName(), placeholder_node(), push_node(), tensor_shape(), moco::TFConcatV2::values(), moco::TFPack::values(), moco::TFConcatV2::values(), and moco::TFPack::values().
void moco::index | ( | TFPlaceholder * | node, |
const loco::GraphInputIndex | index | ||
) |
Definition at line 60 of file TFNode.cpp.
References loco::AnnotatedItem< Annotation >::annot(), and index().
bool moco::indexed | ( | const TFPlaceholder * | node | ) |
Definition at line 49 of file TFNode.cpp.
References loco::AnnotatedItem< Annotation >::annot().
Referenced by index(), and placeholder_node().
moco::INSTANTIATE | ( | loco::DataType::FLOAT32 | ) |
moco::INSTANTIATE | ( | loco::DataType::S32 | ) |
moco::INSTANTIATE | ( | loco::DataType::S8 | ) |
PlaneShape moco::make_plane_shape | ( | const loco::FeatureShape & | feature_shape | ) |
Definition at line 238 of file TFShapeInferenceHelper.cpp.
References loco::FeatureShape::height(), moco::PlaneShape::height, loco::FeatureShape::width(), and moco::PlaneShape::width.
TFConst * moco::new_const | ( | loco::Graph * | graph, |
loco::TensorShape & | tensor_shape, | ||
const loco::DataType & | dtype | ||
) |
Definition at line 45 of file ConstantFoldHelper.cpp.
References loco::TensorShape::dim(), and loco::TensorShape::rank().
loco::NodeShape moco::node_shape | ( | const loco::Node * | node | ) |
Definition at line 142 of file TFShapeInferenceHelper.cpp.
References loco::shape_get(), and loco::shape_known().
Referenced by node_shape().
bool moco::node_shape | ( | const loco::Node * | node, |
loco::NodeShape & | nodeshape | ||
) |
Definition at line 154 of file TFShapeInferenceHelper.cpp.
References loco::NodeShape::domain(), node_shape(), and loco::Unknown.
TFPlaceholder * moco::placeholder_node | ( | loco::Graph * | g, |
const loco::GraphInputIndex & | idx | ||
) |
Definition at line 84 of file TFNode.cpp.
References index(), indexed(), and size.
Referenced by moco::PlaceholderGraphBuilder::build().
TFPush * moco::push_node | ( | loco::Graph * | g, |
const loco::GraphOutputIndex & | index | ||
) |
Find a TFPush node with a given output index.
Definition at line 121 of file TFNode.cpp.
T moco::scalar_from_const | ( | const TFConst * | tfconst | ) |
float moco::scalar_from_const< float > | ( | const TFConst * | tfconst | ) |
Definition at line 86 of file ConstantFoldHelper.cpp.
References moco::TFConst::at().
Referenced by apply_binary< float >().
float moco::scalar_from_const< float > | ( | const TFConst * | tfconst | ) |
Definition at line 86 of file ConstantFoldHelper.cpp.
References moco::TFConst::at().
Referenced by apply_binary< float >().
int32_t moco::scalar_from_const< int32_t > | ( | const TFConst * | tfconst | ) |
Definition at line 79 of file ConstantFoldHelper.cpp.
References moco::TFConst::at().
Referenced by apply_binary< int32_t >().
int32_t moco::scalar_from_const< int32_t > | ( | const TFConst * | tfconst | ) |
Definition at line 79 of file ConstantFoldHelper.cpp.
References moco::TFConst::at().
Referenced by apply_binary< int32_t >().
bool moco::shape_inference_done | ( | const loco::Node * | node | ) |
Return true if node has shape inference data for checking shape inference is done or not.
std::string moco::str_toupper | ( | std::string | s | ) |
Definition at line 27 of file Convert.cpp.
Referenced by moco::AvgPoolGraphBuilder::build(), moco::Conv2DGraphBuilder::build(), moco::MaxPoolGraphBuilder::build(), moco::Conv2DBackpropInputGraphBuilder::build(), moco::DepthwiseConv2dNativeGraphBuilder::build(), and moco::DepthwiseConv2dNativeGraphBuilder::validate().
loco::Stride< 2 > moco::stride_of | ( | const TFStrides & | strides, |
const TFDataLayout & | datalayout | ||
) |
Definition at line 283 of file TFShapeInferenceHelper.cpp.
References INTERNAL_EXN.
loco::TensorShape moco::tensor_shape | ( | const TFPlaceholder * | node | ) |
Definition at line 65 of file TFNode.cpp.
References loco::TensorShape::dim(), index(), loco::TensorShape::rank(), and loco::Dimension::unset().
FeatureShapeUpdater moco::update | ( | loco::FeatureShape & | feature_shape | ) |
Definition at line 248 of file TFShapeInferenceHelper.cpp.
Referenced by moco::AvgPoolGraphBuilder::build(), moco::BiasAddGraphBuilder::build(), moco::ConcatV2GraphBuilder::build(), moco::IdentityGraphBuilder::build(), moco::MaxPoolGraphBuilder::build(), moco::PackGraphBuilder::build(), moco::ReluGraphBuilder::build(), moco::Relu6GraphBuilder::build(), moco::tf::COpCallGraphBuilder::build(), moco::MeanGraphBuilder::build(), moco::ReshapeGraphBuilder::build(), moco::ShapeGraphBuilder::build(), moco::SoftmaxGraphBuilder::build(), moco::SqueezeGraphBuilder::build(), and moco::UpdateQueue::enroll().
bool moco::valid_shape_for_constfold_binary_op | ( | const loco::TensorShape & | lhs, |
const loco::TensorShape & | rhs | ||
) |
Definition at line 93 of file ConstantFoldHelper.cpp.
References loco::TensorShape::dim(), loco::TensorShape::rank(), and loco::Dimension::value().
loco::Window< 2 > moco::window_of | ( | const loco::TensorShape & | shape, |
const TFDataLayout & | datalayout | ||
) |
Definition at line 331 of file TFShapeInferenceHelper.cpp.
References loco::TensorShape::dim(), INTERNAL_EXN_V, and loco::Dimension::value().
loco::Window< 2 > moco::window_of | ( | const TFKSize & | ksize, |
const TFDataLayout & | datalayout | ||
) |
Definition at line 307 of file TFShapeInferenceHelper.cpp.
References INTERNAL_EXN.