#include <MaxMinIntoBoundedRelu.hpp>
|
static void | Run (Graph &graph, InputSlot &connection) |
| Run for every exclusive connection between any Max & Min layers The Max, Min and its associated constant inputs will be removed, and replaced with a BoundedRelu Activation. More...
|
|
Definition at line 13 of file MaxMinIntoBoundedRelu.hpp.
◆ MaxMinIntoBoundedReluImpl()
◆ ~MaxMinIntoBoundedReluImpl()
◆ Run()
Run for every exclusive connection between any Max & Min layers The Max, Min and its associated constant inputs will be removed, and replaced with a BoundedRelu Activation.
Definition at line 18 of file MaxMinIntoBoundedRelu.hpp.
20 Layer& base = connection.GetConnectedOutputSlot()->GetOwningLayer();
21 Layer& child = connection.GetOwningLayer();
23 auto& maxLayer = *PolymorphicDowncast<ElementwiseBinaryLayer*>(&base);
28 auto& minLayer = *PolymorphicDowncast<ElementwiseBinaryLayer*>(&child);
34 if (maxLayer.GetDataType() != minLayer.GetDataType())
41 if (!GetValue(maxLayer, maxValue))
46 if (!GetValue(minLayer, minValue))
52 OutputSlot& parentOut = *maxLayer.GetInputSlot(0).GetConnectedOutputSlot();
56 const std::string name = std::string(
"replaced-") + maxLayer.GetName() + std::string(
"-") + minLayer.GetName()
57 + std::string(
"-with-BoundedRelu");
58 auto& boundedReluLayer = *graph.InsertNewLayer<ActivationLayer>(maxLayer.GetInputSlot(0),
59 boundedReluDescriptor,
63 boundedReluLayer.GetOutputSlot().MoveAllConnections(parentOut);
68 minLayer.GetOutputSlot().MoveAllConnections(boundedReluLayer.GetOutputSlot());
References armnn::BoundedReLu, InputSlot::GetConnectedOutputSlot(), Layer::GetOutputSlot(), InputSlot::GetOwningLayer(), OutputSlot::GetOwningLayer(), Graph::InsertNewLayer(), armnn::Maximum, armnn::Minimum, and OutputSlot::MoveAllConnections().
The documentation for this class was generated from the following file: