Ryan OShea | de36e4a | 2020-03-13 16:26:19 +0000 | [diff] [blame] | 1 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 2 | <html xmlns="http://www.w3.org/1999/xhtml"> |
| 3 | <head> |
| 4 | <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
| 5 | <meta http-equiv="X-UA-Compatible" content="IE=9"/> |
| 6 | <meta name="generator" content="Doxygen 1.8.13"/> |
| 7 | <meta name="viewport" content="width=device-width, initial-scale=1"/> |
| 8 | <title>ArmNN: src/armnnQuantizer/test/QuantizationDataSetTests.cpp File Reference</title> |
| 9 | <link href="tabs.css" rel="stylesheet" type="text/css"/> |
| 10 | <script type="text/javascript" src="jquery.js"></script> |
| 11 | <script type="text/javascript" src="dynsections.js"></script> |
| 12 | <link href="navtree.css" rel="stylesheet" type="text/css"/> |
| 13 | <script type="text/javascript" src="resize.js"></script> |
| 14 | <script type="text/javascript" src="navtreedata.js"></script> |
| 15 | <script type="text/javascript" src="navtree.js"></script> |
| 16 | <script type="text/javascript"> |
| 17 | $(document).ready(initResizable); |
| 18 | </script> |
| 19 | <link href="search/search.css" rel="stylesheet" type="text/css"/> |
| 20 | <script type="text/javascript" src="search/searchdata.js"></script> |
| 21 | <script type="text/javascript" src="search/search.js"></script> |
| 22 | <link href="doxygen.css" rel="stylesheet" type="text/css" /> |
| 23 | </head> |
| 24 | <body> |
| 25 | <div id="top"><!-- do not remove this div, it is closed by doxygen! --> |
| 26 | <div id="titlearea"> |
| 27 | <table cellspacing="0" cellpadding="0"> |
| 28 | <tbody> |
| 29 | <tr style="height: 56px;"> |
| 30 | <td id="projectalign" style="padding-left: 0.5em;"> |
| 31 | <div id="projectname">ArmNN |
| 32 |  <span id="projectnumber">NotReleased</span> |
| 33 | </div> |
| 34 | </td> |
| 35 | </tr> |
| 36 | </tbody> |
| 37 | </table> |
| 38 | </div> |
| 39 | <!-- end header part --> |
| 40 | <!-- Generated by Doxygen 1.8.13 --> |
| 41 | <script type="text/javascript"> |
| 42 | var searchBox = new SearchBox("searchBox", "search",false,'Search'); |
| 43 | </script> |
| 44 | <script type="text/javascript" src="menudata.js"></script> |
| 45 | <script type="text/javascript" src="menu.js"></script> |
| 46 | <script type="text/javascript"> |
| 47 | $(function() { |
| 48 | initMenu('',true,false,'search.php','Search'); |
| 49 | $(document).ready(function() { init_search(); }); |
| 50 | }); |
| 51 | </script> |
| 52 | <div id="main-nav"></div> |
| 53 | </div><!-- top --> |
| 54 | <div id="side-nav" class="ui-resizable side-nav-resizable"> |
| 55 | <div id="nav-tree"> |
| 56 | <div id="nav-tree-contents"> |
| 57 | <div id="nav-sync" class="sync"></div> |
| 58 | </div> |
| 59 | </div> |
| 60 | <div id="splitbar" style="-moz-user-select:none;" |
| 61 | class="ui-resizable-handle"> |
| 62 | </div> |
| 63 | </div> |
| 64 | <script type="text/javascript"> |
| 65 | $(document).ready(function(){initNavTree('_quantization_data_set_tests_8cpp.html','');}); |
| 66 | </script> |
| 67 | <div id="doc-content"> |
| 68 | <!-- window showing the filter options --> |
| 69 | <div id="MSearchSelectWindow" |
| 70 | onmouseover="return searchBox.OnSearchSelectShow()" |
| 71 | onmouseout="return searchBox.OnSearchSelectHide()" |
| 72 | onkeydown="return searchBox.OnSearchSelectKey(event)"> |
| 73 | </div> |
| 74 | |
| 75 | <!-- iframe showing the search results (closed by default) --> |
| 76 | <div id="MSearchResultsWindow"> |
| 77 | <iframe src="javascript:void(0)" frameborder="0" |
| 78 | name="MSearchResults" id="MSearchResults"> |
| 79 | </iframe> |
| 80 | </div> |
| 81 | |
| 82 | <div class="header"> |
| 83 | <div class="summary"> |
| 84 | <a href="#define-members">Macros</a> | |
| 85 | <a href="#func-members">Functions</a> </div> |
| 86 | <div class="headertitle"> |
| 87 | <div class="title">QuantizationDataSetTests.cpp File Reference</div> </div> |
| 88 | </div><!--header--> |
| 89 | <div class="contents"> |
| 90 | <div class="textblock"><code>#include <boost/test/unit_test.hpp></code><br /> |
| 91 | <code>#include "<a class="el" href="_quantization_data_set_8hpp_source.html">../QuantizationDataSet.hpp</a>"</code><br /> |
| 92 | <code>#include <iostream></code><br /> |
| 93 | <code>#include <fstream></code><br /> |
| 94 | <code>#include <vector></code><br /> |
| 95 | <code>#include <map></code><br /> |
| 96 | <code>#include <boost/filesystem/operations.hpp></code><br /> |
| 97 | <code>#include <boost/filesystem/fstream.hpp></code><br /> |
| 98 | <code>#include <boost/filesystem/path.hpp></code><br /> |
| 99 | <code>#include <boost/optional/optional.hpp></code><br /> |
| 100 | </div> |
| 101 | <p><a href="_quantization_data_set_tests_8cpp_source.html">Go to the source code of this file.</a></p> |
| 102 | <table class="memberdecls"> |
| 103 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a> |
| 104 | Macros</h2></td></tr> |
| 105 | <tr class="memitem:a3f662379b0269b73ca7edd271a7a9bfc"><td class="memItemLeft" align="right" valign="top">#define </td><td class="memItemRight" valign="bottom"><a class="el" href="_quantization_data_set_tests_8cpp.html#a3f662379b0269b73ca7edd271a7a9bfc">BOOST_FILESYSTEM_NO_DEPRECATED</a></td></tr> |
| 106 | <tr class="separator:a3f662379b0269b73ca7edd271a7a9bfc"><td class="memSeparator" colspan="2"> </td></tr> |
| 107 | </table><table class="memberdecls"> |
| 108 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> |
| 109 | Functions</h2></td></tr> |
| 110 | <tr class="memitem:aafab10e950eee34163e7f86aacc668fd"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="_quantization_data_set_tests_8cpp.html#aafab10e950eee34163e7f86aacc668fd">BOOST_FIXTURE_TEST_CASE</a> (CheckDataSet, CsvTestHelper)</td></tr> |
| 111 | <tr class="separator:aafab10e950eee34163e7f86aacc668fd"><td class="memSeparator" colspan="2"> </td></tr> |
| 112 | <tr class="memitem:af7f71af5c6c124222dd1c42c5df892f4"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="_quantization_data_set_tests_8cpp.html#af7f71af5c6c124222dd1c42c5df892f4">BOOST_AUTO_TEST_SUITE_END</a> ()</td></tr> |
| 113 | <tr class="separator:af7f71af5c6c124222dd1c42c5df892f4"><td class="memSeparator" colspan="2"> </td></tr> |
| 114 | </table> |
| 115 | <h2 class="groupheader">Macro Definition Documentation</h2> |
| 116 | <a id="a3f662379b0269b73ca7edd271a7a9bfc"></a> |
| 117 | <h2 class="memtitle"><span class="permalink"><a href="#a3f662379b0269b73ca7edd271a7a9bfc">◆ </a></span>BOOST_FILESYSTEM_NO_DEPRECATED</h2> |
| 118 | |
| 119 | <div class="memitem"> |
| 120 | <div class="memproto"> |
| 121 | <table class="memname"> |
| 122 | <tr> |
| 123 | <td class="memname">#define BOOST_FILESYSTEM_NO_DEPRECATED</td> |
| 124 | </tr> |
| 125 | </table> |
| 126 | </div><div class="memdoc"> |
| 127 | |
| 128 | <p class="definition">Definition at line <a class="el" href="_quantization_data_set_tests_8cpp_source.html#l00014">14</a> of file <a class="el" href="_quantization_data_set_tests_8cpp_source.html">QuantizationDataSetTests.cpp</a>.</p> |
| 129 | |
| 130 | </div> |
| 131 | </div> |
| 132 | <h2 class="groupheader">Function Documentation</h2> |
| 133 | <a id="af7f71af5c6c124222dd1c42c5df892f4"></a> |
| 134 | <h2 class="memtitle"><span class="permalink"><a href="#af7f71af5c6c124222dd1c42c5df892f4">◆ </a></span>BOOST_AUTO_TEST_SUITE_END()</h2> |
| 135 | |
| 136 | <div class="memitem"> |
| 137 | <div class="memproto"> |
| 138 | <table class="memname"> |
| 139 | <tr> |
| 140 | <td class="memname">BOOST_AUTO_TEST_SUITE_END </td> |
| 141 | <td>(</td> |
| 142 | <td class="paramname"></td><td>)</td> |
| 143 | <td></td> |
| 144 | </tr> |
| 145 | </table> |
| 146 | </div><div class="memdoc"> |
| 147 | |
| 148 | <p class="reference">Referenced by <a class="el" href="_quantization_data_set_tests_8cpp_source.html#l00114">BOOST_FIXTURE_TEST_CASE()</a>.</p> |
| 149 | |
| 150 | </div> |
| 151 | </div> |
| 152 | <a id="aafab10e950eee34163e7f86aacc668fd"></a> |
| 153 | <h2 class="memtitle"><span class="permalink"><a href="#aafab10e950eee34163e7f86aacc668fd">◆ </a></span>BOOST_FIXTURE_TEST_CASE()</h2> |
| 154 | |
| 155 | <div class="memitem"> |
| 156 | <div class="memproto"> |
| 157 | <table class="memname"> |
| 158 | <tr> |
| 159 | <td class="memname">BOOST_FIXTURE_TEST_CASE </td> |
| 160 | <td>(</td> |
| 161 | <td class="paramtype">CheckDataSet </td> |
| 162 | <td class="paramname">, </td> |
| 163 | </tr> |
| 164 | <tr> |
| 165 | <td class="paramkey"></td> |
| 166 | <td></td> |
| 167 | <td class="paramtype">CsvTestHelper </td> |
| 168 | <td class="paramname"> </td> |
| 169 | </tr> |
| 170 | <tr> |
| 171 | <td></td> |
| 172 | <td>)</td> |
| 173 | <td></td><td></td> |
| 174 | </tr> |
| 175 | </table> |
| 176 | </div><div class="memdoc"> |
| 177 | |
| 178 | <p class="definition">Definition at line <a class="el" href="_quantization_data_set_tests_8cpp_source.html#l00114">114</a> of file <a class="el" href="_quantization_data_set_tests_8cpp_source.html">QuantizationDataSetTests.cpp</a>.</p> |
| 179 | |
| 180 | <p class="reference">References <a class="el" href="_quantization_data_set_tests_8cpp.html#af7f71af5c6c124222dd1c42c5df892f4">BOOST_AUTO_TEST_SUITE_END()</a>, and <a class="el" href="_quantization_data_set_8hpp_source.html#l00029">QuantizationDataSet::IsEmpty()</a>.</p> |
| 181 | <div class="fragment"><div class="line"><a name="l00115"></a><span class="lineno"> 115</span> {</div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span> </div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  std::map<int, std::vector<float>> csvData;</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  csvData.insert(std::pair<<span class="keywordtype">int</span>, std::vector<float>>(0, { 0.111111f, 0.222222f, 0.333333f }));</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  csvData.insert(std::pair<<span class="keywordtype">int</span>, std::vector<float>>(1, { 0.444444f, 0.555555f, 0.666666f }));</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  csvData.insert(std::pair<<span class="keywordtype">int</span>, std::vector<float>>(2, { 0.777777f, 0.888888f, 0.999999f }));</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span> </div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  std::string myCsvFile = CsvTestHelper::CreateTempCsvFile(csvData);</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  <a class="code" href="classarmnn_quantizer_1_1_quantization_data_set.html">QuantizationDataSet</a> dataSet(myCsvFile);</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  BOOST_TEST(!dataSet.IsEmpty());</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span> </div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  <span class="keywordtype">int</span> csvRow = 0;</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  <span class="keywordflow">for</span>(<a class="code" href="classarmnn_quantizer_1_1_quantization_input.html">armnnQuantizer::QuantizationInput</a> input : dataSet)</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  {</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  BOOST_TEST(input.GetPassId() == csvRow);</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span> </div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  BOOST_TEST(input.GetLayerBindingIds().size() == 1);</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  BOOST_TEST(input.GetLayerBindingIds()[0] == 0);</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  BOOST_TEST(input.GetDataForEntry(0).size() == 3);</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span> </div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  <span class="comment">// Check that QuantizationInput data for binding ID 0 corresponds to float values</span></div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span>  <span class="comment">// used for populating the CSV file using by QuantizationDataSet</span></div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  BOOST_TEST(input.GetDataForEntry(0).at(0) == csvData.at(csvRow).at(0));</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  BOOST_TEST(input.GetDataForEntry(0).at(1) == csvData.at(csvRow).at(1));</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  BOOST_TEST(input.GetDataForEntry(0).at(2) == csvData.at(csvRow).at(2));</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  ++csvRow;</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  }</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span> }</div><div class="ttc" id="classarmnn_quantizer_1_1_quantization_input_html"><div class="ttname"><a href="classarmnn_quantizer_1_1_quantization_input.html">armnnQuantizer::QuantizationInput</a></div><div class="ttdoc">QuantizationInput for specific pass ID, can list a corresponding raw data file for each LayerBindingI...</div><div class="ttdef"><b>Definition:</b> <a href="_quantization_input_8hpp_source.html#l00016">QuantizationInput.hpp:16</a></div></div> |
| 182 | <div class="ttc" id="classarmnn_quantizer_1_1_quantization_data_set_html"><div class="ttname"><a href="classarmnn_quantizer_1_1_quantization_data_set.html">armnnQuantizer::QuantizationDataSet</a></div><div class="ttdef"><b>Definition:</b> <a href="_quantization_data_set_8hpp_source.html#l00018">QuantizationDataSet.hpp:18</a></div></div> |
| 183 | </div><!-- fragment --> |
| 184 | </div> |
| 185 | </div> |
| 186 | </div><!-- contents --> |
| 187 | </div><!-- doc-content --> |
| 188 | <!-- start footer part --> |
| 189 | <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> |
| 190 | <ul> |
| 191 | <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_0de8a5774692585e465aba8075a97653.html">armnnQuantizer</a></li><li class="navelem"><a class="el" href="dir_3709aa41a3b61b199034060afb4293ad.html">test</a></li><li class="navelem"><a class="el" href="_quantization_data_set_tests_8cpp.html">QuantizationDataSetTests.cpp</a></li> |
| 192 | <li class="footer">Generated on Fri Mar 13 2020 16:06:59 for ArmNN by |
| 193 | <a href="http://www.doxygen.org/index.html"> |
| 194 | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li> |
| 195 | </ul> |
| 196 | </div> |
| 197 | </body> |
| 198 | </html> |