19 #include <arm_compute/runtime/CL/functions/CLDepthwiseConvolutionLayer.h>
24 using namespace armcomputetensorutils;
33 const arm_compute::TensorInfo aclInputInfo = BuildArmComputeTensorInfo(input, descriptor.
m_DataLayout);
34 const arm_compute::TensorInfo aclOutputInfo = BuildArmComputeTensorInfo(output, descriptor.
m_DataLayout);
45 unsigned int aclDepthMultiplier;
50 arm_compute::TensorInfo aclWeightsInfo = BuildArmComputeTensorInfo(weightsPermuted, descriptor.
m_DataLayout);
51 aclWeightsInfo.set_are_values_constant(weights.
IsConstant());
53 arm_compute::TensorInfo aclBiasesInfo;
54 arm_compute::TensorInfo* optionalAclBiasesInfo =
nullptr;
60 "ArmNN ClDepthwiseConv2dWorkload has empty bias value."};
62 aclBiasesInfo = BuildArmComputeTensorInfo(biases.
value(), descriptor.
m_DataLayout);
63 aclBiasesInfo.set_are_values_constant(biases.
value().IsConstant());
64 optionalAclBiasesInfo = &aclBiasesInfo;
67 const arm_compute::PadStrideInfo aclPadStrideInfo = BuildArmComputePadStrideInfo(descriptor);
68 const arm_compute::Size2D aclDilationInfo = BuildArmComputeSize2D(
73 activationDescriptor);
75 return arm_compute::CLDepthwiseConvolutionLayer::validate(&aclInputInfo,
77 optionalAclBiasesInfo,
89 const arm_compute::CLCompileContext& clCompileContext)
94 arm_compute::ICLTensor& input = PolymorphicDowncast<IClTensorHandle*>(
m_Data.
m_Inputs[0])->GetTensor();
95 arm_compute::ICLTensor& output = PolymorphicDowncast<IClTensorHandle*>(
m_Data.
m_Outputs[0])->GetTensor();
96 arm_compute::ICLTensor& weights = PolymorphicDowncast<IClTensorHandle*>(
m_Data.
m_Inputs[1])->GetTensor();
97 weights.info()->set_are_values_constant(
info.m_InputTensorInfos[1].IsConstant());
98 arm_compute::ITensorInfo* weightsInfo = weights.info();
99 arm_compute::ITensorInfo* inputInfo = input.info();
100 auto weightsShape = weightsInfo->tensor_shape();
101 auto inputShape = inputInfo->tensor_shape();
105 unsigned int depthMultiplier =
108 arm_compute::ICLTensor* bias =
nullptr;
111 bias = &PolymorphicDowncast<IClTensorHandle*>(
m_Data.
m_Inputs[2])->GetTensor();
112 bias->info()->set_are_values_constant(
info.m_InputTensorInfos[2].IsConstant());
115 const arm_compute::Size2D aclDilationInfo = BuildArmComputeSize2D(
120 input.info()->set_data_layout(aclDataLayout);
121 weights.info()->set_data_layout(aclDataLayout);
122 output.info()->set_data_layout(aclDataLayout);
124 arm_compute::PadStrideInfo padStrideInfo = BuildArmComputePadStrideInfo(
m_Data.
m_Parameters);