Compute Library
18.05
|
Interface for the im2col reshape kernel. More...
#include <NEIm2ColKernel.h>
Public Member Functions | |
const char * | name () const override |
Name of the kernel. More... | |
NEIm2ColKernel () | |
Default constructor. More... | |
NEIm2ColKernel (const NEIm2ColKernel &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NEIm2ColKernel & | operator= (const NEIm2ColKernel &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NEIm2ColKernel (NEIm2ColKernel &&)=default | |
Allow instances of this class to be moved. More... | |
NEIm2ColKernel & | operator= (NEIm2ColKernel &&)=default |
Allow instances of this class to be moved. More... | |
~NEIm2ColKernel ()=default | |
Default destructor. More... | |
void | configure (const ITensor *input, ITensor *output, const Size2D &kernel_dims, const PadStrideInfo &conv_info, bool has_bias, bool is_fully_connected=false, bool is_flatten=false, const Size2D &dilation=Size2D(1U, 1U)) |
Set the input and output of the kernel. More... | |
void | run (const Window &window, const ThreadInfo &info) override |
Execute the kernel on the passed window. More... | |
Public Member Functions inherited from ICPPKernel | |
virtual | ~ICPPKernel ()=default |
Default destructor. 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 Size2D &kernel_dims, const PadStrideInfo &conv_info, bool has_bias, bool is_fully_connected, bool is_flatten=false, const Size2D &dilation=Size2D(1U, 1U)) |
Static function to check if given info will lead to a valid configuration of NEIm2ColKernel. More... | |
Interface for the im2col reshape kernel.
Rearranges image blocks into columns. It is used to strip out each convolution block to a single column. It is used to transform a convolution to a plain matrix multiplication.
For example taking into account the image below and assuming 3x3 image blocks with stride of 1 we have:
\[ \left( \begin{array}{cccc} a00 & a01 & a02 & a03 \\ a10 & a11 & a12 & a13 \\ a20 & a21 & a22 & a23 \\ a30 & a31 & a32 & a33 \\ \end{array} \right) \rightarrow \left( \begin{array}{ccccccccc} a00 & a01 & a02 & a10 & a11 & a12 & a20 & a21 & a22 \\ a01 & a02 & a03 & a11 & a12 & a13 & a21 & a22 & a23 \\ a10 & a11 & a12 & a20 & a21 & a22 & a30 & a31 & a32 \\ a11 & a12 & a13 & a21 & a22 & a23 & a31 & a32 & a33 \\ \end{array} \right) \]
Definition at line 57 of file NEIm2ColKernel.h.
NEIm2ColKernel | ( | ) |
Default constructor.
Referenced by NEIm2ColKernel::name().
|
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 NEIm2ColKernel::name().
void configure | ( | const ITensor * | input, |
ITensor * | output, | ||
const Size2D & | kernel_dims, | ||
const PadStrideInfo & | conv_info, | ||
bool | has_bias, | ||
bool | is_fully_connected = false , |
||
bool | is_flatten = false , |
||
const Size2D & | dilation = Size2D(1U, 1U) |
||
) |
Set the input and output of the kernel.
[in] | input | The input tensor to convert. 3 lower dimensions represent a single input [width, height, IFM], while every optional dimension from 4 and above represent a batch of inputs. Data types supported: QS8/QS16/QASYMM8/F16/F32 Note: QASYMM8 works only for has_bias = false |
[out] | output | The output tensor. Data types supported: Same as input |
[in] | kernel_dims | The kernel dimensions (width and height). |
[in] | conv_info | Contains padding and stride information described in PadStrideInfo. |
[in] | has_bias | In case biases are provided expands the matrix with 1. |
[in] | is_fully_connected | Determines whether this kernel will be called by NEFullyConnectedLayer in order to validate the arguments |
[in] | is_flatten | (Optional) Determines whether this kernel will be called by NEFlattenLayer in order to validate the arguments |
[in] | dilation | (Optional) Dilation, in elements, across x and y. Defaults to (1, 1). |
Referenced by NEIm2ColKernel::name().
|
inlineoverridevirtual |
Name of the kernel.
Implements ICPPKernel.
Definition at line 60 of file NEIm2ColKernel.h.
References NEIm2ColKernel::configure(), arm_compute::test::validation::conv_info, arm_compute::test::validation::info(), NEIm2ColKernel::NEIm2ColKernel(), NEIm2ColKernel::operator=(), NEIm2ColKernel::run(), arm_compute::U, NEIm2ColKernel::validate(), IKernel::window(), and NEIm2ColKernel::~NEIm2ColKernel().
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
Referenced by NEIm2ColKernel::name().
|
default |
Allow instances of this class to be moved.
|
overridevirtual |
Execute the kernel on the passed window.
[in] | window | Region on which to execute the kernel. (Must be a region of the window returned by window()) |
[in] | info | Info about executing thread and CPU. |
Implements ICPPKernel.
Referenced by NEIm2ColKernel::name().
|
static |
Static function to check if given info will lead to a valid configuration of NEIm2ColKernel.
[in] | input | The input tensor to convert. 3 lower dimensions represent a single input [width, height, IFM], while every optional dimension from 4 and above represent a batch of inputs. Data types supported: QS8/QS16/QASYMM8/F16/F32 Note: QASYMM8 works only for has_bias = false |
[in] | output | The output tensor. Data types supported: Same as input |
[in] | kernel_dims | The kernel dimensions (width and height). |
[in] | conv_info | Contains padding and stride information described in PadStrideInfo. |
[in] | has_bias | In case biases are provided expands the matrix with 1. |
[in] | is_fully_connected | Determines whether this kernel will be called by NEFullyConnectedLayer in order to validate the arguments |
[in] | is_flatten | (Optional) Determines whether this kernel will be called by NEFlattenLayer in order to validate the arguments |
[in] | dilation | (Optional) Dilation, in elements, across x and y. Defaults to (1, 1). |
Referenced by NEIm2ColKernel::name().