diff options
Diffstat (limited to 'src/backends/reference/RefBackend.cpp')
-rw-r--r-- | src/backends/reference/RefBackend.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/backends/reference/RefBackend.cpp b/src/backends/reference/RefBackend.cpp index 8c8879c8be..02749af1f9 100644 --- a/src/backends/reference/RefBackend.cpp +++ b/src/backends/reference/RefBackend.cpp @@ -1,5 +1,5 @@ // -// Copyright © 2022 Arm Ltd and Contributors. All rights reserved. +// Copyright © 2022-2023 Arm Ltd and Contributors. All rights reserved. // SPDX-License-Identifier: MIT // @@ -16,8 +16,6 @@ #include <backendsCommon/DefaultAllocator.hpp> #include <backendsCommon/SubgraphUtils.hpp> -#include <Optimizer.hpp> - namespace armnn { @@ -116,9 +114,16 @@ OptimizationViews RefBackend::OptimizeSubgraphView(const SubgraphView& subgraph, } } } + + // Remove Reshape where possible + if (base.GetType() == LayerType::Reshape) + { + ReshapeLayer* baseLayer = PolymorphicDowncast<ReshapeLayer*>(&base); + RemoveReshapeLayer(baseLayer, untouched, optimizationViews); + } } - if (optimizationViews.GetSubstitutions().empty()) + if (optimizationViews.GetSubstitutions().empty() && optimizationViews.GetDeletedSubgraphs().empty()) { optimizationViews.AddUntouchedSubgraph(SubgraphView(subgraph)); } |