Compute Library
 21.02
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 ( 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,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 31 of file CLMeanStdDevNormalizationLayer.cpp.

References CLKernelLibrary::get().

Referenced by CLLSTMLayer::configure().

32 {
33  configure(CLKernelLibrary::get().get_compile_context(), input, output, epsilon);
34 }
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
void configure(ICLTensor *input, ICLTensor *output=nullptr, float epsilon=1e-8f)
Initialise the function&#39;s input and outputs.

◆ configure() [2/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 36 of file CLMeanStdDevNormalizationLayer.cpp.

37 {
38  auto k = std::make_unique<CLMeanStdDevNormalizationKernel>();
39  k->configure(compile_context, input, output, epsilon);
40  _kernel = std::move(k);
41 }

◆ 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 43 of file CLMeanStdDevNormalizationLayer.cpp.

References CLMeanStdDevNormalizationKernel::validate().

Referenced by arm_compute::test::validation::DATA_TEST_CASE(), and CLLSTMLayer::validate().

44 {
46 }
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...

The documentation for this class was generated from the following files: