24.02.1
|
Basic function to execute FFT-based convolution on CPU. More...
#include <NEFFTConvolutionLayer.h>
Public Member Functions | |
NEFFTConvolutionLayer (std::shared_ptr< IMemoryManager > memory_manager=nullptr) | |
Default constructor. More... | |
NEFFTConvolutionLayer (const NEFFTConvolutionLayer &)=delete | |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NEFFTConvolutionLayer (NEFFTConvolutionLayer &&)=delete | |
Prevent instances of this class from being moved (As this class contains non movable objects) More... | |
NEFFTConvolutionLayer & | operator= (const NEFFTConvolutionLayer &)=delete |
Prevent instances of this class from being copied (As this class contains pointers) More... | |
NEFFTConvolutionLayer & | operator= (NEFFTConvolutionLayer &&)=delete |
Prevent instances of this class from being moved (As this class contains non movable objects) More... | |
~NEFFTConvolutionLayer () | |
Default destructor. More... | |
void | configure (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... | |
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 NEFFTConvolutionLayer. More... | |
Basic function to execute FFT-based convolution on CPU.
This function calls the following functions/kernels:
Definition at line 58 of file NEFFTConvolutionLayer.h.
NEFFTConvolutionLayer | ( | std::shared_ptr< IMemoryManager > | memory_manager = nullptr | ) |
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
delete |
Prevent instances of this class from being moved (As this class contains non movable objects)
|
default |
Default destructor.
void configure | ( | 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.
Valid data layouts:
Valid data type configurations:
src | dst |
---|---|
F32 | F32 |
[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: 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: Same as input |
[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] | act_info | (Optional) Activation layer information in case of a fused activation. |
[in] | enable_fast_math | (Optional) Enable fast math computation. Unused for CPU backend. |
Definition at line 106 of file NEFFTConvolutionLayer.cpp.
References arm_compute::test::validation::act_info, TensorAllocator::allocate(), Tensor::allocator(), ARM_COMPUTE_LOG_PARAMS, ARM_COMPUTE_UNUSED, arm_compute::auto_init_if_empty(), Tensor::buffer(), ICloneable< T >::clone(), NEReverse::configure(), NEPermute::configure(), NESlice::configure(), NEFFT2D::configure(), NEArithmeticAddition::configure(), NEReductionOperation::configure(), NEActivationLayer::configure(), NEPadLayer::configure(), NEComplexPixelWiseMultiplication::configure(), arm_compute::test::validation::conv_info, FFT2DInfo::direction, arm_compute::get_data_layout_dimension_index(), arm_compute::HEIGHT, arm_compute::test::validation::idx_height, arm_compute::test::validation::idx_width, ITensor::info(), Tensor::info(), TensorAllocator::init(), arm_compute::test::validation::input, arm_compute::Inverse, MemoryGroup::manage(), arm_compute::NCHW, arm_compute::NHWC, TensorShape::remove_dimension(), ITensorInfo::set_data_layout(), arm_compute::SUM, ITensorInfo::tensor_shape(), arm_compute::utils::cast::U, arm_compute::U32, arm_compute::WIDTH, arm_compute::WRAP, Size2D::x(), Dimensions< T >::x(), Size2D::y(), and Dimensions< T >::y().
|
delete |
Prevent instances of this class from being copied (As this class contains pointers)
|
delete |
Prevent instances of this class from being moved (As this class contains non movable objects)
|
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 371 of file NEFFTConvolutionLayer.cpp.
References TensorAllocator::allocate(), Tensor::allocator(), ARM_COMPUTE_ERROR_ON, TensorAllocator::free(), ITensor::is_used(), ITensor::mark_as_unused(), INESimpleFunctionNoBorder::run(), NEPermute::run(), and NEPadLayer::run().
Referenced by NEFFTConvolutionLayer::run().
|
overridevirtual |
Run the kernels contained in the function.
For CPU kernels:
For OpenCL kernels:
Implements IFunction.
Definition at line 330 of file NEFFTConvolutionLayer.cpp.
References Tensor::allocator(), Tensor::buffer(), TensorAllocator::import_memory(), NEFFTConvolutionLayer::prepare(), NEFFT2D::run(), NEPermute::run(), NESlice::run(), NEReductionOperation::run(), NEActivationLayer::run(), NEArithmeticAddition::run(), NEPadLayer::run(), and NEComplexPixelWiseMultiplication::run().
|
static |
Static function to check if given info will lead to a valid configuration of NEFFTConvolutionLayer.
[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: 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: Same as input |
[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. |
[in] | act_info | (Optional) Activation layer information in case of a fused activation. |
[in] | enable_fast_math | (Optional) Enable fast math computation. Unused for CPU backend. |
Definition at line 276 of file NEFFTConvolutionLayer.cpp.
References arm_compute::test::validation::act_info, ARM_COMPUTE_RETURN_ERROR_ON, ARM_COMPUTE_RETURN_ERROR_ON_DATA_TYPE_CHANNEL_NOT_IN, ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES, ARM_COMPUTE_RETURN_ON_ERROR, ARM_COMPUTE_UNUSED, arm_compute::CHANNEL, arm_compute::test::validation::conv_info, arm_compute::F32, arm_compute::get_data_layout_dimension_index(), arm_compute::HEIGHT, arm_compute::test::validation::idx_height, arm_compute::test::validation::idx_width, arm_compute::test::validation::input, ITensorInfo::tensor_shape(), ITensorInfo::total_size(), NEActivationLayer::validate(), arm_compute::WIDTH, Size2D::x(), Dimensions< T >::x(), and Size2D::y().
Referenced by NEConvolutionLayer::validate().