23.08
|
Function to run the direct convolution. More...
#include <CpuDirectConv2d.h>
Public Member Functions | |
CpuDirectConv2d (std::shared_ptr< IMemoryManager > memory_manager=nullptr) | |
~CpuDirectConv2d () | |
void | configure (ITensorInfo *src, ITensorInfo *weights, const ITensorInfo *bias, ITensorInfo *dst, const PadStrideInfo &conv_info, const ActivationLayerInfo &act_info=ActivationLayerInfo()) |
Set the input, weights, biases and output tensors. More... | |
void | run (ITensorPack &tensors) override |
Run the kernels contained in the function. More... | |
![]() | |
INEOperator (IRuntimeContext *ctx=nullptr) | |
Constructor. More... | |
INEOperator (const INEOperator &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
INEOperator (INEOperator &&)=default | |
Default move constructor. More... | |
INEOperator & | operator= (const INEOperator &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
INEOperator & | operator= (INEOperator &&)=default |
Default move assignment operator. More... | |
~INEOperator () | |
Default destructor. More... | |
void | prepare (ITensorPack &constants) override |
Prepare the function for executing. More... | |
MemoryRequirements | workspace () const override |
Return the memory requirements required by the workspace. More... | |
![]() | |
virtual | ~IOperator ()=default |
Destructor. More... | |
Static Public Member Functions | |
static Status | validate (const ITensorInfo *src, const ITensorInfo *weights, const ITensorInfo *bias, const ITensorInfo *dst, const PadStrideInfo &conv_info, const ActivationLayerInfo &act_info=ActivationLayerInfo()) |
Static function to check if given info will lead to a valid configuration. More... | |
Function to run the direct convolution.
This function calls the following kernels:
Definition at line 55 of file CpuDirectConv2d.h.
CpuDirectConv2d | ( | std::shared_ptr< IMemoryManager > | memory_manager = nullptr | ) |
Definition at line 38 of file CpuDirectConv2d.cpp.
|
default |
void configure | ( | ITensorInfo * | src, |
ITensorInfo * | weights, | ||
const ITensorInfo * | bias, | ||
ITensorInfo * | dst, | ||
const PadStrideInfo & | conv_info, | ||
const ActivationLayerInfo & | act_info = ActivationLayerInfo() |
||
) |
Set the input, weights, biases and output tensors.
[in,out] | src | Input tensor info. Data types supported: F16/F32. |
[in] | weights | Set of kernels to convolve the input volume. Supported sizes: 1x1, 3x3 and 5x5. The 3rd dimension must be the same as the input's volume 3rd dimension. Data type supported: Same as src . |
[in] | bias | Set of biases. Can be nullptr. Data type supported: Same as src . |
[out] | dst | Output tensor info. The 3rd dimensions must be equal to the 4th dimension of the kernels tensor. Data types supported: Same as input . |
[in] | conv_info | Contains padding and stride information described in PadStrideInfo. |
[in] | act_info | (Optional) Activation layer information in case of a fused activation. |
Definition at line 44 of file CpuDirectConv2d.cpp.
References arm_compute::test::validation::act_info, Tensor::allocator(), ARM_COMPUTE_ERROR_ON, ARM_COMPUTE_LOG_PARAMS, bias, Tensor::buffer(), arm_compute::CONSTANT, arm_compute::test::validation::conv_info, Window::DimY, Window::DimZ, arm_compute::test::validation::dst, TensorAllocator::free(), arm_compute::NCHW, arm_compute::test::validation::src, and arm_compute::UNKNOWN.
|
overridevirtual |
Run the kernels contained in the function.
[in] | tensors | Vector that contains the tensors to operate on. |
Reimplemented from INEOperator.
Definition at line 117 of file CpuDirectConv2d.cpp.
References arm_compute::ACL_DST, arm_compute::ACL_SRC, arm_compute::ACL_SRC_0, arm_compute::ACL_SRC_1, arm_compute::ACL_SRC_2, arm_compute::ACL_SRC_DST, ITensorPack::add_tensor(), bias, Window::DimY, Window::DimZ, arm_compute::test::validation::dst, Scheduler::get(), ITensorPack::get_const_tensor(), ITensorPack::get_tensor(), arm_compute::test::validation::pack, IScheduler::schedule_op(), and arm_compute::test::validation::src.
|
static |
Static function to check if given info will lead to a valid configuration.
Similar to CpuDirectConv2d::configure()
Definition at line 86 of file CpuDirectConv2d.cpp.
References arm_compute::test::validation::act_info, 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, bias, arm_compute::test::validation::conv_info, arm_compute::test::validation::data_type, ITensorInfo::dimension(), arm_compute::test::validation::dst, arm_compute::test::validation::src, CpuActivation::validate(), CpuDirectConv2dOutputStageKernel::validate(), and CpuDirectConv2dKernel::validate().
Referenced by CpuConv2d::get_convolution_method(), NEDirectConvolutionLayer::validate(), and CpuConv2d::validate().