21.08
|
#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 | CreateNetworkFromTextFile (const char *graphFile) |
Create the network from a protobuf text file on disk. More... | |
armnn::INetworkPtr | CreateNetworkFromString (const std::string &protoText) |
Create the network directly from protobuf text in a string. Useful for debugging/testing. 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 485 of file OnnxParser.cpp.
|
default |
INetworkPtr CreateNetworkFromBinaryFile | ( | const char * | graphFile | ) |
Create the network from a protobuf binary file on disk.
Definition at line 631 of file OnnxParser.cpp.
References OnnxParserImpl::LoadModelFromBinaryFile().
INetworkPtr CreateNetworkFromString | ( | const std::string & | protoText | ) |
Create the network directly from protobuf text in a string. Useful for debugging/testing.
Definition at line 657 of file OnnxParser.cpp.
References ARMNN_ASSERT, CHECK_LOCATION, CHECK_VALID_DATATYPE, CHECK_VALID_SIZE, CHECKED_INT32, IOutputSlot::Connect(), IConnectableLayer::GetInputSlot(), TensorShape::GetNumDimensions(), IConnectableLayer::GetNumInputSlots(), IConnectableLayer::GetNumOutputSlots(), IConnectableLayer::GetOutputSlot(), TensorInfo::GetShape(), OnnxParserImpl::LoadModelFromString(), ActivationDescriptor::m_A, ActivationDescriptor::m_B, FullyConnectedDescriptor::m_BiasEnabled, Convolution2dDescriptor::m_BiasEnabled, Convolution2dDescriptor::m_DilationX, Convolution2dDescriptor::m_DilationY, 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, TensorInfo::SetConstant(), TensorInfo::SetShape(), IOutputSlot::SetTensorInfo(), STR_LIST, armnnDeserializer::ToTensorInfo(), and VALID_INPUTS.
INetworkPtr CreateNetworkFromTextFile | ( | const char * | graphFile | ) |
Create the network from a protobuf text file on disk.
Definition at line 595 of file OnnxParser.cpp.
References OnnxParserImpl::LoadModelFromTextFile().
|
static |
Retrieve inputs names.
Definition at line 1870 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 1842 of file OnnxParser.cpp.
References CHECK_LOCATION, and armnnDeserializer::ToTensorInfo().
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 1856 of file OnnxParser.cpp.
References CHECK_LOCATION, and armnnDeserializer::ToTensorInfo().
|
static |
Retrieve outputs names.
Definition at line 1894 of file OnnxParser.cpp.
References CHECK_LOCATION.
Referenced by TEST_SUITE().
|
static |
Retrieve version in X.Y.Z form.
Definition at line 1909 of file OnnxParser.cpp.
References ONNX_PARSER_VERSION.
|
static |
Definition at line 603 of file OnnxParser.cpp.
References CHECK_LOCATION, and armnn::error.
Referenced by OnnxParserImpl::CreateNetworkFromBinaryFile().
|
static |
Definition at line 638 of file OnnxParser.cpp.
References CHECK_LOCATION, and armnn::error.
Referenced by OnnxParserImpl::CreateNetworkFromString(), and TEST_SUITE().
|
static |
Definition at line 570 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 433 of file OnnxParser.cpp.