ArmNN
 24.08
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 
10 namespace armnn
11 {
12 namespace optimizations
13 {
14 
16 {
17 public:
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 
29 protected:
30  AddDebugImpl() = default;
31  ~AddDebugImpl() = default;
32 };
33 
35 {
36 public:
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 
48 protected:
49  AddDebugToFileImpl() = default;
50  ~AddDebugToFileImpl() = default;
51 };
52 
55 
56 } // namespace optimizations
57 } // namespace armnn
armnn::optimizations::AddDebugToFileImpl
Definition: AddDebug.hpp:34
armnn::optimizations::AddDebugImpl
Definition: AddDebug.hpp:15
armnn::optimizations::AddDebugToFileImpl::AddDebugToFileImpl
AddDebugToFileImpl()=default
armnn::optimizations::AddDebugImpl::Run
void Run(Graph &graph, Layer &layer) const
Definition: AddDebug.hpp:19
armnn::optimizations::AddDebugToFileImpl::Run
void Run(Graph &graph, Layer &layer) const
Definition: AddDebug.hpp:38
armnn::optimizations::AddDebugImpl::~AddDebugImpl
~AddDebugImpl()=default
NetworkUtils.hpp
Optimization.hpp
armnn::Layer
Definition: Layer.hpp:230
armnn::LayerType::Debug
@ Debug
armnn::InsertDebugLayerAfter
std::vector< DebugLayer * > InsertDebugLayerAfter(Graph &graph, Layer &layer, bool toFile)
Definition: NetworkUtils.cpp:112
armnn::optimizations::AddDebugImpl::AddDebugImpl
AddDebugImpl()=default
armnn::OptimizeForType
Definition: Optimization.hpp:67
armnn::Layer::GetType
LayerType GetType() const override
Returns the armnn::LayerType of this layer.
Definition: Layer.hpp:286
armnn::optimizations::AddDebugToFileImpl::~AddDebugToFileImpl
~AddDebugToFileImpl()=default
armnn
Copyright (c) 2021 ARM Limited and Contributors.
Definition: 01_00_quick_start.dox:6
armnn::Graph
Definition: Graph.hpp:30
armnn::LayerType::Output
@ Output