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 15 class AddDebugImpl 16 { 17 public: 18 Run(Graph & graph,Layer & layer) const19 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); 26 } 27 } 28 29 protected: 30 AddDebugImpl() = default; 31 ~AddDebugImpl() = default; 32 }; 33 34 using InsertDebugLayer = OptimizeForType<Layer, AddDebugImpl>; 35 36 } // namespace optimizations 37 } // namespace armnn 38