ArmNN
 20.05
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 366 of file Graph.hpp.

Constructor & Destructor Documentation

◆ LayerInGraph()

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

Definition at line 370 of file Graph.hpp.

References Graph::InputLayersAccessor::m_Graph.

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

◆ ~LayerInGraph()

~LayerInGraph ( )
inlineoverride

Definition at line 382 of file Graph.hpp.

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

383  {
384  const size_t numErased = m_Graph->m_OutputIds.erase(GetBindingId());
385  IgnoreUnused(numErased);
386  ARMNN_ASSERT(numErased == 1);
387  }
void IgnoreUnused(Ts &&...)
#define ARMNN_ASSERT(COND)
Definition: Assert.hpp:14

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