24.02
|
#include <TfLiteParser.hpp>
Public Types | |
using | ModelPtr = std::unique_ptr< tflite::ModelT > |
using | SubgraphPtr = std::unique_ptr< tflite::SubGraphT > |
using | OperatorPtr = std::unique_ptr< tflite::OperatorT > |
using | OperatorCodePtr = std::unique_ptr< tflite::OperatorCodeT > |
using | TensorPtr = std::unique_ptr< tflite::TensorT > |
using | TensorRawPtr = const tflite::TensorT * |
using | TensorRawPtrVector = std::vector< TensorRawPtr > |
using | TensorIdRawPtr = std::pair< size_t, TensorRawPtr > |
using | TensorIdRawPtrVector = std::vector< TensorIdRawPtr > |
using | BufferPtr = std::unique_ptr< tflite::BufferT > |
using | BufferRawPtr = const tflite::BufferT * |
Public Member Functions | |
armnn::INetworkPtr | CreateNetworkFromBinaryFile (const char *graphFile) |
Create the network from a flatbuffers binary file on disk. More... | |
armnn::INetworkPtr | CreateNetworkFromBinary (const std::vector< uint8_t > &binaryContent) |
Create the network from a flatbuffers binary. More... | |
BindingPointInfo | GetNetworkInputBindingInfo (size_t subgraphId, const std::string &name) const |
Retrieve binding info (layer id and tensor info) for the network input identified by the given layer name and subgraph id. More... | |
BindingPointInfo | GetNetworkOutputBindingInfo (size_t subgraphId, const std::string &name) const |
Retrieve binding info (layer id and tensor info) for the network output identified by the given layer name and subgraph id. More... | |
size_t | GetSubgraphCount () const |
Return the number of subgraphs in the parsed model. More... | |
std::vector< std::string > | GetSubgraphInputTensorNames (size_t subgraphId) const |
Return the input tensor names for a given subgraph. More... | |
std::vector< std::string > | GetSubgraphOutputTensorNames (size_t subgraphId) const |
Return the output tensor names for a given subgraph. More... | |
TfLiteParserImpl (const armnn::Optional< ITfLiteParser::TfLiteParserOptions > &options=armnn::EmptyOptional()) | |
~TfLiteParserImpl ()=default | |
armnn::INetworkPtr | CreateNetworkFromBinaryAsDynamic (const std::vector< uint8_t > &binaryContent) |
armnn::INetworkPtr | LoadModel (std::unique_ptr< tflite::ModelT > model) |
Static Public Member Functions | |
static ModelPtr | LoadModelFromFile (const char *fileName) |
static ModelPtr | LoadModelFromBinary (const uint8_t *binaryContent, size_t len) |
static TensorRawPtrVector | GetInputs (const ModelPtr &model, size_t subgraphIndex, size_t operatorIndex) |
static TensorRawPtrVector | GetOutputs (const ModelPtr &model, size_t subgraphIndex, size_t operatorIndex) |
static TensorIdRawPtrVector | GetSubgraphInputs (const ModelPtr &model, size_t subgraphIndex) |
static TensorIdRawPtrVector | GetSubgraphOutputs (const ModelPtr &model, size_t subgraphIndex) |
static std::vector< int32_t > & | GetInputTensorIds (const ModelPtr &model, size_t subgraphIndex, size_t operatorIndex) |
static std::vector< int32_t > & | GetOutputTensorIds (const ModelPtr &model, size_t subgraphIndex, size_t operatorIndex) |
static BufferRawPtr | GetBuffer (const ModelPtr &model, size_t bufferIndex) |
static armnn::TensorInfo | OutputShapeOfSqueeze (std::vector< uint32_t > squeezeDims, const armnn::TensorInfo &inputTensorInfo) |
static armnn::TensorInfo | OutputShapeOfReshape (const armnn::TensorInfo &inputTensorInfo, const std::vector< int32_t > &targetDimsIn) |
static const std::string | GetVersion () |
Retrieve version in X.Y.Z form. More... | |
Definition at line 26 of file TfLiteParser.hpp.
using BufferPtr = std::unique_ptr<tflite::BufferT> |
Definition at line 39 of file TfLiteParser.hpp.
using BufferRawPtr = const tflite::BufferT * |
Definition at line 40 of file TfLiteParser.hpp.
using ModelPtr = std::unique_ptr<tflite::ModelT> |
Definition at line 30 of file TfLiteParser.hpp.
using OperatorCodePtr = std::unique_ptr<tflite::OperatorCodeT> |
Definition at line 33 of file TfLiteParser.hpp.
using OperatorPtr = std::unique_ptr<tflite::OperatorT> |
Definition at line 32 of file TfLiteParser.hpp.
using SubgraphPtr = std::unique_ptr<tflite::SubGraphT> |
Definition at line 31 of file TfLiteParser.hpp.
using TensorIdRawPtr = std::pair<size_t, TensorRawPtr> |
Definition at line 37 of file TfLiteParser.hpp.
using TensorIdRawPtrVector = std::vector<TensorIdRawPtr> |
Definition at line 38 of file TfLiteParser.hpp.
using TensorPtr = std::unique_ptr<tflite::TensorT> |
Definition at line 34 of file TfLiteParser.hpp.
using TensorRawPtr = const tflite::TensorT * |
Definition at line 35 of file TfLiteParser.hpp.
using TensorRawPtrVector = std::vector<TensorRawPtr> |
Definition at line 36 of file TfLiteParser.hpp.
TfLiteParserImpl | ( | const armnn::Optional< ITfLiteParser::TfLiteParserOptions > & | options = armnn::EmptyOptional() | ) |
Definition at line 740 of file TfLiteParser.cpp.
|
default |
INetworkPtr CreateNetworkFromBinary | ( | const std::vector< uint8_t > & | binaryContent | ) |
Create the network from a flatbuffers binary.
Definition at line 959 of file TfLiteParser.cpp.
References TfLiteParserImpl::LoadModelFromBinary().
armnn::INetworkPtr CreateNetworkFromBinaryAsDynamic | ( | const std::vector< uint8_t > & | binaryContent | ) |
INetworkPtr CreateNetworkFromBinaryFile | ( | const char * | graphFile | ) |
Create the network from a flatbuffers binary file on disk.
Definition at line 952 of file TfLiteParser.cpp.
References TfLiteParserImpl::LoadModelFromFile().
|
static |
Definition at line 5714 of file TfLiteParser.cpp.
References CHECK_BUFFER.
|
static |
|
static |
BindingPointInfo GetNetworkInputBindingInfo | ( | size_t | subgraphId, |
const std::string & | name | ||
) | const |
Retrieve binding info (layer id and tensor info) for the network input identified by the given layer name and subgraph id.
Definition at line 5892 of file TfLiteParser.cpp.
References CHECK_LOCATION, CHECK_SUBGRAPH, TfLiteParserImpl::GetSubgraphInputs(), TensorInfo::SetConstant(), and armnnDeserializer::ToTensorInfo().
BindingPointInfo GetNetworkOutputBindingInfo | ( | size_t | subgraphId, |
const std::string & | name | ||
) | const |
Retrieve binding info (layer id and tensor info) for the network output identified by the given layer name and subgraph id.
Definition at line 5924 of file TfLiteParser.cpp.
References CHECK_LOCATION, CHECK_SUBGRAPH, TfLiteParserImpl::GetSubgraphOutputs(), and armnnDeserializer::ToTensorInfo().
|
static |
Definition at line 5429 of file TfLiteParser.cpp.
References CHECK_MODEL, CHECK_TENSOR, and CHECKED_NON_NEGATIVE.
|
static |
size_t GetSubgraphCount | ( | ) | const |
Return the number of subgraphs in the parsed model.
Definition at line 5956 of file TfLiteParser.cpp.
|
static |
Definition at line 5449 of file TfLiteParser.cpp.
References CHECK_SUBGRAPH, CHECK_TENSOR, and CHECKED_NON_NEGATIVE.
Referenced by TfLiteParserImpl::GetNetworkInputBindingInfo(), and TfLiteParserImpl::GetSubgraphInputTensorNames().
std::vector< std::string > GetSubgraphInputTensorNames | ( | size_t | subgraphId | ) | const |
Return the input tensor names for a given subgraph.
Definition at line 5961 of file TfLiteParser.cpp.
References CHECK_SUBGRAPH, and TfLiteParserImpl::GetSubgraphInputs().
|
static |
Definition at line 5466 of file TfLiteParser.cpp.
References CHECK_SUBGRAPH, and CHECKED_NON_NEGATIVE.
Referenced by TfLiteParserImpl::GetNetworkOutputBindingInfo(), and TfLiteParserImpl::GetSubgraphOutputTensorNames().
std::vector< std::string > GetSubgraphOutputTensorNames | ( | size_t | subgraphId | ) | const |
Return the output tensor names for a given subgraph.
Definition at line 5974 of file TfLiteParser.cpp.
References CHECK_SUBGRAPH, and TfLiteParserImpl::GetSubgraphOutputs().
|
static |
Retrieve version in X.Y.Z form.
Definition at line 5987 of file TfLiteParser.cpp.
References TFLITE_PARSER_VERSION.
armnn::INetworkPtr LoadModel | ( | std::unique_ptr< tflite::ModelT > | model | ) |
Definition at line 967 of file TfLiteParser.cpp.
|
static |
Definition at line 5383 of file TfLiteParser.cpp.
References CHECK_LOCATION.
Referenced by TfLiteParserImpl::CreateNetworkFromBinary(), and TfLiteParserImpl::LoadModelFromFile().
|
static |
Definition at line 5353 of file TfLiteParser.cpp.
References CHECK_LOCATION, and TfLiteParserImpl::LoadModelFromBinary().
Referenced by TfLiteParserImpl::CreateNetworkFromBinaryFile().
|
static |
Definition at line 3262 of file TfLiteParser.cpp.
References CHECK_LOCATION, TensorInfo::GetNumElements(), and TensorInfo::SetShape().
|
static |
Definition at line 2381 of file TfLiteParser.cpp.
References CHECK_LOCATION, CHECK_VALID_SIZE, TensorInfo::GetNumDimensions(), TensorInfo::GetShape(), and TensorInfo::SetShape().