aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/optimizations/OptimizeInversePermutes.hpp
diff options
context:
space:
mode:
authorJim Flynn <jim.flynn@arm.com>2020-03-19 17:03:14 +0000
committerJim Flynn <jim.flynn@arm.com>2020-03-19 17:03:14 +0000
commit0e2bab81442ee6cc2b94e4f7881ed0c5c6af65e7 (patch)
treeb0af08b5a0b74149fca422151127ac6310385399 /src/armnn/optimizations/OptimizeInversePermutes.hpp
parent8c3259fa007d43fcc5ea56fe6928526dbe79f3c0 (diff)
downloadarmnn-0e2bab81442ee6cc2b94e4f7881ed0c5c6af65e7.tar.gz
Creating gh-pages documentation for ArmNN
Signed-off-by: Jim Flynn <jim.flynn@arm.com>
Diffstat (limited to 'src/armnn/optimizations/OptimizeInversePermutes.hpp')
-rw-r--r--src/armnn/optimizations/OptimizeInversePermutes.hpp43
1 files changed, 0 insertions, 43 deletions
diff --git a/src/armnn/optimizations/OptimizeInversePermutes.hpp b/src/armnn/optimizations/OptimizeInversePermutes.hpp
deleted file mode 100644
index 48bfa35440..0000000000
--- a/src/armnn/optimizations/OptimizeInversePermutes.hpp
+++ /dev/null
@@ -1,43 +0,0 @@
-//
-// Copyright © 2017 Arm Ltd. All rights reserved.
-// SPDX-License-Identifier: MIT
-//
-#pragma once
-
-#include "Optimization.hpp"
-
-#include <boost/core/ignore_unused.hpp>
-
-namespace armnn
-{
-namespace optimizations
-{
-
-class OptimizeInversePermutesImpl
-{
-public:
- /// Run for every connection between a base PermuteLayer and a child PermuteLayer.
- /// Bypasses both layers for that connection if one is the inverse of the other.
- void Run(Graph& graph, InputSlot& connection) const
- {
- boost::ignore_unused(graph);
- Layer& base = connection.GetConnectedOutputSlot()->GetOwningLayer();
- auto child = boost::polymorphic_downcast<PermuteLayer*>(&connection.GetOwningLayer());
-
- if (child->IsInverse(*boost::polymorphic_downcast<PermuteLayer*>(&base)))
- {
- // Bypass both layers. Child will be removed as it's left unconnected.
- // Base layer will be removed if left unconnected.
- child->GetOutputSlot().MoveAllConnections(*base.GetInputSlot(0).GetConnectedOutputSlot());
- }
- }
-
-protected:
- OptimizeInversePermutesImpl() = default;
- ~OptimizeInversePermutesImpl() = default;
-};
-
-using OptimizeInversePermutes = OptimizeForConnection<PermuteLayer, PermuteLayer, OptimizeInversePermutesImpl>;
-
-} // namespace optimizations
-} // namespace armnn