17 #include <arm_compute/runtime/NEON/functions/NEArgMinMaxLayer.h>
21 unsigned int CalcAclAxis(
unsigned int numDimensions,
unsigned int axisIndex)
23 return (numDimensions - axisIndex) - 1;
35 const arm_compute::TensorInfo aclInput = armcomputetensorutils::BuildArmComputeTensorInfo(input);
36 const arm_compute::TensorInfo aclOutput = armcomputetensorutils::BuildArmComputeTensorInfo(output);
40 int aclAxis = armnn::numeric_cast<int>(CalcAclAxis(numDims, unsignedAxis));
44 return arm_compute::NEArgMinMaxLayer::validate(&aclInput, aclAxis, &aclOutput,
45 arm_compute::ReductionOperation::ARG_IDX_MAX);
49 return arm_compute::NEArgMinMaxLayer::validate(&aclInput, aclAxis, &aclOutput,
50 arm_compute::ReductionOperation::ARG_IDX_MIN);
65 arm_compute::ITensor& input = PolymorphicDowncast<IAclTensorHandle*>(
m_Data.
m_Inputs[0])->GetTensor();
66 arm_compute::ITensor& output = PolymorphicDowncast<IAclTensorHandle*>(
m_Data.
m_Outputs[0])->GetTensor();
68 auto numDims =
info.m_InputTensorInfos[0].GetNumDimensions();
70 int aclAxis = armnn::numeric_cast<int>(CalcAclAxis(numDims, unsignedAxis));
72 auto layer = std::make_unique<arm_compute::NEArgMinMaxLayer>();
76 layer->configure(&input, aclAxis, &output, arm_compute::ReductionOperation::ARG_IDX_MAX);
80 layer->configure(&input, aclAxis, &output, arm_compute::ReductionOperation::ARG_IDX_MIN);
83 m_ArgMinMaxLayer.reset(layer.release());
89 m_ArgMinMaxLayer->run();