24.02.1
|
Function to calculate the index of the minimum or maximum values in a tensor based on an axis. More...
#include <CLArgMinMaxLayer.h>
Public Member Functions | |
CLArgMinMaxLayer (std::shared_ptr< IMemoryManager > memory_manager=nullptr) | |
Default Constructor. More... | |
CLArgMinMaxLayer (const CLArgMinMaxLayer &)=delete | |
Prevent instances of this class from being copied. More... | |
CLArgMinMaxLayer & | operator= (const CLArgMinMaxLayer &)=delete |
Prevent instances of this class from being copied. More... | |
CLArgMinMaxLayer (CLArgMinMaxLayer &&)=delete | |
Prevent instances of this class to be moved. More... | |
CLArgMinMaxLayer & | operator= (CLArgMinMaxLayer &&)=delete |
Prevent instances of this class to be moved. More... | |
~CLArgMinMaxLayer () | |
Default destructor. More... | |
void | configure (const ICLTensor *input, int axis, ICLTensor *output, const ReductionOperation &op) |
Set the input and output tensors. More... | |
void | configure (const CLCompileContext &compile_context, const ICLTensor *input, int axis, ICLTensor *output, const ReductionOperation &op) |
Set the input and output tensors. More... | |
void | run () override |
Run the kernels contained in the function. More... | |
Public Member Functions inherited from IFunction | |
virtual | ~IFunction ()=default |
Destructor. More... | |
virtual void | prepare () |
Prepare the function for executing. More... | |
Static Public Member Functions | |
static Status | validate (const ITensorInfo *input, int axis, const ITensorInfo *output, const ReductionOperation &op) |
Static function to check if given info will lead to a valid configuration of CLArgMinMaxLayer. More... | |
Function to calculate the index of the minimum or maximum values in a tensor based on an axis.
Definition at line 48 of file CLArgMinMaxLayer.h.
CLArgMinMaxLayer | ( | std::shared_ptr< IMemoryManager > | memory_manager = nullptr | ) |
Default Constructor.
[in] | memory_manager | (Optional) Memory manager. |
Definition at line 41 of file CLArgMinMaxLayer.cpp.
|
delete |
Prevent instances of this class from being copied.
|
delete |
Prevent instances of this class to be moved.
|
default |
Default destructor.
void configure | ( | const CLCompileContext & | compile_context, |
const ICLTensor * | input, | ||
int | axis, | ||
ICLTensor * | output, | ||
const ReductionOperation & | op | ||
) |
Set the input and output tensors.
[in] | compile_context | The compile context to be used. |
[in] | input | Input source tensor. Data types supported: QASYMM8/QASYMM8_SIGNED/S32/F16/F32. |
[in] | axis | Axis to find max/min index. |
[out] | output | Output source tensor. Data types supported: U32/S32. |
[in] | op | Reduction operation to perform. Operations supported: ARG_IDX_MAX, ARG_IDX_MIN |
Definition at line 97 of file CLArgMinMaxLayer.cpp.
References CLTensorAllocator::allocate(), CLTensor::allocator(), ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_LOG_PARAMS, arm_compute::auto_init_if_empty(), arm_compute::misc::shape_calculator::compute_reduced_shape(), CLReshapeLayer::configure(), ITensorInfo::data_type(), ITensor::info(), CLTensor::info(), arm_compute::test::validation::input, MemoryGroup::manage(), arm_compute::test::validation::output_shape, arm_compute::S32, and arm_compute::UNKNOWN.
void configure | ( | const ICLTensor * | input, |
int | axis, | ||
ICLTensor * | output, | ||
const ReductionOperation & | op | ||
) |
Set the input and output tensors.
Valid data layouts:
Valid data type configurations:
src | dst |
---|---|
QASYMM8 | U32, S32 |
QASYMM8_SIGNED | U32, S32 |
S32 | U32, S32 |
F16 | U32, S32 |
F32 | U32, S32 |
[in] | input | Input source tensor. Data types supported: QASYMM8/QASYMM8_SIGNED/S32/F16/F32. |
[in] | axis | Axis to find max/min index. |
[out] | output | Output source tensor. Data types supported: U32/S32. |
[in] | op | Reduction operation to perform. Operations supported: ARG_IDX_MAX, ARG_IDX_MIN |
Definition at line 92 of file CLArgMinMaxLayer.cpp.
References CLKernelLibrary::get(), and arm_compute::test::validation::input.
|
delete |
Prevent instances of this class to be moved.
|
delete |
Prevent instances of this class from being copied.
|
overridevirtual |
Run the kernels contained in the function.
For CPU kernels:
For OpenCL kernels:
Implements IFunction.
Definition at line 137 of file CLArgMinMaxLayer.cpp.
References CLScheduler::enqueue(), CLScheduler::get(), and CLReshapeLayer::run().
|
static |
Static function to check if given info will lead to a valid configuration of CLArgMinMaxLayer.
[in] | input | Input source tensor info. Data types supported: QASYMM8/QASYMM8_SIGNED/S32/F16/F32. |
[in] | axis | Axis to find max/min index. |
[in] | output | Output source tensor info. Data types supported: U32/S32. |
[in] | op | Reduction operation to perform. Operations supported: ARG_IDX_MAX, ARG_IDX_MIN |
Definition at line 53 of file CLArgMinMaxLayer.cpp.
References arm_compute::ARG_IDX_MAX, arm_compute::ARG_IDX_MIN, ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN, ARM_COMPUTE_RETURN_ERROR_ON_F16_UNSUPPORTED, ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_SHAPES, ARM_COMPUTE_RETURN_ERROR_ON_MSG, ARM_COMPUTE_RETURN_ON_ERROR, ICloneable< T >::clone(), arm_compute::misc::shape_calculator::compute_reduced_shape(), arm_compute::test::validation::data_type, ITensorInfo::data_type(), arm_compute::F16, arm_compute::F32, arm_compute::test::validation::input, Dimensions< size_t >::num_max_dimensions, arm_compute::QASYMM8, arm_compute::QASYMM8_SIGNED, arm_compute::test::validation::qinfo, arm_compute::S32, TensorInfo::set_data_type(), ITensorInfo::set_num_channels(), ITensorInfo::set_quantization_info(), ITensorInfo::set_tensor_shape(), arm_compute::test::validation::shape, ITensorInfo::total_size(), CLReshapeLayer::validate(), and CLArgMinMaxLayerKernel::validate().