32 template <
typename BaseType,
typename Wrapped>
36 using Wrapped::Wrapped;
40 if (base.
GetType() == LayerEnumOf<BaseType>())
42 Wrapped::Run(graph, *PolymorphicDowncast<BaseType*>(&base));
51 template <
typename Wrapped>
55 using Wrapped::Wrapped;
59 Wrapped::Run(graph, base);
66 template <
typename BaseType,
typename Wrapped>
78 template <
typename BaseType,
typename ChildType,
typename Wrapped>
82 using Wrapped::Wrapped;
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();
117 template <
typename BaseType,
typename ChildType,
typename Wrapped>
119 :
public OptimizeForTypeImpl<BaseType, OptimizeForConnectionImpl<BaseType, ChildType, Wrapped>>
virtual void Run(Graph &graph, Layer &base) const =0
void EraseLayer(Iterator pos)
Deletes the layer at the specified position.
Copyright (c) 2020 ARM Limited.
bool IsOutputUnconnected()
Wrapper Optimization class that calls Wrapped::Run for every connection BaseType -> ChildType...
virtual ~Optimization()=default
void Run(Graph &graph, Layer &base) const override
Wrapper Optimization base class that calls Wrapped::Run() for every layer of type BaseType...
void Run(Graph &graph, BaseType &base) const
void Run(Graph &graph, Layer &base) const override
LayerType GetType() const