21.02
|
Basic function to fuse the batch normalization node to a preceding convolution node. More...
#include <CLFuseBatchNormalization.h>
Public Member Functions | |
CLFuseBatchNormalization () | |
Default constructor. More... | |
CLFuseBatchNormalization (const CLFuseBatchNormalization &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
CLFuseBatchNormalization & | operator= (const CLFuseBatchNormalization &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
CLFuseBatchNormalization (CLFuseBatchNormalization &&)=default | |
Allow instances of this class to be moved. More... | |
CLFuseBatchNormalization & | operator= (CLFuseBatchNormalization &&)=default |
Allow instances of this class to be moved. More... | |
~CLFuseBatchNormalization () | |
Default destructor. More... | |
void | configure (const ICLTensor *input_weights, const ICLTensor *bn_mean, const ICLTensor *bn_var, ICLTensor *fused_weights, ICLTensor *fused_bias, const ICLTensor *input_bias=nullptr, const ICLTensor *bn_beta=nullptr, const ICLTensor *bn_gamma=nullptr, float epsilon=0.001f, FuseBatchNormalizationType fbn_type=FuseBatchNormalizationType::CONVOLUTION) |
Set the input and output tensors. More... | |
void | configure (const CLCompileContext &compile_context, const ICLTensor *input_weights, const ICLTensor *bn_mean, const ICLTensor *bn_var, ICLTensor *fused_weights, ICLTensor *fused_bias, const ICLTensor *input_bias=nullptr, const ICLTensor *bn_beta=nullptr, const ICLTensor *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 CLFuseBatchNormalization. More... | |
Basic function to fuse the batch normalization node to a preceding convolution node.
Definition at line 41 of file CLFuseBatchNormalization.h.
Default constructor.
Definition at line 35 of file CLFuseBatchNormalization.cpp.
References CLFuseBatchNormalization::~CLFuseBatchNormalization().
|
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.
Referenced by CLFuseBatchNormalization::CLFuseBatchNormalization().
void configure | ( | const ICLTensor * | input_weights, |
const ICLTensor * | bn_mean, | ||
const ICLTensor * | bn_var, | ||
ICLTensor * | fused_weights, | ||
ICLTensor * | fused_bias, | ||
const ICLTensor * | input_bias = nullptr , |
||
const ICLTensor * | bn_beta = nullptr , |
||
const ICLTensor * | bn_gamma = nullptr , |
||
float | epsilon = 0.001f , |
||
FuseBatchNormalizationType | fbn_type = FuseBatchNormalizationType::CONVOLUTION |
||
) |
Set the input and output tensors.
[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 | Output fused weights tensor. It can be a nullptr in case of in-place computation. Same as input_weights |
[out] | fused_bias | 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 42 of file CLFuseBatchNormalization.cpp.
References CLKernelLibrary::get().
void configure | ( | const CLCompileContext & | compile_context, |
const ICLTensor * | input_weights, | ||
const ICLTensor * | bn_mean, | ||
const ICLTensor * | bn_var, | ||
ICLTensor * | fused_weights, | ||
ICLTensor * | fused_bias, | ||
const ICLTensor * | input_bias = nullptr , |
||
const ICLTensor * | bn_beta = nullptr , |
||
const ICLTensor * | bn_gamma = nullptr , |
||
float | epsilon = 0.001f , |
||
FuseBatchNormalizationType | fbn_type = FuseBatchNormalizationType::CONVOLUTION |
||
) |
Set the input and output tensors.
[in] | compile_context | The compile context to be used. |
[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 | Output fused weights tensor. It can be a nullptr in case of in-place computation. Same as input_weights |
[out] | fused_bias | 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 50 of file CLFuseBatchNormalization.cpp.
|
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 Neon kernels:
For OpenCL kernels:
Implements IFunction.
Definition at line 66 of file CLFuseBatchNormalization.cpp.
References CLScheduler::enqueue(), and CLScheduler::get().
|
static |
Static function to check if given info will lead to a valid configuration of CLFuseBatchNormalization.
[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 | Output fused weights tensor info. It can be a nullptr in case of in-place computation. Same as input_weights |
[in] | fused_bias | 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 58 of file CLFuseBatchNormalization.cpp.
References CLFuseBatchNormalizationKernel::validate().