ArmNN
 25.11
Loading...
Searching...
No Matches
AddDebug.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#include "NetworkUtils.hpp"
9
10namespace armnn
11{
12namespace optimizations
13{
14
16{
17public:
18
19 void Run(Graph& graph, Layer& layer) const
20 {
21 if (layer.GetType() != LayerType::Debug && layer.GetType() != LayerType::Output)
22 {
23 // if the inputs/outputs of this layer do not have a debug layer
24 // insert the debug layer after them
25 InsertDebugLayerAfter(graph, layer, false);
26 }
27 }
28
29protected:
30 AddDebugImpl() = default;
31 ~AddDebugImpl() = default;
32};
33
35{
36public:
37
38 void Run(Graph& graph, Layer& layer) const
39 {
40 if (layer.GetType() != LayerType::Debug && layer.GetType() != LayerType::Output)
41 {
42 // if the inputs/outputs of this layer do not have a debug layer
43 // insert the debug layer after them
44 InsertDebugLayerAfter(graph, layer, true);
45 }
46 }
47
48protected:
49 AddDebugToFileImpl() = default;
51};
52
55
56} // namespace optimizations
57} // namespace armnn
LayerType GetType() const override
Returns the armnn::LayerType of this layer.
Definition Layer.hpp:286
void Run(Graph &graph, Layer &layer) const
Definition AddDebug.hpp:19
void Run(Graph &graph, Layer &layer) const
Definition AddDebug.hpp:38
OptimizeForType< Layer, AddDebugToFileImpl > InsertDebugToFileLayer
Definition AddDebug.hpp:54
OptimizeForType< Layer, AddDebugImpl > InsertDebugLayer
Definition AddDebug.hpp:53
Copyright (c) 2021 ARM Limited and Contributors.
std::vector< DebugLayer * > InsertDebugLayerAfter(Graph &graph, Layer &layer, bool toFile)