aboutsummaryrefslogtreecommitdiff
path: root/src/armnn/StaticRangeVisitor.hpp
diff options
context:
space:
mode:
authorDerek Lamberti <derek.lamberti@arm.com>2019-02-08 17:54:20 +0000
committerderek.lamberti <derek.lamberti@arm.com>2019-02-12 14:32:33 +0000
commit8a4ca10cca8d5dadb52124187c209c955df7a8b6 (patch)
tree777cead5570867e5f8652ddf1c3bb9fd8c237fdf /src/armnn/StaticRangeVisitor.hpp
parent64e4ccb4546473e922b4ddd699ff6b77a5c2527d (diff)
downloadarmnn-8a4ca10cca8d5dadb52124187c209c955df7a8b6.tar.gz
IVGCVSW-2607 Refactor range tracking into own class
Change-Id: I1b409e5dac7922859e04a554893b982afc5ad1e7 Signed-off-by: Derek Lamberti <derek.lamberti@arm.com>
Diffstat (limited to 'src/armnn/StaticRangeVisitor.hpp')
-rw-r--r--src/armnn/StaticRangeVisitor.hpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/src/armnn/StaticRangeVisitor.hpp b/src/armnn/StaticRangeVisitor.hpp
index 2b0143766a..e1f68f3a31 100644
--- a/src/armnn/StaticRangeVisitor.hpp
+++ b/src/armnn/StaticRangeVisitor.hpp
@@ -6,11 +6,11 @@
#pragma once
#include "armnn/LayerVisitorBase.hpp"
+#include "RangeTracker.hpp"
#include <armnn/INetwork.hpp>
#include <armnn/INetworkQuantizer.hpp>
-#include <unordered_map>
namespace armnn
{
@@ -18,12 +18,8 @@ namespace armnn
/// Visitor class to establish min/max ranges based on the type of the layer
class StaticRangeVisitor : public LayerVisitorBase<VisitorNoThrowPolicy>
{
-private:
- using MinMaxRange = std::pair<float, float>;
- using MinMaxRanges = std::vector<MinMaxRange>;
-
public:
- StaticRangeVisitor(std::unordered_map<LayerGuid, MinMaxRanges>& guidToRangesMap);
+ StaticRangeVisitor(RangeTracker& rangeTracker);
~StaticRangeVisitor() = default;
/// Functions to set the Range on a per-layer-type basis
@@ -61,18 +57,13 @@ public:
void VisitSoftmaxLayer(const IConnectableLayer* layer,
const SoftmaxDescriptor& softmaxDescriptor,
const char* name = nullptr) override;
- /// Retrieve the default range
- MinMaxRange DefaultRange() const { return std::make_pair(-15.0f, 15.0f); }
-
- /// Retrieve the Range for a particular output slot on a particular layer
- MinMaxRange GetRange(LayerGuid guid, unsigned int idx) const;
private:
/// Set the range for an output slot on a layer
void SetRange(const IConnectableLayer* layer, unsigned int outputIdx, float min, float max);
/// Mapping from a layer Guid to an array of ranges for outputs
- std::unordered_map<LayerGuid, MinMaxRanges>& m_GuidToRangesMap;
+ RangeTracker& m_RangeTracker;
};
} //namespace armnn