ArmNN
 24.02
ErasedLayerNamesObservable Class Reference

#include <Observable.hpp>

Inheritance diagram for ErasedLayerNamesObservable:
[legend]
Collaboration diagram for ErasedLayerNamesObservable:
[legend]

Public Member Functions

 ErasedLayerNamesObservable (Graph &subject)
 
void Update (Layer *graphLayer) override
 
- Public Member Functions inherited from GraphObservable< std::string >
 GraphObservable (Graph &subject, GraphEvent notifyOnEvent)
 
void Clear ()
 
Iterator begin ()
 
Iterator end ()
 

Additional Inherited Members

- Public Types inherited from GraphObservable< std::string >
using Iterator = typename std::list< std::string >::const_iterator
 
- Protected Member Functions inherited from GraphObservable< std::string >
 ~GraphObservable ()
 
- Protected Member Functions inherited from IGraphObservable
virtual ~IGraphObservable ()=default
 
- Protected Attributes inherited from GraphObservable< std::string >
GraphEvent m_NotifyOnEvent
 
Graphm_Subject
 
std::list< std::string > m_ObservedObjects
 

Detailed Description

Definition at line 56 of file Observable.hpp.

Constructor & Destructor Documentation

◆ ErasedLayerNamesObservable()

ErasedLayerNamesObservable ( Graph subject)
inlineexplicit

Definition at line 59 of file Observable.hpp.

60  : GraphObservable<std::string>(subject, GraphEvent::LayerErased)
61  {};

References armnn::LayerErased.

Member Function Documentation

◆ Update()

void Update ( Layer graphLayer)
overridevirtual

Implements IGraphObservable.

Definition at line 16 of file Observable.cpp.

17 {
18  auto& relatedLayerNames = graphLayer->GetRelatedLayerNames();
19 
20  // If the erased layer has no related layers we take the erased layer's name
21  // Otherwise we need to preserve the related layer names,
22  // since we want to preserve the original graph's information
23  if (relatedLayerNames.empty())
24  {
25  m_ObservedObjects.emplace_back(graphLayer->GetName());
26  }
27  else
28  {
29  for (auto& relatedLayerName : relatedLayerNames)
30  {
31  m_ObservedObjects.emplace_back(relatedLayerName);
32  }
33  }
34 }

References Layer::GetName(), Layer::GetRelatedLayerNames(), and GraphObservable< std::string >::m_ObservedObjects.


The documentation for this class was generated from the following files:
armnn::GraphObservable< std::string >::m_ObservedObjects
std::list< std::string > m_ObservedObjects
Definition: Observable.hpp:43
armnn::GraphEvent::LayerErased
@ LayerErased