// // Copyright © 2017 Arm Ltd. All rights reserved. // SPDX-License-Identifier: MIT // #include "DebugLayer.hpp" #include "LayerCloneBase.hpp" #include #include namespace armnn { DebugLayer::DebugLayer(const DebugDescriptor& param, const char* name) : LayerWithParameters(1, 1, LayerType::Debug, param, name) {} std::unique_ptr DebugLayer::CreateWorkload(const Graph& graph, const IWorkloadFactory& factory) const { DebugQueueDescriptor descriptor; descriptor.m_Parameters.m_LayerName = m_Param.m_LayerName; descriptor.m_Parameters.m_SlotIndex = m_Param.m_SlotIndex; return factory.CreateDebug(descriptor, PrepInfoAndDesc(descriptor, graph)); } DebugLayer* DebugLayer::Clone(Graph& graph) const { return CloneBase(graph, m_Param, GetName()); } void DebugLayer::ValidateTensorShapesFromInputs() { VerifyLayerConnections(1, CHECK_LOCATION()); std::vector inferredShapes = InferOutputShapes({ GetInputSlot(0).GetConnection()->GetTensorInfo().GetShape() }); BOOST_ASSERT(inferredShapes.size() == 1); ConditionalThrowIfNotEqual( "DebugLayer: TensorShape set on OutputSlot[0] does not match the inferred shape.", GetOutputSlot(0).GetTensorInfo().GetShape(), inferredShapes[0]); } void DebugLayer::Accept(ILayerVisitor& visitor) const { // by design debug layers are never in input graphs throw armnn::Exception("DebugLayer should never appear in an input graph"); } } // namespace armnn