diff options
author | Kevin May <kevin.may@arm.com> | 2021-02-03 17:38:41 +0000 |
---|---|---|
committer | Francis Murtagh <francis.murtagh@arm.com> | 2021-02-04 11:23:41 +0000 |
commit | 7d96b16acfdbdcef6739d59ba067a37c062aa03f (patch) | |
tree | bb0a93f9030e26568d6d7c44776993e433996c31 /src/armnnTfLiteParser/TfLiteParser.hpp | |
parent | d0bb8eafef2a93356e435ccc4029d487a2cde9e4 (diff) | |
download | armnn-7d96b16acfdbdcef6739d59ba067a37c062aa03f.tar.gz |
IVGCVSW-5592 Implement Pimpl Idiom for Tf and TfLite Parsers
Signed-off-by: Kevin May <kevin.may@arm.com>
Change-Id: I4a82aca4a2c47b3c598b91bc0075c09397be728a
Diffstat (limited to 'src/armnnTfLiteParser/TfLiteParser.hpp')
-rw-r--r-- | src/armnnTfLiteParser/TfLiteParser.hpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/armnnTfLiteParser/TfLiteParser.hpp b/src/armnnTfLiteParser/TfLiteParser.hpp index 5f180603f0..12a085d6ca 100644 --- a/src/armnnTfLiteParser/TfLiteParser.hpp +++ b/src/armnnTfLiteParser/TfLiteParser.hpp @@ -16,7 +16,7 @@ namespace armnnTfLiteParser { -class TfLiteParser : public ITfLiteParser +class TfLiteParserImpl { public: // Shorthands for TfLite types @@ -34,33 +34,33 @@ public: public: /// Create the network from a flatbuffers binary file on disk - virtual armnn::INetworkPtr CreateNetworkFromBinaryFile(const char* graphFile) override; + armnn::INetworkPtr CreateNetworkFromBinaryFile(const char* graphFile); /// Create the network from a flatbuffers binary - virtual armnn::INetworkPtr CreateNetworkFromBinary(const std::vector<uint8_t> & binaryContent) override; + armnn::INetworkPtr CreateNetworkFromBinary(const std::vector<uint8_t> & binaryContent); /// Retrieve binding info (layer id and tensor info) for the network input identified by /// the given layer name and subgraph id - virtual BindingPointInfo GetNetworkInputBindingInfo(size_t subgraphId, - const std::string& name) const override; + BindingPointInfo GetNetworkInputBindingInfo(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 - virtual BindingPointInfo GetNetworkOutputBindingInfo(size_t subgraphId, - const std::string& name) const override; + BindingPointInfo GetNetworkOutputBindingInfo(size_t subgraphId, + const std::string& name) const; /// Return the number of subgraphs in the parsed model - virtual size_t GetSubgraphCount() const override; + size_t GetSubgraphCount() const; /// Return the input tensor names for a given subgraph - virtual std::vector<std::string> GetSubgraphInputTensorNames(size_t subgraphId) const override; + std::vector<std::string> GetSubgraphInputTensorNames(size_t subgraphId) const; /// Return the output tensor names for a given subgraph - virtual std::vector<std::string> GetSubgraphOutputTensorNames(size_t subgraphId) const override; + std::vector<std::string> GetSubgraphOutputTensorNames(size_t subgraphId) const; - TfLiteParser(const armnn::Optional<ITfLiteParser::TfLiteParserOptions>& options = armnn::EmptyOptional()); - virtual ~TfLiteParser() {} + TfLiteParserImpl(const armnn::Optional<ITfLiteParser::TfLiteParserOptions>& options = armnn::EmptyOptional()); + ~TfLiteParserImpl() = default; public: // testable helpers @@ -81,14 +81,14 @@ public: private: // No copying allowed until it is wanted and properly implemented - TfLiteParser(const TfLiteParser &) = delete; - TfLiteParser & operator=(const TfLiteParser &) = delete; + TfLiteParserImpl(const TfLiteParserImpl &) = delete; + TfLiteParserImpl & operator=(const TfLiteParserImpl &) = delete; /// Create the network from an already loaded flatbuffers model armnn::INetworkPtr CreateNetworkFromModel(); // signature for the parser functions - using OperatorParsingFunction = void(TfLiteParser::*)(size_t subgraphIndex, size_t operatorIndex); + using OperatorParsingFunction = void(TfLiteParserImpl::*)(size_t subgraphIndex, size_t operatorIndex); void ParseCustomOperator(size_t subgraphIndex, size_t operatorIndex); void ParseUnsupportedOperator(size_t subgraphIndex, size_t operatorIndex); @@ -190,9 +190,9 @@ private: template<typename T> - std::pair<armnn::ConstTensor, TfLiteParser::SupportedDataStorage> - CreateConstTensorAndStoreData(TfLiteParser::BufferRawPtr bufferPtr, - TfLiteParser::TensorRawPtr tensorPtr, + std::pair<armnn::ConstTensor, TfLiteParserImpl::SupportedDataStorage> + CreateConstTensorAndStoreData(TfLiteParserImpl::BufferRawPtr bufferPtr, + TfLiteParserImpl::TensorRawPtr tensorPtr, armnn::TensorInfo& tensorInfo, armnn::Optional<armnn::PermutationVector&> permutationVector); |