21.02
|
#include <TfParser.hpp>
Public Types | |
using | OperationParsingFunction = ParsedTfOperationPtr(TfParserImpl::*)(const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
Public Member Functions | |
armnn::INetworkPtr | CreateNetworkFromTextFile (const char *graphFile, const std::map< std::string, armnn::TensorShape > &inputShapes, const std::vector< std::string > &requestedOutputs) |
Creates the network from a protobuf text file on the disk. More... | |
armnn::INetworkPtr | CreateNetworkFromBinaryFile (const char *graphFile, const std::map< std::string, armnn::TensorShape > &inputShapes, const std::vector< std::string > &requestedOutputs) |
Creates the network from a protobuf binary file on the disk. More... | |
armnn::INetworkPtr | CreateNetworkFromString (const char *protoText, const std::map< std::string, armnn::TensorShape > &inputShapes, const std::vector< std::string > &requestedOutputs) |
Creates the network directly from protobuf text in a string. Useful for debugging/testing. More... | |
BindingPointInfo | GetNetworkInputBindingInfo (const std::string &name) const |
Retrieves binding info (layer id and tensor info) for the network input identified by the given layer name. More... | |
BindingPointInfo | GetNetworkOutputBindingInfo (const std::string &name) const |
Retrieves binding info (layer id and tensor info) for the network output identified by the given layer name. More... | |
TfParserImpl () | |
~TfParserImpl ()=default | |
TfParserImpl (const TfParserImpl &)=delete | |
TfParserImpl & | operator= (const TfParserImpl &)=delete |
armnn::INetworkPtr | CreateNetworkFromGraphDef (const tensorflow::GraphDef &graphDef, const std::map< std::string, armnn::TensorShape > &inputShapes, const std::vector< std::string > &requestedOutputs) |
Parses a GraphDef loaded into memory from one of the other CreateNetwork*. More... | |
void | LoadGraphDef (const tensorflow::GraphDef &graphDef) |
Sets up variables and then performs BFS to parse all nodes. More... | |
void | LoadNodeDef (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
Parses a given node, assuming nodes before it in the graph have been done. More... | |
const tensorflow::NodeDef * | ResolveIdentityNode (const tensorflow::NodeDef *nodeDef) |
Handling identity layers as the input for Conv2D layer. More... | |
std::vector< OutputOfConstNodeDef > | GetTfInputNodes (const tensorflow::NodeDef &nodeDef) const |
Finds the nodes connected as inputs of the given node in the graph. More... | |
std::vector< OutputOfParsedTfOperation > | GetInputParsedTfOperationsChecked (const tensorflow::NodeDef &nodeDef, std::size_t expectedNumInputs) |
Finds the IParsedTfOperations for the nodes connected as inputs of the given node in the graph, and throws an exception if the number of inputs does not match the expected one. More... | |
ParsedTfOperationPtr | ParseConst (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
template<typename Type > | |
bool | HasParsedConstTensor (const std::string &nodeName) const |
Checks if there is a pre-parsed const tensor available with the given name and Type. More... | |
template<typename Type > | |
bool | HasParsedConstTensor (ParsedTfOperation *parsedTfOpPtr) const |
unsigned int | GetConstInputIndex (const std::vector< OutputOfParsedTfOperation > &inputs) |
ParsedTfOperationPtr | ParseAdd (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParseAddN (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParseBiasAdd (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParseConv2D (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParseDepthwiseConv2D (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParseExpandDims (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParseFusedBatchNorm (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParseConcat (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParseIdentity (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParseLrn (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParseMatMul (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParseMean (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParseMul (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParsePlaceholder (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParseRealDiv (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParseRelu (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParseRelu6 (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParseReshape (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParseResizeBilinear (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParseRsqrt (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParseShape (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParseSqueeze (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParseSigmoid (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParseSoftmax (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParseSoftplus (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParseSplit (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParseStridedSlice (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParseTanh (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParseMaxPool (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParseAvgPool (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParsePooling2d (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef, armnn::PoolingAlgorithm pooltype) |
ParsedTfOperationPtr | ParseEqual (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParseMaximum (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParseMinimum (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParseGather (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParseGreater (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParsePad (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParseSub (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParseStack (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | ParseTranspose (const tensorflow::NodeDef &nodeDef, const tensorflow::GraphDef &graphDef) |
ParsedTfOperationPtr | AddActivationLayer (const tensorflow::NodeDef &nodeDef, armnn::ActivationDescriptor &desc) |
ParsedTfOperationPtr | AddAdditionLayer (const tensorflow::NodeDef &nodeDef, bool isBiasAdd=false) |
ParsedTfOperationPtr | AddRealDivLayer (const tensorflow::NodeDef &nodeDef) |
ParsedTfOperationPtr | AddMaximumLayer (const tensorflow::NodeDef &nodeDef) |
armnn::IConnectableLayer * | AddMultiplicationLayer (const tensorflow::NodeDef &nodeDef) |
armnn::IConnectableLayer * | AddFullyConnectedLayer (const tensorflow::NodeDef &matMulNodeDef, const tensorflow::NodeDef *addNodeDef, const char *armnnLayerName) |
bool | IsSupportedLeakyReluPattern (const tensorflow::NodeDef &mulNodeDef, size_t alphaLayerIndex, const OutputOfParsedTfOperation &otherOp, armnn::IOutputSlot **outputOfLeakyRelu, armnn::ActivationDescriptor &desc) |
std::pair< armnn::IOutputSlot *, armnn::IOutputSlot * > | ProcessElementwiseInputSlots (const tensorflow::NodeDef &nodeDef, const std::string &layerName) |
ParsedTfOperationPtr | ProcessComparisonLayer (armnn::IOutputSlot *input0Slot, armnn::IOutputSlot *input1Slot, armnn::IConnectableLayer *const layer, const tensorflow::NodeDef &nodeDef) |
ParsedTfOperationPtr | ProcessElementwiseLayer (armnn::IOutputSlot *input0Slot, armnn::IOutputSlot *input1Slot, armnn::IConnectableLayer *const layer, const tensorflow::NodeDef &nodeDef) |
armnn::IConnectableLayer * | CreateAdditionLayer (const tensorflow::NodeDef &nodeDef, armnn::IOutputSlot *input0Slot, armnn::IOutputSlot *input1Slot, const std::string &layerName) |
armnn::IConnectableLayer * | CreateAdditionLayer (const tensorflow::NodeDef &nodeDef, const OutputOfParsedTfOperation &opOne, const OutputOfParsedTfOperation &opTwo, unsigned int numberOfAddition) |
armnn::IConnectableLayer * | CreateAdditionLayer (const tensorflow::NodeDef &nodeDef, armnn::IConnectableLayer *layerOne, armnn::IConnectableLayer *layerTwo, unsigned int numberOfAddition, unsigned long numberOfLayersToConnect, bool isOdd) |
armnn::IConnectableLayer * | CreateAdditionLayer (const tensorflow::NodeDef &nodeDef, const OutputOfParsedTfOperation &op, armnn::IConnectableLayer *layer) |
void | TrackInputBinding (armnn::IConnectableLayer *layer, armnn::LayerBindingId id, const armnn::TensorInfo &tensorInfo) |
void | TrackOutputBinding (armnn::IConnectableLayer *layer, armnn::LayerBindingId id, const armnn::TensorInfo &tensorInfo) |
void | Cleanup () |
Static Public Member Functions | |
static const std::string | GetVersion () |
Retrieve version in X.Y.Z form. More... | |
static std::pair< armnn::LayerBindingId, armnn::TensorInfo > | GetBindingInfo (const std::string &layerName, const char *bindingPointDesc, const std::unordered_map< std::string, BindingPointInfo > &nameToBindingInfo) |
static void | TrackBindingPoint (armnn::IConnectableLayer *layer, armnn::LayerBindingId id, const armnn::TensorInfo &tensorInfo, const char *bindingPointDesc, std::unordered_map< std::string, BindingPointInfo > &nameToBindingInfo) |
Public Attributes | |
armnn::INetworkPtr | m_Network |
The network we're building. Gets cleared after it is passed to the user. More... | |
std::map< std::string, armnn::TensorShape > | m_InputShapes |
std::vector< std::string > | m_RequestedOutputs |
std::unordered_map< std::string, const tensorflow::NodeDef * > | m_NodesByName |
Map of nodes extracted from the GraphDef to speed up parsing. More... | |
std::unordered_map< std::string, ParsedTfOperationPtr > | m_ParsedTfOperations |
std::unordered_map< std::string, BindingPointInfo > | m_NetworkInputsBindingInfo |
Maps input layer names to their corresponding ids and tensor info. More... | |
std::unordered_map< std::string, BindingPointInfo > | m_NetworkOutputsBindingInfo |
Maps output layer names to their corresponding ids and tensor info. More... | |
Static Public Attributes | |
static const std::map< std::string, OperationParsingFunction > | ms_OperationNameToParsingFunctions |
Map of TensorFlow operation names to parsing member functions. More... | |
static const std::list< std::string > | m_ControlInputs |
Definition at line 64 of file TfParser.hpp.
using OperationParsingFunction = ParsedTfOperationPtr(TfParserImpl::*)(const tensorflow::NodeDef& nodeDef, const tensorflow::GraphDef& graphDef) |
Definition at line 254 of file TfParser.hpp.
TfParserImpl | ( | ) |
Definition at line 540 of file TfParser.cpp.
|
default |
|
delete |
ParsedTfOperationPtr AddActivationLayer | ( | const tensorflow::NodeDef & | nodeDef, |
armnn::ActivationDescriptor & | desc | ||
) |
Definition at line 2984 of file TfParser.cpp.
References IOutputSlot::Connect(), ITfParser::TfParserImpl::GetInputParsedTfOperationsChecked(), IConnectableLayer::GetInputSlot(), IConnectableLayer::GetOutputSlot(), IOutputSlot::GetTensorInfo(), ITfParser::TfParserImpl::m_Network, and IOutputSlot::SetTensorInfo().
Referenced by ITfParser::TfParserImpl::ParseRelu(), ITfParser::TfParserImpl::ParseRelu6(), ITfParser::TfParserImpl::ParseSigmoid(), ITfParser::TfParserImpl::ParseSoftplus(), and ITfParser::TfParserImpl::ParseTanh().
ParsedTfOperationPtr AddAdditionLayer | ( | const tensorflow::NodeDef & | nodeDef, |
bool | isBiasAdd = false |
||
) |
Definition at line 3118 of file TfParser.cpp.
References CHECK_DATA_FORMAT, CHECK_LOCATION, IOutputSlot::Connect(), ITfParser::TfParserImpl::GetInputParsedTfOperationsChecked(), IConnectableLayer::GetInputSlot(), TensorShape::GetNumDimensions(), TensorInfo::GetNumDimensions(), IConnectableLayer::GetOutputSlot(), TensorInfo::GetShape(), IOutputSlot::GetTensorInfo(), ITfParser::TfParserImpl::m_Network, TensorInfo::SetShape(), and IOutputSlot::SetTensorInfo().
Referenced by ITfParser::TfParserImpl::ParseAdd(), ITfParser::TfParserImpl::ParseAddN(), and ITfParser::TfParserImpl::ParseBiasAdd().
IConnectableLayer * AddFullyConnectedLayer | ( | const tensorflow::NodeDef & | matMulNodeDef, |
const tensorflow::NodeDef * | addNodeDef, | ||
const char * | armnnLayerName | ||
) |
Definition at line 3315 of file TfParser.cpp.
References ARMNN_ASSERT, CHECK_LOCATION, ITfParser::TfParserImpl::GetInputParsedTfOperationsChecked(), BaseTensor< MemoryType >::GetShape(), FullyConnectedDescriptor::m_BiasEnabled, ITfParser::TfParserImpl::m_Network, and ITfParser::ParsedTfOperation.
Referenced by ITfParser::TfParserImpl::ParseAdd().
ParsedTfOperationPtr AddMaximumLayer | ( | const tensorflow::NodeDef & | nodeDef | ) |
Definition at line 3236 of file TfParser.cpp.
References IOutputSlot::Connect(), ITfParser::TfParserImpl::GetInputParsedTfOperationsChecked(), IConnectableLayer::GetInputSlot(), TensorShape::GetNumDimensions(), TensorInfo::GetNumDimensions(), IConnectableLayer::GetOutputSlot(), TensorInfo::GetShape(), IOutputSlot::GetTensorInfo(), ITfParser::TfParserImpl::m_Network, TensorInfo::SetShape(), and IOutputSlot::SetTensorInfo().
Referenced by ITfParser::TfParserImpl::ParseMaximum().
IConnectableLayer * AddMultiplicationLayer | ( | const tensorflow::NodeDef & | nodeDef | ) |
Definition at line 3279 of file TfParser.cpp.
References IOutputSlot::Connect(), ITfParser::TfParserImpl::GetInputParsedTfOperationsChecked(), IConnectableLayer::GetInputSlot(), TensorInfo::GetNumDimensions(), IConnectableLayer::GetOutputSlot(), IOutputSlot::GetTensorInfo(), ITfParser::TfParserImpl::m_Network, and IOutputSlot::SetTensorInfo().
ParsedTfOperationPtr AddRealDivLayer | ( | const tensorflow::NodeDef & | nodeDef | ) |
Definition at line 3198 of file TfParser.cpp.
References IOutputSlot::Connect(), ITfParser::TfParserImpl::GetInputParsedTfOperationsChecked(), IConnectableLayer::GetInputSlot(), TensorInfo::GetNumDimensions(), IConnectableLayer::GetOutputSlot(), IOutputSlot::GetTensorInfo(), ITfParser::TfParserImpl::m_Network, and IOutputSlot::SetTensorInfo().
Referenced by ITfParser::TfParserImpl::ParseRealDiv().
void Cleanup | ( | ) |
Definition at line 3669 of file TfParser.cpp.
References ITfParser::TfParserImpl::m_InputShapes, ITfParser::TfParserImpl::m_NodesByName, ITfParser::TfParserImpl::m_ParsedTfOperations, and ITfParser::TfParserImpl::m_RequestedOutputs.
Referenced by ITfParser::TfParserImpl::CreateNetworkFromGraphDef().
IConnectableLayer * CreateAdditionLayer | ( | const tensorflow::NodeDef & | nodeDef, |
armnn::IOutputSlot * | input0Slot, | ||
armnn::IOutputSlot * | input1Slot, | ||
const std::string & | layerName | ||
) |
Definition at line 650 of file TfParser.cpp.
References CHECK_LOCATION, IOutputSlot::Connect(), IConnectableLayer::GetInputSlot(), TensorShape::GetNumDimensions(), TensorInfo::GetNumDimensions(), IConnectableLayer::GetOutputSlot(), TensorInfo::GetShape(), IOutputSlot::GetTensorInfo(), ITfParser::TfParserImpl::m_Network, TensorInfo::SetShape(), and IOutputSlot::SetTensorInfo().
Referenced by ITfParser::TfParserImpl::CreateAdditionLayer(), and ITfParser::TfParserImpl::ParseAddN().
IConnectableLayer * CreateAdditionLayer | ( | const tensorflow::NodeDef & | nodeDef, |
const OutputOfParsedTfOperation & | opOne, | ||
const OutputOfParsedTfOperation & | opTwo, | ||
unsigned int | numberOfAddition | ||
) |
Definition at line 724 of file TfParser.cpp.
References ITfParser::TfParserImpl::CreateAdditionLayer(), WithOutputTensorIndex< T >::m_Index, and WithOutputTensorIndex< T >::m_IndexedValue.
IConnectableLayer * CreateAdditionLayer | ( | const tensorflow::NodeDef & | nodeDef, |
armnn::IConnectableLayer * | layerOne, | ||
armnn::IConnectableLayer * | layerTwo, | ||
unsigned int | numberOfAddition, | ||
unsigned long | numberOfLayersToConnect, | ||
bool | isOdd | ||
) |
Definition at line 705 of file TfParser.cpp.
References ITfParser::TfParserImpl::CreateAdditionLayer(), and IConnectableLayer::GetOutputSlot().
IConnectableLayer * CreateAdditionLayer | ( | const tensorflow::NodeDef & | nodeDef, |
const OutputOfParsedTfOperation & | op, | ||
armnn::IConnectableLayer * | layer | ||
) |
Definition at line 737 of file TfParser.cpp.
References ITfParser::TfParserImpl::CreateAdditionLayer(), IConnectableLayer::GetOutputSlot(), WithOutputTensorIndex< T >::m_Index, and WithOutputTensorIndex< T >::m_IndexedValue.
INetworkPtr CreateNetworkFromBinaryFile | ( | const char * | graphFile, |
const std::map< std::string, armnn::TensorShape > & | inputShapes, | ||
const std::vector< std::string > & | requestedOutputs | ||
) |
Creates the network from a protobuf binary file on the disk.
Definition at line 3605 of file TfParser.cpp.
References CHECK_LOCATION, and ITfParser::TfParserImpl::CreateNetworkFromGraphDef().
INetworkPtr CreateNetworkFromGraphDef | ( | const tensorflow::GraphDef & | graphDef, |
const std::map< std::string, armnn::TensorShape > & | inputShapes, | ||
const std::vector< std::string > & | requestedOutputs | ||
) |
Parses a GraphDef loaded into memory from one of the other CreateNetwork*.
Definition at line 3639 of file TfParser.cpp.
References CHECK_LOCATION, ITfParser::TfParserImpl::Cleanup(), ITfParser::TfParserImpl::LoadGraphDef(), ITfParser::TfParserImpl::m_InputShapes, ITfParser::TfParserImpl::m_Network, and ITfParser::TfParserImpl::m_RequestedOutputs.
Referenced by ITfParser::TfParserImpl::CreateNetworkFromBinaryFile(), ITfParser::TfParserImpl::CreateNetworkFromString(), and ITfParser::TfParserImpl::CreateNetworkFromTextFile().
INetworkPtr CreateNetworkFromString | ( | const char * | protoText, |
const std::map< std::string, armnn::TensorShape > & | inputShapes, | ||
const std::vector< std::string > & | requestedOutputs | ||
) |
Creates the network directly from protobuf text in a string. Useful for debugging/testing.
Definition at line 3587 of file TfParser.cpp.
References CHECK_LOCATION, and ITfParser::TfParserImpl::CreateNetworkFromGraphDef().
INetworkPtr CreateNetworkFromTextFile | ( | const char * | graphFile, |
const std::map< std::string, armnn::TensorShape > & | inputShapes, | ||
const std::vector< std::string > & | requestedOutputs | ||
) |
Creates the network from a protobuf text file on the disk.
Definition at line 3556 of file TfParser.cpp.
References CHECK_LOCATION, and ITfParser::TfParserImpl::CreateNetworkFromGraphDef().
|
static |
Definition at line 3688 of file TfParser.cpp.
References CHECK_LOCATION.
Referenced by ITfParser::TfParserImpl::GetNetworkInputBindingInfo(), and ITfParser::TfParserImpl::GetNetworkOutputBindingInfo().
unsigned int GetConstInputIndex | ( | const std::vector< OutputOfParsedTfOperation > & | inputs | ) |
Definition at line 1198 of file TfParser.cpp.
References CHECK_LOCATION.
Referenced by ITfParser::TfParserImpl::ParseConcat(), ITfParser::TfParserImpl::ParseSplit(), and ITfParser::TfParserImpl::ParseTranspose().
std::vector< OutputOfParsedTfOperation > GetInputParsedTfOperationsChecked | ( | const tensorflow::NodeDef & | nodeDef, |
std::size_t | expectedNumInputs | ||
) |
Finds the IParsedTfOperations for the nodes connected as inputs of the given node in the graph, and throws an exception if the number of inputs does not match the expected one.
This will automatically resolve any identity nodes. The result vector contains the parsed operation together with the output tensor index to make the connection unambiguous.
Definition at line 615 of file TfParser.cpp.
References CHECK_LOCATION, ITfParser::TfParserImpl::GetTfInputNodes(), ITfParser::TfParserImpl::m_ParsedTfOperations, and ITfParser::ParsedTfOperation.
Referenced by ITfParser::TfParserImpl::AddActivationLayer(), ITfParser::TfParserImpl::AddAdditionLayer(), ITfParser::TfParserImpl::AddFullyConnectedLayer(), ITfParser::TfParserImpl::AddMaximumLayer(), ITfParser::TfParserImpl::AddMultiplicationLayer(), ITfParser::TfParserImpl::AddRealDivLayer(), ITfParser::TfParserImpl::IsSupportedLeakyReluPattern(), ITfParser::TfParserImpl::ParseAdd(), ITfParser::TfParserImpl::ParseAddN(), ITfParser::TfParserImpl::ParseConcat(), ITfParser::TfParserImpl::ParseConv2D(), ITfParser::TfParserImpl::ParseDepthwiseConv2D(), ITfParser::TfParserImpl::ParseExpandDims(), ITfParser::TfParserImpl::ParseFusedBatchNorm(), ITfParser::TfParserImpl::ParseGather(), ITfParser::TfParserImpl::ParseIdentity(), ITfParser::TfParserImpl::ParseLrn(), ITfParser::TfParserImpl::ParseMaximum(), ITfParser::TfParserImpl::ParseMean(), ITfParser::TfParserImpl::ParsePad(), ITfParser::TfParserImpl::ParsePlaceholder(), ITfParser::TfParserImpl::ParsePooling2d(), ITfParser::TfParserImpl::ParseReshape(), ITfParser::TfParserImpl::ParseResizeBilinear(), ITfParser::TfParserImpl::ParseRsqrt(), ITfParser::TfParserImpl::ParseShape(), ITfParser::TfParserImpl::ParseSoftmax(), ITfParser::TfParserImpl::ParseSplit(), ITfParser::TfParserImpl::ParseSqueeze(), ITfParser::TfParserImpl::ParseStack(), ITfParser::TfParserImpl::ParseStridedSlice(), ITfParser::TfParserImpl::ParseSub(), ITfParser::TfParserImpl::ParseTranspose(), and ITfParser::TfParserImpl::ProcessElementwiseInputSlots().
BindingPointInfo GetNetworkInputBindingInfo | ( | const std::string & | name | ) | const |
Retrieves binding info (layer id and tensor info) for the network input identified by the given layer name.
Definition at line 3678 of file TfParser.cpp.
References ITfParser::TfParserImpl::GetBindingInfo(), and ITfParser::TfParserImpl::m_NetworkInputsBindingInfo.
BindingPointInfo GetNetworkOutputBindingInfo | ( | const std::string & | name | ) | const |
Retrieves binding info (layer id and tensor info) for the network output identified by the given layer name.
Definition at line 3683 of file TfParser.cpp.
References ITfParser::TfParserImpl::GetBindingInfo(), and ITfParser::TfParserImpl::m_NetworkOutputsBindingInfo.
std::vector< OutputOfConstNodeDef > GetTfInputNodes | ( | const tensorflow::NodeDef & | nodeDef | ) | const |
Finds the nodes connected as inputs of the given node in the graph.
Definition at line 578 of file TfParser.cpp.
References CHECK_LOCATION, WithOutputTensorIndex< T >::m_Index, WithOutputTensorIndex< T >::m_IndexedValue, and ITfParser::TfParserImpl::m_NodesByName.
Referenced by ITfParser::TfParserImpl::GetInputParsedTfOperationsChecked(), ITfParser::TfParserImpl::LoadGraphDef(), ITfParser::TfParserImpl::ParseConcat(), ITfParser::TfParserImpl::ParseExpandDims(), ITfParser::TfParserImpl::ParseSplit(), ITfParser::TfParserImpl::ParseStack(), and ITfParser::TfParserImpl::ParseStridedSlice().
|
static |
Retrieve version in X.Y.Z form.
Definition at line 3740 of file TfParser.cpp.
References TF_PARSER_VERSION.
bool HasParsedConstTensor | ( | const std::string & | nodeName | ) | const |
Checks if there is a pre-parsed const tensor available with the given name and Type.
Definition at line 1182 of file TfParser.cpp.
References ITfParser::TfParserImpl::m_ParsedTfOperations.
bool HasParsedConstTensor | ( | ParsedTfOperation * | parsedTfOpPtr | ) | const |
Definition at line 1193 of file TfParser.cpp.
bool IsSupportedLeakyReluPattern | ( | const tensorflow::NodeDef & | mulNodeDef, |
size_t | alphaLayerIndex, | ||
const OutputOfParsedTfOperation & | otherOp, | ||
armnn::IOutputSlot ** | outputOfLeakyRelu, | ||
armnn::ActivationDescriptor & | desc | ||
) |
Definition at line 1709 of file TfParser.cpp.
References ARMNN_ASSERT, ITfParser::TfParserImpl::GetInputParsedTfOperationsChecked(), ActivationDescriptor::m_A, ActivationDescriptor::m_Function, WithOutputTensorIndex< T >::m_Index, and WithOutputTensorIndex< T >::m_IndexedValue.
Referenced by ITfParser::TfParserImpl::ParseMaximum().
void LoadGraphDef | ( | const tensorflow::GraphDef & | graphDef | ) |
Sets up variables and then performs BFS to parse all nodes.
Definition at line 3486 of file TfParser.cpp.
References CHECK_LOCATION, ITfParser::TfParserImpl::GetTfInputNodes(), ITfParser::TfParserImpl::LoadNodeDef(), ITfParser::TfParserImpl::m_InputShapes, ITfParser::TfParserImpl::m_NetworkInputsBindingInfo, ITfParser::TfParserImpl::m_NetworkOutputsBindingInfo, ITfParser::TfParserImpl::m_NodesByName, and ITfParser::TfParserImpl::m_RequestedOutputs.
Referenced by ITfParser::TfParserImpl::CreateNetworkFromGraphDef().
void LoadNodeDef | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Parses a given node, assuming nodes before it in the graph have been done.
Definition at line 3413 of file TfParser.cpp.
References CHECK_LOCATION, IConnectableLayer::GetInputSlot(), ITfParser::TfParserImpl::m_ControlInputs, ITfParser::TfParserImpl::m_Network, ITfParser::TfParserImpl::m_NetworkOutputsBindingInfo, ITfParser::TfParserImpl::m_ParsedTfOperations, ITfParser::TfParserImpl::m_RequestedOutputs, ITfParser::TfParserImpl::ms_OperationNameToParsingFunctions, armnn::numeric_cast(), ITfParser::ParsedTfOperation, and ITfParser::TfParserImpl::TrackOutputBinding().
Referenced by ITfParser::TfParserImpl::LoadGraphDef().
|
delete |
ParsedTfOperationPtr ParseAdd | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 826 of file TfParser.cpp.
References ITfParser::TfParserImpl::AddAdditionLayer(), ITfParser::TfParserImpl::AddFullyConnectedLayer(), ITfParser::TfParserImpl::GetInputParsedTfOperationsChecked(), and armnn::IgnoreUnused().
ParsedTfOperationPtr ParseAddN | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 747 of file TfParser.cpp.
References ITfParser::TfParserImpl::AddAdditionLayer(), CHECK_LOCATION, ITfParser::TfParserImpl::CreateAdditionLayer(), ITfParser::TfParserImpl::GetInputParsedTfOperationsChecked(), and armnn::IgnoreUnused().
ParsedTfOperationPtr ParseAvgPool | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 3003 of file TfParser.cpp.
References ITfParser::TfParserImpl::ParsePooling2d().
ParsedTfOperationPtr ParseBiasAdd | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 857 of file TfParser.cpp.
References ITfParser::TfParserImpl::AddAdditionLayer(), ARMNN_ASSERT, armnn::IgnoreUnused(), ITfParser::ParsedIdentityTfOperation, and ITfParser::ParsedTfOperation.
ParsedTfOperationPtr ParseConcat | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 2266 of file TfParser.cpp.
References CHECK_LOCATION, IOutputSlot::Connect(), ITfParser::TfParserImpl::GetConstInputIndex(), ITfParser::TfParserImpl::GetInputParsedTfOperationsChecked(), IConnectableLayer::GetInputSlot(), TensorInfo::GetNumDimensions(), IConnectableLayer::GetOutputSlot(), TensorInfo::GetShape(), IOutputSlot::GetTensorInfo(), ITfParser::TfParserImpl::GetTfInputNodes(), OriginsDescriptor::GetViewOrigin(), armnn::IgnoreUnused(), ITfParser::TfParserImpl::m_Network, OriginsDescriptor::SetConcatAxis(), IOutputSlot::SetTensorInfo(), and OriginsDescriptor::SetViewOriginCoord().
ParsedTfOperationPtr ParseConst | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 1086 of file TfParser.cpp.
References ARMNN_ASSERT, CHECK_LOCATION, armnnTfParser::ConvertTfTensorDataType(), armnn::GetDataTypeSize(), and armnn::IgnoreUnused().
ParsedTfOperationPtr ParseConv2D | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 1213 of file TfParser.cpp.
References armnnTfParser::CalcPadding(), CHECK_DATA_FORMAT, CHECK_LOCATION, CHECK_PADDING_TYPE, IOutputSlot::Connect(), DataLayoutIndexed::GetHeightIndex(), ITfParser::TfParserImpl::GetInputParsedTfOperationsChecked(), IConnectableLayer::GetInputSlot(), TensorInfo::GetNumElements(), IConnectableLayer::GetOutputSlot(), TensorInfo::GetShape(), BaseTensor< MemoryType >::GetShape(), IOutputSlot::GetTensorInfo(), DataLayoutIndexed::GetWidthIndex(), armnn::IgnoreUnused(), Convolution2dDescriptor::m_BiasEnabled, Convolution2dDescriptor::m_DataLayout, Convolution2dDescriptor::m_DilationX, Convolution2dDescriptor::m_DilationY, ITfParser::TfParserImpl::m_Network, Convolution2dDescriptor::m_PadBottom, Convolution2dDescriptor::m_PadLeft, Convolution2dDescriptor::m_PadRight, Convolution2dDescriptor::m_PadTop, Convolution2dDescriptor::m_StrideX, Convolution2dDescriptor::m_StrideY, armnnUtils::Permute(), armnnUtils::Permuted(), and IOutputSlot::SetTensorInfo().
ParsedTfOperationPtr ParseDepthwiseConv2D | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 1341 of file TfParser.cpp.
References armnnTfParser::CalcPadding(), CHECK_DATA_FORMAT, CHECK_LOCATION, CHECK_PADDING_TYPE, IOutputSlot::Connect(), DataLayoutIndexed::GetHeightIndex(), ITfParser::TfParserImpl::GetInputParsedTfOperationsChecked(), IConnectableLayer::GetInputSlot(), TensorInfo::GetNumElements(), IConnectableLayer::GetOutputSlot(), TensorInfo::GetShape(), BaseTensor< MemoryType >::GetShape(), IOutputSlot::GetTensorInfo(), DataLayoutIndexed::GetWidthIndex(), armnn::IgnoreUnused(), DepthwiseConvolution2dDescriptor::m_BiasEnabled, DepthwiseConvolution2dDescriptor::m_DataLayout, DepthwiseConvolution2dDescriptor::m_DilationX, DepthwiseConvolution2dDescriptor::m_DilationY, ITfParser::TfParserImpl::m_Network, DepthwiseConvolution2dDescriptor::m_PadBottom, DepthwiseConvolution2dDescriptor::m_PadLeft, DepthwiseConvolution2dDescriptor::m_PadRight, DepthwiseConvolution2dDescriptor::m_PadTop, DepthwiseConvolution2dDescriptor::m_StrideX, DepthwiseConvolution2dDescriptor::m_StrideY, armnnUtils::Permute(), armnnUtils::Permuted(), and IOutputSlot::SetTensorInfo().
ParsedTfOperationPtr ParseEqual | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 1947 of file TfParser.cpp.
References armnn::IgnoreUnused(), ITfParser::TfParserImpl::m_Network, ITfParser::TfParserImpl::ProcessComparisonLayer(), and ITfParser::TfParserImpl::ProcessElementwiseInputSlots().
ParsedTfOperationPtr ParseExpandDims | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 1535 of file TfParser.cpp.
References CHECK_LOCATION, IOutputSlot::Connect(), TensorInfo::GetDataType(), ITfParser::TfParserImpl::GetInputParsedTfOperationsChecked(), IConnectableLayer::GetInputSlot(), TensorInfo::GetNumElements(), IConnectableLayer::GetOutputSlot(), TensorInfo::GetShape(), IOutputSlot::GetTensorInfo(), ITfParser::TfParserImpl::GetTfInputNodes(), armnn::IgnoreUnused(), ITfParser::TfParserImpl::m_Network, ReshapeDescriptor::m_TargetShape, armnnTfParser::OutputShapeOfExpandDims(), IOutputSlot::SetTensorInfo(), and armnn::Signed32.
ParsedTfOperationPtr ParseFusedBatchNorm | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 1618 of file TfParser.cpp.
References CHECK_DATA_FORMAT, CHECK_LOCATION, IOutputSlot::Connect(), ITfParser::TfParserImpl::GetInputParsedTfOperationsChecked(), IConnectableLayer::GetInputSlot(), IConnectableLayer::GetOutputSlot(), IOutputSlot::GetTensorInfo(), armnn::IgnoreUnused(), BatchNormalizationDescriptor::m_DataLayout, BatchNormalizationDescriptor::m_Eps, ITfParser::TfParserImpl::m_Network, and IOutputSlot::SetTensorInfo().
ParsedTfOperationPtr ParseGather | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 1894 of file TfParser.cpp.
References IOutputSlot::Connect(), TensorInfo::GetDataType(), ITfParser::TfParserImpl::GetInputParsedTfOperationsChecked(), TensorInfo::GetNumDimensions(), TensorInfo::GetShape(), IOutputSlot::GetTensorInfo(), armnn::IgnoreUnused(), GatherDescriptor::m_Axis, and ITfParser::TfParserImpl::m_Network.
ParsedTfOperationPtr ParseGreater | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 1933 of file TfParser.cpp.
References armnn::IgnoreUnused(), ITfParser::TfParserImpl::m_Network, ITfParser::TfParserImpl::ProcessComparisonLayer(), and ITfParser::TfParserImpl::ProcessElementwiseInputSlots().
ParsedTfOperationPtr ParseIdentity | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 891 of file TfParser.cpp.
References ITfParser::DeferredSingleLayerParsedTfOperation, ITfParser::TfParserImpl::GetInputParsedTfOperationsChecked(), TensorInfo::GetNumElements(), armnn::IgnoreUnused(), and ITfParser::ParsedConstTfOperation.
ParsedTfOperationPtr ParseLrn | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 2578 of file TfParser.cpp.
References ARMNN_ASSERT, IOutputSlot::Connect(), ITfParser::DeferredSingleLayerParsedTfOperation, ITfParser::TfParserImpl::GetInputParsedTfOperationsChecked(), IConnectableLayer::GetInputSlot(), IConnectableLayer::GetOutputSlot(), IOutputSlot::GetTensorInfo(), armnn::IgnoreUnused(), NormalizationDescriptor::m_Alpha, NormalizationDescriptor::m_Beta, NormalizationDescriptor::m_DataLayout, NormalizationDescriptor::m_K, m_Layer, ITfParser::TfParserImpl::m_Network, NormalizationDescriptor::m_NormChannelType, NormalizationDescriptor::m_NormMethodType, NormalizationDescriptor::m_NormSize, armnn::NHWC, ITfParser::ParsedMatMulTfOperation, and IOutputSlot::SetTensorInfo().
ParsedTfOperationPtr ParseMatMul | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
ParsedTfOperationPtr ParseMaximum | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 1759 of file TfParser.cpp.
References ITfParser::TfParserImpl::AddMaximumLayer(), ARMNN_ASSERT, CHECK_LOCATION, IOutputSlot::Connect(), ITfParser::TfParserImpl::GetInputParsedTfOperationsChecked(), IConnectableLayer::GetInputSlot(), IConnectableLayer::GetOutputSlot(), IOutputSlot::GetTensorInfo(), armnn::IgnoreUnused(), ITfParser::TfParserImpl::IsSupportedLeakyReluPattern(), ITfParser::TfParserImpl::m_Network, and IOutputSlot::SetTensorInfo().
ParsedTfOperationPtr ParseMaxPool | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 2997 of file TfParser.cpp.
References ITfParser::TfParserImpl::ParsePooling2d().
ParsedTfOperationPtr ParseMean | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 2634 of file TfParser.cpp.
References ARMNN_ASSERT, armnnUtils::CalculateReducedOutputTensoInfo(), CHECK_LOCATION, IOutputSlot::Connect(), ITfParser::DeferredSingleLayerParsedTfOperation, ITfParser::TfParserImpl::GetInputParsedTfOperationsChecked(), IConnectableLayer::GetInputSlot(), TensorInfo::GetNumDimensions(), IConnectableLayer::GetOutputSlot(), IOutputSlot::GetTensorInfo(), armnn::IgnoreUnused(), MeanDescriptor::m_Axis, MeanDescriptor::m_KeepDims, m_Layer, ITfParser::TfParserImpl::m_Network, ITfParser::ParsedMulTfOperation, and IOutputSlot::SetTensorInfo().
ParsedTfOperationPtr ParseMinimum | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 1961 of file TfParser.cpp.
References armnn::IgnoreUnused(), ITfParser::TfParserImpl::m_Network, ITfParser::TfParserImpl::ProcessElementwiseInputSlots(), and ITfParser::TfParserImpl::ProcessElementwiseLayer().
ParsedTfOperationPtr ParseMul | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
ParsedTfOperationPtr ParsePad | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 2195 of file TfParser.cpp.
References armnnTfParser::CalculatePaddedOutputTensorInfo(), CHECK_LOCATION, armnnTfParser::CheckPaddingTensor(), IOutputSlot::Connect(), ITfParser::TfParserImpl::GetInputParsedTfOperationsChecked(), IConnectableLayer::GetInputSlot(), IConnectableLayer::GetOutputSlot(), IOutputSlot::GetTensorInfo(), armnn::IgnoreUnused(), ITfParser::TfParserImpl::m_Network, and IOutputSlot::SetTensorInfo().
ParsedTfOperationPtr ParsePlaceholder | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 2718 of file TfParser.cpp.
References CHECK_LOCATION, ITfParser::TfParserImpl::GetInputParsedTfOperationsChecked(), IConnectableLayer::GetOutputSlot(), armnn::IgnoreUnused(), ITfParser::TfParserImpl::m_InputShapes, ITfParser::TfParserImpl::m_Network, ITfParser::TfParserImpl::m_NetworkInputsBindingInfo, armnn::numeric_cast(), IOutputSlot::SetTensorInfo(), and ITfParser::TfParserImpl::TrackInputBinding().
ParsedTfOperationPtr ParsePooling2d | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef, | ||
armnn::PoolingAlgorithm | pooltype | ||
) |
Definition at line 3009 of file TfParser.cpp.
References armnnTfParser::CalcPadding(), CHECK_DATA_FORMAT, CHECK_LOCATION, CHECK_PADDING_TYPE, IOutputSlot::Connect(), DataLayoutIndexed::GetHeightIndex(), ITfParser::TfParserImpl::GetInputParsedTfOperationsChecked(), IConnectableLayer::GetInputSlot(), IConnectableLayer::GetOutputSlot(), TensorInfo::GetShape(), IOutputSlot::GetTensorInfo(), DataLayoutIndexed::GetWidthIndex(), armnn::IgnoreUnused(), Pooling2dDescriptor::m_DataLayout, ITfParser::TfParserImpl::m_Network, Pooling2dDescriptor::m_OutputShapeRounding, Pooling2dDescriptor::m_PadBottom, Pooling2dDescriptor::m_PaddingMethod, Pooling2dDescriptor::m_PadLeft, Pooling2dDescriptor::m_PadRight, Pooling2dDescriptor::m_PadTop, Pooling2dDescriptor::m_PoolHeight, Pooling2dDescriptor::m_PoolType, Pooling2dDescriptor::m_PoolWidth, Pooling2dDescriptor::m_StrideX, Pooling2dDescriptor::m_StrideY, and IOutputSlot::SetTensorInfo().
Referenced by ITfParser::TfParserImpl::ParseAvgPool(), and ITfParser::TfParserImpl::ParseMaxPool().
ParsedTfOperationPtr ParseRealDiv | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 2746 of file TfParser.cpp.
References ITfParser::TfParserImpl::AddRealDivLayer(), and armnn::IgnoreUnused().
ParsedTfOperationPtr ParseRelu | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 2753 of file TfParser.cpp.
References ITfParser::TfParserImpl::AddActivationLayer(), armnn::IgnoreUnused(), and ActivationDescriptor::m_Function.
ParsedTfOperationPtr ParseRelu6 | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 2763 of file TfParser.cpp.
References ITfParser::TfParserImpl::AddActivationLayer(), armnn::IgnoreUnused(), ActivationDescriptor::m_A, ActivationDescriptor::m_B, and ActivationDescriptor::m_Function.
ParsedTfOperationPtr ParseReshape | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 2389 of file TfParser.cpp.
References CHECK_LOCATION, ITfParser::TfParserImpl::GetInputParsedTfOperationsChecked(), IConnectableLayer::GetInputSlot(), IConnectableLayer::GetOutputSlot(), TensorInfo::GetShape(), armnn::IgnoreUnused(), ITfParser::TfParserImpl::m_Network, ReshapeDescriptor::m_TargetShape, ITfParser::ParsedTfOperation, and IOutputSlot::SetTensorInfo().
ParsedTfOperationPtr ParseResizeBilinear | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 2426 of file TfParser.cpp.
References armnn::Bilinear, CHECK_LOCATION, IOutputSlot::Connect(), armnn::Float32, ITfParser::TfParserImpl::GetInputParsedTfOperationsChecked(), IConnectableLayer::GetInputSlot(), IConnectableLayer::GetOutputSlot(), TensorInfo::GetShape(), IOutputSlot::GetTensorInfo(), armnn::IgnoreUnused(), ResizeDescriptor::m_DataLayout, ResizeDescriptor::m_Method, ITfParser::TfParserImpl::m_Network, ResizeDescriptor::m_TargetHeight, ResizeDescriptor::m_TargetWidth, armnn::NHWC, and IOutputSlot::SetTensorInfo().
ParsedTfOperationPtr ParseRsqrt | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 2787 of file TfParser.cpp.
References IOutputSlot::Connect(), ITfParser::TfParserImpl::GetInputParsedTfOperationsChecked(), IConnectableLayer::GetInputSlot(), IConnectableLayer::GetOutputSlot(), IOutputSlot::GetTensorInfo(), armnn::IgnoreUnused(), ITfParser::TfParserImpl::m_Network, and IOutputSlot::SetTensorInfo().
ParsedTfOperationPtr ParseShape | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 2348 of file TfParser.cpp.
References CHECK_LOCATION, ITfParser::TfParserImpl::GetInputParsedTfOperationsChecked(), TensorInfo::GetNumDimensions(), TensorInfo::GetShape(), IOutputSlot::GetTensorInfo(), and armnn::IgnoreUnused().
ParsedTfOperationPtr ParseSigmoid | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 2776 of file TfParser.cpp.
References ITfParser::TfParserImpl::AddActivationLayer(), armnn::IgnoreUnused(), and ActivationDescriptor::m_Function.
ParsedTfOperationPtr ParseSoftmax | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 2804 of file TfParser.cpp.
References IOutputSlot::Connect(), ITfParser::TfParserImpl::GetInputParsedTfOperationsChecked(), IConnectableLayer::GetInputSlot(), IConnectableLayer::GetOutputSlot(), IOutputSlot::GetTensorInfo(), armnn::IgnoreUnused(), ITfParser::TfParserImpl::m_Network, and IOutputSlot::SetTensorInfo().
ParsedTfOperationPtr ParseSoftplus | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 2912 of file TfParser.cpp.
References ITfParser::TfParserImpl::AddActivationLayer(), armnn::IgnoreUnused(), and ActivationDescriptor::m_Function.
ParsedTfOperationPtr ParseSplit | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 2821 of file TfParser.cpp.
References CHECK_LOCATION, IOutputSlot::Connect(), ITfParser::TfParserImpl::GetConstInputIndex(), TensorInfo::GetDataType(), ITfParser::TfParserImpl::GetInputParsedTfOperationsChecked(), IConnectableLayer::GetInputSlot(), TensorInfo::GetNumDimensions(), IConnectableLayer::GetNumOutputSlots(), IConnectableLayer::GetOutputSlot(), TensorInfo::GetShape(), IOutputSlot::GetTensorInfo(), ITfParser::TfParserImpl::GetTfInputNodes(), armnn::IgnoreUnused(), ITfParser::TfParserImpl::m_Network, IOutputSlot::SetTensorInfo(), ViewsDescriptor::SetViewOriginCoord(), and ViewsDescriptor::SetViewSize().
ParsedTfOperationPtr ParseSqueeze | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 2557 of file TfParser.cpp.
References IOutputSlot::Connect(), ITfParser::TfParserImpl::GetInputParsedTfOperationsChecked(), IConnectableLayer::GetInputSlot(), IConnectableLayer::GetOutputSlot(), TensorInfo::GetShape(), IOutputSlot::GetTensorInfo(), armnn::IgnoreUnused(), ITfParser::TfParserImpl::m_Network, ReshapeDescriptor::m_TargetShape, armnnTfParser::OutputShapeOfSqueeze(), and IOutputSlot::SetTensorInfo().
ParsedTfOperationPtr ParseStack | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 2015 of file TfParser.cpp.
References CHECK_LOCATION, IOutputSlot::Connect(), TensorInfo::GetDataType(), ITfParser::TfParserImpl::GetInputParsedTfOperationsChecked(), IConnectableLayer::GetInputSlot(), TensorShape::GetNumDimensions(), TensorInfo::GetNumDimensions(), IConnectableLayer::GetOutputSlot(), TensorInfo::GetShape(), IOutputSlot::GetTensorInfo(), ITfParser::TfParserImpl::GetTfInputNodes(), armnn::IgnoreUnused(), StackDescriptor::m_Axis, StackDescriptor::m_InputShape, ITfParser::TfParserImpl::m_Network, StackDescriptor::m_NumInputs, and IOutputSlot::SetTensorInfo().
ParsedTfOperationPtr ParseStridedSlice | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 2923 of file TfParser.cpp.
References armnnUtils::CalculateStridedSliceOutputTensorInfo(), IOutputSlot::Connect(), ITfParser::TfParserImpl::GetInputParsedTfOperationsChecked(), IConnectableLayer::GetInputSlot(), IConnectableLayer::GetOutputSlot(), IOutputSlot::GetTensorInfo(), ITfParser::TfParserImpl::GetTfInputNodes(), armnn::IgnoreUnused(), StridedSliceDescriptor::m_Begin, StridedSliceDescriptor::m_BeginMask, StridedSliceDescriptor::m_DataLayout, StridedSliceDescriptor::m_EllipsisMask, StridedSliceDescriptor::m_End, StridedSliceDescriptor::m_EndMask, ITfParser::TfParserImpl::m_Network, StridedSliceDescriptor::m_NewAxisMask, StridedSliceDescriptor::m_ShrinkAxisMask, StridedSliceDescriptor::m_Stride, armnn::NHWC, and IOutputSlot::SetTensorInfo().
ParsedTfOperationPtr ParseSub | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 1974 of file TfParser.cpp.
References IOutputSlot::Connect(), ITfParser::TfParserImpl::GetInputParsedTfOperationsChecked(), IConnectableLayer::GetInputSlot(), TensorInfo::GetNumDimensions(), IConnectableLayer::GetOutputSlot(), IOutputSlot::GetTensorInfo(), armnn::IgnoreUnused(), ITfParser::TfParserImpl::m_Network, and IOutputSlot::SetTensorInfo().
ParsedTfOperationPtr ParseTanh | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 2971 of file TfParser.cpp.
References ITfParser::TfParserImpl::AddActivationLayer(), armnn::IgnoreUnused(), ActivationDescriptor::m_A, ActivationDescriptor::m_B, and ActivationDescriptor::m_Function.
ParsedTfOperationPtr ParseTranspose | ( | const tensorflow::NodeDef & | nodeDef, |
const tensorflow::GraphDef & | graphDef | ||
) |
Definition at line 2101 of file TfParser.cpp.
References ARMNN_ASSERT, CHECK_LOCATION, ITfParser::TfParserImpl::GetConstInputIndex(), ITfParser::TfParserImpl::GetInputParsedTfOperationsChecked(), armnn::IgnoreUnused(), ITfParser::TfParserImpl::m_Network, TensorInfo::SetShape(), and armnnUtils::TransposeTensorShape().
ParsedTfOperationPtr ProcessComparisonLayer | ( | armnn::IOutputSlot * | input0Slot, |
armnn::IOutputSlot * | input1Slot, | ||
armnn::IConnectableLayer *const | layer, | ||
const tensorflow::NodeDef & | nodeDef | ||
) |
Definition at line 1841 of file TfParser.cpp.
References IOutputSlot::Connect(), IConnectableLayer::GetInputSlot(), TensorShape::GetNumDimensions(), IConnectableLayer::GetOutputSlot(), TensorInfo::GetShape(), IOutputSlot::GetTensorInfo(), TensorInfo::SetDataType(), TensorInfo::SetShape(), and IOutputSlot::SetTensorInfo().
Referenced by ITfParser::TfParserImpl::ParseEqual(), and ITfParser::TfParserImpl::ParseGreater().
std::pair< armnn::IOutputSlot *, armnn::IOutputSlot * > ProcessElementwiseInputSlots | ( | const tensorflow::NodeDef & | nodeDef, |
const std::string & | layerName | ||
) |
Definition at line 1807 of file TfParser.cpp.
References CHECK_LOCATION, ITfParser::TfParserImpl::GetInputParsedTfOperationsChecked(), TensorInfo::GetNumDimensions(), IOutputSlot::GetTensorInfo(), and ITfParser::TfParserImpl::m_Network.
Referenced by ITfParser::TfParserImpl::ParseEqual(), ITfParser::TfParserImpl::ParseGreater(), and ITfParser::TfParserImpl::ParseMinimum().
ParsedTfOperationPtr ProcessElementwiseLayer | ( | armnn::IOutputSlot * | input0Slot, |
armnn::IOutputSlot * | input1Slot, | ||
armnn::IConnectableLayer *const | layer, | ||
const tensorflow::NodeDef & | nodeDef | ||
) |
Definition at line 1868 of file TfParser.cpp.
References IOutputSlot::Connect(), IConnectableLayer::GetInputSlot(), TensorShape::GetNumDimensions(), IConnectableLayer::GetOutputSlot(), TensorInfo::GetShape(), IOutputSlot::GetTensorInfo(), TensorInfo::SetShape(), and IOutputSlot::SetTensorInfo().
Referenced by ITfParser::TfParserImpl::ParseMinimum().
const tensorflow::NodeDef * ResolveIdentityNode | ( | const tensorflow::NodeDef * | nodeDef | ) |
Handling identity layers as the input for Conv2D layer.
Definition at line 546 of file TfParser.cpp.
References CHECK_LOCATION, and ITfParser::TfParserImpl::m_NodesByName.
|
static |
Definition at line 3718 of file TfParser.cpp.
References CHECK_LOCATION, and IConnectableLayer::GetName().
Referenced by ITfParser::TfParserImpl::TrackInputBinding(), and ITfParser::TfParserImpl::TrackOutputBinding().
void TrackInputBinding | ( | armnn::IConnectableLayer * | layer, |
armnn::LayerBindingId | id, | ||
const armnn::TensorInfo & | tensorInfo | ||
) |
Definition at line 3704 of file TfParser.cpp.
References ITfParser::TfParserImpl::m_NetworkInputsBindingInfo, and ITfParser::TfParserImpl::TrackBindingPoint().
Referenced by ITfParser::TfParserImpl::ParsePlaceholder().
void TrackOutputBinding | ( | armnn::IConnectableLayer * | layer, |
armnn::LayerBindingId | id, | ||
const armnn::TensorInfo & | tensorInfo | ||
) |
Definition at line 3711 of file TfParser.cpp.
References ITfParser::TfParserImpl::m_NetworkOutputsBindingInfo, and ITfParser::TfParserImpl::TrackBindingPoint().
Referenced by ITfParser::TfParserImpl::LoadNodeDef().
|
static |
Definition at line 259 of file TfParser.hpp.
Referenced by ITfParser::TfParserImpl::LoadNodeDef().
std::map<std::string, armnn::TensorShape> m_InputShapes |
Definition at line 261 of file TfParser.hpp.
Referenced by ITfParser::TfParserImpl::Cleanup(), ITfParser::TfParserImpl::CreateNetworkFromGraphDef(), ITfParser::TfParserImpl::LoadGraphDef(), and ITfParser::TfParserImpl::ParsePlaceholder().
armnn::INetworkPtr m_Network |
The network we're building. Gets cleared after it is passed to the user.
Definition at line 251 of file TfParser.hpp.
Referenced by ITfParser::TfParserImpl::AddActivationLayer(), ITfParser::TfParserImpl::AddAdditionLayer(), ITfParser::TfParserImpl::AddFullyConnectedLayer(), ITfParser::TfParserImpl::AddMaximumLayer(), ITfParser::TfParserImpl::AddMultiplicationLayer(), ITfParser::TfParserImpl::AddRealDivLayer(), ITfParser::TfParserImpl::CreateAdditionLayer(), ITfParser::TfParserImpl::CreateNetworkFromGraphDef(), ITfParser::TfParserImpl::LoadNodeDef(), ITfParser::TfParserImpl::ParseConcat(), ITfParser::TfParserImpl::ParseConv2D(), ITfParser::TfParserImpl::ParseDepthwiseConv2D(), ITfParser::TfParserImpl::ParseEqual(), ITfParser::TfParserImpl::ParseExpandDims(), ITfParser::TfParserImpl::ParseFusedBatchNorm(), ITfParser::TfParserImpl::ParseGather(), ITfParser::TfParserImpl::ParseGreater(), ITfParser::TfParserImpl::ParseLrn(), ITfParser::TfParserImpl::ParseMaximum(), ITfParser::TfParserImpl::ParseMean(), ITfParser::TfParserImpl::ParseMinimum(), ITfParser::TfParserImpl::ParsePad(), ITfParser::TfParserImpl::ParsePlaceholder(), ITfParser::TfParserImpl::ParsePooling2d(), ITfParser::TfParserImpl::ParseReshape(), ITfParser::TfParserImpl::ParseResizeBilinear(), ITfParser::TfParserImpl::ParseRsqrt(), ITfParser::TfParserImpl::ParseSoftmax(), ITfParser::TfParserImpl::ParseSplit(), ITfParser::TfParserImpl::ParseSqueeze(), ITfParser::TfParserImpl::ParseStack(), ITfParser::TfParserImpl::ParseStridedSlice(), ITfParser::TfParserImpl::ParseSub(), ITfParser::TfParserImpl::ParseTranspose(), and ITfParser::TfParserImpl::ProcessElementwiseInputSlots().
std::unordered_map<std::string, BindingPointInfo> m_NetworkInputsBindingInfo |
Maps input layer names to their corresponding ids and tensor info.
Definition at line 270 of file TfParser.hpp.
Referenced by ITfParser::TfParserImpl::GetNetworkInputBindingInfo(), ITfParser::TfParserImpl::LoadGraphDef(), ITfParser::TfParserImpl::ParsePlaceholder(), and ITfParser::TfParserImpl::TrackInputBinding().
std::unordered_map<std::string, BindingPointInfo> m_NetworkOutputsBindingInfo |
Maps output layer names to their corresponding ids and tensor info.
Definition at line 273 of file TfParser.hpp.
Referenced by ITfParser::TfParserImpl::GetNetworkOutputBindingInfo(), ITfParser::TfParserImpl::LoadGraphDef(), ITfParser::TfParserImpl::LoadNodeDef(), and ITfParser::TfParserImpl::TrackOutputBinding().
std::unordered_map<std::string, const tensorflow::NodeDef*> m_NodesByName |
Map of nodes extracted from the GraphDef to speed up parsing.
Definition at line 265 of file TfParser.hpp.
Referenced by ITfParser::TfParserImpl::Cleanup(), ITfParser::TfParserImpl::GetTfInputNodes(), ITfParser::TfParserImpl::LoadGraphDef(), and ITfParser::TfParserImpl::ResolveIdentityNode().
std::unordered_map<std::string, ParsedTfOperationPtr> m_ParsedTfOperations |
Definition at line 267 of file TfParser.hpp.
Referenced by ITfParser::TfParserImpl::Cleanup(), ITfParser::TfParserImpl::GetInputParsedTfOperationsChecked(), ITfParser::TfParserImpl::HasParsedConstTensor(), and ITfParser::TfParserImpl::LoadNodeDef().
std::vector<std::string> m_RequestedOutputs |
Definition at line 262 of file TfParser.hpp.
Referenced by ITfParser::TfParserImpl::Cleanup(), ITfParser::TfParserImpl::CreateNetworkFromGraphDef(), ITfParser::TfParserImpl::LoadGraphDef(), and ITfParser::TfParserImpl::LoadNodeDef().
|
static |
Map of TensorFlow operation names to parsing member functions.
Definition at line 257 of file TfParser.hpp.
Referenced by ITfParser::TfParserImpl::LoadNodeDef().