24.02.1
|
Go to the documentation of this file.
45 struct CLDeconvolutionLayer::Impl
51 std::unique_ptr<opencl::IClOperator> op{
nullptr};
57 : _memory_manager(std::move(memory_manager)), _function(), _impl(std::make_unique<Impl>())
87 auto op = std::make_unique<opencl::ClTransposedConvolution>();
88 op->configure(compile_context,
input->info(), weights->
info(),
bias !=
nullptr ?
bias->info() :
nullptr,
89 output->
info(), deconv_info);
92 _impl->weights = weights;
96 _impl->op = std::move(op);
101 auto f = std::make_unique<CLDirectDeconvolutionLayer>();
103 _function = std::move(f);
108 auto f = std::make_unique<CLGEMMDeconvolutionLayer>(_memory_manager);
109 f->configure(compile_context,
input, weights,
bias, output, deconv_info);
110 _function = std::move(f);
200 if (_impl->op !=
nullptr)
210 _impl->op->run(
pack);
220 if (_impl->op ==
nullptr)
222 _function->prepare();
Convolution Layer Weights Information class.
SimpleTensor< float > src
virtual const TensorShape & tensor_shape() const =0
Size for each dimension of the tensor.
DataLayout
[DataLayout enum definition]
@ NHWC
Num samples, height, width, channels.
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.
DeconvolutionMethod
Available DeconvolutionMethod.
Interface for OpenCL tensor.
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
void add_tensor(int id, ITensor *tensor)
Add tensor to the pack.
void run() override
Run the kernels contained in the function.
void prepare() override
Prepare the function for executing.
static CLKernelLibrary & get()
Access the KernelLibrary singleton.
constexpr auto data_layout
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
virtual size_t dimension(size_t index) const =0
Return the size of the requested dimension.
#define ARM_COMPUTE_ERROR_ON_NULLPTR(...)
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
Interface to enqueue OpenCL kernels and get/set the OpenCL CommandQueue and ICLTuner.
virtual DataType data_type() const =0
Data type used for each element of the tensor.
bool is_data_type_quantized_per_channel(DataType dt)
Check if a given data type is of per channel type.
@ GEMM
Deconvolution using GEMM.
#define ARM_COMPUTE_UNUSED(...)
To avoid unused variables warnings.
size_t get_data_layout_dimension_index(const DataLayout &data_layout, const DataLayoutDimension &data_layout_dimension)
Get the index of the given dimension.
static Status validate(const ITensorInfo *input, const ITensorInfo *weights, const ITensorInfo *bias, const ITensorInfo *output, const PadStrideInfo &deconv_info)
Static function to check if given info will lead to a valid configuration of CLDeconvolutionLayer.
static Status validate(const ITensorInfo *input, const ITensorInfo *weights, const ITensorInfo *bias, ITensorInfo *output, const PadStrideInfo &info, const WeightsInfo &weights_info=WeightsInfo())
Static function to check if given info will lead to a valid configuration of CLDirectDeconvolutionLay...
CLDeconvolutionLayer(std::shared_ptr< IMemoryManager > memory_manager=nullptr)
Default constructor.
@ DIRECT
Direct deconvolution.
static Status validate(const ITensorInfo *input, const ITensorInfo *weights, const ITensorInfo *biases, const ITensorInfo *output, const PadStrideInfo &deconv_info)
Static function to check if given info will lead to a valid configuration.
Copyright (c) 2017-2024 Arm Limited.
@ F16
16-bit floating-point number
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
@ UPSCALE_CONV2D
Deconvolution with Upscaling.
Store the tensor's metadata.
@ F32
32-bit floating-point number
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.
static DeconvolutionMethod get_deconvolution_method(const ITensorInfo *input, const ITensorInfo *weights, const ITensorInfo *bias, ITensorInfo *output, const PadStrideInfo &deconv_info, const WeightsInfo &weights_info)
#define ARM_COMPUTE_LOG_PARAMS(...)
std::pair< unsigned int, unsigned int > stride() const
Get the stride.