Compute Library
ConvolutionLayer Class Referencefinal

Convolution Layer. More...

#include <Layers.h>

Collaboration diagram for ConvolutionLayer:

Public Member Functions

 ConvolutionLayer (unsigned int conv_width, unsigned int conv_height, unsigned int ofm, ITensorAccessorUPtr weights, ITensorAccessorUPtr bias, PadStrideInfo conv_info, unsigned int num_groups=1, const QuantizationInfo weights_quant_info=QuantizationInfo(), const QuantizationInfo out_quant_info=QuantizationInfo())
 Construct a convolution layer. More...
NodeID create_layer (IStream &s) override
 Create layer and add to the given stream. More...
- Public Member Functions inherited from ILayer
virtual ~ILayer ()=default
 Default destructor. More...
ILayerset_name (std::string name)
 Sets the name of the layer. More...
const std::string & name () const
 Layer name accessor. More...

Detailed Description

Convolution Layer.

Definition at line 376 of file Layers.h.

Constructor & Destructor Documentation

◆ ConvolutionLayer()

ConvolutionLayer ( unsigned int  conv_width,
unsigned int  conv_height,
unsigned int  ofm,
ITensorAccessorUPtr  weights,
ITensorAccessorUPtr  bias,
PadStrideInfo  conv_info,
unsigned int  num_groups = 1,
const QuantizationInfo  weights_quant_info = QuantizationInfo(),
const QuantizationInfo  out_quant_info = QuantizationInfo() 

Construct a convolution layer.

[in]conv_widthConvolution width.
[in]conv_heightConvolution height.
[in]ofmOutput feature map.
[in]weightsAccessor to get kernel weights from.
[in]biasAccessor to get kernel bias from.
[in]conv_infoPadding and stride information.
[in]num_groups(Optional) Number of groups. Default: 1.
[in]weights_quant_info(Optional) Weights quantization information
[in]out_quant_info(Optional) Output quantization info

Definition at line 391 of file Layers.h.

400  : _conv_width(conv_width),
401  _conv_height(conv_height),
402  _ofm(ofm),
403  _conv_info(std::move(conv_info)),
404  _num_groups(num_groups),
405  _weights(std::move(weights)),
406  _bias(std::move(bias)),
407  _weights_quant_info(std::move(weights_quant_info)),
408  _out_quant_info(std::move(out_quant_info))
409  {
410  }
const unsigned int num_groups
Definition: Im2Col.cpp:153

Member Function Documentation

◆ create_layer()

NodeID create_layer ( IStream s)

Create layer and add to the given stream.

[in]sStream to add layer to.
ID of the created node.

Implements ILayer.

Definition at line 412 of file Layers.h.

References GraphBuilder::add_convolution_node(), StreamHints::convolution_method_hint, StreamHints::fast_math_hint, IStream::graph(), IStream::hints(), arm_compute::test::validation::input, ILayer::name(), IStream::tail_node(), and StreamHints::target_hint.

413  {
414  NodeIdxPair input = { s.tail_node(), 0 };
415  NodeParams common_params = { name(), s.hints().target_hint };
416  return GraphBuilder::add_convolution_node(s.graph(), common_params, input,
417  Size2D(_conv_width, _conv_height), _ofm, _conv_info, _num_groups,
418  s.hints().convolution_method_hint, s.hints().fast_math_hint,
419  std::move(_weights), std::move(_bias), std::move(_weights_quant_info), std::move(_out_quant_info));
420  }
static NodeID add_convolution_node(Graph &g, NodeParams params, NodeIdxPair input, Size2D kernel_spatial_extend, unsigned int depth, PadStrideInfo conv_info, unsigned int num_groups=1, ConvolutionMethod method=ConvolutionMethod::Default, FastMathHint fast_math_hint=FastMathHint::Disabled, ITensorAccessorUPtr weights_accessor=nullptr, ITensorAccessorUPtr bias_accessor=nullptr, const QuantizationInfo &weights_quant_info=QuantizationInfo(), const QuantizationInfo &out_quant_info=QuantizationInfo())
Adds a convolution layer node to the graph.
const std::string & name() const
Layer name accessor.
Definition: ILayer.h:64

The documentation for this class was generated from the following file: