24.02.1
|
Basic function to compute the deconvolution layer. More...
#include <CLDeconvolutionLayer.h>
Public Member Functions | |
CLDeconvolutionLayer (std::shared_ptr< IMemoryManager > memory_manager=nullptr) | |
Default constructor. More... | |
~CLDeconvolutionLayer () | |
void | configure (ICLTensor *input, ICLTensor *weights, const ICLTensor *bias, ICLTensor *output, const PadStrideInfo &deconv_info, const WeightsInfo &weights_info=WeightsInfo()) |
Set the input, weights, biases and output tensors. More... | |
void | configure (const CLCompileContext &compile_context, ICLTensor *input, ICLTensor *weights, const ICLTensor *bias, ICLTensor *output, const PadStrideInfo &deconv_info, const WeightsInfo &weights_info=WeightsInfo()) |
Set the input, weights, biases and output tensors. More... | |
void | run () override |
Run the kernels contained in the function. More... | |
void | prepare () override |
Prepare the function for executing. More... | |
Public Member Functions inherited from IFunction | |
virtual | ~IFunction ()=default |
Destructor. More... | |
Static Public Member Functions | |
static Status | validate (const ITensorInfo *input, const ITensorInfo *weights, const ITensorInfo *bias, ITensorInfo *output, const PadStrideInfo &deconv_info, const WeightsInfo &weights_info=WeightsInfo()) |
Static function to check if given info will lead to a valid configuration of CLDeconvolutionLayer. More... | |
static DeconvolutionMethod | get_deconvolution_method (const ITensorInfo *input, const ITensorInfo *weights, const ITensorInfo *bias, ITensorInfo *output, const PadStrideInfo &deconv_info, const WeightsInfo &weights_info) |
Basic function to compute the deconvolution layer.
This function calls the following OpenCL kernels/functions:
Definition at line 41 of file CLDeconvolutionLayer.h.
CLDeconvolutionLayer | ( | std::shared_ptr< IMemoryManager > | memory_manager = nullptr | ) |
Default constructor.
Definition at line 56 of file CLDeconvolutionLayer.cpp.
|
default |
void configure | ( | const CLCompileContext & | compile_context, |
ICLTensor * | input, | ||
ICLTensor * | weights, | ||
const ICLTensor * | bias, | ||
ICLTensor * | output, | ||
const PadStrideInfo & | deconv_info, | ||
const WeightsInfo & | weights_info = WeightsInfo() |
||
) |
Set the input, weights, biases and output tensors.
[in] | compile_context | The compile context to be used. |
[in,out] | input | Input tensor. 3 lower dimensions represent a single input, and an optional 4th dimension for batch of inputs. Data types supported: QASYMM8_SIGNED/QASYMM8/F16/F32. |
[in] | weights | The 4d weights with dimensions [width, height, IFM, OFM]. Data type supported: Same as input or QSYMM8_PER_CHANNEL if input is QASYMM8/QASYMM8_SIGNED. |
[in] | bias | (Optional) The biases have one dimension. Data type supported: Should match input data type, except for input of QASYMM8 and QASYMM8_SIGNED type where biases should be of S32 type |
[out] | output | Output tensor. The output has the same number of dimensions as the input . |
[in] | deconv_info | Contains padding and policies to be used in the deconvolution, this is described in PadStrideInfo. |
[in] | weights_info | (Optional) Weights information needed for CLConvolutionLayer, specifies if the weights tensor has been reshaped with opencl::kernels::ClWeightsReshapeKernel. |
Definition at line 71 of file CLDeconvolutionLayer.cpp.
References ARM_COMPUTE_ERROR, ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_LOG_PARAMS, bias, arm_compute::DIRECT, arm_compute::GEMM, CLDeconvolutionLayer::get_deconvolution_method(), ITensor::info(), arm_compute::test::validation::input, arm_compute::UPSCALE_CONV2D, and arm_compute::test::validation::weights_info.
void configure | ( | ICLTensor * | input, |
ICLTensor * | weights, | ||
const ICLTensor * | bias, | ||
ICLTensor * | output, | ||
const PadStrideInfo & | deconv_info, | ||
const WeightsInfo & | weights_info = WeightsInfo() |
||
) |
Set the input, weights, biases and output tensors.
Valid data layouts:
Valid data type configurations:
src0 | src1 | src2 | dst |
---|---|---|---|
F16 | F16 | F16 | F16 |
F32 | F32 | F32 | F32 |
QASYMM8 | QASYMM8 | S32 | QASYMM8 |
QASYMM8 | QSYMM8_PER_CHANNEL | S32 | QASYMM8 |
QASYMM8_SIGNED | QASYMM8_SIGNED | S32 | QASYMM8_SIGNED |
QASYMM8_SIGNED | QSYMM8_PER_CHANNEL | S32 | QASYMM8_SIGNED |
[in,out] | input | Input tensor. 3 lower dimensions represent a single input, and an optional 4th dimension for batch of inputs. Data types supported: QASYMM8_SIGNED/QASYMM8/F16/F32. |
[in] | weights | The 4d weights with dimensions [width, height, IFM, OFM]. Data type supported: Same as input or QSYMM8_PER_CHANNEL if input is QASYMM8/QASYMM8_SIGNED. |
[in] | bias | (Optional) The biases have one dimension. Data type supported: Should match input data type, except for input of QASYMM8 and QASYMM8_SIGNED type where biases should be of S32 type |
[out] | output | Output tensor. The output has the same number of dimensions as the input . |
[in] | deconv_info | Contains padding and policies to be used in the deconvolution, this is described in PadStrideInfo. |
[in] | weights_info | (Optional) Weights information needed for CLConvolutionLayer, specifies if the weights tensor has been reshaped with opencl::kernels::ClWeightsReshapeKernel. |
Definition at line 61 of file CLDeconvolutionLayer.cpp.
References bias, CLKernelLibrary::get(), arm_compute::test::validation::input, and arm_compute::test::validation::weights_info.
|
static |
Definition at line 157 of file CLDeconvolutionLayer.cpp.
References ARM_COMPUTE_UNUSED, arm_compute::BATCHES, bias, arm_compute::cpu::data_layout, ITensorInfo::data_type(), ITensorInfo::dimension(), arm_compute::DIRECT, arm_compute::F16, arm_compute::F32, arm_compute::GEMM, arm_compute::get_data_layout_dimension_index(), arm_compute::HEIGHT, arm_compute::test::validation::input, arm_compute::is_data_type_quantized_per_channel(), arm_compute::NHWC, PadStrideInfo::stride(), ITensorInfo::tensor_shape(), arm_compute::UPSCALE_CONV2D, arm_compute::test::validation::weights_info, and arm_compute::WIDTH.
Referenced by CLDeconvolutionLayer::configure(), and CLDeconvolutionLayer::validate().
|
overridevirtual |
Prepare the function for executing.
Any one off pre-processing step required by the function is handled here
Reimplemented from IFunction.
Definition at line 218 of file CLDeconvolutionLayer.cpp.
Referenced by CLDeconvolutionLayer::run().
|
overridevirtual |
Run the kernels contained in the function.
For CPU kernels:
For OpenCL kernels:
Implements IFunction.
Definition at line 196 of file CLDeconvolutionLayer.cpp.
References arm_compute::ACL_DST, arm_compute::ACL_SRC_0, arm_compute::ACL_SRC_1, arm_compute::ACL_SRC_2, ITensorPack::add_tensor(), arm_compute::test::validation::pack, and CLDeconvolutionLayer::prepare().
|
static |
Static function to check if given info will lead to a valid configuration of CLDeconvolutionLayer.
[in] | input | Input tensor info. 3 lower dimensions represent a single input, and an optional 4th dimension for batch of inputs. Data types supported: QASYMM8_SIGNED/QASYMM8/F16/F32. |
[in] | weights | The 4d weights info with dimensions [width, height, IFM, OFM]. Data type supported: Same as input or QSYMM8_PER_CHANNEL if input is QASYMM8/QASYMM8_SIGNED. |
[in] | bias | (Optional) The biases have one dimension. Data type supported: Should match input data type, except for input of QASYMM8 and QASYMM8_SIGNED type where biases should be of S32 type |
[in] | output | Output tensor info. The output has the same number of dimensions as the input . |
[in] | deconv_info | Contains padding and policies to be used in the deconvolution, this is described in PadStrideInfo. |
[in] | weights_info | (Optional) Weights information needed for CLConvolutionLayer, specifies if the weights tensor has been reshaped with opencl::kernels::ClWeightsReshapeKernel. |
Definition at line 119 of file CLDeconvolutionLayer.cpp.
References ARM_COMPUTE_ERROR, ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR, ARM_COMPUTE_RETURN_ON_ERROR, bias, arm_compute::DIRECT, arm_compute::GEMM, CLDeconvolutionLayer::get_deconvolution_method(), arm_compute::test::validation::input, arm_compute::UPSCALE_CONV2D, ClTransposedConvolution::validate(), CLGEMMDeconvolutionLayer::validate(), CLDirectDeconvolutionLayer::validate(), and arm_compute::test::validation::weights_info.