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/armnnTfLiteParser/test/LoadModel.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('_load_model_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="#typedef-members">Typedefs</a> | |
| 85 | <a href="#func-members">Functions</a> </div> |
| 86 | <div class="headertitle"> |
| 87 | <div class="title">LoadModel.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="_parser_flatbuffers_fixture_8hpp_source.html">ParserFlatbuffersFixture.hpp</a>"</code><br /> |
| 92 | <code>#include "<a class="el" href="_tf_lite_parser_8hpp_source.html">../TfLiteParser.hpp</a>"</code><br /> |
| 93 | </div> |
| 94 | <p><a href="_load_model_8cpp_source.html">Go to the source code of this file.</a></p> |
| 95 | <table class="memberdecls"> |
| 96 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="typedef-members"></a> |
| 97 | Typedefs</h2></td></tr> |
| 98 | <tr class="memitem:ab8262a23f76732432e30196fa09a5d4d"><td class="memItemLeft" align="right" valign="top">using </td><td class="memItemRight" valign="bottom"><a class="el" href="_load_model_8cpp.html#ab8262a23f76732432e30196fa09a5d4d">ModelPtr</a> = TfLiteParser::ModelPtr</td></tr> |
| 99 | <tr class="separator:ab8262a23f76732432e30196fa09a5d4d"><td class="memSeparator" colspan="2"> </td></tr> |
| 100 | <tr class="memitem:ab4ad5c0bbec93520b8210fd6d8e2051c"><td class="memItemLeft" align="right" valign="top">using </td><td class="memItemRight" valign="bottom"><a class="el" href="_load_model_8cpp.html#ab4ad5c0bbec93520b8210fd6d8e2051c">SubgraphPtr</a> = TfLiteParser::SubgraphPtr</td></tr> |
| 101 | <tr class="separator:ab4ad5c0bbec93520b8210fd6d8e2051c"><td class="memSeparator" colspan="2"> </td></tr> |
| 102 | <tr class="memitem:af3f6f44d7fdab7f4c61f59e4154dd696"><td class="memItemLeft" align="right" valign="top">using </td><td class="memItemRight" valign="bottom"><a class="el" href="_load_model_8cpp.html#af3f6f44d7fdab7f4c61f59e4154dd696">OperatorPtr</a> = TfLiteParser::OperatorPtr</td></tr> |
| 103 | <tr class="separator:af3f6f44d7fdab7f4c61f59e4154dd696"><td class="memSeparator" colspan="2"> </td></tr> |
| 104 | </table><table class="memberdecls"> |
| 105 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> |
| 106 | Functions</h2></td></tr> |
| 107 | <tr class="memitem:a95a7c926cb96a1c57de39a72a8209c94"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="_load_model_8cpp.html#a95a7c926cb96a1c57de39a72a8209c94">BOOST_FIXTURE_TEST_CASE</a> (LoadModelFromBinary, LoadModelFixture)</td></tr> |
| 108 | <tr class="separator:a95a7c926cb96a1c57de39a72a8209c94"><td class="memSeparator" colspan="2"> </td></tr> |
| 109 | <tr class="memitem:a757da23bc4ad3305fe973413be85015f"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="_load_model_8cpp.html#a757da23bc4ad3305fe973413be85015f">BOOST_FIXTURE_TEST_CASE</a> (LoadModelFromFile, LoadModelFixture)</td></tr> |
| 110 | <tr class="separator:a757da23bc4ad3305fe973413be85015f"><td class="memSeparator" colspan="2"> </td></tr> |
| 111 | <tr class="memitem:a78183790dc7c28aa493485715480bc39"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="_load_model_8cpp.html#a78183790dc7c28aa493485715480bc39">BOOST_AUTO_TEST_CASE</a> (LoadNullBinary)</td></tr> |
| 112 | <tr class="separator:a78183790dc7c28aa493485715480bc39"><td class="memSeparator" colspan="2"> </td></tr> |
| 113 | <tr class="memitem:a3496184393204134fcf4cdeeedc21cf6"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="_load_model_8cpp.html#a3496184393204134fcf4cdeeedc21cf6">BOOST_AUTO_TEST_CASE</a> (LoadInvalidBinary)</td></tr> |
| 114 | <tr class="separator:a3496184393204134fcf4cdeeedc21cf6"><td class="memSeparator" colspan="2"> </td></tr> |
| 115 | <tr class="memitem:a8afd4e4f33c8c5ea6ed0fcc2c8db1620"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="_load_model_8cpp.html#a8afd4e4f33c8c5ea6ed0fcc2c8db1620">BOOST_AUTO_TEST_CASE</a> (LoadFileNotFound)</td></tr> |
| 116 | <tr class="separator:a8afd4e4f33c8c5ea6ed0fcc2c8db1620"><td class="memSeparator" colspan="2"> </td></tr> |
| 117 | <tr class="memitem:aecebec3130e12fbe592fac5113b01c6f"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="_load_model_8cpp.html#aecebec3130e12fbe592fac5113b01c6f">BOOST_AUTO_TEST_CASE</a> (LoadNullPtrFile)</td></tr> |
| 118 | <tr class="separator:aecebec3130e12fbe592fac5113b01c6f"><td class="memSeparator" colspan="2"> </td></tr> |
| 119 | </table> |
| 120 | <h2 class="groupheader">Typedef Documentation</h2> |
| 121 | <a id="ab8262a23f76732432e30196fa09a5d4d"></a> |
| 122 | <h2 class="memtitle"><span class="permalink"><a href="#ab8262a23f76732432e30196fa09a5d4d">◆ </a></span>ModelPtr</h2> |
| 123 | |
| 124 | <div class="memitem"> |
| 125 | <div class="memproto"> |
| 126 | <table class="memname"> |
| 127 | <tr> |
| 128 | <td class="memname">using <a class="el" href="armnn_onnx_parser_2test_2_get_inputs_outputs_8cpp.html#a503ae4f55dae1486e53978657083b35d">ModelPtr</a> = TfLiteParser::ModelPtr</td> |
| 129 | </tr> |
| 130 | </table> |
| 131 | </div><div class="memdoc"> |
| 132 | |
| 133 | <p class="definition">Definition at line <a class="el" href="_load_model_8cpp_source.html#l00010">10</a> of file <a class="el" href="_load_model_8cpp_source.html">LoadModel.cpp</a>.</p> |
| 134 | |
| 135 | </div> |
| 136 | </div> |
| 137 | <a id="af3f6f44d7fdab7f4c61f59e4154dd696"></a> |
| 138 | <h2 class="memtitle"><span class="permalink"><a href="#af3f6f44d7fdab7f4c61f59e4154dd696">◆ </a></span>OperatorPtr</h2> |
| 139 | |
| 140 | <div class="memitem"> |
| 141 | <div class="memproto"> |
| 142 | <table class="memname"> |
| 143 | <tr> |
| 144 | <td class="memname">using <a class="el" href="_load_model_8cpp.html#af3f6f44d7fdab7f4c61f59e4154dd696">OperatorPtr</a> = TfLiteParser::OperatorPtr</td> |
| 145 | </tr> |
| 146 | </table> |
| 147 | </div><div class="memdoc"> |
| 148 | |
| 149 | <p class="definition">Definition at line <a class="el" href="_load_model_8cpp_source.html#l00012">12</a> of file <a class="el" href="_load_model_8cpp_source.html">LoadModel.cpp</a>.</p> |
| 150 | |
| 151 | </div> |
| 152 | </div> |
| 153 | <a id="ab4ad5c0bbec93520b8210fd6d8e2051c"></a> |
| 154 | <h2 class="memtitle"><span class="permalink"><a href="#ab4ad5c0bbec93520b8210fd6d8e2051c">◆ </a></span>SubgraphPtr</h2> |
| 155 | |
| 156 | <div class="memitem"> |
| 157 | <div class="memproto"> |
| 158 | <table class="memname"> |
| 159 | <tr> |
| 160 | <td class="memname">using <a class="el" href="_load_model_8cpp.html#ab4ad5c0bbec93520b8210fd6d8e2051c">SubgraphPtr</a> = TfLiteParser::SubgraphPtr</td> |
| 161 | </tr> |
| 162 | </table> |
| 163 | </div><div class="memdoc"> |
| 164 | |
| 165 | <p class="definition">Definition at line <a class="el" href="_load_model_8cpp_source.html#l00011">11</a> of file <a class="el" href="_load_model_8cpp_source.html">LoadModel.cpp</a>.</p> |
| 166 | |
| 167 | </div> |
| 168 | </div> |
| 169 | <h2 class="groupheader">Function Documentation</h2> |
| 170 | <a id="a78183790dc7c28aa493485715480bc39"></a> |
| 171 | <h2 class="memtitle"><span class="permalink"><a href="#a78183790dc7c28aa493485715480bc39">◆ </a></span>BOOST_AUTO_TEST_CASE() <span class="overload">[1/4]</span></h2> |
| 172 | |
| 173 | <div class="memitem"> |
| 174 | <div class="memproto"> |
| 175 | <table class="memname"> |
| 176 | <tr> |
| 177 | <td class="memname">BOOST_AUTO_TEST_CASE </td> |
| 178 | <td>(</td> |
| 179 | <td class="paramtype">LoadNullBinary </td> |
| 180 | <td class="paramname"></td><td>)</td> |
| 181 | <td></td> |
| 182 | </tr> |
| 183 | </table> |
| 184 | </div><div class="memdoc"> |
| 185 | |
| 186 | <p class="definition">Definition at line <a class="el" href="_load_model_8cpp_source.html#l00218">218</a> of file <a class="el" href="_load_model_8cpp_source.html">LoadModel.cpp</a>.</p> |
| 187 | <div class="fragment"><div class="line"><a name="l00219"></a><span class="lineno"> 219</span> {</div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  BOOST_CHECK_THROW(TfLiteParser::LoadModelFromBinary(<span class="keyword">nullptr</span>, 0), <a class="code" href="classarmnn_1_1_invalid_argument_exception.html">armnn::InvalidArgumentException</a>);</div><div class="line"><a name="l00221"></a><span class="lineno"> 221</span> }</div><div class="ttc" id="classarmnn_1_1_invalid_argument_exception_html"><div class="ttname"><a href="classarmnn_1_1_invalid_argument_exception.html">armnn::InvalidArgumentException</a></div><div class="ttdef"><b>Definition:</b> <a href="_exceptions_8hpp_source.html#l00080">Exceptions.hpp:80</a></div></div> |
| 188 | </div><!-- fragment --> |
| 189 | </div> |
| 190 | </div> |
| 191 | <a id="a3496184393204134fcf4cdeeedc21cf6"></a> |
| 192 | <h2 class="memtitle"><span class="permalink"><a href="#a3496184393204134fcf4cdeeedc21cf6">◆ </a></span>BOOST_AUTO_TEST_CASE() <span class="overload">[2/4]</span></h2> |
| 193 | |
| 194 | <div class="memitem"> |
| 195 | <div class="memproto"> |
| 196 | <table class="memname"> |
| 197 | <tr> |
| 198 | <td class="memname">BOOST_AUTO_TEST_CASE </td> |
| 199 | <td>(</td> |
| 200 | <td class="paramtype">LoadInvalidBinary </td> |
| 201 | <td class="paramname"></td><td>)</td> |
| 202 | <td></td> |
| 203 | </tr> |
| 204 | </table> |
| 205 | </div><div class="memdoc"> |
| 206 | |
| 207 | <p class="definition">Definition at line <a class="el" href="_load_model_8cpp_source.html#l00223">223</a> of file <a class="el" href="_load_model_8cpp_source.html">LoadModel.cpp</a>.</p> |
| 208 | <div class="fragment"><div class="line"><a name="l00224"></a><span class="lineno"> 224</span> {</div><div class="line"><a name="l00225"></a><span class="lineno"> 225</span>  std::string testData = <span class="stringliteral">"invalid data"</span>;</div><div class="line"><a name="l00226"></a><span class="lineno"> 226</span>  BOOST_CHECK_THROW(TfLiteParser::LoadModelFromBinary(reinterpret_cast<const uint8_t*>(&testData),</div><div class="line"><a name="l00227"></a><span class="lineno"> 227</span>  testData.length()), <a class="code" href="classarmnn_1_1_parse_exception.html">armnn::ParseException</a>);</div><div class="line"><a name="l00228"></a><span class="lineno"> 228</span> }</div><div class="ttc" id="classarmnn_1_1_parse_exception_html"><div class="ttname"><a href="classarmnn_1_1_parse_exception.html">armnn::ParseException</a></div><div class="ttdef"><b>Definition:</b> <a href="_exceptions_8hpp_source.html#l00092">Exceptions.hpp:92</a></div></div> |
| 209 | </div><!-- fragment --> |
| 210 | </div> |
| 211 | </div> |
| 212 | <a id="a8afd4e4f33c8c5ea6ed0fcc2c8db1620"></a> |
| 213 | <h2 class="memtitle"><span class="permalink"><a href="#a8afd4e4f33c8c5ea6ed0fcc2c8db1620">◆ </a></span>BOOST_AUTO_TEST_CASE() <span class="overload">[3/4]</span></h2> |
| 214 | |
| 215 | <div class="memitem"> |
| 216 | <div class="memproto"> |
| 217 | <table class="memname"> |
| 218 | <tr> |
| 219 | <td class="memname">BOOST_AUTO_TEST_CASE </td> |
| 220 | <td>(</td> |
| 221 | <td class="paramtype">LoadFileNotFound </td> |
| 222 | <td class="paramname"></td><td>)</td> |
| 223 | <td></td> |
| 224 | </tr> |
| 225 | </table> |
| 226 | </div><div class="memdoc"> |
| 227 | |
| 228 | <p class="definition">Definition at line <a class="el" href="_load_model_8cpp_source.html#l00230">230</a> of file <a class="el" href="_load_model_8cpp_source.html">LoadModel.cpp</a>.</p> |
| 229 | <div class="fragment"><div class="line"><a name="l00231"></a><span class="lineno"> 231</span> {</div><div class="line"><a name="l00232"></a><span class="lineno"> 232</span>  BOOST_CHECK_THROW(TfLiteParser::LoadModelFromFile(<span class="stringliteral">"invalidfile.tflite"</span>), <a class="code" href="classarmnn_1_1_file_not_found_exception.html">armnn::FileNotFoundException</a>);</div><div class="line"><a name="l00233"></a><span class="lineno"> 233</span> }</div><div class="ttc" id="classarmnn_1_1_file_not_found_exception_html"><div class="ttname"><a href="classarmnn_1_1_file_not_found_exception.html">armnn::FileNotFoundException</a></div><div class="ttdef"><b>Definition:</b> <a href="_exceptions_8hpp_source.html#l00086">Exceptions.hpp:86</a></div></div> |
| 230 | </div><!-- fragment --> |
| 231 | </div> |
| 232 | </div> |
| 233 | <a id="aecebec3130e12fbe592fac5113b01c6f"></a> |
| 234 | <h2 class="memtitle"><span class="permalink"><a href="#aecebec3130e12fbe592fac5113b01c6f">◆ </a></span>BOOST_AUTO_TEST_CASE() <span class="overload">[4/4]</span></h2> |
| 235 | |
| 236 | <div class="memitem"> |
| 237 | <div class="memproto"> |
| 238 | <table class="memname"> |
| 239 | <tr> |
| 240 | <td class="memname">BOOST_AUTO_TEST_CASE </td> |
| 241 | <td>(</td> |
| 242 | <td class="paramtype">LoadNullPtrFile </td> |
| 243 | <td class="paramname"></td><td>)</td> |
| 244 | <td></td> |
| 245 | </tr> |
| 246 | </table> |
| 247 | </div><div class="memdoc"> |
| 248 | |
| 249 | <p class="definition">Definition at line <a class="el" href="_load_model_8cpp_source.html#l00235">235</a> of file <a class="el" href="_load_model_8cpp_source.html">LoadModel.cpp</a>.</p> |
| 250 | |
| 251 | <p class="reference">References <a class="el" href="_profiler_tests_8cpp.html#af7f71af5c6c124222dd1c42c5df892f4">BOOST_AUTO_TEST_SUITE_END()</a>.</p> |
| 252 | <div class="fragment"><div class="line"><a name="l00236"></a><span class="lineno"> 236</span> {</div><div class="line"><a name="l00237"></a><span class="lineno"> 237</span>  BOOST_CHECK_THROW(TfLiteParser::LoadModelFromFile(<span class="keyword">nullptr</span>), <a class="code" href="classarmnn_1_1_invalid_argument_exception.html">armnn::InvalidArgumentException</a>);</div><div class="line"><a name="l00238"></a><span class="lineno"> 238</span> }</div><div class="ttc" id="classarmnn_1_1_invalid_argument_exception_html"><div class="ttname"><a href="classarmnn_1_1_invalid_argument_exception.html">armnn::InvalidArgumentException</a></div><div class="ttdef"><b>Definition:</b> <a href="_exceptions_8hpp_source.html#l00080">Exceptions.hpp:80</a></div></div> |
| 253 | </div><!-- fragment --> |
| 254 | </div> |
| 255 | </div> |
| 256 | <a id="a95a7c926cb96a1c57de39a72a8209c94"></a> |
| 257 | <h2 class="memtitle"><span class="permalink"><a href="#a95a7c926cb96a1c57de39a72a8209c94">◆ </a></span>BOOST_FIXTURE_TEST_CASE() <span class="overload">[1/2]</span></h2> |
| 258 | |
| 259 | <div class="memitem"> |
| 260 | <div class="memproto"> |
| 261 | <table class="memname"> |
| 262 | <tr> |
| 263 | <td class="memname">BOOST_FIXTURE_TEST_CASE </td> |
| 264 | <td>(</td> |
| 265 | <td class="paramtype">LoadModelFromBinary </td> |
| 266 | <td class="paramname">, </td> |
| 267 | </tr> |
| 268 | <tr> |
| 269 | <td class="paramkey"></td> |
| 270 | <td></td> |
| 271 | <td class="paramtype">LoadModelFixture </td> |
| 272 | <td class="paramname"> </td> |
| 273 | </tr> |
| 274 | <tr> |
| 275 | <td></td> |
| 276 | <td>)</td> |
| 277 | <td></td><td></td> |
| 278 | </tr> |
| 279 | </table> |
| 280 | </div><div class="memdoc"> |
| 281 | |
| 282 | <p class="definition">Definition at line <a class="el" href="_load_model_8cpp_source.html#l00184">184</a> of file <a class="el" href="_load_model_8cpp_source.html">LoadModel.cpp</a>.</p> |
| 283 | <div class="fragment"><div class="line"><a name="l00185"></a><span class="lineno"> 185</span> {</div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  <a class="code" href="_load_model_8cpp.html#ab8262a23f76732432e30196fa09a5d4d">TfLiteParser::ModelPtr</a> model = TfLiteParser::LoadModelFromBinary(m_GraphBinary.data(), m_GraphBinary.size());</div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span>  CheckModel(model, 3, 2, { tflite::BuiltinOperator_AVERAGE_POOL_2D, tflite::BuiltinOperator_CONV_2D },</div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  2, <span class="stringliteral">"Test loading a model"</span>, 2);</div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  CheckSubgraph(model->subgraphs[0], 2, { 1 }, { 0 }, 1, <span class="stringliteral">""</span>);</div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  CheckSubgraph(model->subgraphs[1], 3, { 0 }, { 1 }, 1, <span class="stringliteral">""</span>);</div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  CheckOperator(model->subgraphs[0]->operators[0], 0, { 1 }, { 0 }, tflite::BuiltinOptions_Pool2DOptions,</div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  tflite::CustomOptionsFormat_FLEXBUFFERS);</div><div class="line"><a name="l00193"></a><span class="lineno"> 193</span>  CheckOperator(model->subgraphs[1]->operators[0], 1, { 0, 2 }, { 1 }, tflite::BuiltinOptions_Conv2DOptions,</div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  tflite::CustomOptionsFormat_FLEXBUFFERS);</div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span> }</div><div class="ttc" id="_load_model_8cpp_html_ab8262a23f76732432e30196fa09a5d4d"><div class="ttname"><a href="_load_model_8cpp.html#ab8262a23f76732432e30196fa09a5d4d">ModelPtr</a></div><div class="ttdeci">TfLiteParser::ModelPtr ModelPtr</div><div class="ttdef"><b>Definition:</b> <a href="_load_model_8cpp_source.html#l00010">LoadModel.cpp:10</a></div></div> |
| 284 | </div><!-- fragment --> |
| 285 | </div> |
| 286 | </div> |
| 287 | <a id="a757da23bc4ad3305fe973413be85015f"></a> |
| 288 | <h2 class="memtitle"><span class="permalink"><a href="#a757da23bc4ad3305fe973413be85015f">◆ </a></span>BOOST_FIXTURE_TEST_CASE() <span class="overload">[2/2]</span></h2> |
| 289 | |
| 290 | <div class="memitem"> |
| 291 | <div class="memproto"> |
| 292 | <table class="memname"> |
| 293 | <tr> |
| 294 | <td class="memname">BOOST_FIXTURE_TEST_CASE </td> |
| 295 | <td>(</td> |
| 296 | <td class="paramtype">LoadModelFromFile </td> |
| 297 | <td class="paramname">, </td> |
| 298 | </tr> |
| 299 | <tr> |
| 300 | <td class="paramkey"></td> |
| 301 | <td></td> |
| 302 | <td class="paramtype">LoadModelFixture </td> |
| 303 | <td class="paramname"> </td> |
| 304 | </tr> |
| 305 | <tr> |
| 306 | <td></td> |
| 307 | <td>)</td> |
| 308 | <td></td><td></td> |
| 309 | </tr> |
| 310 | </table> |
| 311 | </div><div class="memdoc"> |
| 312 | |
| 313 | <p class="definition">Definition at line <a class="el" href="_load_model_8cpp_source.html#l00197">197</a> of file <a class="el" href="_load_model_8cpp_source.html">LoadModel.cpp</a>.</p> |
| 314 | <div class="fragment"><div class="line"><a name="l00198"></a><span class="lineno"> 198</span> {</div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span>  <span class="keyword">using namespace </span>boost::filesystem;</div><div class="line"><a name="l00200"></a><span class="lineno"> 200</span>  std::string fname = unique_path(temp_directory_path() / <span class="stringliteral">"%%%%-%%%%-%%%%.tflite"</span>).string();</div><div class="line"><a name="l00201"></a><span class="lineno"> 201</span>  <span class="keywordtype">bool</span> saved = flatbuffers::SaveFile(fname.c_str(),</div><div class="line"><a name="l00202"></a><span class="lineno"> 202</span>  <span class="keyword">reinterpret_cast<</span><span class="keywordtype">char</span> *<span class="keyword">></span>(m_GraphBinary.data()),</div><div class="line"><a name="l00203"></a><span class="lineno"> 203</span>  m_GraphBinary.size(), <span class="keyword">true</span>);</div><div class="line"><a name="l00204"></a><span class="lineno"> 204</span>  BOOST_CHECK_MESSAGE(saved, <span class="stringliteral">"Cannot save test file"</span>);</div><div class="line"><a name="l00205"></a><span class="lineno"> 205</span> </div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  <a class="code" href="_load_model_8cpp.html#ab8262a23f76732432e30196fa09a5d4d">TfLiteParser::ModelPtr</a> model = TfLiteParser::LoadModelFromFile(fname.c_str());</div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  CheckModel(model, 3, 2, { tflite::BuiltinOperator_AVERAGE_POOL_2D, tflite::BuiltinOperator_CONV_2D },</div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  2, <span class="stringliteral">"Test loading a model"</span>, 2);</div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  CheckSubgraph(model->subgraphs[0], 2, { 1 }, { 0 }, 1, <span class="stringliteral">""</span>);</div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  CheckSubgraph(model->subgraphs[1], 3, { 0 }, { 1 }, 1, <span class="stringliteral">""</span>);</div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  CheckOperator(model->subgraphs[0]->operators[0], 0, { 1 }, { 0 }, tflite::BuiltinOptions_Pool2DOptions,</div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  tflite::CustomOptionsFormat_FLEXBUFFERS);</div><div class="line"><a name="l00213"></a><span class="lineno"> 213</span>  CheckOperator(model->subgraphs[1]->operators[0], 1, { 0, 2 }, { 1 }, tflite::BuiltinOptions_Conv2DOptions,</div><div class="line"><a name="l00214"></a><span class="lineno"> 214</span>  tflite::CustomOptionsFormat_FLEXBUFFERS);</div><div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  <span class="keyword">remove</span>(fname);</div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span> }</div><div class="ttc" id="_load_model_8cpp_html_ab8262a23f76732432e30196fa09a5d4d"><div class="ttname"><a href="_load_model_8cpp.html#ab8262a23f76732432e30196fa09a5d4d">ModelPtr</a></div><div class="ttdeci">TfLiteParser::ModelPtr ModelPtr</div><div class="ttdef"><b>Definition:</b> <a href="_load_model_8cpp_source.html#l00010">LoadModel.cpp:10</a></div></div> |
| 315 | </div><!-- fragment --> |
| 316 | </div> |
| 317 | </div> |
| 318 | </div><!-- contents --> |
| 319 | </div><!-- doc-content --> |
| 320 | <!-- start footer part --> |
| 321 | <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> |
| 322 | <ul> |
| 323 | <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_510324e450b9df55f9aac2d01fae83d8.html">armnnTfLiteParser</a></li><li class="navelem"><a class="el" href="dir_6d8d07609c57029a35488d2120e28fbd.html">test</a></li><li class="navelem"><a class="el" href="_load_model_8cpp.html">LoadModel.cpp</a></li> |
| 324 | <li class="footer">Generated on Fri Mar 13 2020 16:06:59 for ArmNN by |
| 325 | <a href="http://www.doxygen.org/index.html"> |
| 326 | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li> |
| 327 | </ul> |
| 328 | </div> |
| 329 | </body> |
| 330 | </html> |