21.02
|
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 Neon kernels:
Definition at line 44 of file NEReductionOperation.h.
NEReductionOperation | ( | std::shared_ptr< IMemoryManager > | memory_manager = nullptr | ) |
Default constructor.
Definition at line 60 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.
[in,out] | input | Source tensor. Data type supported: QASYMM8_SIGNED/QASYMM8/F16/F32/S32. Data layouts supported: NCHW. (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 104 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::auto_init_if_empty(), ICloneable< T >::clone(), arm_compute::misc::shape_calculator::compute_reduced_shape(), NEReshapeLayer::configure(), ITensorInfo::data_type(), ITensor::info(), TensorAllocator::init(), MemoryGroup::manage(), ITensorInfo::num_channels(), arm_compute::test::validation::qinfo, ITensorInfo::quantization_info(), arm_compute::S32, ITensorInfo::tensor_shape(), and NEReductionOperation::validate().
Referenced by NEL2NormalizeLayer::configure(), NEFFTConvolutionLayer::configure(), and arm_compute::test::validation::DATA_TEST_CASE().
|
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 Neon kernels:
For OpenCL kernels:
Implements IFunction.
Definition at line 143 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. Data layouts supported: NCHW. |
[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 65 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(), ITensorInfo::num_channels(), Dimensions< size_t >::num_max_dimensions, ITensorInfo::quantization_info(), arm_compute::S32, TensorShape::set(), TensorInfo::set_data_type(), ITensorInfo::set_num_channels(), ITensorInfo::set_quantization_info(), ITensorInfo::set_tensor_shape(), ITensorInfo::tensor_shape(), NEReshapeLayer::validate(), and NEReductionOperationKernel::validate().
Referenced by NEReductionOperation::configure(), arm_compute::test::validation::DATA_TEST_CASE(), NEL2NormalizeLayer::validate(), and NEArgMinMaxLayer::validate().