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 --- ...1_1_quantized_multiplier_smaller_than_one.xhtml | 186 +++++++++++++++++++++ 1 file changed, 186 insertions(+) create mode 100644 20.02/structarmnn_1_1_quantized_multiplier_smaller_than_one.xhtml (limited to '20.02/structarmnn_1_1_quantized_multiplier_smaller_than_one.xhtml') diff --git a/20.02/structarmnn_1_1_quantized_multiplier_smaller_than_one.xhtml b/20.02/structarmnn_1_1_quantized_multiplier_smaller_than_one.xhtml new file mode 100644 index 0000000000..f3536347b8 --- /dev/null +++ b/20.02/structarmnn_1_1_quantized_multiplier_smaller_than_one.xhtml @@ -0,0 +1,186 @@ + + + + + + + + + + + + + +ArmNN: QuantizedMultiplierSmallerThanOne Struct Reference + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  20.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
QuantizedMultiplierSmallerThanOne Struct Reference
+
+
+ +

Performs multiplication of an integer with a multiplier which is less than one, using quantized integer arithmetic which is consistent with AndroidNN's CPU executor. + More...

+ +

#include <ConvImpl.hpp>

+ + + + + + + + +

+Public Member Functions

 QuantizedMultiplierSmallerThanOne (float multiplier)
 Constructs a QuantizedMultiplierSmallerThanOne which will multiply by the given multiplier. More...
 
int32_t operator* (int32_t rhs) const
 The implementation of this function is adapted from Android NN's MultiplyByQuantizedMultiplierSmallerThanOne(). More...
 
+

Detailed Description

+

Performs multiplication of an integer with a multiplier which is less than one, using quantized integer arithmetic which is consistent with AndroidNN's CPU executor.

+ +

Definition at line 29 of file ConvImpl.hpp.

+

Constructor & Destructor Documentation

+ +

◆ QuantizedMultiplierSmallerThanOne()

+ +
+
+ + + + + + + + +
QuantizedMultiplierSmallerThanOne (float multiplier)
+
+ +

Constructs a QuantizedMultiplierSmallerThanOne which will multiply by the given multiplier.

+

This stores the appropriate integer quantities (derived from the given multiplier) for later use. The implementation of this function is adapted from Android NN's QuantizeMultiplierSmallerThanOne().

+ +

Definition at line 16 of file ConvImpl.cpp.

+
17 {
18  BOOST_ASSERT(multiplier >= 0.0f && multiplier < 1.0f);
19  if (multiplier == 0.0f)
20  {
21  m_Multiplier = 0;
22  m_RightShift = 0;
23  }
24  else
25  {
26  const double q = std::frexp(multiplier, &m_RightShift);
27  m_RightShift = -m_RightShift;
28  int64_t qFixed = static_cast<int64_t>(std::round(q * (1ll << 31)));
29  BOOST_ASSERT(qFixed <= (1ll << 31));
30  if (qFixed == (1ll << 31))
31  {
32  qFixed /= 2;
33  --m_RightShift;
34  }
35  BOOST_ASSERT(m_RightShift >= 0);
36  BOOST_ASSERT(qFixed <= std::numeric_limits<int32_t>::max());
37  m_Multiplier = static_cast<int32_t>(qFixed);
38  }
39 }
+
+
+

Member Function Documentation

+ +

◆ operator*()

+ +
+
+ + + + + + + + +
int32_t operator* (int32_t rhs) const
+
+ +

The implementation of this function is adapted from Android NN's MultiplyByQuantizedMultiplierSmallerThanOne().

+ +

Definition at line 41 of file ConvImpl.cpp.

+
42 {
43  int32_t x = SaturatingRoundingDoublingHighMul(rhs, m_Multiplier);
44  return RoundingDivideByPOT(x, m_RightShift);
45 }
+
+
+
The documentation for this struct was generated from the following files: +
+
+ + + + -- cgit v1.2.1