21.02
|
Basic function to simulate a convolution layer. More...
#include <NEWinogradConvolutionLayer.h>
Public Member Functions | |
NEWinogradConvolutionLayer (const std::shared_ptr< IMemoryManager > &memory_manager=nullptr) | |
Constructor. More... | |
NEWinogradConvolutionLayer (NEWinogradConvolutionLayer &&)=delete | |
Prevent instances of this class from being moved (As this class contains non movable objects) More... | |
NEWinogradConvolutionLayer & | operator= (NEWinogradConvolutionLayer &&)=delete |
Prevent instances of this class from being moved (As this class contains non movable objects) More... | |
~NEWinogradConvolutionLayer ()=default | |
Default destructor. More... | |
void | configure (const ITensor *input, const ITensor *weights, const ITensor *biases, ITensor *output, const PadStrideInfo &conv_info, const ActivationLayerInfo &act_info=ActivationLayerInfo(), bool enable_fast_math=false) |
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... | |
NEWinogradConvolutionLayer (const NEWinogradConvolutionLayer &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NEWinogradConvolutionLayer & | operator= (const NEWinogradConvolutionLayer &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) 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 PadStrideInfo &conv_info, const ActivationLayerInfo &act_info=ActivationLayerInfo(), bool enable_fast_math=false) |
Static function to check if given info will lead to a valid configuration of NEGEMMConvolutionLayer. More... | |
Basic function to simulate a convolution layer.
This function calls the following Neon kernels:
Definition at line 54 of file NEWinogradConvolutionLayer.h.
NEWinogradConvolutionLayer | ( | const std::shared_ptr< IMemoryManager > & | memory_manager = nullptr | ) |
Constructor.
Definition at line 303 of file NEWinogradConvolutionLayer.cpp.
|
delete |
Prevent instances of this class from being moved (As this class contains non movable objects)
|
default |
Default destructor.
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
void configure | ( | const ITensor * | input, |
const ITensor * | weights, | ||
const ITensor * | biases, | ||
ITensor * | output, | ||
const PadStrideInfo & | conv_info, | ||
const ActivationLayerInfo & | act_info = ActivationLayerInfo() , |
||
bool | enable_fast_math = false |
||
) |
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 . Currently only 3x3 and 5x5 kernels are supported. |
[in] | biases | Biases tensor. Shared biases supported. Biases are 1D tensor with dimensions [OFM]. Data type supported: Same as weights . |
[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. Currently only unit strides are supported. |
[in] | act_info | (Optional) Activation layer information in case of a fused activation. |
[in] | enable_fast_math | (Optional) Enable fast math computation. In case this flag were set, the function could dispatch the fastest implementation available which may introduce a drop of accuracy as well. Default is false |
Definition at line 310 of file NEWinogradConvolutionLayer.cpp.
References TensorAllocator::allocate(), Tensor::allocator(), ARM_COMPUTE_ERROR, ARM_COMPUTE_ERROR_ON_MSG, ARM_COMPUTE_ERROR_ON_NULLPTR, ARM_COMPUTE_ERROR_THROW_ON, arm_compute::CHANNEL, CPPPermute::configure(), NEActivationLayer::configure(), NEGEMM::configure(), arm_compute::test::validation::conv_info, ITensorInfo::data_layout(), ITensorInfo::data_type(), ITensorInfo::dimension(), ITensorInfo::element_size(), ActivationLayerInfo::enabled(), arm_compute::F16, arm_compute::F32, Scheduler::get(), arm_compute::get_data_layout_dimension_index(), Size2D::height, arm_compute::HEIGHT, arm_gemm::iceildiv(), ITensor::info(), arm_compute::test::validation::info, TensorAllocator::init(), TensorInfo::init(), arm_compute::test::validation::input, MemoryGroup::manage(), arm_compute::NCHW, IScheduler::num_threads(), arm_compute::test::validation::output_shape, PadStrideInfo::pad_left(), PadStrideInfo::pad_top(), arm_gemm::roundup(), Dimensions< T >::set(), arm_compute::U, arm_compute::validate_arguments(), Size2D::width, and arm_compute::WIDTH.
|
delete |
Prevent instances of this class from being moved (As this class contains non movable objects)
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
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 757 of file NEWinogradConvolutionLayer.cpp.
References TensorAllocator::allocate(), Tensor::allocator(), Window::DimX, TensorAllocator::free(), Scheduler::get(), ITensor::is_used(), ITensor::mark_as_unused(), NEGEMM::prepare(), ICPPSimpleFunction::run(), and IScheduler::schedule().
Referenced by NEWinogradConvolutionLayer::run().
|
overridevirtual |
Run the kernels contained in the function.
For Neon kernels:
For OpenCL kernels:
Implements IFunction.
Definition at line 612 of file NEWinogradConvolutionLayer.cpp.
References ITensorInfo::data_layout(), Window::DimX, Scheduler::get(), ITensor::info(), arm_compute::NCHW, NEWinogradConvolutionLayer::prepare(), ICPPSimpleFunction::run(), NEActivationLayer::run(), NEGEMM::run(), and IScheduler::schedule().
|
static |
Static function to check if given info will lead to a valid configuration of NEGEMMConvolutionLayer.
[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 . Currently only 3x3 and 5x5 kernels are supported. |
[in] | biases | Biases tensor. Shared biases supported. Biases are 1D tensor with dimensions [OFM]. Data type supported: Same as weights . |
[in] | 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. Currently only unit strides are supported. |
[in] | act_info | (Optional) Activation layer information in case of a fused activation. |
[in] | enable_fast_math | (Optional) Enable fast math computation. In case this flag were set, the function could dispatch the fastest implementation available which may introduce a drop of accuracy as well. Default is false |
Definition at line 647 of file NEWinogradConvolutionLayer.cpp.
References ARM_COMPUTE_RETURN_ERROR_MSG, ARM_COMPUTE_RETURN_ERROR_ON_MSG, ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR, ARM_COMPUTE_RETURN_ON_ERROR, ICloneable< T >::clone(), TensorInfo::clone(), arm_compute::misc::shape_calculator::compute_winograd_filter_transform_shape(), arm_compute::misc::shape_calculator::compute_winograd_input_transform_shape(), ITensorInfo::data_layout(), ITensorInfo::data_type(), ITensorInfo::dimension(), arm_compute::get_data_layout_dimension_index(), arm_compute::HEIGHT, arm_compute::test::validation::idx_height, arm_compute::test::validation::idx_width, PadStrideInfo::pad_bottom(), PadStrideInfo::pad_left(), PadStrideInfo::pad_right(), PadStrideInfo::pad_top(), TensorInfo::tensor_shape(), arm_compute::validate_arguments(), and arm_compute::WIDTH.
Referenced by NEConvolutionLayer::get_convolution_method(), and NEConvolutionLayer::validate().