24.02.1
|
Basic function to perform a Instance normalization. More...
#include <CLInstanceNormalizationLayer.h>
Public Member Functions | |
CLInstanceNormalizationLayer (CLRuntimeContext *ctx=nullptr) | |
Constructor. More... | |
CLInstanceNormalizationLayer (const CLInstanceNormalizationLayer &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
CLInstanceNormalizationLayer (CLInstanceNormalizationLayer &&)=default | |
Default move constructor. More... | |
CLInstanceNormalizationLayer & | operator= (const CLInstanceNormalizationLayer &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
CLInstanceNormalizationLayer & | operator= (CLInstanceNormalizationLayer &&)=default |
Default move assignment operator. More... | |
~CLInstanceNormalizationLayer () | |
Default destructor. More... | |
void | configure (ICLTensor *input, ICLTensor *output, float gamma=1.0f, float beta=0.0f, float epsilon=1e-12f, bool use_mixed_precision=true) |
Set the input and output tensors. More... | |
void | configure (const CLCompileContext &compile_context, ICLTensor *input, ICLTensor *output, float gamma=1.0f, float beta=0.0f, float epsilon=1e-12f, bool use_mixed_precision=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, float gamma=1.0f, float beta=0.0f, float epsilon=1e-12f, bool use_mixed_precision=true) |
Static function to check if given info will lead to a valid configuration of CLInstanceNormalizationLayer. More... | |
Basic function to perform a Instance normalization.
This function runs the following kernels:
Definition at line 46 of file CLInstanceNormalizationLayer.h.
CLInstanceNormalizationLayer | ( | CLRuntimeContext * | ctx = nullptr | ) |
Constructor.
[in] | ctx | Runtime context to be used by the function |
Definition at line 38 of file CLInstanceNormalizationLayer.cpp.
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Default move constructor.
void configure | ( | const CLCompileContext & | compile_context, |
ICLTensor * | input, | ||
ICLTensor * | output, | ||
float | gamma = 1.0f , |
||
float | beta = 0.0f , |
||
float | epsilon = 1e-12f , |
||
bool | use_mixed_precision = true |
||
) |
Set the input and output tensors.
[in] | compile_context | The compile context to be used. |
[in,out] | input | Source tensor. In case of output tensor = nullptr this tensor will store the result of the normalization. Data types supported: F16/F32. Data layout supported: NHWC, NCHW |
[out] | output | Destination tensor. Data types and data layouts supported: same as input . |
[in] | gamma | (Optional) The scale scalar value applied to the normalized tensor. Defaults to 1.0 |
[in] | beta | (Optional) The offset scalar value applied to the normalized tensor. Defaults to 0.0 |
[in] | epsilon | (Optional) Lower bound value for the normalization. Defaults to 1e-12 |
[in] | use_mixed_precision | (Optional) Use mixed precision in case of FP16 execution |
Definition at line 52 of file CLInstanceNormalizationLayer.cpp.
References CLTensorAllocator::allocate(), CLTensor::allocator(), ARM_COMPUTE_LOG_PARAMS, arm_compute::quantization::epsilon, arm_compute::test::validation::input, and arm_compute::test::validation::w.
void configure | ( | ICLTensor * | input, |
ICLTensor * | output, | ||
float | gamma = 1.0f , |
||
float | beta = 0.0f , |
||
float | epsilon = 1e-12f , |
||
bool | use_mixed_precision = true |
||
) |
Set the input and output tensors.
Valid data layouts:
Valid data type configurations:
src | dst |
---|---|
F16 | F16 |
F32 | F32 |
[in,out] | input | Source tensor. In case of output tensor = nullptr this tensor will store the result of the normalization. Data types supported: F16/F32. Data layout supported: NHWC, NCHW |
[out] | output | Destination tensor. Data types and data layouts supported: same as input . |
[in] | gamma | (Optional) The scale scalar value applied to the normalized tensor. Defaults to 1.0 |
[in] | beta | (Optional) The offset scalar value applied to the normalized tensor. Defaults to 0.0 |
[in] | epsilon | (Optional) Lower bound value for the normalization. Defaults to 1e-12 |
[in] | use_mixed_precision | (Optional) Use mixed precision in case of FP16 execution |
Definition at line 46 of file CLInstanceNormalizationLayer.cpp.
References arm_compute::quantization::epsilon, CLKernelLibrary::get(), and arm_compute::test::validation::input.
|
default |
Default move assignment operator.
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
overridevirtual |
Run the kernels contained in the function.
For CPU kernels:
For OpenCL kernels:
Implements IFunction.
Definition at line 82 of file CLInstanceNormalizationLayer.cpp.
References ARM_COMPUTE_ERROR_ON_MSG, and arm_compute::schedule_kernel_on_ctx().
|
static |
Static function to check if given info will lead to a valid configuration of CLInstanceNormalizationLayer.
[in] | input | Source tensor info. Data types supported: F16/F32. Data layout supported: NHWC, NCHW |
[in] | output | Destination tensor info. Data types and data layouts supported: same as input . |
[in] | gamma | (Optional) The scale scalar value applied to the normalized tensor. Defaults to 1.0 |
[in] | beta | (Optional) The offset scalar value applied to the normalized tensor. Defaults to 0.0 |
[in] | epsilon | (Optional) Lower bound value for the normalization. Defaults to 1e-12 |
[in] | use_mixed_precision | (Optional) Use mixed precision in case of FP16 execution |
Definition at line 71 of file CLInstanceNormalizationLayer.cpp.
References arm_compute::quantization::epsilon, arm_compute::test::validation::input, and CLInstanceNormalizationLayerKernel::validate().