Compute Library
 21.11
ReductionLayer Class Referencefinal

Reduction Layer. More...

#include <Layers.h>

Collaboration diagram for ReductionLayer:
[legend]

Public Member Functions

 ReductionLayer (ReductionOperation op, unsigned int axis, bool keep_dims)
 Construct a reduction 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

Reduction Layer.

Definition at line 1137 of file Layers.h.

Constructor & Destructor Documentation

◆ ReductionLayer()

ReductionLayer ( ReductionOperation  op,
unsigned int  axis,
bool  keep_dims 
)
inline

Construct a reduction layer.

Parameters
[in]opReduction operation
[in]axisReduction axis
[in]keep_dims(Optional) Whether to keep the reduced dimension after the operation. Defaults to true.

Definition at line 1146 of file Layers.h.

1147  : _op(op), _axis(axis), _keep_dims(keep_dims)
1148  {
1149  }

Member Function Documentation

◆ create_layer()

NodeID create_layer ( IStream s)
inlineoverridevirtual

Create layer and add to the given stream.

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

Implements ILayer.

Definition at line 1151 of file Layers.h.

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

1152  {
1153  NodeParams common_params = { name(), s.hints().target_hint };
1154  NodeIdxPair input = { s.tail_node(), 0 };
1155  return GraphBuilder::add_reduction_operation_node(s.graph(), common_params, input, _op, _axis, _keep_dims);
1156  }
static NodeID add_reduction_operation_node(Graph &g, NodeParams params, NodeIdxPair input, ReductionOperation op, int axis, bool keep_dims=true)
Adds a reduction sum 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: