Compute Library
 21.11
ScaleLayer Class Referencefinal

Scale Layer. More...

#include <Layers.h>

Collaboration diagram for ScaleLayer:
[legend]

Public Member Functions

 ScaleLayer (ITensorAccessorUPtr mul_w, ITensorAccessorUPtr add_w)
 Construct a scale 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

Scale Layer.

Definition at line 1270 of file Layers.h.

Constructor & Destructor Documentation

◆ ScaleLayer()

ScaleLayer ( ITensorAccessorUPtr  mul_w,
ITensorAccessorUPtr  add_w 
)
inline

Construct a scale layer.

Parameters
[in]mul_wAccessor to get mul weight from.
[in]add_wAccessor to get add weight from.

Definition at line 1278 of file Layers.h.

1280  : _mul_w(std::move(mul_w)), _add_w(std::move(add_w))
1281  {
1282  }

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 1284 of file Layers.h.

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

1285  {
1286  NodeParams common_params = { name(), s.hints().target_hint };
1287  NodeIdxPair input = { s.tail_node(), 0 };
1288  return GraphBuilder::add_scale_layer(s.graph(), common_params, input, std::move(_mul_w), std::move(_add_w));
1289  }
static NodeID add_scale_layer(Graph &g, const NodeParams &params, NodeIdxPair input, ITensorAccessorUPtr mul_accessor=nullptr, ITensorAccessorUPtr add_accessor=nullptr)
Adds a scale layer node to the graph This layer computes a product of the input with a scale (read fr...
const std::string & name() const
Layer name accessor.
Definition: ILayer.h:64

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