aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Hughes <robert.hughes@arm.com>2019-07-23 15:33:39 +0100
committerRob Hughes <robert.hughes@arm.com>2019-07-23 15:58:18 +0100
commit65c32264d02c5f01fd5bd2b1549ef5b61a905bd9 (patch)
tree9fd05035fac8cfc72b73834824d47dee851682bc
parent588973fa6f68660b2cdc0704bb452984b32e16fd (diff)
downloadarmnn-65c32264d02c5f01fd5bd2b1549ef5b61a905bd9.tar.gz
NNXSW-1697 Remove use of SubgraphView that may become invalid.
The mainSubgraph variable held references to layers in the optimised graph that become invalid when a graph substitution is made. The fix is to always use the optimised graph itself rather than a view of it. The view served no purpose anyway. Change-Id: Iad75f5829597ec43a774cfd7f2e5e7dede09dfa4
-rw-r--r--src/armnn/Network.cpp5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/armnn/Network.cpp b/src/armnn/Network.cpp
index 6707cc7a26..a43800827f 100644
--- a/src/armnn/Network.cpp
+++ b/src/armnn/Network.cpp
@@ -346,9 +346,6 @@ OptimizationResult ApplyBackendOptimizations(OptimizedNetwork* optNetObjPtr,
// Get the optimized graph
Graph& optGraph = optNetObjPtr->GetGraph();
- // Get the entire graph as a sub-graph
- SubgraphView mainSubgraph(optGraph);
-
// Run backend specific optimizations
for (auto&& selectedBackend : backendSettings.m_SelectedBackends)
{
@@ -357,7 +354,7 @@ OptimizationResult ApplyBackendOptimizations(OptimizedNetwork* optNetObjPtr,
// Select sub-graphs based on backend
SubgraphViewSelector::Subgraphs subgraphs =
- SubgraphViewSelector::SelectSubgraphs(mainSubgraph,
+ SubgraphViewSelector::SelectSubgraphs(optGraph,
// Select layers assigned to the requested backend
[&backendObjPtr](const Layer& layer)
{