From fd627ffaec8fd8801d980b4c91ee7c0607ab6aaf Mon Sep 17 00:00:00 2001 From: Jan Eilers Date: Thu, 25 Feb 2021 17:44:00 +0000 Subject: IVGCVSW-5687 Update Doxygen Docu * Update Doxygen Documentation for 21.02 release Signed-off-by: Jan Eilers Change-Id: I9ed2f9caab038836ea99d7b378d7899fe431a4e5 --- 21.02/_range_tracker_8cpp_source.xhtml | 129 +++++++++++++++++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 21.02/_range_tracker_8cpp_source.xhtml (limited to '21.02/_range_tracker_8cpp_source.xhtml') diff --git a/21.02/_range_tracker_8cpp_source.xhtml b/21.02/_range_tracker_8cpp_source.xhtml new file mode 100644 index 0000000000..1edd1a03a4 --- /dev/null +++ b/21.02/_range_tracker_8cpp_source.xhtml @@ -0,0 +1,129 @@ + + + + + + + + + + + + + +ArmNN: src/armnn/RangeTracker.cpp Source File + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  21.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
RangeTracker.cpp
+
+
+Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #include "RangeTracker.hpp"
7 #include "InternalTypes.hpp"
8 
9 namespace armnn
10 {
11 
12 void RangeTracker::SetRange(const armnn::IConnectableLayer* layer, unsigned int outputIdx, float min, float max)
13 {
14  auto& ranges = m_GuidToRangesMap[layer->GetGuid()];
15 
16  unsigned int numOfOutputSlots = layer->GetNumOutputSlots();
17  // output layers are a special case
18  if (numOfOutputSlots == 0)
19  {
20  ++numOfOutputSlots;
21  }
22  if (ranges.size() < numOfOutputSlots)
23  {
24  ranges.resize(numOfOutputSlots);
25  }
26  ranges[outputIdx] = std::make_pair(min, max);
27 }
28 
30 {
31  auto search = m_GuidToRangesMap.find(guid);
32  if (search == m_GuidToRangesMap.end())
33  {
34  if (IsInDynamicMode())
35  {
36  throw armnn::Exception("Have no entry for layer GUID [" + std::to_string(guid) + "]");
37  }
38  else
39  {
40  return DefaultRange();
41  }
42  }
43  return search->second.at(idx);
44 }
45 
46 void RangeTracker::RefineMin(LayerGuid guid, unsigned int idx, float newMin)
47 {
48  auto& currentMin = m_GuidToRangesMap.find(guid)->second.at(idx).first;
49  if (newMin < currentMin)
50  {
51  currentMin = newMin;
52  }
53 }
54 
55 void RangeTracker::RefineMax(LayerGuid guid, unsigned int idx, float newMax)
56 {
57  auto& currentMax = m_GuidToRangesMap.find(guid)->second.at(idx).second;
58  if (newMax > currentMax)
59  {
60  currentMax = newMax;
61  }
62 }
63 
64 void RangeTracker::ResetMinMax(LayerGuid guid, unsigned int idx, float newMin, float newMax)
65 {
66  auto minMaxPair = m_GuidToRangesMap.find(guid);
67  auto& currentMin = minMaxPair->second.at(idx).first;
68  auto& currentMax = minMaxPair->second.at(idx).second;
69 
70  currentMin = newMin;
71  currentMax = newMax;
72 }
73 
75 {
76  m_GuidToRangesMap.clear();
77 }
78 
79 } //namespace armnn
virtual unsigned int GetNumOutputSlots() const =0
Returns the number of connectable output slots.
+
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
Definition: INetwork.hpp:62
+
bool IsInDynamicMode() const
+
void ResetMinMax(LayerGuid guid, unsigned int idx, float newMin, float newMax)
Overwrite min and max in RangeTracker with newMin and newMax.
+ +
void RefineMax(LayerGuid guid, unsigned int slotIndex, float newMax)
Update max in RangeTracker with new_max if it is greater than current value.
+ +
Copyright (c) 2021 ARM Limited and Contributors.
+ +
std::pair< float, float > MinMaxRange
+
MinMaxRange GetRange(LayerGuid guid, unsigned int idx) const
Retrieve the Range for a particular output slot on a particular layer.
+
void SetRange(const IConnectableLayer *layer, unsigned int outputIdx, float min, float max)
Set the range for an output slot on a layer.
+
virtual LayerGuid GetGuid() const =0
Returns the unique id of the layer.
+
Base class for all ArmNN exceptions so that users can filter to just those.
Definition: Exceptions.hpp:46
+ +
void RefineMin(LayerGuid guid, unsigned int slotIndex, float newMin)
Update min in RangeTracker with new_min if it is lower than current value.
+
+
+ + + + -- cgit v1.2.1