21.08
|
Function to execute a depthwise convolution. More...
#include <CLDepthwiseConvolutionLayer.h>
Public Member Functions | |
CLDepthwiseConvolutionLayer (std::shared_ptr< IMemoryManager > memory_manager=nullptr) | |
Default constructor. More... | |
CLDepthwiseConvolutionLayer (const CLDepthwiseConvolutionLayer &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
CLDepthwiseConvolutionLayer (CLDepthwiseConvolutionLayer &&)=default | |
Default move constructor. More... | |
CLDepthwiseConvolutionLayer & | operator= (const CLDepthwiseConvolutionLayer &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
CLDepthwiseConvolutionLayer & | operator= (CLDepthwiseConvolutionLayer &&)=default |
Default move assignment operator. More... | |
~CLDepthwiseConvolutionLayer () | |
Default destructor. More... | |
void | configure (const CLCompileContext &compile_context, ICLTensor *input, const ICLTensor *weights, const ICLTensor *biases, ICLTensor *output, const PadStrideInfo &conv_info, unsigned int depth_multiplier=1, ActivationLayerInfo act_info=ActivationLayerInfo(), const Size2D &dilation=Size2D(1U, 1U)) |
Initialize the function's source, destination, weights and convolution information. More... | |
void | configure (ICLTensor *input, const ICLTensor *weights, const ICLTensor *biases, ICLTensor *output, const PadStrideInfo &conv_info, unsigned int depth_multiplier=1, ActivationLayerInfo act_info=ActivationLayerInfo(), const Size2D &dilation=Size2D(1U, 1U)) |
Initialize the function's source, destination, weights and convolution information. More... | |
void | run () override |
Run the kernels contained in the function. More... | |
void | prepare () override |
Prepare the function for executing. More... | |
void | set_memory_group (std::shared_ptr< IMemoryManager > memory_manager) |
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 *biases, const ITensorInfo *output, const PadStrideInfo &conv_info, unsigned int depth_multiplier=1, ActivationLayerInfo act_info=ActivationLayerInfo(), const Size2D &dilation=Size2D(1U, 1U)) |
Static function to check if given info will lead to a valid configuration of CLDepthwiseConvolutionLayer. More... | |
Function to execute a depthwise convolution.
Definition at line 45 of file CLDepthwiseConvolutionLayer.h.
CLDepthwiseConvolutionLayer | ( | std::shared_ptr< IMemoryManager > | memory_manager = nullptr | ) |
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Default move constructor.
|
default |
Default destructor.
void configure | ( | const CLCompileContext & | compile_context, |
ICLTensor * | input, | ||
const ICLTensor * | weights, | ||
const ICLTensor * | biases, | ||
ICLTensor * | output, | ||
const PadStrideInfo & | conv_info, | ||
unsigned int | depth_multiplier = 1 , |
||
ActivationLayerInfo | act_info = ActivationLayerInfo() , |
||
const Size2D & | dilation = Size2D(1U, 1U) |
||
) |
Initialize the function's source, destination, weights and convolution information.
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] | compile_context | The compile context to be used. |
[in,out] | input | Source tensor. Data type supported: QASYMM8/QASYMM8_SIGNED/FP16/FP32. Data layout supported: NHWC, NCHW |
[in] | weights | Weights tensor. These are 3D tensors with shape [kernel_x, kernel_y, IFM]. Data type supported: Same as input or QASYMM8/QASYMM8_SIGNED/QSYMM8_PER_CHANNEL when input is QASYMM8. |
[in] | biases | Biases tensor. A 1D tensor with shape [IFM]. Must be nullptr if not needed. Data type supported: Same as input , S32 when input is QASYMM8/QASYMM8_SIGNED. |
[out] | output | Destination tensor. Pass in nullptr or input for in-place operation. Data type supported: same as input . |
[in] | conv_info | Padding and stride information to use for the convolution. |
[in] | depth_multiplier | (Optional) Multiplier to apply to the input's depth in order to retrieve the output's depth. Defaults to 1. |
[in] | act_info | (Optional) Activation layer information in case of a fused activation. |
[in] | dilation | (Optional) Dilation, in elements, across x and y. Defaults to (1, 1). |
Definition at line 161 of file CLDepthwiseConvolutionLayer.cpp.
References CLTensorAllocator::allocate(), CLTensor::allocator(), ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_THROW_ON, arm_compute::CHANNEL, CLPermute::configure(), arm_compute::test::validation::conv_info, ITensorInfo::data_layout(), ITensorInfo::data_type(), ITensorInfo::dimension(), CLScheduler::get(), arm_compute::get_data_layout_dimension_index(), ITensor::info(), CLTensor::info(), ITensorAllocator::init(), arm_compute::test::validation::input, arm_compute::is_data_type_quantized(), arm_compute::is_data_type_quantized_per_channel(), MemoryGroup::manage(), arm_compute::NCHW, arm_compute::NHWC, ITensorInfo::quantization_info(), arm_compute::S32, TensorInfo::set_data_layout(), TensorInfo::set_quantization_info(), CLScheduler::target(), arm_compute::U, and CLDepthwiseConvolutionLayer::validate().
Referenced by CLDepthwiseConvolutionLayer::configure().
void configure | ( | ICLTensor * | input, |
const ICLTensor * | weights, | ||
const ICLTensor * | biases, | ||
ICLTensor * | output, | ||
const PadStrideInfo & | conv_info, | ||
unsigned int | depth_multiplier = 1 , |
||
ActivationLayerInfo | act_info = ActivationLayerInfo() , |
||
const Size2D & | dilation = Size2D(1U, 1U) |
||
) |
Initialize the function's source, destination, weights and convolution information.
Similar to CLDepthwiseConvolutionLayer::configure()
Definition at line 155 of file CLDepthwiseConvolutionLayer.cpp.
References CLDepthwiseConvolutionLayer::configure(), and CLKernelLibrary::get().
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Default move assignment operator.
|
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 340 of file CLDepthwiseConvolutionLayer.cpp.
References CLTensorAllocator::allocate(), CLTensor::allocator(), ARM_COMPUTE_ERROR_ON, arm_compute::quantization::compute_quantized_multipliers_and_shifts(), ITensor::info(), ITensor::is_used(), CLTensor::map(), ITensor::mark_as_unused(), ITensor::ptr_to_element(), CLPermute::run(), and CLTensor::unmap().
Referenced by CLDepthwiseConvolutionLayer::run().
|
overridevirtual |
Run the kernels contained in the function.
For CPU kernels:
For OpenCL kernels:
Implements IFunction.
Definition at line 323 of file CLDepthwiseConvolutionLayer.cpp.
References CLScheduler::enqueue(), CLScheduler::get(), CLDepthwiseConvolutionLayer::prepare(), and CLPermute::run().
|
inline |
Definition at line 113 of file CLDepthwiseConvolutionLayer.h.
|
static |
Static function to check if given info will lead to a valid configuration of CLDepthwiseConvolutionLayer.
Similar to CLDepthwiseConvolutionLayer::configure()
Definition at line 247 of file CLDepthwiseConvolutionLayer.cpp.
References ARM_COMPUTE_RETURN_ERROR_ON, ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN, ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_LAYOUT, ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES, ARM_COMPUTE_RETURN_ERROR_ON_MSG, ARM_COMPUTE_RETURN_ON_ERROR, arm_compute::CHANNEL, ICloneable< T >::clone(), arm_compute::misc::shape_calculator::compute_depthwise_convolution_shape(), arm_compute::test::validation::conv_info, ITensorInfo::data_layout(), ITensorInfo::data_type(), ITensorInfo::dimension(), CLScheduler::get(), arm_compute::get_data_layout_dimension_index(), arm_compute::HEIGHT, arm_compute::test::validation::info, arm_compute::test::validation::input, arm_compute::is_data_type_quantized(), arm_compute::is_data_type_quantized_per_channel(), arm_compute::NCHW, arm_compute::NHWC, PadStrideInfo::pad_bottom(), PadStrideInfo::pad_left(), PadStrideInfo::pad_right(), PadStrideInfo::pad_top(), arm_compute::permute(), arm_compute::QSYMM8_PER_CHANNEL, arm_compute::S32, CLScheduler::target(), ITensorInfo::tensor_shape(), arm_compute::U, CLDepthwiseConvolutionLayerNativeKernel::validate(), CLPermute::validate(), arm_compute::WIDTH, Size2D::x(), and Size2D::y().
Referenced by CLDepthwiseConvolutionLayer::configure(), and arm_compute::test::validation::DATA_TEST_CASE().