24.02.1
|
Basic function to spatial divide a tensor. More...
#include <CLSpaceToBatchLayer.h>
Public Member Functions | |
CLSpaceToBatchLayer () | |
Default constructor. More... | |
CLSpaceToBatchLayer (const CLSpaceToBatchLayer &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
CLSpaceToBatchLayer & | operator= (const CLSpaceToBatchLayer &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
CLSpaceToBatchLayer (CLSpaceToBatchLayer &&)=default | |
Allow instances of this class to be moved. More... | |
CLSpaceToBatchLayer & | operator= (CLSpaceToBatchLayer &&)=default |
Allow instances of this class to be moved. More... | |
~CLSpaceToBatchLayer () | |
Default destructor. More... | |
void | configure (const ICLTensor *input, const ICLTensor *block_shape, const ICLTensor *paddings, ICLTensor *output) |
Set the input and output tensors. More... | |
void | configure (const CLCompileContext &compile_context, const ICLTensor *input, const ICLTensor *block_shape, const ICLTensor *paddings, ICLTensor *output) |
Set the input and output tensors. More... | |
void | configure (const ICLTensor *input, const int block_shape_x, const int block_shape_y, const Size2D &padding_left, const Size2D &padding_right, ICLTensor *output) |
Set the input and output tensors. More... | |
void | configure (const CLCompileContext &compile_context, const ICLTensor *input, const int block_shape_x, const int block_shape_y, const Size2D &padding_left, const Size2D &padding_right, ICLTensor *output) |
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, const ITensorInfo *block_shape, const ITensorInfo *paddings, const ITensorInfo *output) |
Static function to check if given info will lead to a valid configuration of CLSpaceToBatchLayer. More... | |
static Status | validate (const ITensorInfo *input, const int block_shape_x, const int block_shape_y, const Size2D &padding_left, const Size2D &padding_right, const ITensorInfo *output) |
Static function to check if given info will lead to a valid configuration of CLSpaceToBatchLayer (Static block shape and paddings) More... | |
Basic function to spatial divide a tensor.
This function calls the following OpenCL kernels/functions:
Definition at line 46 of file CLSpaceToBatchLayer.h.
Default constructor.
Definition at line 38 of file CLSpaceToBatchLayer.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 CLCompileContext & | compile_context, |
const ICLTensor * | input, | ||
const ICLTensor * | block_shape, | ||
const ICLTensor * | paddings, | ||
ICLTensor * | output | ||
) |
Set the input and output tensors.
[in] | compile_context | The compile context to be used. |
[in] | input | Tensor input. Supported tensor rank: 4. Data types supported: All. |
[in] | block_shape | 1-D tensor with shape [M]. Supported M: 2. Data types supported: S32 |
[in] | paddings | 2-D tensor with shape [2, M] (First dimension is the fastest-changing dimension). Supported M: 2. Data types supported: S32 |
[out] | output | Tensor output. Data types supported: same as input |
Definition at line 53 of file CLSpaceToBatchLayer.cpp.
References ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_LOG_PARAMS, CLFill::configure(), ITensor::info(), arm_compute::test::validation::input, ITensorInfo::tensor_shape(), and TensorShape::total_size().
void configure | ( | const CLCompileContext & | compile_context, |
const ICLTensor * | input, | ||
const int | block_shape_x, | ||
const int | block_shape_y, | ||
const Size2D & | padding_left, | ||
const Size2D & | padding_right, | ||
ICLTensor * | output | ||
) |
Set the input and output tensors.
(Static block shape and paddings)
[in] | compile_context | The compile context to be used. |
[in] | input | Tensor input. Supported tensor rank: 4. Data types supported: All. |
[in] | block_shape_x | Block shape x value. |
[in] | block_shape_y | Block shape y value. |
[in] | padding_left | The padding at the beginning of every dimension of the output tensor. |
[in] | padding_right | The padding at the end of every dimension of the output tensor. |
[out] | output | Tensor output. Data types supported: same as input |
Definition at line 82 of file CLSpaceToBatchLayer.cpp.
References ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_LOG_PARAMS, CLFill::configure(), ITensor::info(), arm_compute::test::validation::input, ITensorInfo::tensor_shape(), and TensorShape::total_size().
void configure | ( | const ICLTensor * | input, |
const ICLTensor * | block_shape, | ||
const ICLTensor * | paddings, | ||
ICLTensor * | output | ||
) |
Set the input and output tensors.
Valid data layouts:
Valid data type configurations:
src0 | src1 | src2 | dst |
---|---|---|---|
All | S32 | S32 | All |
[in] | input | Tensor input. Supported tensor rank: 4. Data types supported: All. |
[in] | block_shape | 1-D tensor with shape [M]. Supported M: 2. Data types supported: S32 |
[in] | paddings | 2-D tensor with shape [2, M] (First dimension is the fastest-changing dimension). Supported M: 2. Data types supported: S32 |
[out] | output | Tensor output. Data types supported: same as input |
Definition at line 45 of file CLSpaceToBatchLayer.cpp.
References CLKernelLibrary::get(), and arm_compute::test::validation::input.
Referenced by CLSpaceToBatchLayer::configure().
void configure | ( | const ICLTensor * | input, |
const int | block_shape_x, | ||
const int | block_shape_y, | ||
const Size2D & | padding_left, | ||
const Size2D & | padding_right, | ||
ICLTensor * | output | ||
) |
Set the input and output tensors.
(Static block shape and paddings)
[in] | input | Tensor input. Supported tensor rank: 4. Data types supported: All. |
[in] | block_shape_x | Block shape x value. |
[in] | block_shape_y | Block shape y value. |
[in] | padding_left | The padding at the beginning of every dimension of the output tensor. |
[in] | padding_right | The padding at the end of every dimension of the output tensor. |
[out] | output | Tensor output. Data types supported: same as input |
Definition at line 71 of file CLSpaceToBatchLayer.cpp.
References CLSpaceToBatchLayer::configure(), CLKernelLibrary::get(), and arm_compute::test::validation::input.
|
default |
Allow instances of this class to be moved.
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
overridevirtual |
Run the kernels contained in the function.
For CPU kernels:
For OpenCL kernels:
Implements IFunction.
Definition at line 130 of file CLSpaceToBatchLayer.cpp.
References CLScheduler::enqueue(), CLScheduler::get(), and CLFill::run().
|
static |
Static function to check if given info will lead to a valid configuration of CLSpaceToBatchLayer (Static block shape and paddings)
[in] | input | Tensor input info. Supported tensor rank: 4. Data types supported: All. |
[in] | block_shape_x | Block shape x value. |
[in] | block_shape_y | Block shape y value. |
[in] | padding_left | The padding at the beginning of every dimension of the output tensor. |
[in] | padding_right | The padding at the end of every dimension of the output tensor. |
[out] | output | Tensor output info. Data types supported: same as input |
Definition at line 115 of file CLSpaceToBatchLayer.cpp.
References ARM_COMPUTE_RETURN_ON_ERROR, arm_compute::test::validation::input, CLFill::validate(), and CLSpaceToBatchLayerKernel::validate().
|
static |
Static function to check if given info will lead to a valid configuration of CLSpaceToBatchLayer.
[in] | input | Tensor input info. Supported tensor rank: 4. Data types supported: All. |
[in] | block_shape | block shape tensor info with shape [M]. Supported M: 2. Data types supported: S32 |
[in] | paddings | paddings tensor info with shape [2, M] (First dimension is the fastest-changing dimension). Supported M: 2. Data types supported: S32 |
[out] | output | Tensor output info. Data types supported: same as input |
Definition at line 103 of file CLSpaceToBatchLayer.cpp.
References ARM_COMPUTE_RETURN_ON_ERROR, arm_compute::test::validation::input, CLFill::validate(), and CLSpaceToBatchLayerKernel::validate().