diff options
author | David Monahan <david.monahan@arm.com> | 2019-05-10 11:52:14 +0100 |
---|---|---|
committer | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-05-10 13:09:20 +0100 |
commit | 5200afa2742ad9cd1cda7fbce8604794c0616818 (patch) | |
tree | c12a889ebceff8618b672876a353ec13e5c4291d /src/armnn/SubgraphView.hpp | |
parent | afe78896447a90e065df6d9b1e8753bd85525750 (diff) | |
download | armnn-5200afa2742ad9cd1cda7fbce8604794c0616818.tar.gz |
IVGCVSW-3034 Updates to SubstituteSubGraph and
ReplaceSubgraphConnections to support Graphs instead of
SubGraphViews
* Added layer iteration function to SubgraphView similar to
the Graph's one
* Updated SubstituteSubgraph to reparent the layers to the
calling graph
Signed-off-by: David Monahan <david.monahan@arm.com>
Change-Id: Ib2f8e70decca4a59c53ceb127e07ef5a430d1005
Diffstat (limited to 'src/armnn/SubgraphView.hpp')
-rw-r--r-- | src/armnn/SubgraphView.hpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/armnn/SubgraphView.hpp b/src/armnn/SubgraphView.hpp index d86f1c1c93..f29e0a18ae 100644 --- a/src/armnn/SubgraphView.hpp +++ b/src/armnn/SubgraphView.hpp @@ -23,6 +23,17 @@ namespace armnn class SubgraphView final { public: + template <typename Func> + void ForEachLayer(Func func) const + { + for (auto it = m_Layers.begin(); it != m_Layers.end(); ) + { + auto next = std::next(it); + func(*it); + it = next; + } + } + using SubgraphViewPtr = std::unique_ptr<SubgraphView>; using InputSlots = std::vector<InputSlot*>; using OutputSlots = std::vector<OutputSlot*>; |