ArmNN
 21.02
Graph::LayerInGraph< OutputLayer > Class Template Referencefinal

Outputs add/remove their binding id to m_OutputIds in the graph. More...

#include <Graph.hpp>

Inherits Graph::LayerInGraphBase< LayerT >.

Public Member Functions

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

Detailed Description

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

Outputs add/remove their binding id to m_OutputIds in the graph.

Definition at line 370 of file Graph.hpp.

Constructor & Destructor Documentation

◆ LayerInGraph()

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

Definition at line 374 of file Graph.hpp.

References Graph::InputLayersAccessor::m_Graph.

375  : LayerInGraphBase<OutputLayer>(graph,
376  // Always add to the back of the outputs.
377  graph.end(),
378  std::forward<Args>(args)...)
379  {
380  const bool isNewId = m_Graph->m_OutputIds.emplace(GetBindingId()).second;
381  if (!isNewId)
382  {
383  throw InvalidArgumentException("A layer already exists with the specified id");
384  }
385  }

◆ ~LayerInGraph()

~LayerInGraph ( )
inlineoverride

Definition at line 386 of file Graph.hpp.

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

387  {
388  const size_t numErased = m_Graph->m_OutputIds.erase(GetBindingId());
389  IgnoreUnused(numErased);
390  ARMNN_ASSERT(numErased == 1);
391  }
void IgnoreUnused(Ts &&...)
#define ARMNN_ASSERT(COND)
Definition: Assert.hpp:14

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