ArmNN
 20.02
OverrideInputRangeVisitor.hpp
Go to the documentation of this file.
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #pragma once
7 
8 #include "NetworkQuantizer.hpp"
10 #include "RangeTracker.hpp"
11 
12 #include <unordered_map>
13 
14 namespace armnn
15 {
16 
17 /// Visitor object for overriding the input range of the quantized input layers in a network
18 class OverrideInputRangeVisitor : public LayerVisitorBase<VisitorNoThrowPolicy>
19 {
20 private:
21  using MinMaxRange = RangeTracker::MinMaxRange;
22 
23 public:
25  LayerBindingId layerId,
26  const MinMaxRange& minMaxRange);
27  ~OverrideInputRangeVisitor() = default;
28 
29  void VisitInputLayer(const IConnectableLayer* layer, LayerBindingId id, const char* name = nullptr) override;
30 
31 private:
32  /// Mapping from a layer Guid to an array of ranges for outputs
33  RangeTracker& m_Ranges;
34 
35  /// The id of the input layer of which to override the input range
36  LayerBindingId m_LayerId;
37 
38  /// The new input range to be applied to the input layer
39  MinMaxRange m_MinMaxRange;
40 };
41 
42 } // namespace armnn
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
Definition: INetwork.hpp:61
OverrideInputRangeVisitor(RangeTracker &ranges, LayerBindingId layerId, const MinMaxRange &minMaxRange)
Visitor object for overriding the input range of the quantized input layers in a network.
Copyright (c) 2020 ARM Limited.
std::pair< float, float > MinMaxRange
int LayerBindingId
Type of identifiers for bindable layers (inputs, outputs).
Definition: Types.hpp:171
Visitor base class with empty implementations.
void VisitInputLayer(const IConnectableLayer *layer, LayerBindingId id, const char *name=nullptr) override
Function that an InputLayer should call back to when its Accept(ILayerVisitor&) function is invoked...