20.11
|
#include <OnnxParser.hpp>
Public Types | |
using | GraphPtr = std::unique_ptr< onnx::GraphProto > |
Public Member Functions | |
virtual armnn::INetworkPtr | CreateNetworkFromBinaryFile (const char *graphFile) override |
Create the network from a protobuf binary file on disk. More... | |
virtual armnn::INetworkPtr | CreateNetworkFromTextFile (const char *graphFile) override |
Create the network from a protobuf text file on disk. More... | |
virtual armnn::INetworkPtr | CreateNetworkFromString (const std::string &protoText) override |
Create the network directly from protobuf text in a string. Useful for debugging/testing. More... | |
virtual BindingPointInfo | GetNetworkInputBindingInfo (const std::string &name) const override |
Retrieve binding info (layer id and tensor info) for the network input identified by the given layer name. More... | |
virtual BindingPointInfo | GetNetworkOutputBindingInfo (const std::string &name) const override |
Retrieve binding info (layer id and tensor info) for the network output identified by the given layer name. More... | |
OnnxParser () | |
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 IOnnxParser * | CreateRaw () |
static IOnnxParserPtr | Create () |
static void | Destroy (IOnnxParser *parser) |
Additional Inherited Members | |
![]() | |
virtual | ~IOnnxParser () |
Definition at line 25 of file OnnxParser.hpp.
using GraphPtr = std::unique_ptr<onnx::GraphProto> |
Definition at line 32 of file OnnxParser.hpp.
OnnxParser | ( | ) |
Definition at line 445 of file OnnxParser.cpp.
References CHECK_LOCATION, TensorInfo::GetNumBytes(), and TensorInfo::GetNumElements().
|
overridevirtual |
Create the network from a protobuf binary file on disk.
Implements IOnnxParser.
Definition at line 563 of file OnnxParser.cpp.
References OnnxParser::LoadModelFromBinaryFile().
|
overridevirtual |
Create the network directly from protobuf text in a string. Useful for debugging/testing.
Implements IOnnxParser.
Definition at line 589 of file OnnxParser.cpp.
References ARMNN_ASSERT, armnnTfParser::CalcPadding(), CHECK_LOCATION, CHECK_VALID_DATATYPE, CHECK_VALID_SIZE, CHECKED_INT32, IConnectableLayer::GetInputSlot(), TensorShape::GetNumDimensions(), IConnectableLayer::GetNumInputSlots(), IConnectableLayer::GetNumOutputSlots(), IConnectableLayer::GetOutputSlot(), TensorInfo::GetShape(), OnnxParser::LoadModelFromString(), ActivationDescriptor::m_A, ActivationDescriptor::m_B, FullyConnectedDescriptor::m_BiasEnabled, Convolution2dDescriptor::m_BiasEnabled, 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::SetShape(), IOutputSlot::SetTensorInfo(), STR_LIST, armnnDeserializer::ToTensorInfo(), and VALID_INPUTS.
|
overridevirtual |
Create the network from a protobuf text file on disk.
Implements IOnnxParser.
Definition at line 527 of file OnnxParser.cpp.
References OnnxParser::LoadModelFromTextFile().
|
static |
Retrieve inputs names.
Definition at line 1765 of file OnnxParser.cpp.
References CHECK_LOCATION.
Referenced by BOOST_FIXTURE_TEST_CASE().
|
overridevirtual |
Retrieve binding info (layer id and tensor info) for the network input identified by the given layer name.
Implements IOnnxParser.
Definition at line 1737 of file OnnxParser.cpp.
References CHECK_LOCATION, and armnnDeserializer::ToTensorInfo().
|
overridevirtual |
Retrieve binding info (layer id and tensor info) for the network output identified by the given layer name.
Implements IOnnxParser.
Definition at line 1751 of file OnnxParser.cpp.
References CHECK_LOCATION, and armnnDeserializer::ToTensorInfo().
|
static |
Retrieve outputs names.
Definition at line 1789 of file OnnxParser.cpp.
References CHECK_LOCATION.
Referenced by BOOST_FIXTURE_TEST_CASE().
|
static |
Definition at line 535 of file OnnxParser.cpp.
References CHECK_LOCATION, and armnn::error.
Referenced by OnnxParser::CreateNetworkFromBinaryFile().
|
static |
Definition at line 570 of file OnnxParser.cpp.
References CHECK_LOCATION, and armnn::error.
Referenced by BOOST_AUTO_TEST_CASE(), BOOST_FIXTURE_TEST_CASE(), and OnnxParser::CreateNetworkFromString().
|
static |
Definition at line 502 of file OnnxParser.cpp.
References CHECK_LOCATION, and armnn::error.
Referenced by OnnxParser::CreateNetworkFromTextFile().
void ValidateInputs | ( | const onnx::NodeProto & | node, |
TypePair | validInputs, | ||
const Location & | location | ||
) |
Definition at line 378 of file OnnxParser.cpp.