21.02
|
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 39 of file CLArgMinMaxLayer.cpp.
References CLArgMinMaxLayer::~CLArgMinMaxLayer().
|
delete |
Prevent instances of this class from being copied.
|
delete |
Prevent instances of this class to be moved.
|
default |
Default destructor.
Referenced by CLArgMinMaxLayer::CLArgMinMaxLayer().
void configure | ( | const ICLTensor * | input, |
int | axis, | ||
ICLTensor * | output, | ||
const ReductionOperation & | op | ||
) |
Set the input and output tensors.
[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 114 of file CLArgMinMaxLayer.cpp.
References CLKernelLibrary::get().
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 119 of file CLArgMinMaxLayer.cpp.
References CLTensorAllocator::allocate(), CLTensor::allocator(), ARM_COMPUTE_ERROR_ON_NULLPTR, arm_compute::auto_init_if_empty(), arm_compute::utils::calculate_number_of_stages_only_x_axis(), ICloneable< T >::clone(), arm_compute::misc::shape_calculator::compute_reduced_shape(), CLReshapeLayer::configure(), ITensorInfo::data_type(), ITensorInfo::dimension(), ITensor::info(), arm_compute::test::validation::input, MemoryGroup::manage(), arm_compute::test::validation::output_shape, arm_compute::S32, arm_compute::test::validation::shape, ITensorInfo::tensor_shape(), and arm_compute::UNKNOWN.
|
delete |
Prevent instances of this class from being copied.
|
delete |
Prevent instances of this class to be moved.
|
overridevirtual |
Run the kernels contained in the function.
For Neon kernels:
For OpenCL kernels:
Implements IFunction.
Definition at line 175 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 46 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, arm_compute::utils::calculate_number_of_stages_only_x_axis(), ICloneable< T >::clone(), arm_compute::misc::shape_calculator::compute_reduced_shape(), arm_compute::test::validation::data_type, ITensorInfo::data_type(), ITensorInfo::dimension(), arm_compute::F16, arm_compute::F32, ITensorInfo::num_channels(), Dimensions< size_t >::num_max_dimensions, arm_compute::QASYMM8, arm_compute::QASYMM8_SIGNED, arm_compute::test::validation::qinfo, ITensorInfo::quantization_info(), arm_compute::S32, TensorShape::set(), TensorInfo::set_data_type(), ITensorInfo::set_num_channels(), ITensorInfo::set_quantization_info(), ITensorInfo::set_tensor_shape(), arm_compute::test::validation::shape, ITensorInfo::tensor_shape(), ITensorInfo::total_size(), CLReshapeLayer::validate(), and CLArgMinMaxLayerKernel::validate().
Referenced by arm_compute::test::validation::DATA_TEST_CASE().