From a983e4699082a0b1ef685bab7354f2ad9cd37a44 Mon Sep 17 00:00:00 2001 From: Colm Donelan Date: Wed, 20 May 2020 16:12:19 +0100 Subject: Updating Doxygen documentation for 20.05 release. Change-Id: I4d624343ed5fd6ae269c3d53532903084508fd14 Signed-off-by: Colm Donelan --- ..._dynamic_quantization_visitor_8hpp_source.xhtml | 171 +++++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 20.05/_dynamic_quantization_visitor_8hpp_source.xhtml (limited to '20.05/_dynamic_quantization_visitor_8hpp_source.xhtml') diff --git a/20.05/_dynamic_quantization_visitor_8hpp_source.xhtml b/20.05/_dynamic_quantization_visitor_8hpp_source.xhtml new file mode 100644 index 0000000000..635fe763d9 --- /dev/null +++ b/20.05/_dynamic_quantization_visitor_8hpp_source.xhtml @@ -0,0 +1,171 @@ + + + + + + + + + + + + + +ArmNN: src/armnn/DynamicQuantizationVisitor.hpp Source File + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  20.05 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+
+
DynamicQuantizationVisitor.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 
9 #include "RangeTracker.hpp"
10 #include "layers/DebugLayer.hpp"
11 
12 #include <armnn/INetwork.hpp>
14 
15 namespace armnn
16 {
17 
18 /// Visitor class to establish min/max ranges based on the type of the layer
19 class DynamicQuantizationVisitor : public LayerVisitorBase<VisitorThrowingPolicy>
20 {
21 public:
22  DynamicQuantizationVisitor(RangeTracker& rangeTracker, Graph& graph);
23  ~DynamicQuantizationVisitor() = default;
24 
25  /// Functions to set the Range on a per-layer-type basis
26  void VisitAbsLayer(const IConnectableLayer* layer,
27  const char* name = nullptr) override;
28 
29  void VisitAdditionLayer(const IConnectableLayer* layer,
30  const char* name = nullptr) override;
31 
32  void VisitArgMinMaxLayer(const IConnectableLayer* layer,
33  const ArgMinMaxDescriptor& desc,
34  const char* name = nullptr) override;
35 
37  const NormalizationDescriptor& desc,
38  const char* name = nullptr) override ;
39 
41  const BatchNormalizationDescriptor& desc,
42  const ConstTensor& mean,
43  const ConstTensor& variance,
44  const ConstTensor& beta,
45  const ConstTensor& gamma,
46  const char* name = nullptr) override;
47 
49  const Convolution2dDescriptor& convolution2dDescriptor,
50  const ConstTensor& weights,
51  const Optional<ConstTensor>& biases,
52  const char* name = nullptr) override;
53 
56  const ConstTensor& weights,
57  const Optional<ConstTensor>& biases,
58  const char* name = nullptr) override;
59 
60  void VisitActivationLayer(const IConnectableLayer* layer,
61  const ActivationDescriptor& activationDescriptor,
62  const char* name = nullptr) override;
63 
65  const FullyConnectedDescriptor& desc,
66  const ConstTensor& weights,
67  const Optional<ConstTensor>& biases,
68  const char *name) override;
69 
70  void VisitPermuteLayer(const IConnectableLayer* layer,
71  const PermuteDescriptor& permuteDescriptor,
72  const char* name) override;
73 
75  const SpaceToBatchNdDescriptor& spaceToBatchNdDescriptor,
76  const char* name = nullptr) override;
77 
78  void VisitPooling2dLayer(const IConnectableLayer* layer,
79  const Pooling2dDescriptor& pooling2dDescriptor,
80  const char* name) override;
81 
82  void VisitSoftmaxLayer(const IConnectableLayer* layer,
83  const SoftmaxDescriptor& softmaxDescriptor,
84  const char* name = nullptr) override;
85 
86  void VisitConcatLayer(const IConnectableLayer* layer,
87  const ConcatDescriptor& originsDescriptor,
88  const char* name = nullptr) override;
89 
90  void VisitConstantLayer(const IConnectableLayer* layer,
91  const ConstTensor& input,
92  const char* name = nullptr) override;
93 
94  void VisitReshapeLayer(const IConnectableLayer* layer,
95  const ReshapeDescriptor& reshapeDescriptor,
96  const char* name = nullptr) override;
97 
98  void VisitSplitterLayer(const IConnectableLayer* layer,
99  const SplitterDescriptor& splitterDescriptor,
100  const char* name = nullptr) override;
101 
103  const ResizeBilinearDescriptor& resizeDesc,
104  const char* name = nullptr) override;
105 
106  void VisitStridedSliceLayer(const IConnectableLayer* layer,
107  const StridedSliceDescriptor& stridedSliceDescriptor,
108  const char* name = nullptr) override;
109 
111  const BatchToSpaceNdDescriptor& batchToSpaceNdDescriptor,
112  const char* name = nullptr) override;
113 
114  void VisitInputLayer(const IConnectableLayer* layer,
115  LayerBindingId id,
116  const char* name = nullptr) override;
117 
118  void VisitOutputLayer(const IConnectableLayer* layer,
119  LayerBindingId id,
120  const char* name = nullptr) override;
121 
122  void FinishVisit() override;
124 
125  const std::vector<armnn::LayerBindingId>& GetOutputLayers();
126 
127 private:
128  /// Set the range for an output slot on a layer
129  void SetRange(const IConnectableLayer* layer, unsigned int outputIdx, float min, float max);
130 
131  void ForwardParentParameters(const IConnectableLayer* layer);
132 
133  /// Mapping from a layer Guid to an array of ranges for outputs
134  RangeTracker& m_RangeTracker;
135 
136  Graph& m_Graph;
137 
138  std::vector<const IConnectableLayer*> m_LayersToCalibrate;
139  std::vector<const IConnectableLayer*> m_LayersNotToCalibrate;
140  std::vector<DebugLayer*> m_DebugLayers;
141 
142  std::vector<armnn::LayerBindingId> m_OutputLayers;
143 
144  void AddToCalibratedLayers(const IConnectableLayer* layer);
145  void AddToNonCalibratedLayers(const IConnectableLayer* layer);
146  void RemoveDebugLayers();
147 };
148 
149 } //namespace armnn
void VisitReshapeLayer(const IConnectableLayer *layer, const ReshapeDescriptor &reshapeDescriptor, const char *name=nullptr) override
Function a reshape layer should call back to when its Accept(ILayerVisitor&) function is invoked...
+
void VisitBatchNormalizationLayer(const IConnectableLayer *layer, const BatchNormalizationDescriptor &desc, const ConstTensor &mean, const ConstTensor &variance, const ConstTensor &beta, const ConstTensor &gamma, const char *name=nullptr) override
Function that a batch normalization layer should call back to when its Accept(ILayerVisitor&) functio...
+
void VisitNormalizationLayer(const IConnectableLayer *layer, const NormalizationDescriptor &desc, const char *name=nullptr) override
Function that a normalization layer should call back to when its Accept(ILayerVisitor&) function is i...
+
void VisitPermuteLayer(const IConnectableLayer *layer, const PermuteDescriptor &permuteDescriptor, const char *name) override
Function that a permute layer should call back to when its Accept(ILayerVisitor&) function is invoked...
+
A ViewsDescriptor for the SplitterLayer.
+
Interface for a layer that is connectable to other layers via InputSlots and OutputSlots.
Definition: INetwork.hpp:61
+ + +
void VisitConstantLayer(const IConnectableLayer *layer, const ConstTensor &input, const char *name=nullptr) override
Function a layer with no inputs and a single output, which always corresponds to the passed in consta...
+
A ReshapeDescriptor for the ReshapeLayer.
+
void VisitConcatLayer(const IConnectableLayer *layer, const ConcatDescriptor &originsDescriptor, const char *name=nullptr) override
Function that a concat layer should call back to when its Accept(ILayerVisitor&) function is invoked...
+
void VisitSpaceToBatchNdLayer(const IConnectableLayer *layer, const SpaceToBatchNdDescriptor &spaceToBatchNdDescriptor, const char *name=nullptr) override
Function a space to batch layer should call back to when its Accept(ILayerVisitor&) function is invok...
+ +
A Convolution2dDescriptor for the Convolution2dLayer.
+
void VisitBatchToSpaceNdLayer(const IConnectableLayer *layer, const BatchToSpaceNdDescriptor &batchToSpaceNdDescriptor, const char *name=nullptr) override
Function that a batch to space ND layer should call back to when its Accept(ILayerVisitor&) function ...
+
void VisitResizeBilinearLayer(const IConnectableLayer *layer, const ResizeBilinearDescriptor &resizeDesc, const char *name=nullptr) override
Function that a resize bilinear layer should call back to when its Accept(ILayerVisitor&) function is...
+ + +
Copyright (c) 2020 ARM Limited.
+
void VisitConvolution2dLayer(const IConnectableLayer *layer, const Convolution2dDescriptor &convolution2dDescriptor, const ConstTensor &weights, const Optional< ConstTensor > &biases, const char *name=nullptr) override
Function that a 2D convolution layer should call back to when its Accept(ILayerVisitor&) function is ...
+
void VisitSoftmaxLayer(const IConnectableLayer *layer, const SoftmaxDescriptor &softmaxDescriptor, const char *name=nullptr) override
Function that a softmax layer should call back to when its Accept(ILayerVisitor&) function is invoked...
+
A BatchToSpaceNdDescriptor for the BatchToSpaceNdLayer.
+ +
void VisitFullyConnectedLayer(const IConnectableLayer *layer, const FullyConnectedDescriptor &desc, const ConstTensor &weights, const Optional< ConstTensor > &biases, const char *name) override
Function that a fully connected layer should call back to when its Accept(ILayerVisitor&) function is...
+
int LayerBindingId
Type of identifiers for bindable layers (inputs, outputs).
Definition: Types.hpp:171
+
void VisitDepthwiseConvolution2dLayer(const IConnectableLayer *layer, const DepthwiseConvolution2dDescriptor &desc, const ConstTensor &weights, const Optional< ConstTensor > &biases, const char *name=nullptr) override
Function that a 2D depthwise convolution layer with biases should call back to when its Accept(ILayer...
+
DynamicQuantizationVisitor(RangeTracker &rangeTracker, Graph &graph)
+ +
void VisitActivationLayer(const IConnectableLayer *layer, const ActivationDescriptor &activationDescriptor, const char *name=nullptr) override
Function that an activation layer should call back to when its Accept(ILayerVisitor&) function is inv...
+
void VisitAdditionLayer(const IConnectableLayer *layer, const char *name=nullptr) override
Function that an addition layer should call back to when its Accept(ILayerVisitor&) function is invok...
+
An ArgMinMaxDescriptor for ArgMinMaxLayer.
Definition: Descriptors.hpp:51
+
An OriginsDescriptor for the ConcatLayer.
+
A FullyConnectedDescriptor for the FullyConnectedLayer.
+
A tensor defined by a TensorInfo (shape and data type) and an immutable backing store.
Definition: Tensor.hpp:199
+
void VisitArgMinMaxLayer(const IConnectableLayer *layer, const ArgMinMaxDescriptor &desc, const char *name=nullptr) override
Function that an arg min max layer should call back to when its Accept(ILayerVisitor&) function is in...
+
An ActivationDescriptor for the ActivationLayer.
Definition: Descriptors.hpp:20
+
Visitor base class with empty implementations.
+ + +
A SpaceToBatchNdDescriptor for the SpaceToBatchNdLayer.
+
void VisitAbsLayer(const IConnectableLayer *layer, const char *name=nullptr) override
Functions to set the Range on a per-layer-type basis.
+
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...
+
A StridedSliceDescriptor for the StridedSliceLayer.
+
Visitor class to establish min/max ranges based on the type of the layer.
+ +
A Pooling2dDescriptor for the Pooling2dLayer.
+
void VisitPooling2dLayer(const IConnectableLayer *layer, const Pooling2dDescriptor &pooling2dDescriptor, const char *name) override
Function that a pooling layer should call back to when its Accept(ILayerVisitor&) function is invoked...
+
A NormalizationDescriptor for the NormalizationLayer.
+
void VisitOutputLayer(const IConnectableLayer *layer, LayerBindingId id, const char *name=nullptr) override
Function an output layer should call back to when its Accept(ILayerVisitor&) function is invoked...
+
A ResizeBilinearDescriptor for the ResizeBilinearLayer.
+
void VisitSplitterLayer(const IConnectableLayer *layer, const SplitterDescriptor &splitterDescriptor, const char *name=nullptr) override
Function that a splitter layer should call back to when its Accept(ILayerVisitor&) function is invoke...
+
A SoftmaxDescriptor for the SoftmaxLayer.
+
void VisitStridedSliceLayer(const IConnectableLayer *layer, const StridedSliceDescriptor &stridedSliceDescriptor, const char *name=nullptr) override
Function a strided slice layer should call back to when its Accept(ILayerVisitor&) function is invoke...
+
const std::vector< armnn::LayerBindingId > & GetOutputLayers()
+
A DepthwiseConvolution2dDescriptor for the DepthwiseConvolution2dLayer.
+
A BatchNormalizationDescriptor for the BatchNormalizationLayer.
+ +
A PermuteDescriptor for the PermuteLayer.
+
+
+ + + + -- cgit v1.2.1