ArmNN
 24.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
ARMNN_ASSERT
#define ARMNN_ASSERT(COND)
Definition: Assert.hpp:14
armnn::InputSlot::GetOwningLayer
Layer & GetOwningLayer() const
Definition: Layer.hpp:53
armnn::LayerType::ConvertFp16ToFp32
@ ConvertFp16ToFp32
armnn::Layer::GetOutputSlot
const OutputSlot & GetOutputSlot(unsigned int index=0) const override
Get the const output slot handle by slot index.
Definition: Layer.hpp:339
IgnoreUnused.hpp
Optimization.hpp
armnn::Layer::GetInputSlot
const InputSlot & GetInputSlot(unsigned int index) const override
Get a const input slot handle by slot index.
Definition: Layer.hpp:337
armnn::optimizations::OptimizeInverseConversionsFp16
OptimizeForConnection< ConvertFp16ToFp32Layer, ConvertFp32ToFp16Layer, OptimizeInverseConversionsImpl > OptimizeInverseConversionsFp16
Definition: OptimizeInverseConversions.hpp:42
armnn::LayerType::ConvertFp32ToFp16
@ ConvertFp32ToFp16
armnn::Layer
Definition: Layer.hpp:230
armnn::optimizations::OptimizeInverseConversionsImpl
Definition: OptimizeInverseConversions.hpp:16
armnn::OutputSlot::GetOwningLayer
Layer & GetOwningLayer() const
Definition: Layer.hpp:132
armnn::optimizations::OptimizeInverseConversionsImpl::~OptimizeInverseConversionsImpl
~OptimizeInverseConversionsImpl()=default
armnn::OptimizeForConnection
Definition: Optimization.hpp:118
armnn::OutputSlot::MoveAllConnections
void MoveAllConnections(OutputSlot &destination)
Moves all connections to another OutputSlot.
Definition: Layer.cpp:145
armnn::optimizations::OptimizeInverseConversionsImpl::OptimizeInverseConversionsImpl
OptimizeInverseConversionsImpl()=default
armnn::InputSlot
Definition: Layer.hpp:42
armnn::Layer::GetType
LayerType GetType() const override
Returns the armnn::LayerType of this layer.
Definition: Layer.hpp:286
armnn::IgnoreUnused
void IgnoreUnused(Ts &&...)
Definition: IgnoreUnused.hpp:14
armnn::InputSlot::GetConnectedOutputSlot
const OutputSlot * GetConnectedOutputSlot() const
Definition: Layer.hpp:56
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
armnn::Graph
Definition: Graph.hpp:30
armnn::optimizations::OptimizeInverseConversionsImpl::Run
void Run(Graph &graph, InputSlot &connection) const
Run for every connection between two inverse data type conversion layers, i.e.
Definition: OptimizeInverseConversions.hpp:21