diff options
author | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-01-24 14:06:23 +0000 |
---|---|---|
committer | Matteo Martincigh <matteo.martincigh@arm.com> | 2019-01-30 14:03:28 +0000 |
commit | adddddb6cbcb777d92a8c464c9ad0cb9aecc76a3 (patch) | |
tree | b15de32bf9f8612f66e1ae23d2f8009e80e7d0e6 /src/armnn/SubGraphSelector.hpp | |
parent | d089b74bebbcc8518fb0f4eacb7e6569ae170199 (diff) | |
download | armnn-adddddb6cbcb777d92a8c464c9ad0cb9aecc76a3.tar.gz |
IVGCVSW-2458 Refactor the Optimize function (Network.cpp) so that
subgraphs are optimized by the backends
* Added a new method OptimizeSubGraph to the backend interface
* Refactored the Optimize function so that the backend-specific
optimization is performed by the backend itself (through the new
OptimizeSubGraph interface method)
* Added a new ApplyBackendOptimizations function to apply the new
changes
* Added some new convenient constructors to the SubGraph class
* Added AddLayer method and a pointer to the parent graph to the
SubGraph class
* Updated the sub-graph unit tests to match the changes
* Added SelectSubGraphs and ReplaceSubGraphConnections overloads
that work with sub-graphs
* Removed unused code and minor refactoring where necessary
Change-Id: I46181794c6a9e3b10558944f804e06a8f693a6d0
Diffstat (limited to 'src/armnn/SubGraphSelector.hpp')
-rw-r--r-- | src/armnn/SubGraphSelector.hpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/armnn/SubGraphSelector.hpp b/src/armnn/SubGraphSelector.hpp index f96b986a2e..371ba78f18 100644 --- a/src/armnn/SubGraphSelector.hpp +++ b/src/armnn/SubGraphSelector.hpp @@ -21,14 +21,12 @@ public: using SubGraphs = std::vector<SubGraphPtr>; using LayerSelectorFunction = std::function<bool(const Layer&)>; - /// Selects subgraphs of a graph based on the selector function - /// and the algorithm. Since the SubGraphs returns modifiable pointers - /// the input and output slots of the graph: - /// 1) the graph cannot be const - /// 2) the caller need to make sure that the SubGraphs lifetime is - /// shorter than the graph's - static SubGraphs SelectSubGraphs(Graph& graph, - const LayerSelectorFunction& selector); + /// Selects subgraphs from a graph based on the selector function and the algorithm. + /// Since the SubGraphs object returns modifiable pointers to the input and output slots of the graph: + /// 1) the graph/sub-graph cannot be const + /// 2) the caller needs to make sure that the SubGraphs lifetime is shorter than the parent graph's + static SubGraphs SelectSubGraphs(Graph& graph, const LayerSelectorFunction& selector); + static SubGraphs SelectSubGraphs(SubGraph& subGraph, const LayerSelectorFunction& selector); private: // this is a utility class, don't construct or copy |