21.11
|
#include <OnnxParser.hpp>
Public Types | |
using | GraphPtr = std::unique_ptr< onnx::GraphProto > |
Public Member Functions | |
armnn::INetworkPtr | CreateNetworkFromBinaryFile (const char *graphFile) |
Create the network from a protobuf binary file on disk. More... | |
armnn::INetworkPtr | CreateNetworkFromBinaryFile (const char *graphFile, const std::map< std::string, armnn::TensorShape > &inputShapes) |
Create the network from a protobuf binary file on disk, with inputShapes specified. More... | |
armnn::INetworkPtr | CreateNetworkFromTextFile (const char *graphFile) |
Create the network from a protobuf text file on disk. More... | |
armnn::INetworkPtr | CreateNetworkFromTextFile (const char *graphFile, const std::map< std::string, armnn::TensorShape > &inputShapes) |
Create the network from a protobuf text file on disk, with inputShapes specified. More... | |
armnn::INetworkPtr | CreateNetworkFromString (const std::string &protoText) |
Create the network directly from protobuf text in a string. Useful for debugging/testing. More... | |
armnn::INetworkPtr | CreateNetworkFromString (const std::string &protoText, const std::map< std::string, armnn::TensorShape > &inputShapes) |
Create the network directly from protobuf text in a string, with inputShapes specified. More... | |
BindingPointInfo | GetNetworkInputBindingInfo (const std::string &name) const |
Retrieve 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 |
Retrieve binding info (layer id and tensor info) for the network output identified by the given layer name. More... | |
OnnxParserImpl () | |
~OnnxParserImpl ()=default | |
template<typename TypePair , typename Location > | |
void | ValidateInputs (const onnx::NodeProto &node, TypePair validInputs, const Location &location) |
Static Public Member Functions | |
static ModelPtr | LoadModelFromBinaryFile (const char *fileName) |
static ModelPtr | LoadModelFromTextFile (const char *fileName) |
static ModelPtr | LoadModelFromString (const std::string &inputString) |
static std::vector< std::string > | GetInputs (ModelPtr &model) |
Retrieve inputs names. More... | |
static std::vector< std::string > | GetOutputs (ModelPtr &model) |
Retrieve outputs names. More... | |
static const std::string | GetVersion () |
Retrieve version in X.Y.Z form. More... | |
Definition at line 25 of file OnnxParser.hpp.
using GraphPtr = std::unique_ptr<onnx::GraphProto> |
Definition at line 32 of file OnnxParser.hpp.
OnnxParserImpl | ( | ) |
Definition at line 542 of file OnnxParser.cpp.
|
default |
INetworkPtr CreateNetworkFromBinaryFile | ( | const char * | graphFile | ) |
Create the network from a protobuf binary file on disk.
Definition at line 762 of file OnnxParser.cpp.
References OnnxParserImpl::LoadModelFromBinaryFile().
armnn::INetworkPtr CreateNetworkFromBinaryFile | ( | const char * | graphFile, |
const std::map< std::string, armnn::TensorShape > & | inputShapes | ||
) |
Create the network from a protobuf binary file on disk, with inputShapes specified.
INetworkPtr CreateNetworkFromString | ( | const std::string & | protoText | ) |
Create the network directly from protobuf text in a string. Useful for debugging/testing.
Definition at line 797 of file OnnxParser.cpp.
References ARMNN_ASSERT, CHECK_LOCATION, CHECK_VALID_DATATYPE, CHECK_VALID_SIZE, CHECKED_INT32, CHECKED_NON_NEGATIVE, IOutputSlot::Connect(), TensorShape::GetDimensionality(), IConnectableLayer::GetInputSlot(), TensorShape::GetNumDimensions(), IConnectableLayer::GetNumInputSlots(), IConnectableLayer::GetNumOutputSlots(), IConnectableLayer::GetOutputSlot(), TensorInfo::GetShape(), OnnxParserImpl::LoadModelFromString(), ActivationDescriptor::m_A, GatherDescriptor::m_Axis, ActivationDescriptor::m_B, FullyConnectedDescriptor::m_BiasEnabled, Convolution2dDescriptor::m_BiasEnabled, Convolution2dDescriptor::m_DilationX, Convolution2dDescriptor::m_DilationY, TransposeDescriptor::m_DimMappings, BatchNormalizationDescriptor::m_Eps, ActivationDescriptor::m_Function, Pooling2dDescriptor::m_OutputShapeRounding, Pooling2dDescriptor::m_PadBottom, Convolution2dDescriptor::m_PadBottom, Pooling2dDescriptor::m_PaddingMethod, Pooling2dDescriptor::m_PadLeft, Convolution2dDescriptor::m_PadLeft, DepthwiseConvolution2dDescriptor::m_PadLeft, Pooling2dDescriptor::m_PadRight, Convolution2dDescriptor::m_PadRight, Pooling2dDescriptor::m_PadTop, Convolution2dDescriptor::m_PadTop, Pooling2dDescriptor::m_PoolHeight, Pooling2dDescriptor::m_PoolType, Pooling2dDescriptor::m_PoolWidth, Pooling2dDescriptor::m_StrideX, Convolution2dDescriptor::m_StrideX, Pooling2dDescriptor::m_StrideY, Convolution2dDescriptor::m_StrideY, ReshapeDescriptor::m_TargetShape, FullyConnectedDescriptor::m_TransposeWeightMatrix, armnn::numeric_cast(), armnnUtils::ProcessConcatInputTensorInfo(), OriginsDescriptor::SetConcatAxis(), TensorInfo::SetConstant(), TensorInfo::SetShape(), IOutputSlot::SetTensorInfo(), STR_LIST, armnnDeserializer::ToTensorInfo(), and VALID_INPUTS.
armnn::INetworkPtr CreateNetworkFromString | ( | const std::string & | protoText, |
const std::map< std::string, armnn::TensorShape > & | inputShapes | ||
) |
Create the network directly from protobuf text in a string, with inputShapes specified.
Useful for debugging/testing
INetworkPtr CreateNetworkFromTextFile | ( | const char * | graphFile | ) |
Create the network from a protobuf text file on disk.
Definition at line 718 of file OnnxParser.cpp.
References OnnxParserImpl::LoadModelFromTextFile().
armnn::INetworkPtr CreateNetworkFromTextFile | ( | const char * | graphFile, |
const std::map< std::string, armnn::TensorShape > & | inputShapes | ||
) |
Create the network from a protobuf text file on disk, with inputShapes specified.
|
static |
Retrieve inputs names.
Definition at line 2428 of file OnnxParser.cpp.
References CHECK_LOCATION.
Referenced by TEST_SUITE().
BindingPointInfo GetNetworkInputBindingInfo | ( | const std::string & | name | ) | const |
Retrieve binding info (layer id and tensor info) for the network input identified by the given layer name.
Definition at line 2390 of file OnnxParser.cpp.
References CHECK_LOCATION.
BindingPointInfo GetNetworkOutputBindingInfo | ( | const std::string & | name | ) | const |
Retrieve binding info (layer id and tensor info) for the network output identified by the given layer name.
Definition at line 2409 of file OnnxParser.cpp.
References CHECK_LOCATION.
|
static |
Retrieve outputs names.
Definition at line 2452 of file OnnxParser.cpp.
References CHECK_LOCATION.
Referenced by TEST_SUITE().
|
static |
Retrieve version in X.Y.Z form.
Definition at line 2467 of file OnnxParser.cpp.
References ONNX_PARSER_VERSION.
|
static |
Definition at line 734 of file OnnxParser.cpp.
References CHECK_LOCATION, and armnn::error.
Referenced by OnnxParserImpl::CreateNetworkFromBinaryFile().
|
static |
Definition at line 778 of file OnnxParser.cpp.
References CHECK_LOCATION, and armnn::error.
Referenced by OnnxParserImpl::CreateNetworkFromString(), and TEST_SUITE().
|
static |
Definition at line 693 of file OnnxParser.cpp.
References CHECK_LOCATION, and armnn::error.
Referenced by OnnxParserImpl::CreateNetworkFromTextFile().
void ValidateInputs | ( | const onnx::NodeProto & | node, |
TypePair | validInputs, | ||
const Location & | location | ||
) |
Definition at line 467 of file OnnxParser.cpp.