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/_network_quantizer_8hpp_source.xhtml | 142 +++++++++++++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 21.02/_network_quantizer_8hpp_source.xhtml (limited to '21.02/_network_quantizer_8hpp_source.xhtml') diff --git a/21.02/_network_quantizer_8hpp_source.xhtml b/21.02/_network_quantizer_8hpp_source.xhtml new file mode 100644 index 0000000000..637bb8700f --- /dev/null +++ b/21.02/_network_quantizer_8hpp_source.xhtml @@ -0,0 +1,142 @@ + + + + + + + + + + + + + +ArmNN: src/armnn/NetworkQuantizer.hpp Source File + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  21.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
NetworkQuantizer.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 <armnn/INetwork.hpp>
10 #include <armnn/IRuntime.hpp>
11 #include <armnn/Types.hpp>
12 #include <armnn/Optional.hpp>
13 
15 #include "RangeTracker.hpp"
16 
17 namespace armnn
18 {
19 
21 {
22 public:
23  NetworkQuantizer(INetwork* inputNetwork, const QuantizerOptions& options)
24  : m_InputNetwork(inputNetwork),
25  m_NetworkId(0),
26  m_Runtime(nullptr, &IRuntime::Destroy),
27  m_RefineCount(0),
28  m_Options(options) {}
29 
30  void OverrideInputRange(LayerBindingId layerId, float min, float max) override;
31  void Refine(const InputTensors& inputTensors) override;
32 
33  // Required for testing? Need some way to get min/max in RangeTracker (m_Ranges)
34  std::pair<float, float> GetMinMaxRange(LayerGuid guid, unsigned int idx) { return m_Ranges.GetRange(guid, idx); }
35  INetworkPtr ExportNetwork() override;
36 
37 private:
38  /// Original input network to quantize
39  INetwork* m_InputNetwork;
40 
41  NetworkId m_NetworkId;
42 
43  // if we are run in dynamic mode this unique pointer will hold
44  // the runtime between invocations of the Refine method.
45  IRuntimePtr m_Runtime;
46 
47  Optional<DynamicQuantizationStrategy> m_DynamicQuantizationStrategy;
48 
49  // counts the number of times refine is called
50  unsigned int m_RefineCount;
51 
52  /// Mapping from Guid to an array of ranges for outputs
53  RangeTracker m_Ranges;
54 
55  /// Options for the NetworkQuantizer
56  QuantizerOptions m_Options;
57 
58  std::pair<float, float> FindMinMax(ITensorHandle* tensorHandle);
59 };
60 
61 } //namespace armnn
+ +
NetworkQuantizer(INetwork *inputNetwork, const QuantizerOptions &options)
+ + +
std::unique_ptr< IRuntime, void(*)(IRuntime *runtime)> IRuntimePtr
Definition: IRuntime.hpp:26
+ +
Main network class which provides the interface for building up a neural network. ...
Definition: INetwork.hpp:178
+
std::vector< std::pair< LayerBindingId, class ConstTensor > > InputTensors
Definition: Tensor.hpp:340
+ +
int NetworkId
Definition: IRuntime.hpp:20
+ +
Copyright (c) 2021 ARM Limited and Contributors.
+ +
int LayerBindingId
Type of identifiers for bindable layers (inputs, outputs).
Definition: Types.hpp:210
+
MinMaxRange GetRange(LayerGuid guid, unsigned int idx) const
Retrieve the Range for a particular output slot on a particular layer.
+
static void Destroy(INetworkQuantizer *quantizer)
Destroy Quantizer object.
+
std::pair< float, float > GetMinMaxRange(LayerGuid guid, unsigned int idx)
+
void Refine(const InputTensors &inputTensors) override
Refine input network with a set of refinement data for specified LayerBindingId.
+
void OverrideInputRange(LayerBindingId layerId, float min, float max) override
Overrides the default quantization values for the input layer with the given id.
+ + + + + +
std::unique_ptr< INetwork, void(*)(INetwork *network)> INetworkPtr
Definition: INetwork.hpp:173
+
Quantizer class Quantizes a float32 InputNetwork.
+
INetworkPtr ExportNetwork() override
Extract final quantized network.
+ +
+
+ + + + -- cgit v1.2.1