23.05
|
The SubgraphView class represents a subgraph of a Graph. More...
#include <SubgraphView.hpp>
Public Types | |
using | SubgraphViewPtr = std::shared_ptr< SubgraphView > |
using | InputSlots = std::vector< InputSlot * > |
using | IInputSlots = std::vector< IInputSlot * > |
using | OutputSlots = std::vector< OutputSlot * > |
using | IOutputSlots = std::vector< IOutputSlot * > |
using | Layers = std::list< Layer * > |
using | IConnectableLayers = std::list< IConnectableLayer * > |
using | Iterator = Layers::iterator |
using | IConnectableLayerIterator = IConnectableLayers::iterator |
using | ConstIterator = Layers::const_iterator |
using | ConstIConnectableIterator = IConnectableLayers::const_iterator |
Public Member Functions | |
template<typename Func > | |
void | ForEachLayer (Func func) const |
template<typename Func > | |
void | ForEachIConnectableLayer (Func func) const |
SubgraphView (Graph &graph) | |
Constructs a sub-graph from the entire given graph. More... | |
ARMNN_DEPRECATED_MSG_REMOVAL_DATE ("This function has been deprecated, please use constructor with arguments: " "IConnectableLayers, IInputSlots and IOutputSlots", "23.08") SubgraphView(InputSlots &&inputs | |
Constructs a sub-graph with the given arguments. More... | |
SubgraphView (IConnectableLayers &&layers, IInputSlots &&inputs, IOutputSlots &&outputs) | |
Constructs a sub-graph with the given arguments. More... | |
SubgraphView (const SubgraphView &subgraph) | |
Copy-constructor. More... | |
SubgraphView (SubgraphView &&subgraph) | |
Move-constructor. More... | |
SubgraphView (IConnectableLayer *layer) | |
Constructs a sub-graph with only the given layer. More... | |
SubgraphView & | operator= (SubgraphView &&other) |
Move-assignment operator. More... | |
ARMNN_DEPRECATED_MSG_REMOVAL_DATE ("This function has been deprecated, please use GetIInputSlots() returning" " public IInputSlots", "23.08") const InputSlots &GetInputSlots() const | |
const IInputSlots & | GetIInputSlots () const |
ARMNN_DEPRECATED_MSG_REMOVAL_DATE ("This function has been deprecated, please use GetIOutputSlots() returning" " public IOutputSlots", "23.08") const OutputSlots &GetOutputSlots() const | |
const IOutputSlots & | GetIOutputSlots () const |
ARMNN_DEPRECATED_MSG_REMOVAL_DATE ("This function has been deprecated, please use GetIConnectableLayers() " "returning public IConnectableLayers", "23.08") const Layers &GetLayers() const | |
const IConnectableLayers & | GetIConnectableLayers () const |
ARMNN_DEPRECATED_MSG_REMOVAL_DATE ("This function has been deprecated, please use GetIInputSlot() returning public " "IInputSlot", "23.08") const InputSlot *GetInputSlot(unsigned int index) const | |
const IInputSlot * | GetIInputSlot (unsigned int index) const |
ARMNN_DEPRECATED_MSG_REMOVAL_DATE ("This function has been deprecated, please use GetIInputSlot() returning public " "IInputSlot", "23.08") InputSlot *GetInputSlot(unsigned int index) | |
IInputSlot * | GetIInputSlot (unsigned int index) |
ARMNN_DEPRECATED_MSG_REMOVAL_DATE ("This function has been deprecated, please use GetIOutputSlot() returning" " public IOutputSlot", "23.08") const OutputSlot *GetOutputSlot(unsigned int index) const | |
const IOutputSlot * | GetIOutputSlot (unsigned int index) const |
ARMNN_DEPRECATED_MSG_REMOVAL_DATE ("This function has been deprecated, please use GetIOutputSlot() returning" " public IOutputSlot", "23.08") OutputSlot *GetOutputSlot(unsigned int index) | |
IOutputSlot * | GetIOutputSlot (unsigned int index) |
unsigned int | GetNumInputSlots () const |
unsigned int | GetNumOutputSlots () const |
ARMNN_DEPRECATED_MSG_CHANGE_DATE ("This function is deprecated and will be changed to return an " "IConnectableLayerIterator, until that occurs in 23.08; please use " "beginIConnectable() returning public IConnectableLayerIterator", "23.08") Iterator begin() | |
IConnectableLayerIterator | beginIConnectable () |
ARMNN_DEPRECATED_MSG_CHANGE_DATE ("This function is deprecated and will be changed to return an " "IConnectableLayerIterator, until that occurs in 23.08; please use " "endIConnectable() returning public IConnectableLayerIterator", "23.08") Iterator end() | |
IConnectableLayerIterator | endIConnectable () |
ARMNN_DEPRECATED_MSG_CHANGE_DATE ("This function is deprecated and will be changed to return an " "ConstIConnectableIterator, until that occurs in 23.08; please use " "beginIConnectable() returning public ConstIConnectableIterator", "23.08") ConstIterator begin() const | |
ConstIConnectableIterator | beginIConnectable () const |
ARMNN_DEPRECATED_MSG_CHANGE_DATE ("This function is deprecated and will be changed to return an " "ConstIConnectableIterator, until that occurs in 23.08; please use " "endIConnectable() returning public ConstIConnectableIterator", "23.08") ConstIterator end() const | |
ConstIConnectableIterator | endIConnectable () const |
ARMNN_DEPRECATED_MSG_CHANGE_DATE ("This function is deprecated and will be changed to return an " "ConstIConnectableIterator, until that occurs in 23.08; please use " "cbeginIConnectable() returning public ConstIConnectableIterator", "23.08") ConstIterator cbegin() const | |
ConstIConnectableIterator | cbeginIConnectable () const |
ARMNN_DEPRECATED_MSG_CHANGE_DATE ("This function is deprecated and will be changed to return an " "ConstIConnectableIterator, until that occurs in 23.08; please use " "cendIConnectable() returning public ConstIConnectableIterator", "23.08") ConstIterator cend() const | |
ConstIConnectableIterator | cendIConnectable () const |
void | Clear () |
SubgraphView | GetWorkingCopy () const |
This method returns a copy of the original SubgraphView provided by OptimizeSubgraphView with a separate underlying graph from the main ArmNN graph. More... | |
void | SubstituteSubgraph (SubgraphView &, IConnectableLayer *) |
These methods should be called on a working copy subgraph created from GetWorkingCopy. More... | |
void | SubstituteSubgraph (SubgraphView &, const SubgraphView &) |
const IInputSlots & | GetOriginalInputSlots () const |
These methods should be called on a working copy subgraph created from GetWorkingCopy. More... | |
const IOutputSlots & | GetOriginalOutputSlots () const |
Public Attributes | |
OutputSlots && | outputs |
OutputSlots Layers && | layers |
The SubgraphView class represents a subgraph of a Graph.
The data it holds, points to data held by layers of the Graph, so the the contents of the SubgraphView become invalid when the Layers are destroyed or changed.
Definition at line 31 of file SubgraphView.hpp.
using ConstIConnectableIterator = IConnectableLayers::const_iterator |
Definition at line 66 of file SubgraphView.hpp.
using ConstIterator = Layers::const_iterator |
Definition at line 65 of file SubgraphView.hpp.
using IConnectableLayerIterator = IConnectableLayers::iterator |
Definition at line 64 of file SubgraphView.hpp.
using IConnectableLayers = std::list<IConnectableLayer*> |
Definition at line 62 of file SubgraphView.hpp.
using IInputSlots = std::vector<IInputSlot*> |
Definition at line 58 of file SubgraphView.hpp.
using InputSlots = std::vector<InputSlot*> |
Definition at line 57 of file SubgraphView.hpp.
using IOutputSlots = std::vector<IOutputSlot*> |
Definition at line 60 of file SubgraphView.hpp.
using Iterator = Layers::iterator |
Definition at line 63 of file SubgraphView.hpp.
Definition at line 61 of file SubgraphView.hpp.
using OutputSlots = std::vector<OutputSlot*> |
Definition at line 59 of file SubgraphView.hpp.
using SubgraphViewPtr = std::shared_ptr<SubgraphView> |
Definition at line 56 of file SubgraphView.hpp.
|
explicit |
Constructs a sub-graph from the entire given graph.
Definition at line 45 of file SubgraphView.cpp.
SubgraphView | ( | SubgraphView::IConnectableLayers && | layers, |
SubgraphView::IInputSlots && | inputs, | ||
SubgraphView::IOutputSlots && | outputs | ||
) |
Constructs a sub-graph with the given arguments.
IConnectable Duplication to maintain backwards compatibility.
Definition at line 71 of file SubgraphView.cpp.
SubgraphView | ( | const SubgraphView & | subgraph | ) |
SubgraphView | ( | SubgraphView && | subgraph | ) |
SubgraphView | ( | IConnectableLayer * | layer | ) |
ARMNN_DEPRECATED_MSG_CHANGE_DATE | ( | "This function is deprecated and will be changed to return an " " | ConstIConnectableIterator, |
until that occurs in 23.08;please use " "beginIConnectable() returning public ConstIConnectableIterator" | , | ||
"23.08" | |||
) | const |
ARMNN_DEPRECATED_MSG_CHANGE_DATE | ( | "This function is deprecated and will be changed to return an " " | ConstIConnectableIterator, |
until that occurs in 23.08;please use " "cbeginIConnectable() returning public ConstIConnectableIterator" | , | ||
"23.08" | |||
) | const |
ARMNN_DEPRECATED_MSG_CHANGE_DATE | ( | "This function is deprecated and will be changed to return an " " | ConstIConnectableIterator, |
until that occurs in 23.08;please use " "cendIConnectable() returning public ConstIConnectableIterator" | , | ||
"23.08" | |||
) | const |
ARMNN_DEPRECATED_MSG_CHANGE_DATE | ( | "This function is deprecated and will be changed to return an " " | ConstIConnectableIterator, |
until that occurs in 23.08;please use " "endIConnectable() returning public ConstIConnectableIterator" | , | ||
"23.08" | |||
) | const |
ARMNN_DEPRECATED_MSG_CHANGE_DATE | ( | "This function is deprecated and will be changed to return an " " | IConnectableLayerIterator, |
until that occurs in 23.08;please use " "beginIConnectable() returning public IConnectableLayerIterator" | , | ||
"23.08" | |||
) |
ARMNN_DEPRECATED_MSG_CHANGE_DATE | ( | "This function is deprecated and will be changed to return an " " | IConnectableLayerIterator, |
until that occurs in 23.08;please use " "endIConnectable() returning public IConnectableLayerIterator" | , | ||
"23.08" | |||
) |
ARMNN_DEPRECATED_MSG_REMOVAL_DATE | ( | "This function has been | deprecated, |
please use constructor with arguments:" " | IConnectableLayers, | ||
IInputSlots and IOutputSlots" | , | ||
"23.08" | |||
) | && |
Constructs a sub-graph with the given arguments.
ARMNN_DEPRECATED_MSG_REMOVAL_DATE | ( | "This function has been | deprecated, |
please use GetIConnectableLayers() " "returning public IConnectableLayers" | , | ||
"23.08" | |||
) | const & |
ARMNN_DEPRECATED_MSG_REMOVAL_DATE | ( | "This function has been | deprecated, |
please use GetIInputSlot() returning public " "IInputSlot" | , | ||
"23.08" | |||
) | const |
ARMNN_DEPRECATED_MSG_REMOVAL_DATE | ( | "This function has been | deprecated, |
please use GetIInputSlot() returning public " "IInputSlot" | , | ||
"23.08" | |||
) |
ARMNN_DEPRECATED_MSG_REMOVAL_DATE | ( | "This function has been | deprecated, |
please use GetIInputSlots() returning" " public IInputSlots" | , | ||
"23.08" | |||
) | const & |
ARMNN_DEPRECATED_MSG_REMOVAL_DATE | ( | "This function has been | deprecated, |
please use GetIOutputSlot() returning" " public IOutputSlot" | , | ||
"23.08" | |||
) | const |
ARMNN_DEPRECATED_MSG_REMOVAL_DATE | ( | "This function has been | deprecated, |
please use GetIOutputSlot() returning" " public IOutputSlot" | , | ||
"23.08" | |||
) |
ARMNN_DEPRECATED_MSG_REMOVAL_DATE | ( | "This function has been | deprecated, |
please use GetIOutputSlots() returning" " public IOutputSlots" | , | ||
"23.08" | |||
) | const & |
SubgraphView::ConstIConnectableIterator beginIConnectable | ( | ) |
Definition at line 324 of file SubgraphView.cpp.
Referenced by armnn::AssignBackends(), SubgraphView::cbeginIConnectable(), TosaRefBackend::OptimizeSubgraphView(), RefBackend::OptimizeSubgraphView(), NeonBackend::OptimizeSubgraphView(), and ClBackend::OptimizeSubgraphView().
ConstIConnectableIterator beginIConnectable | ( | ) | const |
SubgraphView::ConstIConnectableIterator cbeginIConnectable | ( | ) | const |
Definition at line 372 of file SubgraphView.cpp.
References SubgraphView::beginIConnectable().
SubgraphView::ConstIConnectableIterator cendIConnectable | ( | ) | const |
Definition at line 377 of file SubgraphView.cpp.
References SubgraphView::endIConnectable().
void Clear | ( | ) |
Definition at line 382 of file SubgraphView.cpp.
SubgraphView::ConstIConnectableIterator endIConnectable | ( | ) |
Definition at line 329 of file SubgraphView.cpp.
Referenced by armnn::AssignBackends(), SubgraphView::cendIConnectable(), TosaRefBackend::OptimizeSubgraphView(), RefBackend::OptimizeSubgraphView(), NeonBackend::OptimizeSubgraphView(), and ClBackend::OptimizeSubgraphView().
ConstIConnectableIterator endIConnectable | ( | ) | const |
|
inline |
Definition at line 46 of file SubgraphView.hpp.
Referenced by SubgraphView::SubstituteSubgraph(), and Graph::SubstituteSubgraph().
|
inline |
Definition at line 35 of file SubgraphView.hpp.
const SubgraphView::IConnectableLayers & GetIConnectableLayers | ( | ) | const |
Definition at line 308 of file SubgraphView.cpp.
Referenced by armnn::ApplyBackendOptimizations(), SubgraphView::GetWorkingCopy(), SubgraphViewSelector::SelectSubgraphs(), and OptimizationViews::Validate().
IInputSlot * GetIInputSlot | ( | unsigned int | index | ) |
Definition at line 268 of file SubgraphView.cpp.
const IInputSlot * GetIInputSlot | ( | unsigned int | index | ) | const |
Definition at line 258 of file SubgraphView.cpp.
const SubgraphView::IInputSlots & GetIInputSlots | ( | ) | const |
Definition at line 238 of file SubgraphView.cpp.
Referenced by SubgraphView::GetWorkingCopy(), SubgraphViewSelector::SelectSubgraphs(), SubgraphView::SubstituteSubgraph(), and OptimizationViews::Validate().
IOutputSlot * GetIOutputSlot | ( | unsigned int | index | ) |
Definition at line 288 of file SubgraphView.cpp.
const IOutputSlot * GetIOutputSlot | ( | unsigned int | index | ) | const |
Definition at line 278 of file SubgraphView.cpp.
Referenced by TosaRefBackend::OptimizeSubgraphView().
const SubgraphView::IOutputSlots & GetIOutputSlots | ( | ) | const |
Definition at line 248 of file SubgraphView.cpp.
Referenced by SubgraphView::GetWorkingCopy(), SubgraphView::SubstituteSubgraph(), and OptimizationViews::Validate().
unsigned int GetNumInputSlots | ( | ) | const |
Definition at line 293 of file SubgraphView.cpp.
Referenced by TosaRefBackend::OptimizeSubgraphView().
unsigned int GetNumOutputSlots | ( | ) | const |
Definition at line 298 of file SubgraphView.cpp.
Referenced by TosaRefBackend::OptimizeSubgraphView().
const SubgraphView::IInputSlots & GetOriginalInputSlots | ( | ) | const |
These methods should be called on a working copy subgraph created from GetWorkingCopy.
They return pointers to the input and output Slots belonging to the original SubgraphView that the working copy was created from. This may be used to find the original TensorInfo of connected boundary OutputSlots.
Definition at line 638 of file SubgraphView.cpp.
const SubgraphView::IOutputSlots & GetOriginalOutputSlots | ( | ) | const |
Definition at line 651 of file SubgraphView.cpp.
SubgraphView GetWorkingCopy | ( | ) | const |
This method returns a copy of the original SubgraphView provided by OptimizeSubgraphView with a separate underlying graph from the main ArmNN graph.
Backend users should edit this working copy and then add it as a SubstitutionPair, along with original SubgraphView, to the OptimizationViews returned by OptimizeSubgraphView. ArmNN will then decide on whether or not to carry out Substitution of the two SubgraphViews.
Definition at line 429 of file SubgraphView.cpp.
References Layer::Clone(), SubgraphView::GetIConnectableLayers(), SubgraphView::GetIInputSlots(), SubgraphView::GetIOutputSlots(), IConnectableLayer::GetNumOutputSlots(), IConnectableLayer::GetOutputSlot(), IConnectableLayer::GetType(), and armnn::Output.
SubgraphView & operator= | ( | SubgraphView && | other | ) |
void SubstituteSubgraph | ( | SubgraphView & | patternSubgraph, |
const SubgraphView & | substituteSubgraph | ||
) |
Definition at line 572 of file SubgraphView.cpp.
References SubgraphView::ForEachIConnectableLayer(), SubgraphView::GetIInputSlots(), and SubgraphView::GetIOutputSlots().
void SubstituteSubgraph | ( | SubgraphView & | subgraph, |
IConnectableLayer * | substituteLayer | ||
) |
These methods should be called on a working copy subgraph created from GetWorkingCopy.
They take a SubgraphView pattern to replace and the substitute layer or subgraphView to substitute in.
Definition at line 530 of file SubgraphView.cpp.
References ARMNN_ASSERT.
OutputSlots Layers&& layers |
Definition at line 74 of file SubgraphView.hpp.
OutputSlots&& outputs |
Definition at line 74 of file SubgraphView.hpp.