2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
6 #include "PadLayer.hpp"
7 #include "LayerCloneBase.hpp"
9 #include "backends/CpuTensorHandle.hpp"
10 #include "backends/WorkloadData.hpp"
11 #include "backends/WorkloadFactory.hpp"
18 PadLayer::PadLayer(const armnn::PadDescriptor& param, const char* name)
19 : LayerWithParameters(1, 1, LayerType::Pad, param, name)
22 std::unique_ptr<IWorkload> PadLayer::CreateWorkload(const armnn::Graph& graph,
23 const armnn::IWorkloadFactory& factory) const
25 PadQueueDescriptor descriptor;
26 descriptor.m_Parameters.m_PadList = m_Param.m_PadList;
28 return factory.CreatePad(descriptor, PrepInfoAndDesc(descriptor, graph));
31 PadLayer* PadLayer::Clone(Graph& graph) const
33 auto layer = CloneBase<PadLayer>(graph, m_Param, GetName());
35 layer->m_Param.m_PadList = m_Param.m_PadList;
37 return std::move(layer);
40 void PadLayer::ValidateTensorShapesFromInputs()