ArmNN
 22.05.01
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 393 of file Graph.hpp.

Constructor & Destructor Documentation

◆ LayerInGraph()

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

Definition at line 397 of file Graph.hpp.

References Graph::InputLayersAccessor::m_Graph.

398  : LayerInGraphBase<OutputLayer>(graph,
399  // Always add to the back of the outputs.
400  graph.end(),
401  std::forward<Args>(args)...)
402  {
403  const bool isNewId = m_Graph->m_OutputIds.emplace(GetBindingId()).second;
404  if (!isNewId)
405  {
406  throw InvalidArgumentException("A layer already exists with the specified id");
407  }
408  }

◆ ~LayerInGraph()

~LayerInGraph ( )
inlineoverride

Definition at line 409 of file Graph.hpp.

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

410  {
411  const size_t numErased = m_Graph->m_OutputIds.erase(GetBindingId());
412  IgnoreUnused(numErased);
413  ARMNN_ASSERT(numErased == 1);
414  }
void IgnoreUnused(Ts &&...)
#define ARMNN_ASSERT(COND)
Definition: Assert.hpp:14

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