21.05
|
Basic function to compute the convolution layer. More...
#include <NEGEMMConv2d.h>
Public Member Functions | |
NEGEMMConv2d (const std::shared_ptr< IMemoryManager > &memory_manager=nullptr) | |
Constructor. More... | |
NEGEMMConv2d (const NEGEMMConv2d &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NEGEMMConv2d (NEGEMMConv2d &&)=default | |
Default move constructor. More... | |
NEGEMMConv2d & | operator= (const NEGEMMConv2d &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NEGEMMConv2d & | operator= (NEGEMMConv2d &&)=default |
Default move assignment operator. More... | |
~NEGEMMConv2d () | |
Destructor. More... | |
void | configure (ITensor *input, const ITensor *weights, const ITensor *biases, ITensor *output, const Conv2dInfo &info) |
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... | |
Static Public Member Functions | |
static Status | validate (const ITensorInfo *input, const ITensorInfo *weights, const ITensorInfo *biases, const ITensorInfo *output, const Conv2dInfo &info) |
Static function to check if given info will lead to a valid configuration of NEGEMMConv2d. More... | |
Basic function to compute the convolution layer.
This function calls the following kernels/functions:
Supports only NHWC data layout
Weights are transformed from OHWI to HWIO format using the following kernels:
Definition at line 51 of file NEGEMMConv2d.h.
NEGEMMConv2d | ( | const std::shared_ptr< IMemoryManager > & | memory_manager = nullptr | ) |
Constructor.
Definition at line 85 of file NEGEMMConv2d.cpp.
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
default |
Default move constructor.
|
default |
Destructor.
void configure | ( | ITensor * | input, |
const ITensor * | weights, | ||
const ITensor * | biases, | ||
ITensor * | output, | ||
const Conv2dInfo & | info | ||
) |
Set the input and output tensors.
Valid data layouts:
Valid data type configurations:
src0 | src1 | src2 | dst |
---|---|---|---|
QASYMM8 | QASYMM8 | S32 | QASYMM8 |
QASYMM8_SIGNED | QASYMM8_SIGNED | S32 | QASYMM8_SIGNED |
F16 | F16 | F16 | F16 |
F32 | F32 | F32 | F32 |
BFLOAT16 | BFLOAT16 | BFLOAT16 | BFLOAT16 |
[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: QASYMM8/QASYMM8_SIGNED/BFLOAT16/F16/F32. |
[in] | weights | Weights tensor. Weights are 4D tensor with dimensions [kernel_x, kernel_y, IFM, OFM]. Data type supported: QASYMM8/QASYMM8_SIGNED/QSYMM8_PER_CHANNEL/BFLOAT16/F16/F32. |
[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/QASYMM8_SIGNED 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] | info | Convolution layer descriptor |
Definition at line 93 of file NEGEMMConv2d.cpp.
References ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_THROW_ON, NEPermute::configure(), NEActivationLayer::configure(), ITensor::info(), arm_compute::test::validation::info, arm_compute::test::validation::input, arm_compute::is_data_type_quantized(), AsmGemmInfo::output_stage, and NEGEMMConv2d::validate().
|
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 166 of file NEGEMMConv2d.cpp.
References TensorAllocator::allocate(), Tensor::allocator(), ITensor::mark_as_unused(), and NEPermute::run().
Referenced by NEGEMMConv2d::run().
|
overridevirtual |
Run the kernels contained in the function.
For CPU kernels:
For OpenCL kernels:
Implements IFunction.
Definition at line 156 of file NEGEMMConv2d.cpp.
References NEGEMMConv2d::prepare(), and NEActivationLayer::run().
|
static |
Static function to check if given info will lead to a valid configuration of NEGEMMConv2d.
[in] | input | Source tensor info. 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: QASYMM8/QASYMM8_SIGNED/BFLOAT16/F16/F32. |
[in] | weights | Weights tensor info. Weights are 4D tensor with dimensions [kernel_x, kernel_y, IFM, OFM]. Data type supported: QASYMM8/QASYMM8_SIGNED/QSYMM8_PER_CHANNEL/BFLOAT16/F16/F32. |
[in] | biases | Biases tensor info. Shared biases supported. Biases are 1D tensor with dimensions [OFM]. Data type supported: Should match input data type, except for input of QASYMM8/QASYMM8_SIGNED type where biases should be of S32 type. |
[in] | output | Destination tensor info. 3 lower dimensions represent a single output [width, height, OFM], while the rest represent batch of outputs. Data types supported: Same as input . |
[in] | info | Contains padding and stride information described in PadStrideInfo. |
Definition at line 119 of file NEGEMMConv2d.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_ERROR_ON_NULLPTR, ARM_COMPUTE_RETURN_ON_ERROR, arm_compute::BFLOAT16, arm_compute::test::validation::data_type, ITensorInfo::dimension(), arm_compute::F16, arm_compute::F32, arm_compute::test::validation::info, arm_compute::test::validation::input, arm_compute::is_data_type_quantized_asymmetric(), arm_compute::NHWC, ITensorInfo::num_dimensions(), arm_compute::QASYMM8, arm_compute::QASYMM8_SIGNED, arm_compute::QSYMM8_PER_CHANNEL, arm_compute::S32, ITensorInfo::tensor_shape(), arm_compute::U, and NEGEMMAssemblyDispatch::validate().
Referenced by NEGEMMConv2d::configure(), NEConvolutionLayer::get_convolution_method(), and NEConvolutionLayer::validate().