Compute Library
 22.11
InputLayer Class Referencefinal

Input Layer. More...

#include <Layers.h>

Collaboration diagram for InputLayer:
[legend]

Public Member Functions

 InputLayer (TensorDescriptor desc, ITensorAccessorUPtr accessor)
 Construct an input 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

Input Layer.

Definition at line 45 of file Layers.h.

Constructor & Destructor Documentation

◆ InputLayer()

InputLayer ( TensorDescriptor  desc,
ITensorAccessorUPtr  accessor 
)
inline

Construct an input layer.

Parameters
[in]descDescription of input tensor.
[in]accessorAccessor to get input tensor data from.

Definition at line 53 of file Layers.h.

54  : _desc(desc), _accessor(std::move(accessor))
55  {
56  }

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

References GraphBuilder::add_input_node(), IStream::graph(), IStream::hints(), ILayer::name(), and StreamHints::target_hint.

59  {
60  NodeParams common_params = { name(), s.hints().target_hint };
61  return GraphBuilder::add_input_node(s.graph(), common_params, _desc, std::move(_accessor));
62  }
static NodeID add_input_node(Graph &g, NodeParams params, const TensorDescriptor &desc, ITensorAccessorUPtr accessor=nullptr)
Adds an input 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: