24.02.1
|
Basic function to fuse the batch normalization node to a preceding convolution node. More...
#include <NEFuseBatchNormalization.h>
Public Member Functions | |
NEFuseBatchNormalization () | |
Default constructor. More... | |
NEFuseBatchNormalization (const NEFuseBatchNormalization &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NEFuseBatchNormalization & | operator= (const NEFuseBatchNormalization &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NEFuseBatchNormalization (NEFuseBatchNormalization &&)=default | |
Allow instances of this class to be moved. More... | |
NEFuseBatchNormalization & | operator= (NEFuseBatchNormalization &&)=default |
Allow instances of this class to be moved. More... | |
~NEFuseBatchNormalization () | |
Default destructor. More... | |
void | configure (const ITensor *input_weights, const ITensor *bn_mean, const ITensor *bn_var, ITensor *fused_weights, ITensor *fused_bias, const ITensor *input_bias=nullptr, const ITensor *bn_beta=nullptr, const ITensor *bn_gamma=nullptr, float epsilon=0.001f, FuseBatchNormalizationType fbn_type=FuseBatchNormalizationType::CONVOLUTION) |
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_weights, const ITensorInfo *bn_mean, const ITensorInfo *bn_var, const ITensorInfo *fused_weights, const ITensorInfo *fused_bias, const ITensorInfo *input_bias=nullptr, const ITensorInfo *bn_beta=nullptr, const ITensorInfo *bn_gamma=nullptr, float epsilon=0.001f, FuseBatchNormalizationType fbn_type=FuseBatchNormalizationType::CONVOLUTION) |
Static function to check if given info will lead to a valid configuration of NEFuseBatchNormalization. More... | |
Basic function to fuse the batch normalization node to a preceding convolution node.
Definition at line 38 of file NEFuseBatchNormalization.h.
Default constructor.
Definition at line 39 of file NEFuseBatchNormalization.cpp.
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Allow instances of this class to be moved.
|
default |
Default destructor.
void configure | ( | const ITensor * | input_weights, |
const ITensor * | bn_mean, | ||
const ITensor * | bn_var, | ||
ITensor * | fused_weights, | ||
ITensor * | fused_bias, | ||
const ITensor * | input_bias = nullptr , |
||
const ITensor * | bn_beta = nullptr , |
||
const ITensor * | bn_gamma = nullptr , |
||
float | epsilon = 0.001f , |
||
FuseBatchNormalizationType | fbn_type = FuseBatchNormalizationType::CONVOLUTION |
||
) |
Set the input and output tensors.
Valid data layouts:
Valid data type configurations:
src | dst |
---|---|
F32 | F32 |
F16 | F16 |
[in] | input_weights | Input weights tensor for convolution or depthwise convolution layer. Data type supported: F16/F32. Data layout supported: NCHW, NHWC |
[in] | bn_mean | Batch normalization layer mean tensor. Same as input_weights |
[in] | bn_var | Batch normalization layer variance tensor. Same as input_weights |
[out] | fused_weights | (Optional) Output fused weights tensor. It can be a nullptr in case of in-place computation. Same as input_weights |
[out] | fused_bias | (Optional) Output fused bias tensor. It can be a nullptr in case of in-place computation and input_bias != nullptr. Same as input_weights |
[in] | input_bias | (Optional) Input bias tensor for convolution or depthwise convolution layer. It can be a nullptr in case the bias tensor is not required. Same as input_weights |
[in] | bn_beta | (Optional) Batch normalization layer beta tensor. It can be a nullptr in case the beta tensor is not required. Same as input_weights |
[in] | bn_gamma | (Optional) Batch normalization layer gamma tensor. It can be a nullptr in case the gamma tensor is not required. Same as input_weights |
[in] | epsilon | (Optional) Batch normalization layer epsilon parameter. Defaults to 0.001f. |
[in] | fbn_type | (Optional) Fused batch normalization type. Defaults to Convolution. |
Definition at line 43 of file NEFuseBatchNormalization.cpp.
References ARM_COMPUTE_LOG_PARAMS, arm_compute::quantization::epsilon, and fbn_type.
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Allow instances of this class to be moved.
|
overridevirtual |
Run the kernels contained in the function.
For CPU kernels:
For OpenCL kernels:
Implements IFunction.
Definition at line 77 of file NEFuseBatchNormalization.cpp.
References Window::DimY, Scheduler::get(), and IScheduler::schedule().
|
static |
Static function to check if given info will lead to a valid configuration of NEFuseBatchNormalization.
[in] | input_weights | Input weights tensor info for convolution or depthwise convolution layer. Data type supported: F16/F32. Data layout supported: NCHW, NHWC |
[in] | bn_mean | Batch normalization layer mean tensor info. Same as input_weights |
[in] | bn_var | Batch normalization layer variance tensor info. Same as input_weights |
[in] | fused_weights | (Optional) Output fused weights tensor info. It can be a nullptr in case of in-place computation. Same as input_weights |
[in] | fused_bias | (Optional) Output fused bias tensor info. It can be a nullptr in case of in-place computation and input_bias != nullptr. Same as input_weights |
[in] | input_bias | (Optional) Input bias tensor info for convolution or depthwise convolution layer. It can be a nullptr in case the bias tensor is not required. Same as input_weights |
[in] | bn_beta | (Optional) Batch normalization layer beta tensor info. It can be a nullptr in case the beta tensor is not required. Same as input_weights |
[in] | bn_gamma | (Optional) Batch normalization layer gamma tensor info. It can be a nullptr in case the gamma tensor is not required. Same as input_weights |
[in] | epsilon | (Optional) Batch normalization layer epsilon parameter. Defaults to 0.001f. |
[in] | fbn_type | (Optional) Fused batch normalization type. Defaults to Convolution. |
Definition at line 62 of file NEFuseBatchNormalization.cpp.
References arm_compute::quantization::epsilon, fbn_type, and NEFuseBatchNormalizationKernel::validate().