21.02
|
Interface for the BatchNormalization layer kernel. More...
#include <GCBatchNormalizationLayerKernel.h>
Public Member Functions | |
GCBatchNormalizationLayerKernel () | |
Constructor. More... | |
GCBatchNormalizationLayerKernel (const GCBatchNormalizationLayerKernel &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
GCBatchNormalizationLayerKernel & | operator= (const GCBatchNormalizationLayerKernel &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
GCBatchNormalizationLayerKernel (GCBatchNormalizationLayerKernel &&)=default | |
Default Move Constructor. More... | |
GCBatchNormalizationLayerKernel & | operator= (GCBatchNormalizationLayerKernel &&)=default |
Default move assignment operator. More... | |
~GCBatchNormalizationLayerKernel ()=default | |
Default destructor. More... | |
void | configure (const IGCTensor *input, IGCTensor *output, const IGCTensor *mean, const IGCTensor *var, const IGCTensor *beta=nullptr, const IGCTensor *gamma=nullptr, float epsilon=0.001f, ActivationLayerInfo act_info=ActivationLayerInfo()) |
Set the input and output tensors. More... | |
void | run (const Window &window) override |
Enqueue the OpenGL ES shader to process the given window. More... | |
Public Member Functions inherited from IGCKernel | |
IGCKernel () | |
Constructor. More... | |
GCKernel & | kernel () |
Returns a reference to the GLES kernel of this object. More... | |
void | add_1D_tensor_argument (unsigned int &idx, const IGCTensor *tensor, const unsigned int binding_point, const Window &window) |
Add the passed 1D tensor's parameters to the object's kernel's arguments starting from the index idx. More... | |
void | add_2D_tensor_argument (unsigned int &idx, const IGCTensor *tensor, const unsigned int binding_point, const Window &window) |
Add the passed 2D tensor's parameters to the object's kernel's arguments starting from the index idx. More... | |
void | add_3D_tensor_argument (unsigned int &idx, const IGCTensor *tensor, const unsigned int binding_point, const Window &window) |
Add the passed 3D tensor's parameters to the object's kernel's arguments starting from the index idx. More... | |
unsigned int | num_arguments_per_1D_tensor () const |
Returns the number of arguments enqueued per 1D tensor object. More... | |
unsigned int | num_arguments_per_2D_tensor () const |
Returns the number of arguments enqueued per 2D tensor object. More... | |
unsigned int | num_arguments_per_3D_tensor () const |
Returns the number of arguments enqueued per 3D tensor object. More... | |
void | set_lws_hint (gles::NDRange &lws_hint) |
Set the Local-Workgroup-Size hint. More... | |
void | set_target (GPUTarget target) |
Set the targeted GPU architecture. More... | |
GPUTarget | get_target () const |
Get the targeted GPU architecture. More... | |
Public Member Functions inherited from IKernel | |
IKernel () | |
Constructor. More... | |
virtual | ~IKernel ()=default |
Destructor. More... | |
virtual bool | is_parallelisable () const |
Indicates whether or not the kernel is parallelisable. More... | |
virtual BorderSize | border_size () const |
The size of the border for that kernel. More... | |
const Window & | window () const |
The maximum window the kernel can be executed on. More... | |
Static Public Member Functions | |
static Status | validate (const ITensorInfo *input, const ITensorInfo *output, const ITensorInfo *mean, const ITensorInfo *var, const ITensorInfo *beta=nullptr, const ITensorInfo *gamma=nullptr, float epsilon=0.001f, ActivationLayerInfo act_info=ActivationLayerInfo()) |
Static function to check if given info will lead to a valid configuration of GCBatchNormalizationLayerKernel. More... | |
Interface for the BatchNormalization layer kernel.
Definition at line 35 of file GCBatchNormalizationLayerKernel.h.
Constructor.
Definition at line 136 of file GCBatchNormalizationLayerKernel.cpp.
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Default Move Constructor.
|
default |
Default destructor.
void configure | ( | const IGCTensor * | input, |
IGCTensor * | output, | ||
const IGCTensor * | mean, | ||
const IGCTensor * | var, | ||
const IGCTensor * | beta = nullptr , |
||
const IGCTensor * | gamma = nullptr , |
||
float | epsilon = 0.001f , |
||
ActivationLayerInfo | act_info = ActivationLayerInfo() |
||
) |
Set the input and output tensors.
[in] | input | Source tensor. 3 lower dimensions represent a single input with dimensions [width, height, FM]. The rest are optional and used for representing batches. Data types supported: F16/F32. |
[out] | output | Destination tensor. Output will have the same number of dimensions as input. Data type supported: same as input |
[in] | mean | Mean values tensor. 1 dimension with size equal to the feature maps [FM]. Data types supported: Same as input |
[in] | var | Variance values tensor. 1 dimension with size equal to the feature maps [FM]. Data types supported: Same as input |
[in] | beta | (Optional) Beta values tensor info. 1 dimension with size equal to the feature maps [FM]. If not provided, default value for beta is 0. Data types supported: Same as input |
[in] | gamma | (Optional) Gamma values tensor info. 1 dimension with size equal to the feature maps [FM]. If not provided, default value for gamma is 1. Data types supported: Same as input |
[in] | epsilon | (optional) Small value to avoid division with zero. |
[in] | act_info | (Optional) Activation layer information in case of a fused activation. Only RELU, BOUNDED_RELU and LU_BOUNDED_RELU supported. |
Definition at line 141 of file GCBatchNormalizationLayerKernel.cpp.
References ActivationLayerInfo::a(), ActivationLayerInfo::activation(), ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_THROW_ON, ActivationLayerInfo::b(), GCKernelLibrary::create_kernel(), ITensorInfo::data_type(), ActivationLayerInfo::enabled(), arm_compute::quantization::epsilon, arm_compute::F32, arm_compute::float_to_string_with_full_precision(), GCKernelLibrary::get(), ITensor::info(), arm_compute::test::validation::input, arm_compute::string_from_activation_func(), arm_compute::support::cpp11::to_string(), and arm_compute::validate_arguments().
Referenced by GCBatchNormalizationLayer::configure().
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Default move assignment operator.
|
overridevirtual |
Enqueue the OpenGL ES shader to process the given window.
[in] | window | Region on which to execute the kernel. (Must be a valid region of the window returned by window()). |
Implements IGCKernel.
Definition at line 207 of file GCBatchNormalizationLayerKernel.cpp.
References IGCKernel::add_1D_tensor_argument(), IGCKernel::add_3D_tensor_argument(), ARM_COMPUTE_ERROR_ON_INVALID_SUBWINDOW, ARM_COMPUTE_ERROR_ON_UNCONFIGURED_KERNEL, Window::DimX, arm_compute::enqueue(), Window::first_slice_window_1D(), Window::first_slice_window_3D(), ITensor::info(), IGCKernel::num_arguments_per_3D_tensor(), ITensorInfo::padding(), Window::set(), IGCTensor::set_needs_shifting(), Window::shift(), arm_compute::test::validation::reference::slice(), Window::slide_window_slice_3D(), and IKernel::window().
|
static |
Static function to check if given info will lead to a valid configuration of GCBatchNormalizationLayerKernel.
[in] | input | Source tensor info. In case of output tensor info = nullptr, this tensor will store the result. 3 lower dimensions represent a single input with dimensions [width, height, FM]. The rest are optional and used for representing batches. Data types supported: F16/F32. |
[in] | output | Destination tensor info. Output will have the same number of dimensions as input. Data type supported: same as input |
[in] | mean | Mean values tensor info. 1 dimension with size equal to the feature maps [FM]. Data types supported: Same as input |
[in] | var | Variance values tensor info. 1 dimension with size equal to the feature maps [FM]. Data types supported: Same as input |
[in] | beta | (Optional) Beta values tensor info. 1 dimension with size equal to the feature maps [FM]. If not provided, default value for beta is 0. Data types supported: Same as input |
[in] | gamma | (Optional) Gamma values tensor info. 1 dimension with size equal to the feature maps [FM]. If not provided, default value for gamma is 1. Data types supported: Same as input |
[in] | epsilon | (Optional) Small value to avoid division with zero. Default value is 0.001f. |
[in] | act_info | (Optional) Activation layer information in case of a fused activation. Only RELU, BOUNDED_RELU and LU_BOUNDED_RELU supported. |
Definition at line 193 of file GCBatchNormalizationLayerKernel.cpp.
References ARM_COMPUTE_RETURN_ON_ERROR, ICloneable< T >::clone(), and arm_compute::validate_arguments().