ArmNN
 21.02
OptimizeInverseConversions.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 #pragma once
6 
7 #include "Optimization.hpp"
8 
10 
11 namespace armnn
12 {
13 namespace optimizations
14 {
15 
17 {
18 public:
19  /// Run for every connection between two inverse data type conversion layers, i.e.
20  /// Fp16ToFp32 followed by Fp32ToFp16 or vice-versa.
21  void Run(Graph& graph, InputSlot& connection) const
22  {
23  IgnoreUnused(graph);
24  Layer& base = connection.GetConnectedOutputSlot()->GetOwningLayer();
25  Layer& child = connection.GetOwningLayer();
26 
31 
32  // Bypass both conversion layers
34  }
35 
36 protected:
39 };
40 
45 
46 } // namespace optimizations
47 } // namespace armnn
void Run(Graph &graph, InputSlot &connection) const
Run for every connection between two inverse data type conversion layers, i.e.
Layer & GetOwningLayer() const
Definition: Layer.hpp:115
Copyright (c) 2021 ARM Limited and Contributors.
void IgnoreUnused(Ts &&...)
const InputSlot & GetInputSlot(unsigned int index) const override
Get a const input slot handle by slot index.
Definition: Layer.hpp:316
LayerType GetType() const override
Returns the armnn::LayerType of this layer.
Definition: Layer.hpp:265
#define ARMNN_ASSERT(COND)
Definition: Assert.hpp:14
const OutputSlot * GetConnectedOutputSlot() const
Definition: Layer.hpp:55
Layer & GetOwningLayer() const
Definition: Layer.hpp:52
const OutputSlot & GetOutputSlot(unsigned int index=0) const override
Get the const output slot handle by slot index.
Definition: Layer.hpp:318
void MoveAllConnections(OutputSlot &destination)
Moves all connections to another OutputSlot.
Definition: Layer.cpp:116