22.02
|
The SubgraphView class represents a subgraph of a Graph. More...
#include <SubgraphView.hpp>
Public Types | |
using | SubgraphViewPtr = std::unique_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", "22.11") 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", "22.11") const InputSlots &GetInputSlots() const | |
const IInputSlots & | GetIInputSlots () const |
ARMNN_DEPRECATED_MSG_REMOVAL_DATE ("This function has been deprecated, please use GetIOutputSlots() returning" " public IOutputSlots", "22.11") const OutputSlots &GetOutputSlots() const | |
const IOutputSlots & | GetIOutputSlots () const |
ARMNN_DEPRECATED_MSG_REMOVAL_DATE ("This function has been deprecated, please use GetIConnectableLayers() " "returning public IConnectableLayers", "22.11") const Layers &GetLayers() const | |
const IConnectableLayers & | GetIConnectableLayers () const |
ARMNN_DEPRECATED_MSG_REMOVAL_DATE ("This function has been deprecated, please use GetIInputSlot() returning public " "IInputSlot", "22.11") 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", "22.11") 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", "22.11") 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", "22.11") 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.02; please use " "beginIConnectable() returning public IConnectableLayerIterator", "23.02") 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.02; please use " "endIConnectable() returning public IConnectableLayerIterator", "23.02") 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.02; please use " "beginIConnectable() returning public ConstIConnectableIterator", "23.02") 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.02; please use " "endIConnectable() returning public ConstIConnectableIterator", "23.02") 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.02; please use " "cbeginIConnectable() returning public ConstIConnectableIterator", "23.02") 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.02; please use " "cendIConnectable() returning public ConstIConnectableIterator", "23.02") ConstIterator cend() const | |
ConstIConnectableIterator | cendIConnectable () const |
void | Clear () |
SubgraphView | GetWorkingCopy () |
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 &) |
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 23 of file SubgraphView.hpp.
using ConstIConnectableIterator = IConnectableLayers::const_iterator |
Definition at line 58 of file SubgraphView.hpp.
using ConstIterator = Layers::const_iterator |
Definition at line 57 of file SubgraphView.hpp.
using IConnectableLayerIterator = IConnectableLayers::iterator |
Definition at line 56 of file SubgraphView.hpp.
using IConnectableLayers = std::list<IConnectableLayer*> |
Definition at line 54 of file SubgraphView.hpp.
using IInputSlots = std::vector<IInputSlot*> |
Definition at line 50 of file SubgraphView.hpp.
using InputSlots = std::vector<InputSlot*> |
Definition at line 49 of file SubgraphView.hpp.
using IOutputSlots = std::vector<IOutputSlot*> |
Definition at line 52 of file SubgraphView.hpp.
using Iterator = Layers::iterator |
Definition at line 55 of file SubgraphView.hpp.
Definition at line 53 of file SubgraphView.hpp.
using OutputSlots = std::vector<OutputSlot*> |
Definition at line 51 of file SubgraphView.hpp.
using SubgraphViewPtr = std::unique_ptr<SubgraphView> |
Definition at line 48 of file SubgraphView.hpp.
|
explicit |
Constructs a sub-graph from the entire given graph.
Definition at line 44 of file SubgraphView.cpp.
References SubgraphView::layers, and SubgraphView::outputs.
Referenced by SubgraphView::SubgraphView().
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 68 of file SubgraphView.cpp.
References SubgraphView::layers, SubgraphView::outputs, and SubgraphView::SubgraphView().
SubgraphView | ( | const SubgraphView & | subgraph | ) |
Copy-constructor.
Definition at line 139 of file SubgraphView.cpp.
SubgraphView | ( | SubgraphView && | subgraph | ) |
SubgraphView | ( | IConnectableLayer * | layer | ) |
ARMNN_DEPRECATED_MSG_CHANGE_DATE | ( | "This function is deprecated and will be changed to return an " " | IConnectableLayerIterator, |
until that occurs in 23.02;please use " "beginIConnectable() returning public IConnectableLayerIterator" | , | ||
"23.02" | |||
) |
ARMNN_DEPRECATED_MSG_CHANGE_DATE | ( | "This function is deprecated and will be changed to return an " " | IConnectableLayerIterator, |
until that occurs in 23.02;please use " "endIConnectable() returning public IConnectableLayerIterator" | , | ||
"23.02" | |||
) |
ARMNN_DEPRECATED_MSG_CHANGE_DATE | ( | "This function is deprecated and will be changed to return an " " | ConstIConnectableIterator, |
until that occurs in 23.02;please use " "beginIConnectable() returning public ConstIConnectableIterator" | , | ||
"23.02" | |||
) | const |
ARMNN_DEPRECATED_MSG_CHANGE_DATE | ( | "This function is deprecated and will be changed to return an " " | ConstIConnectableIterator, |
until that occurs in 23.02;please use " "endIConnectable() returning public ConstIConnectableIterator" | , | ||
"23.02" | |||
) | const |
ARMNN_DEPRECATED_MSG_CHANGE_DATE | ( | "This function is deprecated and will be changed to return an " " | ConstIConnectableIterator, |
until that occurs in 23.02;please use " "cbeginIConnectable() returning public ConstIConnectableIterator" | , | ||
"23.02" | |||
) | const |
ARMNN_DEPRECATED_MSG_CHANGE_DATE | ( | "This function is deprecated and will be changed to return an " " | ConstIConnectableIterator, |
until that occurs in 23.02;please use " "cendIConnectable() returning public ConstIConnectableIterator" | , | ||
"23.02" | |||
) | const |
ARMNN_DEPRECATED_MSG_REMOVAL_DATE | ( | "This function has been | deprecated, |
please use constructor with arguments:" " | IConnectableLayers, | ||
IInputSlots and IOutputSlots" | , | ||
"22.11" | |||
) | && |
Constructs a sub-graph with the given arguments.
ARMNN_DEPRECATED_MSG_REMOVAL_DATE | ( | "This function has been | deprecated, |
please use GetIInputSlots() returning" " public IInputSlots" | , | ||
"22.11" | |||
) | const & |
ARMNN_DEPRECATED_MSG_REMOVAL_DATE | ( | "This function has been | deprecated, |
please use GetIOutputSlots() returning" " public IOutputSlots" | , | ||
"22.11" | |||
) | const & |
ARMNN_DEPRECATED_MSG_REMOVAL_DATE | ( | "This function has been | deprecated, |
please use GetIConnectableLayers() " "returning public IConnectableLayers" | , | ||
"22.11" | |||
) | const & |
ARMNN_DEPRECATED_MSG_REMOVAL_DATE | ( | "This function has been | deprecated, |
please use GetIInputSlot() returning public " "IInputSlot" | , | ||
"22.11" | |||
) | const |
ARMNN_DEPRECATED_MSG_REMOVAL_DATE | ( | "This function has been | deprecated, |
please use GetIInputSlot() returning public " "IInputSlot" | , | ||
"22.11" | |||
) |
ARMNN_DEPRECATED_MSG_REMOVAL_DATE | ( | "This function has been | deprecated, |
please use GetIOutputSlot() returning" " public IOutputSlot" | , | ||
"22.11" | |||
) | const |
ARMNN_DEPRECATED_MSG_REMOVAL_DATE | ( | "This function has been | deprecated, |
please use GetIOutputSlot() returning" " public IOutputSlot" | , | ||
"22.11" | |||
) |
SubgraphView::IConnectableLayerIterator beginIConnectable | ( | ) |
Definition at line 316 of file SubgraphView.cpp.
Referenced by armnn::AssignBackends(), SubgraphView::cbeginIConnectable(), NeonBackend::OptimizeSubgraphView(), and ClBackend::OptimizeSubgraphView().
SubgraphView::ConstIConnectableIterator beginIConnectable | ( | ) | const |
Definition at line 337 of file SubgraphView.cpp.
SubgraphView::ConstIConnectableIterator cbeginIConnectable | ( | ) | const |
Definition at line 364 of file SubgraphView.cpp.
References SubgraphView::beginIConnectable().
SubgraphView::ConstIConnectableIterator cendIConnectable | ( | ) | const |
Definition at line 369 of file SubgraphView.cpp.
References SubgraphView::endIConnectable().
void Clear | ( | ) |
Definition at line 374 of file SubgraphView.cpp.
Referenced by Graph::SubstituteSubgraph().
SubgraphView::IConnectableLayerIterator endIConnectable | ( | ) |
Definition at line 321 of file SubgraphView.cpp.
Referenced by armnn::AssignBackends(), SubgraphView::cendIConnectable(), NeonBackend::OptimizeSubgraphView(), and ClBackend::OptimizeSubgraphView().
SubgraphView::ConstIConnectableIterator endIConnectable | ( | ) | const |
Definition at line 342 of file SubgraphView.cpp.
References ARMNN_NO_DEPRECATE_WARN_BEGIN, and ARMNN_NO_DEPRECATE_WARN_END.
|
inline |
Definition at line 38 of file SubgraphView.hpp.
Referenced by SubgraphView::SubstituteSubgraph(), Graph::SubstituteSubgraph(), and TEST_SUITE().
|
inline |
Definition at line 27 of file SubgraphView.hpp.
Referenced by TEST_SUITE().
const SubgraphView::IConnectableLayers & GetIConnectableLayers | ( | ) | const |
Definition at line 300 of file SubgraphView.cpp.
Referenced by armnn::ApplyBackendOptimizations(), SubgraphView::GetWorkingCopy(), MockBackend::OptimizeSubgraphView(), SubgraphViewSelector::SelectSubgraphs(), Graph::SubstituteSubgraph(), TEST_SUITE(), and OptimizationViews::Validate().
const IInputSlot * GetIInputSlot | ( | unsigned int | index | ) | const |
Definition at line 250 of file SubgraphView.cpp.
IInputSlot * GetIInputSlot | ( | unsigned int | index | ) |
Definition at line 260 of file SubgraphView.cpp.
const SubgraphView::IInputSlots & GetIInputSlots | ( | ) | const |
Definition at line 230 of file SubgraphView.cpp.
Referenced by SubgraphView::GetWorkingCopy(), SubgraphViewSelector::SelectSubgraphs(), Graph::SubstituteSubgraph(), TEST_SUITE(), and OptimizationViews::Validate().
const IOutputSlot * GetIOutputSlot | ( | unsigned int | index | ) | const |
Definition at line 270 of file SubgraphView.cpp.
IOutputSlot * GetIOutputSlot | ( | unsigned int | index | ) |
Definition at line 280 of file SubgraphView.cpp.
const SubgraphView::IOutputSlots & GetIOutputSlots | ( | ) | const |
Definition at line 240 of file SubgraphView.cpp.
Referenced by SubgraphView::GetWorkingCopy(), Graph::SubstituteSubgraph(), TEST_SUITE(), and OptimizationViews::Validate().
unsigned int GetNumInputSlots | ( | ) | const |
Definition at line 285 of file SubgraphView.cpp.
References armnn::numeric_cast().
unsigned int GetNumOutputSlots | ( | ) | const |
Definition at line 290 of file SubgraphView.cpp.
References armnn::numeric_cast().
SubgraphView GetWorkingCopy | ( | ) |
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 419 of file SubgraphView.cpp.
References SubgraphView::GetIConnectableLayers(), SubgraphView::GetIInputSlots(), IConnectableLayer::GetInputSlot(), SubgraphView::GetIOutputSlots(), IConnectableLayer::GetNumInputSlots(), IConnectableLayer::GetNumOutputSlots(), IConnectableLayer::GetOutputSlot(), IConnectableLayer::GetType(), and armnn::Output.
Referenced by TEST_SUITE().
SubgraphView & operator= | ( | SubgraphView && | other | ) |
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 543 of file SubgraphView.cpp.
References ARMNN_ASSERT.
Referenced by TEST_SUITE().
void SubstituteSubgraph | ( | SubgraphView & | patternSubgraph, |
const SubgraphView & | substituteSubgraph | ||
) |
Definition at line 551 of file SubgraphView.cpp.
References SubgraphView::ForEachIConnectableLayer().
OutputSlots Layers&& layers |
Definition at line 66 of file SubgraphView.hpp.
Referenced by SubgraphView::SubgraphView().
OutputSlots&& outputs |
Definition at line 66 of file SubgraphView.hpp.
Referenced by SubgraphView::SubgraphView().