39 : _memory_group(
std::move(memory_manager)), _output_stage_kernel(), _conv_kernel(), _input_border_handler(), _activationlayer_function(), _accumulator(), _has_bias(false),
40 _is_activationlayer_enabled(false), _dim_split(
Window::DimZ), _is_padding_required()
47 _output_stage_kernel = std::make_unique<NEDirectConvolutionLayerOutputStageKernel>();
48 _conv_kernel = std::make_unique<NEDirectConvolutionLayerKernel>();
49 _input_border_handler = std::make_unique<NEFillBorderKernel>();
52 if(_accumulator.
buffer() !=
nullptr)
60 _has_bias = (bias !=
nullptr);
62 _conv_kernel->configure(input, weights, output, conv_info);
65 _output_stage_kernel->configure(output, bias);
67 _is_padding_required = !_conv_kernel->border_size().empty();
69 if(_is_padding_required)
76 _is_activationlayer_enabled = act_info.
enabled();
77 if(_is_activationlayer_enabled)
79 _activationlayer_function.
configure(output,
nullptr, act_info);
90 TensorInfo accumulator(output->
clone()->set_is_resizable(
true).reset_padding().set_data_type(data_type));
99 "Biases size and number of input feature maps should match");
118 if(_is_padding_required)
128 if(_is_activationlayer_enabled)
130 _activationlayer_function.
run();
virtual size_t num_dimensions() const =0
The number of dimensions of the tensor (rank)
Class describing the value of a pixel for any image format.
~NEDirectConvolutionLayer()
Default destructor.
bool enabled() const
Check if initialised.
virtual size_t dimension(size_t index) const =0
Return the size of the requested dimension.
#define ARM_COMPUTE_RETURN_ON_ERROR(status)
Checks if a status contains an error and returns it.
virtual DataType data_type() const =0
Data type used for each element of the tensor.
static Status validate(const ITensorInfo *input, const ITensorInfo *output, const ActivationLayerInfo &act_info)
[NEActivationLayer snippet]
void run() override
Run the kernels contained in the function.
#define ARM_COMPUTE_ERROR_ON(cond)
If the condition is true then an error message is printed and an exception thrown.
Store the tensor's metadata.
Activation Layer Information class.
Interface for Neon tensor.
Copyright (c) 2017-2021 Arm Limited.
TensorAllocator * allocator()
Return a pointer to the tensor's allocator.
#define ARM_COMPUTE_RETURN_ERROR_ON_NULLPTR(...)
NEDirectConvolutionLayer(std::shared_ptr< IMemoryManager > memory_manager=nullptr)
Constructor.
void run() override
Run the kernels contained in the function.
virtual std::unique_ptr< T > clone() const =0
Provide a clone of the current object of class T.
virtual ITensorInfo * info() const =0
Interface to be implemented by the child class to return the tensor's metadata.
Padding and stride information class.
void free() override
Free allocated CPU memory.
Num samples, channels, height, width.
void configure(ITensor *input, const ITensor *weights, const ITensor *bias, ITensor *output, const PadStrideInfo &conv_info, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Set the input, weights, biases and output tensors.
static constexpr size_t DimY
Alias for dimension 1 also known as Y dimension.
static Status validate(const ITensorInfo *input, const ITensorInfo *bias=nullptr, const ITensorInfo *output=nullptr, const DirectConvolutionLayerOutputStageKernelInfo &info=DirectConvolutionLayerOutputStageKernelInfo())
Static function to check if given info will lead to a valid configuration of NEDirectConvolutionLayer...
Memory group resources scope handling class.
virtual void schedule(ICPPKernel *kernel, const Hints &hints)=0
Runs the kernel in the same thread as the caller synchronously.
static constexpr size_t DimZ
Alias for dimension 2 also known as Z dimension.
#define ARM_COMPUTE_RETURN_ERROR_ON_MISMATCHING_DATA_TYPES(...)
void configure(ITensor *input, ITensor *output, ActivationLayerInfo activation_info)
[NEActivationLayer snippet]
uint8_t * buffer() const override
Interface to be implemented by the child class to return a pointer to CPU memory. ...
static Status validate(const ITensorInfo *input, const ITensorInfo *weights, const ITensorInfo *output, const PadStrideInfo &conv_info)
Static function to check if given info will lead to a valid configuration of NEDirectConvolutionLayer...
#define ARM_COMPUTE_RETURN_ERROR_ON_MSG(cond, msg)
If the condition is true, an error is returned.
Store the tensor's metadata.
DataType
Available data types.
static Status validate(const ITensorInfo *input, const ITensorInfo *weights, const ITensorInfo *bias, const ITensorInfo *output, const PadStrideInfo &conv_info, const ActivationLayerInfo &act_info=ActivationLayerInfo())
Static function to check if given info will lead to a valid configuration of NEDirectConvolutionLayer...
Describe a multidimensional execution window.
virtual DataLayout data_layout() const =0
Get the data layout of the tensor.
static IScheduler & get()
Access the scheduler singleton.