ARM Compute Library
17.04
|
Interface for the weights reshape kernel used by convolution and fully connected layers. More...
#include <CLConvolutionLayerWeightsReshapeKernel.h>
Public Member Functions | |
CLConvolutionLayerWeightsReshapeKernel () | |
Default constructor. More... | |
CLConvolutionLayerWeightsReshapeKernel (const CLConvolutionLayerWeightsReshapeKernel &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
CLConvolutionLayerWeightsReshapeKernel & | operator= (const CLConvolutionLayerWeightsReshapeKernel &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
CLConvolutionLayerWeightsReshapeKernel (CLConvolutionLayerWeightsReshapeKernel &&)=default | |
Allow instances of this class to be moved. More... | |
CLConvolutionLayerWeightsReshapeKernel & | operator= (CLConvolutionLayerWeightsReshapeKernel &&)=default |
Allow instances of this class to be moved. More... | |
~CLConvolutionLayerWeightsReshapeKernel ()=default | |
Default destructor. More... | |
void | configure (const ICLTensor *input, const ICLTensor *biases, ICLTensor *output) |
Set the input and output of the kernel. More... | |
void | run (const Window &window, cl::CommandQueue &queue) override |
Enqueue the OpenCL kernel to process the given window on the passed OpenCL command queue. More... | |
![]() | |
ICLKernel () | |
Constructor. More... | |
cl::Kernel & | kernel () |
Returns a reference to the OpenCL kernel of this object. More... | |
void | add_1D_tensor_argument (unsigned int &idx, const ICLTensor *tensor, 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 ICLTensor *tensor, 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 ICLTensor *tensor, 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... | |
template<typename T > | |
void | add_argument (unsigned int &idx, T value) |
Add the passed parameters to the object's kernel's arguments starting from the index idx. More... | |
![]() | |
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... | |
Interface for the weights reshape kernel used by convolution and fully connected layers.
Rearranges each 3-dimensional kernel to a single row leading to a matrix with linearized kernels. In combination with the CLIm2ColKernel can transform a convolution into a matrix multiplication.
For example assuming a 3D weight kernel of 3x3 dimensions and depth of 2 we have:
\[ \left( \begin{array}{ccc} a000 & a001 & a002 \\ a010 & a011 & a012 \\ a020 & a021 & a022 \\ \end{array} \right) \left( \begin{array}{ccc} a100 & a101 & a102 \\ a110 & a111 & a112 \\ a120 & a121 & a122 \\ \end{array} \right) \rightarrow \left( \begin{array}{ccccccccc} a000 & a001 & a002 & a010 & a011 & a012 & a020 & a021 & a022 & a100 & a101 & a102 & a110 & a111 & a112 & a120 & a121 & a122 \\ \end{array} \right) \]
Definition at line 54 of file CLConvolutionLayerWeightsReshapeKernel.h.
Default constructor.
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
Allow instances of this class to be moved.
|
default |
Default destructor.
Set the input and output of the kernel.
[in] | input | The input tensor to convert. Weights are 4D tensor with dimensions [kernel_x, kernel_y, IFM, OFM]. Data types supported: F16, F32 |
[in] | biases | The shared biases tensor to append. Bias is 1D tensor with dimensions [OFM]. Data types supported: Same as input |
[out] | output | The output tensor. Should be a 2D Tensor. Data types supported: Same as input |
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Allow instances of this class to be moved.
|
overridevirtual |
Enqueue the OpenCL kernel to process the given window on the passed OpenCL command queue.
[in] | window | Region on which to execute the kernel. (Must be a valid region of the window returned by window()). |
[in,out] | queue | Command queue on which to enqueue the kernel. |
Implements ICLKernel.