From 602af090a6b7285dc1041e3d8424836e5fa12cef Mon Sep 17 00:00:00 2001 From: Matteo Martincigh Date: Wed, 1 May 2019 10:31:27 +0100 Subject: IVGCVSW-3029 Remove any AddLayer capabilities from SubgraphView * Removed the reference to the parent graph in SubgraphView * Removed the AddLayer method in SubgraphView * Updated the code where necessary to adapt to the new changes in SubgraphView * Fixed a check in the CreatePreCompiledWorkloadTest test function Change-Id: I4d3af87f11ec3cd8f18a21b250a2d295da56e1a0 Signed-off-by: Matteo Martincigh --- src/armnn/SubgraphView.hpp | 36 +++++------------------------------- 1 file changed, 5 insertions(+), 31 deletions(-) (limited to 'src/armnn/SubgraphView.hpp') diff --git a/src/armnn/SubgraphView.hpp b/src/armnn/SubgraphView.hpp index b211ad4046..d4d92bbf6c 100644 --- a/src/armnn/SubgraphView.hpp +++ b/src/armnn/SubgraphView.hpp @@ -17,7 +17,7 @@ namespace armnn /// /// The SubgraphView class represents a subgraph of a Graph. /// The data it holds, points to data held by layers of the Graph, so the -/// the contents of the SubgraphView becomes invalid when the Layers are destroyed +/// the contents of the SubgraphView become invalid when the Layers are destroyed /// or changed. /// class SubgraphView final @@ -30,18 +30,11 @@ public: using Iterator = Layers::iterator; using ConstIterator = Layers::const_iterator; - /// Empty subgraphs are not allowed, they must at least have a parent graph. - SubgraphView() = delete; - /// Constructs a sub-graph from the entire given graph. SubgraphView(Graph& graph); - /// Constructs a sub-graph with the given arguments and binds it to the specified parent graph. - SubgraphView(Graph* parentGraph, InputSlots&& inputs, OutputSlots&& outputs, Layers&& layers); - - /// Constructs a sub-graph with the given arguments and uses the specified sub-graph to get a reference - /// to the parent graph. - SubgraphView(const SubgraphView& referenceSubgraph, InputSlots&& inputs, OutputSlots&& outputs, Layers&& layers); + /// Constructs a sub-graph with the given arguments. + SubgraphView(InputSlots&& inputs, OutputSlots&& outputs, Layers&& layers); /// Copy-constructor. SubgraphView(const SubgraphView& subgraph); @@ -49,16 +42,8 @@ public: /// Move-constructor. SubgraphView(SubgraphView&& subgraph); - /// Constructs a sub-graph with only the given layer and uses the specified sub-graph to get a reference - /// to the parent graph. - SubgraphView(const SubgraphView& referenceSubgraph, IConnectableLayer* layer); - - /// Updates this sub-graph with the contents of the whole given graph. - void Update(Graph& graph); - - /// Adds a new layer, of type LayerType, to the parent graph of this sub-graph. - template - LayerT* AddLayer(Args&&... args) const; + /// Constructs a sub-graph with only the given layer. + SubgraphView(IConnectableLayer* layer); const InputSlots& GetInputSlots() const; const OutputSlots& GetOutputSlots() const; @@ -93,17 +78,6 @@ private: /// The list of pointers to the layers of the parent graph. Layers m_Layers; - - /// Pointer to the graph this sub-graph is a view of. - Graph* m_ParentGraph; }; -template -LayerT* SubgraphView::AddLayer(Args&&... args) const -{ - BOOST_ASSERT(m_ParentGraph); - - return m_ParentGraph->AddLayer(args...); -} - } // namespace armnn -- cgit v1.2.1