ArmNN
 22.11
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
Copyright (c) 2021 ARM Limited and Contributors.
std::vector< DebugLayer * > InsertDebugLayerAfter(Graph &graph, Layer &layer, bool toFile)
void Run(Graph &graph, Layer &layer) const
Definition: AddDebug.hpp:38
LayerType GetType() const override
Returns the armnn::LayerType of this layer.
Definition: Layer.hpp:273
void Run(Graph &graph, Layer &layer) const
Definition: AddDebug.hpp:19