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 --- 20.02/_parser_helper_test_8cpp.xhtml | 154 +++++++++++++++++++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 20.02/_parser_helper_test_8cpp.xhtml (limited to '20.02/_parser_helper_test_8cpp.xhtml') diff --git a/20.02/_parser_helper_test_8cpp.xhtml b/20.02/_parser_helper_test_8cpp.xhtml new file mode 100644 index 0000000000..f1e35cedf8 --- /dev/null +++ b/20.02/_parser_helper_test_8cpp.xhtml @@ -0,0 +1,154 @@ + + + + + + + + + + + + + +ArmNN: src/armnnUtils/test/ParserHelperTest.cpp File Reference + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  20.02 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
ParserHelperTest.cpp File Reference
+
+
+
#include "../ParserHelper.hpp"
+#include <armnn/Tensor.hpp>
+#include <armnn/Types.hpp>
+#include <boost/test/unit_test.hpp>
+
+

Go to the source code of this file.

+ + + + +

+Functions

 BOOST_AUTO_TEST_CASE (CalculateReducedOutputTensoInfoTest)
 
+

Function Documentation

+ +

◆ BOOST_AUTO_TEST_CASE()

+ +
+
+ + + + + + + + +
BOOST_AUTO_TEST_CASE (CalculateReducedOutputTensoInfoTest )
+
+ +

Definition at line 19 of file ParserHelperTest.cpp.

+ +

References BOOST_AUTO_TEST_SUITE_END(), armnnUtils::CalculateReducedOutputTensoInfo(), armnn::Float32, TensorInfo::GetNumDimensions(), and TensorInfo::GetShape().

+
20 {
21  bool keepDims = false;
22 
23  unsigned int inputShape[] = { 2, 3, 4 };
24  TensorInfo inputTensorInfo(3, &inputShape[0], DataType::Float32);
25 
26  // Reducing all dimensions results in one single output value (one dimension)
27  std::set<unsigned int> axisData1 = { 0, 1, 2 };
28  TensorInfo outputTensorInfo1;
29 
30  CalculateReducedOutputTensoInfo(inputTensorInfo, axisData1, keepDims, outputTensorInfo1);
31 
32  BOOST_ASSERT(outputTensorInfo1.GetNumDimensions() == 1);
33  BOOST_ASSERT(outputTensorInfo1.GetShape()[0] == 1);
34 
35  // Reducing dimension 0 results in a 3x4 size tensor (one dimension)
36  std::set<unsigned int> axisData2 = { 0 };
37  TensorInfo outputTensorInfo2;
38 
39  CalculateReducedOutputTensoInfo(inputTensorInfo, axisData2, keepDims, outputTensorInfo2);
40 
41  BOOST_ASSERT(outputTensorInfo2.GetNumDimensions() == 1);
42  BOOST_ASSERT(outputTensorInfo2.GetShape()[0] == 12);
43 
44  // Reducing dimensions 0,1 results in a 4 size tensor (one dimension)
45  std::set<unsigned int> axisData3 = { 0, 1 };
46  TensorInfo outputTensorInfo3;
47 
48  CalculateReducedOutputTensoInfo(inputTensorInfo, axisData3, keepDims, outputTensorInfo3);
49 
50  BOOST_ASSERT(outputTensorInfo3.GetNumDimensions() == 1);
51  BOOST_ASSERT(outputTensorInfo3.GetShape()[0] == 4);
52 
53  // Reducing dimension 0 results in a { 1, 3, 4 } dimension tensor
54  keepDims = true;
55  std::set<unsigned int> axisData4 = { 0 };
56 
57  TensorInfo outputTensorInfo4;
58 
59  CalculateReducedOutputTensoInfo(inputTensorInfo, axisData4, keepDims, outputTensorInfo4);
60 
61  BOOST_ASSERT(outputTensorInfo4.GetNumDimensions() == 3);
62  BOOST_ASSERT(outputTensorInfo4.GetShape()[0] == 1);
63  BOOST_ASSERT(outputTensorInfo4.GetShape()[1] == 3);
64  BOOST_ASSERT(outputTensorInfo4.GetShape()[2] == 4);
65 
66  // Reducing dimension 1, 2 results in a { 2, 1, 1 } dimension tensor
67  keepDims = true;
68  std::set<unsigned int> axisData5 = { 1, 2 };
69 
70  TensorInfo outputTensorInfo5;
71 
72  CalculateReducedOutputTensoInfo(inputTensorInfo, axisData5, keepDims, outputTensorInfo5);
73 
74  BOOST_ASSERT(outputTensorInfo5.GetNumDimensions() == 3);
75  BOOST_ASSERT(outputTensorInfo5.GetShape()[0] == 2);
76  BOOST_ASSERT(outputTensorInfo5.GetShape()[1] == 1);
77  BOOST_ASSERT(outputTensorInfo5.GetShape()[2] == 1);
78 
79 }
const TensorShape & GetShape() const
Definition: Tensor.hpp:88
+ +
void CalculateReducedOutputTensoInfo(const armnn::TensorInfo &inputTensorInfo, const std::set< unsigned int > &axisSet, bool keepDims, armnn::TensorInfo &outputTensorInfo)
Creates a tensor info after reducing the dimensions mentioned in axisData.
+
unsigned int GetNumDimensions() const
Definition: Tensor.hpp:92
+
+
+
+
+
+ + + + -- cgit v1.2.1