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::OptimizeForExclusiveConnectionImpl< 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 131 of file Optimization.hpp.
◆ ~OptimizeForExclusiveConnectionImpl()
◆ Run()
void Run |
( |
Graph & |
graph, |
|
|
BaseType & |
base |
|
) |
| const |
|
inline |
Definition at line 136 of file Optimization.hpp.
138 for (
auto output = base.BeginOutputSlots(); output != base.EndOutputSlots(); ++output)
140 if (output->GetNumConnections() == 1)
142 for (
auto&& childInput : output->GetConnections())
144 if (childInput->GetOwningLayer().GetType() == LayerEnumOf<ChildType>())
146 Wrapped::Run(graph, *childInput);
151 for (
unsigned int i = 0; i < output->GetNumConnections();)
153 Layer* child = &output->GetConnection(i)->GetOwningLayer();
155 if (child->IsOutputUnconnected())
157 graph.EraseLayer(child);
References Graph::EraseLayer(), and Layer::IsOutputUnconnected().
The documentation for this class was generated from the following file: