13 #include <arm_compute/runtime/NEON/functions/NENormalizationLayer.h>
15 using namespace armnn::armcomputetensorutils;
24 bool IsNeonNormalizationDescriptorSupported(
const NormalizationDescriptor& parameters,
25 Optional<std::string&> reasonIfUnsupported)
29 if (reasonIfUnsupported)
31 reasonIfUnsupported.value() =
"Unsupported normalisation method type, only LocalBrightness is supported";
35 if (parameters.m_NormSize % 2 == 0)
37 if (reasonIfUnsupported)
39 reasonIfUnsupported.value() =
"Normalization size must be an odd number.";
53 const arm_compute::TensorInfo aclInput = BuildArmComputeTensorInfo(input, descriptor.
m_DataLayout);
54 const arm_compute::TensorInfo aclOutput = BuildArmComputeTensorInfo(output, descriptor.
m_DataLayout);
56 arm_compute::NormalizationLayerInfo normalizationInfo = BuildArmComputeNormalizationLayerInfo(descriptor);
58 return arm_compute::NENormalizationLayer::validate(&aclInput, &aclOutput, normalizationInfo);
73 std::string reasonIfUnsupported;
80 if (
info.m_InputTensorInfos[0].GetShape()[1] !=
info.m_OutputTensorInfos[0].GetShape()[1]
81 ||
info.m_InputTensorInfos[0].GetShape()[0] !=
info.m_OutputTensorInfos[0].GetShape()[0]
82 ||
info.m_InputTensorInfos[0].GetShape()[3] !=
info.m_OutputTensorInfos[0].GetShape()[3]
83 ||
info.m_InputTensorInfos[0].GetShape()[2] !=
info.m_OutputTensorInfos[0].GetShape()[2])
88 arm_compute::ITensor& input = PolymorphicDowncast<IAclTensorHandle*>(
m_Data.
m_Inputs[0])->GetTensor();
89 arm_compute::ITensor& output = PolymorphicDowncast<IAclTensorHandle*>(
m_Data.
m_Outputs[0])->GetTensor();
91 input.info()->set_data_layout(aclDataLayout);
92 output.info()->set_data_layout(aclDataLayout);
94 const arm_compute::NormType normType =
96 arm_compute::NormalizationLayerInfo normalizationInfo(normType,
97 m_Data.m_Parameters.m_NormSize,
98 m_Data.m_Parameters.m_Alpha,
99 m_Data.m_Parameters.m_Beta,
102 auto layer = std::make_unique<arm_compute::NENormalizationLayer>(memoryManager);
103 layer->configure(&input, &output, normalizationInfo);
104 m_NormalizationLayer.reset(layer.release());
110 m_NormalizationLayer->run();
146 void NeonNormalizationFloatWorkload::Reconfigure()