21.02
|
Interface for the batch normalization layer kernel. More...
#include <NEBatchNormalizationLayerKernel.h>
Public Member Functions | |
const char * | name () const override |
Name of the kernel. More... | |
NEBatchNormalizationLayerKernel () | |
Default constructor. More... | |
NEBatchNormalizationLayerKernel (const NEBatchNormalizationLayerKernel &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NEBatchNormalizationLayerKernel & | operator= (const NEBatchNormalizationLayerKernel &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NEBatchNormalizationLayerKernel (NEBatchNormalizationLayerKernel &&)=default | |
Default Move Constructor. More... | |
NEBatchNormalizationLayerKernel & | operator= (NEBatchNormalizationLayerKernel &&)=default |
Default move assignment operator. More... | |
~NEBatchNormalizationLayerKernel ()=default | |
Default destructor. More... | |
void | configure (ITensor *input, ITensor *output, const ITensor *mean, const ITensor *var, const ITensor *beta=nullptr, const ITensor *gamma=nullptr, float epsilon=0.001f, ActivationLayerInfo act_info=ActivationLayerInfo()) |
Set the input and output tensors. More... | |
void | run (const Window &window, const ThreadInfo &info) override |
Execute the kernel on the passed window. More... | |
Public Member Functions inherited from ICPPKernel | |
virtual | ~ICPPKernel ()=default |
Default destructor. More... | |
virtual void | run_nd (const Window &window, const ThreadInfo &info, const Window &thread_locator) |
legacy compatibility layer for implemantions which do not support thread_locator In these cases we simply narrow the interface down the legacy version More... | |
virtual void | run_op (ITensorPack &tensors, const Window &window, const ThreadInfo &info) |
Execute the kernel on the passed window. More... | |
Public Member Functions inherited from IKernel | |
IKernel () | |
Constructor. More... | |
virtual | ~IKernel ()=default |
Destructor. More... | |
virtual bool | is_parallelisable () const |
Indicates whether or not the kernel is parallelisable. More... | |
virtual BorderSize | border_size () const |
The size of the border for that kernel. More... | |
const Window & | window () const |
The maximum window the kernel can be executed on. More... | |
Static Public Member Functions | |
static Status | validate (const ITensorInfo *input, const ITensorInfo *output, const ITensorInfo *mean, const ITensorInfo *var, const ITensorInfo *beta=nullptr, const ITensorInfo *gamma=nullptr, float epsilon=0.001f, ActivationLayerInfo act_info=ActivationLayerInfo()) |
Static function to check if given info will lead to a valid configuration of NEBatchNormalizationLayerKernel. More... | |
Interface for the batch normalization layer kernel.
Definition at line 36 of file NEBatchNormalizationLayerKernel.h.
Default constructor.
Definition at line 307 of file NEBatchNormalizationLayerKernel.cpp.
Referenced by NEBatchNormalizationLayerKernel::name().
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Default Move Constructor.
|
default |
Default destructor.
Referenced by NEBatchNormalizationLayerKernel::name().
void configure | ( | ITensor * | input, |
ITensor * | output, | ||
const ITensor * | mean, | ||
const ITensor * | var, | ||
const ITensor * | beta = nullptr , |
||
const ITensor * | gamma = nullptr , |
||
float | epsilon = 0.001f , |
||
ActivationLayerInfo | act_info = ActivationLayerInfo() |
||
) |
Set the input and output tensors.
[in,out] | input | Source tensor. In case of output tensor = nullptr, this tensor will store the result. 3 lower dimensions represent a single input with dimensions [width, height, FM]. The rest are optional and used for representing batches. Data types supported: F16/F32. |
[out] | output | Destination tensor. Output will have the same number of dimensions as input. Data type supported: same as input |
[in] | mean | Mean values tensor. 1 dimension with size equal to the feature maps [FM]. Data types supported: Same as input |
[in] | var | Variance values tensor. 1 dimension with size equal to the feature maps [FM]. Data types supported: Same as input |
[in] | beta | (Optional) Beta values tensor info. 1 dimension with size equal to the feature maps [FM]. If not provided, default value for beta is 0. Data types supported: Same as input |
[in] | gamma | (Optional) Gamma values tensor info. 1 dimension with size equal to the feature maps [FM]. If not provided, default value for gamma is 1. Data types supported: Same as input |
[in] | epsilon | (Optional) Small value to avoid division with zero. Default value is 0.001f. |
[in] | act_info | (Optional) Activation layer information in case of a fused activation. Only RELU, BOUNDED_RELU and LU_BOUNDED_RELU supported. |
Definition at line 312 of file NEBatchNormalizationLayerKernel.cpp.
References ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_THROW_ON, arm_compute::auto_init_if_empty(), arm_compute::calculate_max_window(), ICloneable< T >::clone(), ITensorInfo::data_layout(), ActivationLayerInfo::enabled(), arm_compute::quantization::epsilon, ITensor::info(), arm_compute::test::validation::input, arm_compute::NCHW, ITensorInfo::num_dimensions(), Dimensions< T >::set_num_dimensions(), ITensorInfo::set_valid_region(), ITensorInfo::tensor_shape(), and arm_compute::validate_arguments().
Referenced by NEBatchNormalizationLayerKernel::name().
|
inlineoverridevirtual |
Name of the kernel.
Implements ICPPKernel.
Definition at line 39 of file NEBatchNormalizationLayerKernel.h.
References NEBatchNormalizationLayerKernel::configure(), arm_compute::quantization::epsilon, arm_compute::test::validation::info, arm_compute::test::validation::input, NEBatchNormalizationLayerKernel::NEBatchNormalizationLayerKernel(), NEBatchNormalizationLayerKernel::operator=(), NEBatchNormalizationLayerKernel::run(), NEBatchNormalizationLayerKernel::validate(), IKernel::window(), and NEBatchNormalizationLayerKernel::~NEBatchNormalizationLayerKernel().
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
Referenced by NEBatchNormalizationLayerKernel::name().
|
default |
Default move assignment operator.
|
overridevirtual |
Execute the kernel on the passed window.
[in] | window | Region on which to execute the kernel. (Must be a region of the window returned by window()) |
[in] | info | Info about executing thread and CPU. |
Reimplemented from ICPPKernel.
Definition at line 379 of file NEBatchNormalizationLayerKernel.cpp.
References ARM_COMPUTE_ERROR_ON, ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW, ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL, ARM_COMPUTE_UNUSED, ITensorInfo::data_layout(), ITensorInfo::data_type(), ITensor::info(), arm_compute::NCHW, and IKernel::window().
Referenced by NEBatchNormalizationLayerKernel::name().
|
static |
Static function to check if given info will lead to a valid configuration of NEBatchNormalizationLayerKernel.
[in] | input | Source tensor info. In case of output tensor = nullptr, this tensor will store the result. 3 lower dimensions represent a single input with dimensions [width, height, FM]. The rest are optional and used for representing batches. Data types supported: F16/F32. |
[in] | output | Destination tensor info. Output will have the same number of dimensions as input. Data type supported: same as input |
[in] | mean | Mean values tensor info. 1 dimension with size equal to the feature maps [FM]. Data types supported: Same as input |
[in] | var | Variance values tensor info. 1 dimension with size equal to the feature maps [FM]. Data types supported: Same as input |
[in] | beta | (Optional) Beta values tensor info. 1 dimension with size equal to the feature maps [FM]. If not provided, default value for beta is 0. Data types supported: Same as input |
[in] | gamma | (Optional) Gamma values tensor info. 1 dimension with size equal to the feature maps [FM]. If not provided, default value for gamma is 1. Data types supported: Same as input |
[in] | epsilon | (Optional) Small value to avoid division with zero. Default value is 0.001f. |
[in] | act_info | (Optional) Activation layer information in case of a fused activation. Only RELU, BOUNDED_RELU and LU_BOUNDED_RELU supported. |
Definition at line 369 of file NEBatchNormalizationLayerKernel.cpp.
References ARM_COMPUTE_RETURN_ON_ERROR, and arm_compute::validate_arguments().
Referenced by NEBatchNormalizationLayerKernel::name(), and NEBatchNormalizationLayer::validate().