Wrapper Optimization class that calls Wrapped::Run for every connection BaseType -> ChildType.
More...
#include <Optimization.hpp>
|
void | Run (Graph &graph, BaseType &base) const |
|
template<typename BaseType, typename ChildType, typename Wrapped>
class armnn::OptimizeForConnectionImpl< BaseType, ChildType, Wrapped >
Wrapper Optimization class that calls Wrapped::Run for every connection BaseType -> ChildType.
- Wrapped class mustn't remove the base layer. The optimizer will remove it if left unconnected after applying each optimization.
- Wrapped class mustn't affect existing connections in the same output. It might add new ones.
- Children layers are removed if left unconnected after applying the wrapped optimization.
Definition at line 79 of file Optimization.hpp.
◆ ~OptimizeForConnectionImpl()
◆ Run()
void Run |
( |
Graph & |
graph, |
|
|
BaseType & |
base |
|
) |
| const |
|
inline |
Definition at line 84 of file Optimization.hpp.
86 for (
auto output = base.BeginOutputSlots(); output != base.EndOutputSlots(); ++output)
88 for (
auto&& childInput : output->GetConnections())
90 if (childInput->GetOwningLayer().GetType() == LayerEnumOf<ChildType>())
92 Wrapped::Run(graph, *childInput);
97 for (
unsigned int i = 0; i < output->GetNumConnections();)
99 Layer* child = &output->GetConnection(i)->GetOwningLayer();
101 if (child->IsOutputUnconnected())
103 graph.EraseLayer(child);
References Graph::EraseLayer(), and Layer::IsOutputUnconnected().
The documentation for this class was generated from the following file: