From add078b7f9a658d52ee6e8fe6771ea0517c07674 Mon Sep 17 00:00:00 2001 From: mathad01 Date: Mon, 10 May 2021 16:51:20 +0100 Subject: IVGCVSW-5908 Update 21.05 Doxygen Documents Signed-off-by: mathad01 Change-Id: I95316d4fc5f9d10185492dc835bb2411c1daea7b --- 21.05/_prototxt_conversions_test_8cpp.xhtml | 176 ++++++++++++++++++++++++++++ 1 file changed, 176 insertions(+) create mode 100644 21.05/_prototxt_conversions_test_8cpp.xhtml (limited to '21.05/_prototxt_conversions_test_8cpp.xhtml') diff --git a/21.05/_prototxt_conversions_test_8cpp.xhtml b/21.05/_prototxt_conversions_test_8cpp.xhtml new file mode 100644 index 0000000000..c21426c912 --- /dev/null +++ b/21.05/_prototxt_conversions_test_8cpp.xhtml @@ -0,0 +1,176 @@ + + + + + + + + + + + + + +ArmNN: src/armnnUtils/test/PrototxtConversionsTest.cpp File Reference + + + + + + + + + + + + + + + + +
+
+ + + + ArmNN + + + +
+
+  21.05 +
+
+
+ + + + + + + +
+
+ +
+
+
+ +
+ +
+
+ + +
+ +
+ +
+ +
+
PrototxtConversionsTest.cpp File Reference
+
+
+
#include <PrototxtConversions.hpp>
+#include "armnn/Tensor.hpp"
+#include <boost/test/unit_test.hpp>
+
+

Go to the source code of this file.

+ + + + + + +

+Functions

 BOOST_AUTO_TEST_CASE (ConvertInt32ToOctalStringTest)
 
 BOOST_AUTO_TEST_CASE (ConvertTensorShapeToStringTest)
 
+

Function Documentation

+ +

◆ BOOST_AUTO_TEST_CASE() [1/2]

+ +
+
+ + + + + + + + +
BOOST_AUTO_TEST_CASE (ConvertInt32ToOctalStringTest )
+
+ +

Definition at line 13 of file PrototxtConversionsTest.cpp.

+ +

References armnnUtils::ConvertInt32ToOctalString().

+
14 {
16 
17  std::string octalString = ConvertInt32ToOctalString(1);
18  BOOST_TEST(octalString.compare("\\\\001\\\\000\\\\000\\\\000"));
19 
20  octalString = ConvertInt32ToOctalString(256);
21  BOOST_TEST(octalString.compare("\\\\000\\\\100\\\\000\\\\000"));
22 
23  octalString = ConvertInt32ToOctalString(65536);
24  BOOST_TEST(octalString.compare("\\\\000\\\\000\\\\100\\\\000"));
25 
26  octalString = ConvertInt32ToOctalString(16777216);
27  BOOST_TEST(octalString.compare("\\\\000\\\\000\\\\000\\\\100"));
28 
29  octalString = ConvertInt32ToOctalString(-1);
30  BOOST_TEST(octalString.compare("\\\\377\\\\377\\\\377\\\\377"));
31 
32  octalString = ConvertInt32ToOctalString(-256);
33  BOOST_TEST(octalString.compare("\\\\000\\\\377\\\\377\\\\377"));
34 
35  octalString = ConvertInt32ToOctalString(-65536);
36  BOOST_TEST(octalString.compare("\\\\000\\\\000\\\\377\\\\377"));
37 
38  octalString = ConvertInt32ToOctalString(-16777216);
39  BOOST_TEST(octalString.compare("\\\\000\\\\000\\\\000\\\\377"));
40 }
std::string ConvertInt32ToOctalString(int value)
Converts an int value into the Prototxt octal representation.
+
+
+
+ +

◆ BOOST_AUTO_TEST_CASE() [2/2]

+ +
+
+ + + + + + + + +
BOOST_AUTO_TEST_CASE (ConvertTensorShapeToStringTest )
+
+ +

Definition at line 42 of file PrototxtConversionsTest.cpp.

+ +

References BOOST_AUTO_TEST_SUITE_END(), and armnnUtils::ConvertTensorShapeToString().

+
43 {
45  using armnn::TensorShape;
46 
47  auto createAndConvert = [](std::initializer_list<unsigned int> dims) -> std::string
48  {
49  auto shape = TensorShape{dims};
50  return ConvertTensorShapeToString(shape);
51  };
52 
53  auto output_string = createAndConvert({5});
54  BOOST_TEST(output_string.compare(
55  "dim {\n"
56  "size: 5\n"
57  "}"));
58 
59  output_string = createAndConvert({4, 5});
60  BOOST_TEST(output_string.compare(
61  "dim {\n"
62  "size: 4\n"
63  "}\n"
64  "dim {\n"
65  "size: 5\n"
66  "}"
67  ));
68 
69  output_string = createAndConvert({3, 4, 5});
70  BOOST_TEST(output_string.compare(
71  "dim {\n"
72  "size: 3\n"
73  "}\n"
74  "dim {\n"
75  "size: 4\n"
76  "}\n"
77  "dim {\n"
78  "size: 5\n"
79  "}"
80  ));
81 
82  output_string = createAndConvert({2, 3, 4, 5});
83  BOOST_TEST(output_string.compare(
84  "dim {\n"
85  "size: 2\n"
86  "}\n"
87  "dim {\n"
88  "size: 3\n"
89  "}\n"
90  "dim {\n"
91  "size: 4\n"
92  "}\n"
93  "dim {\n"
94  "size: 5\n"
95  "}"
96  ));
97 
98  output_string = createAndConvert({1, 2, 3, 4, 5});
99  BOOST_TEST(output_string.compare(
100  "dim {\n"
101  "size: 1\n"
102  "}\n"
103  "dim {\n"
104  "size: 2\n"
105  "}\n"
106  "dim {\n"
107  "size: 3\n"
108  "}\n"
109  "dim {\n"
110  "size: 4\n"
111  "}\n"
112  "dim {\n"
113  "size: 5\n"
114  "}"
115  ));
116 
117  output_string = createAndConvert({0xffffffff, 0xffffffff});
118  BOOST_TEST(output_string.compare(
119  "dim {\n"
120  "size: 4294967295\n"
121  "}\n"
122  "dim {\n"
123  "size: 4294967295\n"
124  "}"
125  ));
126 
127  output_string = createAndConvert({1, 0});
128  BOOST_TEST(output_string.compare(
129  "dim {\n"
130  "size: 1\n"
131  "}\n"
132  "dim {\n"
133  "size: 0\n"
134  "}"
135  ));
136 }
+
std::string ConvertTensorShapeToString(const armnn::TensorShape &shape)
Converts an TensorShape into Prototxt representation.
+
+
+
+
+
+ + + + -- cgit v1.2.1