ArmNN
 21.11
Graph::LayerInGraph< InputLayer > Class Template Referencefinal

Inputs add/remove their binding id to m_InputIds in the graph. More...

#include <Graph.hpp>

Inherits Graph::LayerInGraphBase< LayerT >.

Public Member Functions

template<typename... Args>
 LayerInGraph (Graph &graph, Args &&... args)
 
template<typename... Args>
 LayerInGraph (Graph &graph, Iterator, Args &&... args)
 
 ~LayerInGraph () override
 

Detailed Description

template<>
class armnn::Graph::LayerInGraph< InputLayer >

Inputs add/remove their binding id to m_InputIds in the graph.

Definition at line 353 of file Graph.hpp.

Constructor & Destructor Documentation

◆ LayerInGraph() [1/2]

LayerInGraph ( Graph graph,
Args &&...  args 
)
inline

Definition at line 357 of file Graph.hpp.

References Graph::InputLayersAccessor::m_Graph.

358  : LayerInGraphBase<InputLayer>(graph,
359  // Always add to the back of the inputs.
360  std::next(graph.begin(), IteratorDifference(graph.GetNumInputs())),
361  std::forward<Args>(args)...)
362  {
363  const bool isNewId = m_Graph->m_InputIds.emplace(GetBindingId()).second;
364  if (!isNewId)
365  {
366  throw InvalidArgumentException("A layer already exists with the specified id");
367  }
368  }
Iterator::difference_type IteratorDifference
Definition: Graph.hpp:52

◆ LayerInGraph() [2/2]

LayerInGraph ( Graph graph,
Iterator  ,
Args &&...  args 
)
inline

Definition at line 370 of file Graph.hpp.

372  : LayerInGraph(graph, std::forward<Args>(args)...)
373  {
374  }
LayerInGraph(Graph &graph, Args &&... args)
Definition: Graph.hpp:357

◆ ~LayerInGraph()

~LayerInGraph ( )
inlineoverride

Definition at line 375 of file Graph.hpp.

References ARMNN_ASSERT, armnn::IgnoreUnused(), and Graph::InputLayersAccessor::m_Graph.

376  {
377  const size_t numErased = m_Graph->m_InputIds.erase(GetBindingId());
378  IgnoreUnused(numErased);
379  ARMNN_ASSERT(numErased == 1);
380  }
void IgnoreUnused(Ts &&...)
#define ARMNN_ASSERT(COND)
Definition: Assert.hpp:14

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