12 Optimizer::Optimizer()
23 bool graphNeedsSorting =
false;
30 for (
auto&& optimization : optimizations)
37 optimization->Run(graph, **it);
39 if ((*it)->IsOutputUnconnected())
44 graphNeedsSorting =
true;
48 for (
auto& erasedLayerName : erasedLayerNamesObservable)
50 for (
auto& addedLayer : addedLayerObservable)
52 addedLayer->AddRelatedLayerName(erasedLayerName);
56 erasedLayerNamesObservable.Clear();
57 addedLayerObservable.
Clear();
59 if (graphNeedsSorting)
61 graphNeedsSorting =
false;
#define ARMNN_SCOPED_PROFILING_EVENT(backendId, name)
Iterator begin()
Returns iterator pointing to the beginning of the list. Lowercase for range-based for loops.
void EraseLayer(Iterator pos)
Deletes the layer at the specified position.
Graph & TopologicalSort()
Sorts layers in topological order and return this.
Iterator end()
Returns iterator pointing to the end of the list. Lowercase for range-based for loops.
Iterator GetPosInGraph(Layer &layer)
Gets the position of a layer in the graph.
static void Pass(Graph &graph, const Optimizations &optimizations)
std::vector< OptimizationPtr > Optimizations
Copyright (c) 2021 ARM Limited and Contributors.