From cbfd718464b8ac41f0338ae6565d8213d24c0a2a Mon Sep 17 00:00:00 2001 From: Cathal Corbett Date: Wed, 15 Dec 2021 17:12:59 +0000 Subject: IVGCVSW-6632 OptimizationViews: has INetwork rather than Graph for holding layers * Deprecate the GetGraph() function in OptimizationViews & remove/fix occurances where OptimizationViews.GetGraph() is called. * OptimizationViews has member INetworkPtr. * OptimizationViews has GetINetwork() method. * Unit test added to OptimizationViewsTests.cpp. Signed-off-by: Cathal Corbett Change-Id: Ifc1e53f1c34d786502279631942f0472f401038e --- include/armnn/INetwork.hpp | 3 ++- include/armnn/backends/OptimizationViews.hpp | 8 ++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/armnn/INetwork.hpp b/include/armnn/INetwork.hpp index 4da01a62db..3e607256ec 100644 --- a/include/armnn/INetwork.hpp +++ b/include/armnn/INetwork.hpp @@ -424,7 +424,8 @@ public: /// @return - Interface for configuring the layer. IConnectableLayer* AddPrecompiledLayer(const PreCompiledDescriptor& preCompiledDescriptor, CompiledBlobPtr& compiledBlobPtr, - const Optional& backend); + const Optional& backend, + const char* name = nullptr); /// Adds an activation layer to the network. /// @param activationDescriptor - ActivationDescriptor to configure the activation. diff --git a/include/armnn/backends/OptimizationViews.hpp b/include/armnn/backends/OptimizationViews.hpp index c357c0c8bb..f3479febd3 100644 --- a/include/armnn/backends/OptimizationViews.hpp +++ b/include/armnn/backends/OptimizationViews.hpp @@ -56,8 +56,11 @@ public: bool Validate(const SubgraphView& originalSubgraph) const; + ARMNN_DEPRECATED_MSG_REMOVAL_DATE("GetGraph is deprecated. Use GetINetwork instead.", "22.08") Graph& GetGraph() { return m_Graph; } + INetworkPtr& GetINetwork() { return m_INetwork; } + private: Substitutions m_SuccesfulOptimizations; ///< Proposed substitutions from successful optimizations Subgraphs m_FailedOptimizations; ///< Subgraphs from the original subgraph which cannot be supported @@ -65,6 +68,11 @@ private: /// Graph object used only as a container for any layer generated by the optimization process Graph m_Graph; + + /// INetworkPtr object used only as a container for any layer generated by the optimization process + /// Also, can use to AddPrecompiledLayer to the SubstitutionPair + /// Use in favour of m_Graph which depreciates 22.08 + INetworkPtr m_INetwork = INetwork::Create();; }; } //namespace armnn -- cgit v1.2.1