18 : m_RangeTracker(rangeTracker)
21 void StaticRangeStrategy::SetRange(
const IConnectableLayer* layer,
unsigned int outputIdx,
float min,
float max)
23 m_RangeTracker.
SetRange(layer, outputIdx, min, max);
29 SetRange(layer, 0, parentRange.first, parentRange.second);
35 const std::vector<armnn::ConstTensor> &constants,
54 SetRange(layer, 0, 0.f, 15.f);
57 SetRange(layer, 0, 0.f, activationDescriptor.
m_A);
60 SetRange(layer, 0, -1.f, 1.f);
63 SetRange(layer, 0, -5.f, 15.f);
66 SetRange(layer, 0, -15.f, 15.f);
73 SetRange(layer, 0, -20.f, 20.f);
78 ForwardParentParameters(layer);
83 ForwardParentParameters(layer);
88 SetRange(layer, 0, -15.0f, 15.0f);
93 float min = std::numeric_limits<float>::max();
94 float max = std::numeric_limits<float>::lowest();
101 min = std::min(min, range.first);
102 max = std::max(max, range.second);
104 SetRange(layer, 0, min, max);
116 unsigned int inputNumElements = constants[0].GetNumElements();
117 const float* inputData =
reinterpret_cast<const float*
>(constants[0].GetMemoryArea());
119 float min = std::numeric_limits<float>::max();
120 float max = std::numeric_limits<float>::lowest();
122 for (
unsigned int i = 0; i < inputNumElements; i++)
124 const float inputValue = inputData[i];
126 min = std::min(min, inputValue);
127 max = std::max(max, inputValue);
129 SetRange(layer, 0, min, max);
134 SetRange(layer, 0, -15.0f, 15.0f);
139 SetRange(layer, 0, -15.0f, 15.0f);
144 SetRange(layer, 0, -15.0f, 15.0f);
149 ForwardParentParameters(layer);
154 ForwardParentParameters(layer);
159 ForwardParentParameters(layer);
164 ForwardParentParameters(layer);
169 ForwardParentParameters(layer);
174 ForwardParentParameters(layer);
179 SetRange(layer, 0, 0.f, 1.f);
184 ForwardParentParameters(layer);
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
virtual unsigned int GetNumInputSlots() const =0
Returns the number of connectable input slots.
void ExecuteStrategy(const armnn::IConnectableLayer *layer, const BaseDescriptor &descriptor, const std::vector< armnn::ConstTensor > &constants, const char *name, const armnn::LayerBindingId id) override
StaticRangeStrategy(RangeTracker &rangeTracker)
Copyright (c) 2021 ARM Limited and Contributors.
void IgnoreUnused(Ts &&...)
std::pair< float, float > MinMaxRange
int LayerBindingId
Type of identifiers for bindable layers (inputs, outputs).
MinMaxRange GetRange(LayerGuid guid, unsigned int idx) const
Retrieve the Range for a particular output slot on a particular layer.
Base class for all descriptors.
void SetRange(const IConnectableLayer *layer, unsigned int outputIdx, float min, float max)
Set the range for an output slot on a layer.
An output connection slot for a layer.
virtual unsigned int CalculateIndexOnOwner() const =0
An ActivationDescriptor for the ActivationLayer.
min(a, max(b, input)) ReLu1 & ReLu6.
virtual LayerType GetType() const =0
Returns the armnn::LayerType of this layer.
float m_A
Alpha upper bound value used by the activation functions. (BoundedReLu, Linear, TanH, Elu).
virtual const IInputSlot & GetInputSlot(unsigned int index) const =0
Get a const input slot handle by slot index.
virtual LayerGuid GetOwningLayerGuid() const =0
ActivationFunction m_Function
The activation function to use (Sigmoid, TanH, Linear, ReLu, BoundedReLu, SoftReLu, LeakyReLu, Abs, Sqrt, Square, Elu).