24.02.1
|
Basic function to simulate a reduction operation. More...
#include <NEReductionOperation.h>
Public Member Functions | |
NEReductionOperation (std::shared_ptr< IMemoryManager > memory_manager=nullptr) | |
Default constructor. More... | |
NEReductionOperation (const NEReductionOperation &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NEReductionOperation (NEReductionOperation &&)=default | |
Default move constructor. More... | |
NEReductionOperation & | operator= (const NEReductionOperation &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NEReductionOperation & | operator= (NEReductionOperation &&)=default |
Default move assignment operator. More... | |
~NEReductionOperation () | |
Default destructor. More... | |
void | configure (ITensor *input, ITensor *output, unsigned int axis, ReductionOperation op, bool keep_dims=true) |
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, const ITensorInfo *output, unsigned int axis, ReductionOperation op, bool keep_dims=true) |
Static function to check if given info will lead to a valid configuration of NEReductionOperation. More... | |
Basic function to simulate a reduction operation.
This function calls the following kernels:
Definition at line 44 of file NEReductionOperation.h.
NEReductionOperation | ( | std::shared_ptr< IMemoryManager > | memory_manager = nullptr | ) |
Default constructor.
Definition at line 62 of file NEReductionOperation.cpp.
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Default move constructor.
|
default |
Default destructor.
void configure | ( | ITensor * | input, |
ITensor * | output, | ||
unsigned int | axis, | ||
ReductionOperation | op, | ||
bool | keep_dims = true |
||
) |
Set the input and output tensors.
Valid data layouts:
Valid data type configurations:
src | dst |
---|---|
QASYMM8 | QASYMM8 |
QASYMM8_SIGNED | QASYMM8_SIGNED |
F16 | F16 |
F32 | F32 |
S32 | S32 |
[in,out] | input | Source tensor. Data type supported: QASYMM8_SIGNED/QASYMM8/F16/F32/S32. (Written to only for border_size != 0) |
[out] | output | Destination tensor. Data types and data layouts supported: same as input . |
[in] | axis | Dimension along which to reduce. Supported reduction axis : 0 |
[in] | op | Reduction operation to perform. |
[in] | keep_dims | (Optional) Whether to keep the reduced dimension after the operation. Defaults to true. |
Definition at line 118 of file NEReductionOperation.cpp.
References TensorAllocator::allocate(), Tensor::allocator(), arm_compute::ARG_IDX_MAX, arm_compute::ARG_IDX_MIN, ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_THROW_ON, ARM_COMPUTE_LOG_PARAMS, arm_compute::auto_init_if_empty(), arm_compute::misc::shape_calculator::compute_reduced_shape(), NEReshapeLayer::configure(), ITensor::info(), TensorAllocator::init(), arm_compute::test::validation::input, MemoryGroup::manage(), arm_compute::test::validation::qinfo, arm_compute::S32, and NEReductionOperation::validate().
Referenced by NEL2NormalizeLayer::configure(), and NEFFTConvolutionLayer::configure().
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Default move assignment operator.
|
overridevirtual |
Run the kernels contained in the function.
For CPU kernels:
For OpenCL kernels:
Implements IFunction.
Definition at line 172 of file NEReductionOperation.cpp.
References Scheduler::get(), NEReshapeLayer::run(), and IScheduler::schedule().
Referenced by NEL2NormalizeLayer::run(), and NEFFTConvolutionLayer::run().
|
static |
Static function to check if given info will lead to a valid configuration of NEReductionOperation.
[in] | input | Source tensor info. Data type supported: QASYMM8_SIGNED/QASYMM8/F16/F32/S32. |
[in] | output | Destination tensor info. Data types and data layouts supported: same as input . |
[in] | axis | Dimension along which to reduce. Supported reduction axis : 0 |
[in] | op | Reduction operation to perform. |
[in] | keep_dims | (Optional) Whether to keep the reduced dimension after the operation. Defaults to true. |
Definition at line 73 of file NEReductionOperation.cpp.
References arm_compute::ARG_IDX_MAX, arm_compute::ARG_IDX_MIN, 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(), ITensorInfo::data_type(), arm_compute::test::validation::input, Dimensions< size_t >::num_max_dimensions, arm_compute::S32, TensorInfo::set_data_type(), ITensorInfo::set_num_channels(), ITensorInfo::set_quantization_info(), ITensorInfo::set_tensor_shape(), NEReshapeLayer::validate(), and NEReductionOperationKernel::validate().
Referenced by NEReductionOperation::configure(), NEL2NormalizeLayer::validate(), and NEArgMinMaxLayer::validate().