From 6940dd720ebb6b3d1df8ca203ab696daefe58189 Mon Sep 17 00:00:00 2001 From: Jim Flynn Date: Fri, 20 Mar 2020 12:25:56 +0000 Subject: renamed Documentation folder 20.02 and added .nojekyll file Signed-off-by: Jim Flynn --- ...tarmnn_1_1_q_asymm_u8_quantization_scheme.xhtml | 253 +++++++++++++++++++++ 1 file changed, 253 insertions(+) create mode 100644 20.02/structarmnn_1_1_q_asymm_u8_quantization_scheme.xhtml (limited to '20.02/structarmnn_1_1_q_asymm_u8_quantization_scheme.xhtml') diff --git a/20.02/structarmnn_1_1_q_asymm_u8_quantization_scheme.xhtml b/20.02/structarmnn_1_1_q_asymm_u8_quantization_scheme.xhtml new file mode 100644 index 0000000000..f073fedcf2 --- /dev/null +++ b/20.02/structarmnn_1_1_q_asymm_u8_quantization_scheme.xhtml @@ -0,0 +1,253 @@ + + + + + + + + + + + + + +ArmNN: QAsymmU8QuantizationScheme Struct Reference + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  20.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
QAsymmU8QuantizationScheme Struct Reference
+
+
+ +

#include <NetworkQuantizationScheme.hpp>

+
+Inheritance diagram for QAsymmU8QuantizationScheme:
+
+
+ + +IQuantizationScheme + +
+ + + + + + + + + + + +

+Public Member Functions

OffsetScalePair ComputeScheme (double min, double max) const override
 
int NumBits () const override
 
DataType GetDataType () const override
 
- Public Member Functions inherited from IQuantizationScheme
virtual ~IQuantizationScheme ()
 
+

Detailed Description

+
+

Definition at line 29 of file NetworkQuantizationScheme.hpp.

+

Member Function Documentation

+ +

◆ ComputeScheme()

+ +
+
+ + + + + +
+ + + + + + + + + + + + + + + + + + +
OffsetScalePair ComputeScheme (double min,
double max 
) const
+
+inlineoverridevirtual
+
+ +

Implements IQuantizationScheme.

+ +

Definition at line 31 of file NetworkQuantizationScheme.hpp.

+ +

References IQuantizationScheme::NumBits().

+ +

Referenced by armnn::QuantizeConstant().

+
32  {
33  if (min > max)
34  {
35  throw InvalidArgumentException("min > max will result in invalid quantization.");
36  }
37 
38  double highest = (1 << NumBits()) - 1;
39 
40  min = std::min(0.0, min); // min <= 0.0
41  max = std::max(0.0, max); // max >= 0.0
42 
43  // To avoid dividing by zero when quantizing a zero filled tensor
44  if (min == 0.0 && max == 0.0)
45  {
46  max = 1.0;
47  }
48 
49  // Assumes quantization range [0-highest]
50  double scale = (max-min) / highest;
51  double offset = -min / scale;
52 
53  // Clamp offset [0-highest]
54  offset = std::max(0.0, std::min(highest, offset));
55 
56  return std::make_pair(static_cast<float>(scale), static_cast<int>(std::round(offset)));
57  }
+
+
+
+ +

◆ GetDataType()

+ +
+
+ + + + + +
+ + + + + + + +
DataType GetDataType () const
+
+inlineoverridevirtual
+
+ +

Implements IQuantizationScheme.

+ +

Definition at line 61 of file NetworkQuantizationScheme.hpp.

+ +

References armnn::QAsymmU8.

+ +
+
+ +

◆ NumBits()

+ +
+
+ + + + + +
+ + + + + + + +
int NumBits () const
+
+inlineoverridevirtual
+
+ +

Implements IQuantizationScheme.

+ +

Definition at line 59 of file NetworkQuantizationScheme.hpp.

+
59 { return 8; }
+
+
+
The documentation for this struct was generated from the following file: +
+
+ + + + -- cgit v1.2.1