diff options
author | Cathal Corbett <cathal.corbett@arm.com> | 2023-01-12 11:17:03 +0000 |
---|---|---|
committer | Cathal Corbett <cathal.corbett@arm.com> | 2023-01-12 11:18:21 +0000 |
commit | d69c1c595375b904a7f19f562ac1d54098184b4e (patch) | |
tree | b2c4980eb367aa160282aae5c2deda8ef19682de /include | |
parent | 267c985a6322fbc1efa22ba44188ac867537f1b1 (diff) | |
download | armnn-d69c1c595375b904a7f19f562ac1d54098184b4e.tar.gz |
Merge 'main' onto 'experimental/GpuFsa'.
* I6c71be11e9b73694747b27fe9febab8d9669b4d4
Signed-off-by: Cathal Corbett <cathal.corbett@arm.com>
Change-Id: Iccaf50e2484559979d801ee9d0e130e848554733
Diffstat (limited to 'include')
-rw-r--r-- | include/armnn/backends/OptimizationViews.hpp | 5 | ||||
-rw-r--r-- | include/armnnOnnxParser/IOnnxParser.hpp | 9 | ||||
-rw-r--r-- | include/armnnUtils/TensorUtils.hpp | 5 |
3 files changed, 16 insertions, 3 deletions
diff --git a/include/armnn/backends/OptimizationViews.hpp b/include/armnn/backends/OptimizationViews.hpp index 0357adaa27..59d71ca560 100644 --- a/include/armnn/backends/OptimizationViews.hpp +++ b/include/armnn/backends/OptimizationViews.hpp @@ -1,5 +1,5 @@ // -// Copyright © 2017 Arm Ltd. All rights reserved. +// Copyright © 2017, 2019, 2021-2022 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -64,7 +64,8 @@ public: ARMNN_DEPRECATED_MSG_REMOVAL_DATE("GetGraph is deprecated. Use GetINetwork instead.", "23.08") Graph& GetGraph() { return m_Graph; } - INetworkPtr& GetINetwork() { return m_INetwork; } + INetwork* GetINetwork() { return m_INetwork.get(); } + INetwork& GetINetworkRef() { return *m_INetwork; } private: Substitutions m_SuccesfulOptimizations; ///< Proposed substitutions from successful optimizations diff --git a/include/armnnOnnxParser/IOnnxParser.hpp b/include/armnnOnnxParser/IOnnxParser.hpp index ba7fc83f93..89c22c03de 100644 --- a/include/armnnOnnxParser/IOnnxParser.hpp +++ b/include/armnnOnnxParser/IOnnxParser.hpp @@ -1,5 +1,5 @@ // -// Copyright © 2017 Arm Ltd. All rights reserved. +// Copyright © 2017,2022 Arm Ltd. All rights reserved. // SPDX-License-Identifier: MIT // #pragma once @@ -27,6 +27,13 @@ public: static IOnnxParserPtr Create(); static void Destroy(IOnnxParser* parser); + /// Create the network from a protobuf binary vector + armnn::INetworkPtr CreateNetworkFromBinary(const std::vector<uint8_t>& binaryContent); + + /// Create the network from a protobuf binary vector, with inputShapes specified + armnn::INetworkPtr CreateNetworkFromBinary(const std::vector<uint8_t>& binaryContent, + const std::map<std::string, armnn::TensorShape>& inputShapes); + /// Create the network from a protobuf binary file on disk armnn::INetworkPtr CreateNetworkFromBinaryFile(const char* graphFile); diff --git a/include/armnnUtils/TensorUtils.hpp b/include/armnnUtils/TensorUtils.hpp index f7f20bd065..2d6ec2fea4 100644 --- a/include/armnnUtils/TensorUtils.hpp +++ b/include/armnnUtils/TensorUtils.hpp @@ -55,4 +55,9 @@ unsigned int GetNumElementsAfter(const armnn::TensorShape& shape, unsigned int a std::pair<unsigned int, std::vector<float>> GetPerAxisParams(const armnn::TensorInfo& info); +template<typename PrimitiveType> +std::unique_ptr<float[]> ToFloatArray(const std::vector<PrimitiveType>& data, const armnn::TensorInfo& tensorInfo); + +std::unique_ptr<float[]> ToFloatArray(const std::vector<uint8_t>& data, const armnn::TensorInfo& tensorInfo); + } // namespace armnnUtils |