Compute Library
 24.02.1
CLMeanStdDevNormalizationLayer Class Reference

Basic function to execute mean and standard deviation normalization by calling CLMeanStdDevNormalizationKernel. More...

#include <CLMeanStdDevNormalizationLayer.h>

Collaboration diagram for CLMeanStdDevNormalizationLayer:
[legend]

Public Member Functions

void configure (ICLTensor *input, ICLTensor *output=nullptr, float epsilon=1e-8f)
 Initialise the function's input and outputs. More...
 
void configure (const CLCompileContext &compile_context, ICLTensor *input, ICLTensor *output=nullptr, float epsilon=1e-8f)
 Initialise the function's input and outputs. More...
 
- Public Member Functions inherited from ICLSimpleFunction
 ICLSimpleFunction (CLRuntimeContext *ctx=nullptr)
 Constructor. More...
 
 ICLSimpleFunction (const ICLSimpleFunction &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
 ICLSimpleFunction (ICLSimpleFunction &&)=default
 Default move constructor. More...
 
ICLSimpleFunctionoperator= (const ICLSimpleFunction &)=delete
 Prevent instances of this class from being copied (As this class contains pointers) More...
 
ICLSimpleFunctionoperator= (ICLSimpleFunction &&)=default
 Default move assignment operator. More...
 
 ~ICLSimpleFunction ()
 Default destructor. More...
 
void run () override final
 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=nullptr, float epsilon=1e-8f)
 Static function to check if given info will lead to a valid configuration of CLMeanStdDevNormalizationKernel. More...
 

Detailed Description

Basic function to execute mean and standard deviation normalization by calling CLMeanStdDevNormalizationKernel.

Definition at line 37 of file CLMeanStdDevNormalizationLayer.h.

Member Function Documentation

◆ configure() [1/2]

void configure ( const CLCompileContext compile_context,
ICLTensor input,
ICLTensor output = nullptr,
float  epsilon = 1e-8f 
)

Initialise the function's input and outputs.

Note
If the output tensor is a nullptr, the normalization will be performed in-place.
Parameters
[in]compile_contextThe compile context to be used.
[in,out]inputInput tensor with 2 dimensions. Data types supported: F16/F32.
[out]output(Optional) Destination tensor. It can be nullptr in case of in-place computation. Data type supported: same as input
[in]epsilon(Optional) Small float to avoid division by zero in case of zero standard deviation. Defaults to 1e-8.

Definition at line 38 of file CLMeanStdDevNormalizationLayer.cpp.

42 {
44  auto k = std::make_unique<CLMeanStdDevNormalizationKernel>();
45  k->configure(compile_context, input, output, epsilon);
46  _kernel = std::move(k);
47 }

References ARM_COMPUTE_LOG_PARAMS, arm_compute::quantization::epsilon, and arm_compute::test::validation::input.

◆ configure() [2/2]

void configure ( ICLTensor input,
ICLTensor output = nullptr,
float  epsilon = 1e-8f 
)

Initialise the function's input and outputs.

Valid data layouts:

  • NHWC
  • NCHW

Valid data type configurations:

src dst
F32 F32
F16 F16
Note
If the output tensor is a nullptr, the normalization will be performed in-place.
Parameters
[in,out]inputInput tensor with 2 dimensions. Data types supported: F16/F32.
[out]output(Optional) Destination tensor. It can be nullptr in case of in-place computation. Data type supported: same as input
[in]epsilon(Optional) Small float to avoid division by zero in case of zero standard deviation. Defaults to 1e-8.

Definition at line 33 of file CLMeanStdDevNormalizationLayer.cpp.

34 {
35  configure(CLKernelLibrary::get().get_compile_context(), input, output, epsilon);
36 }

References arm_compute::quantization::epsilon, CLKernelLibrary::get(), and arm_compute::test::validation::input.

Referenced by CLLSTMLayer::configure().

◆ validate()

Status validate ( const ITensorInfo input,
const ITensorInfo output = nullptr,
float  epsilon = 1e-8f 
)
static

Static function to check if given info will lead to a valid configuration of CLMeanStdDevNormalizationKernel.

Parameters
[in]inputSource tensor info with 2 dimensions. In case of output tensor info = nullptr, this tensor will store the result of the normalization. Data types supported: F16/F32.
[in]output(Optional) Destination tensor info. It can be nullptr in case of in-place computation. Data type supported: same as input
[in]epsilon(Optional) Small float to avoid division by zero in case of zero standard deviation. Defaults to 1e-8.
Returns
a status

Definition at line 49 of file CLMeanStdDevNormalizationLayer.cpp.

50 {
52 }

References arm_compute::quantization::epsilon, arm_compute::test::validation::input, and CLMeanStdDevNormalizationKernel::validate().

Referenced by CLLSTMLayer::validate().


The documentation for this class was generated from the following files:
arm_compute::CLMeanStdDevNormalizationKernel::validate
static Status validate(const ITensorInfo *input, const ITensorInfo *output=nullptr, float epsilon=1e-8f)
Static function to check if given info will lead to a valid configuration of CLMeanStdDevNormalizatio...
Definition: CLMeanStdDevNormalizationKernel.cpp:121
arm_compute::CLKernelLibrary::get
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
Definition: CLKernelLibrary.cpp:41
ARM_COMPUTE_LOG_PARAMS
#define ARM_COMPUTE_LOG_PARAMS(...)
Definition: Log.h:35
arm_compute::CLMeanStdDevNormalizationLayer::configure
void configure(ICLTensor *input, ICLTensor *output=nullptr, float epsilon=1e-8f)
Initialise the function's input and outputs.
Definition: CLMeanStdDevNormalizationLayer.cpp:33
arm_compute::test::validation::input
auto input
Definition: LSTMLayerQuantized.cpp:486
arm_compute::quantization::epsilon
constexpr float epsilon
Definition: AsymmHelpers.cpp:41