ArmNN
 25.11
Loading...
Searching...
No Matches
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
11namespace armnn
12{
13namespace optimizations
14{
15
17{
18public:
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
36protected:
39};
40
45
46} // namespace optimizations
47} // namespace armnn
#define ARMNN_ASSERT(COND)
Definition Assert.hpp:14
Layer & GetOwningLayer() const
Definition Layer.hpp:53
const OutputSlot * GetConnectedOutputSlot() const
Definition Layer.hpp:56
const InputSlot & GetInputSlot(unsigned int index) const override
Get a const input slot handle by slot index.
Definition Layer.hpp:337
const OutputSlot & GetOutputSlot(unsigned int index=0) const override
Get the const output slot handle by slot index.
Definition Layer.hpp:339
LayerType GetType() const override
Returns the armnn::LayerType of this layer.
Definition Layer.hpp:286
void MoveAllConnections(OutputSlot &destination)
Moves all connections to another OutputSlot.
Definition Layer.cpp:156
Layer & GetOwningLayer() const
Definition Layer.hpp:132
void Run(Graph &graph, InputSlot &connection) const
Run for every connection between two inverse data type conversion layers, i.e.
OptimizeForConnection< ConvertFp16ToFp32Layer, ConvertFp32ToFp16Layer, OptimizeInverseConversionsImpl > OptimizeInverseConversionsFp16
OptimizeForConnection< ConvertFp32ToFp16Layer, ConvertFp16ToFp32Layer, OptimizeInverseConversionsImpl > OptimizeInverseConversionsFp32
Copyright (c) 2021 ARM Limited and Contributors.
void IgnoreUnused(Ts &&...)