21.02
|
Basic function to compute the convolution layer. More...
#include <GCConvolutionLayer.h>
Public Member Functions | |
GCConvolutionLayer (std::shared_ptr< IMemoryManager > memory_manager=nullptr) | |
Default constructor. More... | |
GCConvolutionLayer (const GCConvolutionLayer &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
GCConvolutionLayer (GCConvolutionLayer &&)=default | |
Default move constructor. More... | |
GCConvolutionLayer & | operator= (const GCConvolutionLayer &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
GCConvolutionLayer & | operator= (GCConvolutionLayer &&)=default |
Default move assignment operator. More... | |
void | configure (const IGCTensor *input, const IGCTensor *weights, const IGCTensor *biases, IGCTensor *output, const PadStrideInfo &conv_info, const WeightsInfo &weights_info=WeightsInfo(), const Size2D &dilation=Size2D(1U, 1U), const ActivationLayerInfo &act_info=ActivationLayerInfo(), unsigned int num_groups=1) |
Set the input 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... | |
Basic function to compute the convolution layer.
This function calls the following GLES kernels:
Definition at line 82 of file GCConvolutionLayer.h.
GCConvolutionLayer | ( | std::shared_ptr< IMemoryManager > | memory_manager = nullptr | ) |
Default constructor.
Definition at line 68 of file GCConvolutionLayer.cpp.
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Default move constructor.
void configure | ( | const IGCTensor * | input, |
const IGCTensor * | weights, | ||
const IGCTensor * | biases, | ||
IGCTensor * | output, | ||
const PadStrideInfo & | conv_info, | ||
const WeightsInfo & | weights_info = WeightsInfo() , |
||
const Size2D & | dilation = Size2D(1U, 1U) , |
||
const ActivationLayerInfo & | act_info = ActivationLayerInfo() , |
||
unsigned int | num_groups = 1 |
||
) |
Set the input and output tensors.
[in] | input | Source tensor. 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: F16/F32. |
[in] | weights | Weights tensor. Weights are 4D tensor with dimensions [kernel_x, kernel_y, IFM, OFM]. Data type supported: Same as input . |
[in] | biases | Biases tensor. Shared biases supported. Biases are 1D tensor with dimensions [OFM]. Data type supported: Should match input data type, except for input of QASYMM8 type where biases should be of S32 type. |
[out] | output | Destination tensor. 3 lower dimensions represent a single output [width, height, OFM], while the rest represent batch of outputs. Data types supported: Same as input . |
[in] | conv_info | Contains padding and stride information described in PadStrideInfo. |
[in] | weights_info | Specifies if the weights tensor has been reshaped with GCWeightsReshapeKernel. If this is not part of the fully connected layer the weights tensor has also been transposed with GCGEMMTranspose1xWKernel. Data type supported: Same as input . |
[in] | dilation | (Optional) Dilation, in elements, across x and y. Defaults to (1, 1). |
[in] | act_info | (Optional) Activation layer information in case of a fused activation. |
[in] | num_groups | (Optional) Number of groups when performing a grouped convolution. num_groups != 1 is not supported |
Definition at line 89 of file GCConvolutionLayer.cpp.
References ITensorAllocator::allocate(), GCTensor::allocator(), WeightsInfo::are_reshaped(), ARM_COMPUTE_ERROR_ON, ARM_COMPUTE_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN, ARM_COMPUTE_ERROR_ON_MISMATCHING_DATA_TYPES, ARM_COMPUTE_ERROR_ON_MSG, ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_UNUSED, GCFillBorderKernel::configure(), GCConvolutionLayerReshapeWeights::configure(), GCActivationLayer::configure(), GCCol2ImKernel::configure(), GCIm2ColKernel::configure(), arm_compute::CONSTANT, arm_compute::test::validation::conv_info, ITensorInfo::data_type(), ITensorInfo::dimension(), dt, ActivationLayerInfo::enabled(), ITensorInfo::extend_padding(), arm_compute::F16, arm_compute::F32, GCScheduler::get(), ITensor::info(), GCTensor::info(), ITensorAllocator::init(), MemoryGroup::manage(), ITensorInfo::num_dimensions(), arm_compute::scaled_dimensions(), TensorShape::set(), IGCKernel::set_target(), PadStrideInfo::stride(), ITensorInfo::tensor_shape(), and TensorInfo::tensor_shape().
|
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 225 of file GCConvolutionLayer.cpp.
References ITensorAllocator::allocate(), GCTensor::allocator(), ARM_COMPUTE_ERROR_ON, ITensor::is_used(), ITensor::mark_as_unused(), and GCConvolutionLayerReshapeWeights::run().
Referenced by GCConvolutionLayer::run().
|
overridevirtual |
Run the kernels contained in the function.
For Neon kernels:
For OpenCL kernels:
Implements IFunction.
Definition at line 199 of file GCConvolutionLayer.cpp.
References GCScheduler::dispatch(), GCScheduler::get(), GCScheduler::memory_barrier(), GCConvolutionLayer::prepare(), IGCSimpleFunction::run(), and GCGEMM::run().