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/armnnOnnxParser/test/CreateNetwork.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('_create_network_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="#func-members">Functions</a> </div> |
| 85 | <div class="headertitle"> |
| 86 | <div class="title">CreateNetwork.cpp File Reference</div> </div> |
| 87 | </div><!--header--> |
| 88 | <div class="contents"> |
| 89 | <div class="textblock"><code>#include <boost/test/unit_test.hpp></code><br /> |
| 90 | <code>#include "<a class="el" href="_i_onnx_parser_8hpp_source.html">armnnOnnxParser/IOnnxParser.hpp</a>"</code><br /> |
| 91 | <code>#include "google/protobuf/stubs/logging.h"</code><br /> |
| 92 | </div> |
| 93 | <p><a href="_create_network_8cpp_source.html">Go to the source code of this file.</a></p> |
| 94 | <table class="memberdecls"> |
| 95 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> |
| 96 | Functions</h2></td></tr> |
| 97 | <tr class="memitem:aa5ceda43325f472de8a1927bf18cc3cb"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="_create_network_8cpp.html#aa5ceda43325f472de8a1927bf18cc3cb">BOOST_AUTO_TEST_CASE</a> (CreateNetworkFromString)</td></tr> |
| 98 | <tr class="separator:aa5ceda43325f472de8a1927bf18cc3cb"><td class="memSeparator" colspan="2"> </td></tr> |
| 99 | <tr class="memitem:a012963e57e43aaec9c435078e7d0e946"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="_create_network_8cpp.html#a012963e57e43aaec9c435078e7d0e946">BOOST_AUTO_TEST_CASE</a> (CreateNetworkFromStringWithNullptr)</td></tr> |
| 100 | <tr class="separator:a012963e57e43aaec9c435078e7d0e946"><td class="memSeparator" colspan="2"> </td></tr> |
| 101 | <tr class="memitem:af68032727ddee02432970ffc6759d793"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="_create_network_8cpp.html#af68032727ddee02432970ffc6759d793">BOOST_AUTO_TEST_CASE</a> (CreateNetworkWithInvalidString)</td></tr> |
| 102 | <tr class="separator:af68032727ddee02432970ffc6759d793"><td class="memSeparator" colspan="2"> </td></tr> |
| 103 | </table> |
| 104 | <h2 class="groupheader">Function Documentation</h2> |
| 105 | <a id="aa5ceda43325f472de8a1927bf18cc3cb"></a> |
| 106 | <h2 class="memtitle"><span class="permalink"><a href="#aa5ceda43325f472de8a1927bf18cc3cb">◆ </a></span>BOOST_AUTO_TEST_CASE() <span class="overload">[1/3]</span></h2> |
| 107 | |
| 108 | <div class="memitem"> |
| 109 | <div class="memproto"> |
| 110 | <table class="memname"> |
| 111 | <tr> |
| 112 | <td class="memname">BOOST_AUTO_TEST_CASE </td> |
| 113 | <td>(</td> |
| 114 | <td class="paramtype">CreateNetworkFromString </td> |
| 115 | <td class="paramname"></td><td>)</td> |
| 116 | <td></td> |
| 117 | </tr> |
| 118 | </table> |
| 119 | </div><div class="memdoc"> |
| 120 | |
| 121 | <p class="definition">Definition at line <a class="el" href="_create_network_8cpp_source.html#l00012">12</a> of file <a class="el" href="_create_network_8cpp_source.html">CreateNetwork.cpp</a>.</p> |
| 122 | |
| 123 | <p class="reference">References <a class="el" href="_onnx_parser_8cpp_source.html#l00424">IOnnxParser::Create()</a>.</p> |
| 124 | <div class="fragment"><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> {</div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span>  std::string TestModel = R<span class="stringliteral">"(</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="stringliteral"> ir_version: 3</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="stringliteral"> producer_name: "CNTK "</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="stringliteral"> producer_version: "2.5.1 "</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="stringliteral"> domain: "ai.cntk "</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="stringliteral"> model_version: 1</span></div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="stringliteral"> graph {</span></div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="stringliteral"> name: "CNTKGraph "</span></div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span> <span class="stringliteral"> output {</span></div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="stringliteral"> name: "Output"</span></div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="stringliteral"> type {</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="stringliteral"> tensor_type {</span></div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="stringliteral"> elem_type: 1</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span> <span class="stringliteral"> shape {</span></div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span> <span class="stringliteral"> dim {</span></div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> <span class="stringliteral"> dim_value: 1</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="stringliteral"> }</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="stringliteral"> dim {</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="stringliteral"> dim_value: 10</span></div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="stringliteral"> }</span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="stringliteral"> }</span></div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="stringliteral"> }</span></div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> <span class="stringliteral"> }</span></div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="stringliteral"> }</span></div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span> <span class="stringliteral"> }</span></div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span> <span class="stringliteral"> opset_import {</span></div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span> <span class="stringliteral"> version: 7</span></div><div class="line"><a name="l00041"></a><span class="lineno"> 41</span> <span class="stringliteral"> })";</span></div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span> <span class="stringliteral"></span></div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <span class="stringliteral"> <a class="code" href="namespacearmnn_onnx_parser.html#ac7dfccab29feeb5f33f1ec0183c1e123">armnnOnnxParser::IOnnxParserPtr</a> parser(<a class="code" href="classarmnn_onnx_parser_1_1_i_onnx_parser.html#af9b9254fb8a084f0db4f7deff0498b20">armnnOnnxParser::IOnnxParser::Create</a>());</span></div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span> <span class="stringliteral"></span></div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span> <span class="stringliteral"> <a class="code" href="namespacearmnn.html#ace74f6f9feb95a964a49d79458232703">armnn::INetworkPtr</a> network = parser->CreateNetworkFromString(TestModel.c_str());</span></div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span> <span class="stringliteral"> BOOST_TEST(network.get());</span></div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span> <span class="stringliteral">}</span></div><div class="ttc" id="namespacearmnn_html_ace74f6f9feb95a964a49d79458232703"><div class="ttname"><a href="namespacearmnn.html#ace74f6f9feb95a964a49d79458232703">armnn::INetworkPtr</a></div><div class="ttdeci">std::unique_ptr< INetwork, void(*)(INetwork *network)> INetworkPtr</div><div class="ttdef"><b>Definition:</b> <a href="_i_network_8hpp_source.html#l00085">INetwork.hpp:85</a></div></div> |
| 125 | <div class="ttc" id="classarmnn_onnx_parser_1_1_i_onnx_parser_html_af9b9254fb8a084f0db4f7deff0498b20"><div class="ttname"><a href="classarmnn_onnx_parser_1_1_i_onnx_parser.html#af9b9254fb8a084f0db4f7deff0498b20">armnnOnnxParser::IOnnxParser::Create</a></div><div class="ttdeci">static IOnnxParserPtr Create()</div><div class="ttdef"><b>Definition:</b> <a href="_onnx_parser_8cpp_source.html#l00424">OnnxParser.cpp:424</a></div></div> |
| 126 | <div class="ttc" id="namespacearmnn_onnx_parser_html_ac7dfccab29feeb5f33f1ec0183c1e123"><div class="ttname"><a href="namespacearmnn_onnx_parser.html#ac7dfccab29feeb5f33f1ec0183c1e123">armnnOnnxParser::IOnnxParserPtr</a></div><div class="ttdeci">std::unique_ptr< IOnnxParser, void(*)(IOnnxParser *parser)> IOnnxParserPtr</div><div class="ttdef"><b>Definition:</b> <a href="_i_onnx_parser_8hpp_source.html#l00020">IOnnxParser.hpp:20</a></div></div> |
| 127 | </div><!-- fragment --> |
| 128 | </div> |
| 129 | </div> |
| 130 | <a id="a012963e57e43aaec9c435078e7d0e946"></a> |
| 131 | <h2 class="memtitle"><span class="permalink"><a href="#a012963e57e43aaec9c435078e7d0e946">◆ </a></span>BOOST_AUTO_TEST_CASE() <span class="overload">[2/3]</span></h2> |
| 132 | |
| 133 | <div class="memitem"> |
| 134 | <div class="memproto"> |
| 135 | <table class="memname"> |
| 136 | <tr> |
| 137 | <td class="memname">BOOST_AUTO_TEST_CASE </td> |
| 138 | <td>(</td> |
| 139 | <td class="paramtype">CreateNetworkFromStringWithNullptr </td> |
| 140 | <td class="paramname"></td><td>)</td> |
| 141 | <td></td> |
| 142 | </tr> |
| 143 | </table> |
| 144 | </div><div class="memdoc"> |
| 145 | |
| 146 | <p class="definition">Definition at line <a class="el" href="_create_network_8cpp_source.html#l00049">49</a> of file <a class="el" href="_create_network_8cpp_source.html">CreateNetwork.cpp</a>.</p> |
| 147 | |
| 148 | <p class="reference">References <a class="el" href="_onnx_parser_8cpp_source.html#l00424">IOnnxParser::Create()</a>.</p> |
| 149 | <div class="fragment"><div class="line"><a name="l00050"></a><span class="lineno"> 50</span> {</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span>  <a class="code" href="namespacearmnn_onnx_parser.html#ac7dfccab29feeb5f33f1ec0183c1e123">armnnOnnxParser::IOnnxParserPtr</a> parser(<a class="code" href="classarmnn_onnx_parser_1_1_i_onnx_parser.html#af9b9254fb8a084f0db4f7deff0498b20">armnnOnnxParser::IOnnxParser::Create</a>());</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  BOOST_CHECK_THROW(parser->CreateNetworkFromString(<span class="stringliteral">""</span>), <a class="code" href="classarmnn_1_1_invalid_argument_exception.html">armnn::InvalidArgumentException</a> );</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</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> |
| 150 | <div class="ttc" id="classarmnn_onnx_parser_1_1_i_onnx_parser_html_af9b9254fb8a084f0db4f7deff0498b20"><div class="ttname"><a href="classarmnn_onnx_parser_1_1_i_onnx_parser.html#af9b9254fb8a084f0db4f7deff0498b20">armnnOnnxParser::IOnnxParser::Create</a></div><div class="ttdeci">static IOnnxParserPtr Create()</div><div class="ttdef"><b>Definition:</b> <a href="_onnx_parser_8cpp_source.html#l00424">OnnxParser.cpp:424</a></div></div> |
| 151 | <div class="ttc" id="namespacearmnn_onnx_parser_html_ac7dfccab29feeb5f33f1ec0183c1e123"><div class="ttname"><a href="namespacearmnn_onnx_parser.html#ac7dfccab29feeb5f33f1ec0183c1e123">armnnOnnxParser::IOnnxParserPtr</a></div><div class="ttdeci">std::unique_ptr< IOnnxParser, void(*)(IOnnxParser *parser)> IOnnxParserPtr</div><div class="ttdef"><b>Definition:</b> <a href="_i_onnx_parser_8hpp_source.html#l00020">IOnnxParser.hpp:20</a></div></div> |
| 152 | </div><!-- fragment --> |
| 153 | </div> |
| 154 | </div> |
| 155 | <a id="af68032727ddee02432970ffc6759d793"></a> |
| 156 | <h2 class="memtitle"><span class="permalink"><a href="#af68032727ddee02432970ffc6759d793">◆ </a></span>BOOST_AUTO_TEST_CASE() <span class="overload">[3/3]</span></h2> |
| 157 | |
| 158 | <div class="memitem"> |
| 159 | <div class="memproto"> |
| 160 | <table class="memname"> |
| 161 | <tr> |
| 162 | <td class="memname">BOOST_AUTO_TEST_CASE </td> |
| 163 | <td>(</td> |
| 164 | <td class="paramtype">CreateNetworkWithInvalidString </td> |
| 165 | <td class="paramname"></td><td>)</td> |
| 166 | <td></td> |
| 167 | </tr> |
| 168 | </table> |
| 169 | </div><div class="memdoc"> |
| 170 | |
| 171 | <p class="definition">Definition at line <a class="el" href="_create_network_8cpp_source.html#l00055">55</a> of file <a class="el" href="_create_network_8cpp_source.html">CreateNetwork.cpp</a>.</p> |
| 172 | |
| 173 | <p class="reference">References <a class="el" href="_profiler_tests_8cpp.html#af7f71af5c6c124222dd1c42c5df892f4">BOOST_AUTO_TEST_SUITE_END()</a>, and <a class="el" href="_onnx_parser_8cpp_source.html#l00424">IOnnxParser::Create()</a>.</p> |
| 174 | <div class="fragment"><div class="line"><a name="l00056"></a><span class="lineno"> 56</span> {</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  <span class="keyword">auto</span> silencer = google::protobuf::LogSilencer(); <span class="comment">//get rid of errors from protobuf</span></div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span>  <a class="code" href="namespacearmnn_onnx_parser.html#ac7dfccab29feeb5f33f1ec0183c1e123">armnnOnnxParser::IOnnxParserPtr</a> parser(<a class="code" href="classarmnn_onnx_parser_1_1_i_onnx_parser.html#af9b9254fb8a084f0db4f7deff0498b20">armnnOnnxParser::IOnnxParser::Create</a>());</div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  BOOST_CHECK_THROW(parser->CreateNetworkFromString( <span class="stringliteral">"I'm not a model so I should raise an error"</span> ),</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  <a class="code" href="classarmnn_1_1_parse_exception.html">armnn::ParseException</a> );</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</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> |
| 175 | <div class="ttc" id="classarmnn_onnx_parser_1_1_i_onnx_parser_html_af9b9254fb8a084f0db4f7deff0498b20"><div class="ttname"><a href="classarmnn_onnx_parser_1_1_i_onnx_parser.html#af9b9254fb8a084f0db4f7deff0498b20">armnnOnnxParser::IOnnxParser::Create</a></div><div class="ttdeci">static IOnnxParserPtr Create()</div><div class="ttdef"><b>Definition:</b> <a href="_onnx_parser_8cpp_source.html#l00424">OnnxParser.cpp:424</a></div></div> |
| 176 | <div class="ttc" id="namespacearmnn_onnx_parser_html_ac7dfccab29feeb5f33f1ec0183c1e123"><div class="ttname"><a href="namespacearmnn_onnx_parser.html#ac7dfccab29feeb5f33f1ec0183c1e123">armnnOnnxParser::IOnnxParserPtr</a></div><div class="ttdeci">std::unique_ptr< IOnnxParser, void(*)(IOnnxParser *parser)> IOnnxParserPtr</div><div class="ttdef"><b>Definition:</b> <a href="_i_onnx_parser_8hpp_source.html#l00020">IOnnxParser.hpp:20</a></div></div> |
| 177 | </div><!-- fragment --> |
| 178 | </div> |
| 179 | </div> |
| 180 | </div><!-- contents --> |
| 181 | </div><!-- doc-content --> |
| 182 | <!-- start footer part --> |
| 183 | <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> |
| 184 | <ul> |
| 185 | <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_29e3193d5087607956cb928081b12830.html">armnnOnnxParser</a></li><li class="navelem"><a class="el" href="dir_14b0222e5488316bb30ce89add6c280e.html">test</a></li><li class="navelem"><a class="el" href="_create_network_8cpp.html">CreateNetwork.cpp</a></li> |
| 186 | <li class="footer">Generated on Fri Mar 13 2020 16:06:59 for ArmNN by |
| 187 | <a href="http://www.doxygen.org/index.html"> |
| 188 | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li> |
| 189 | </ul> |
| 190 | </div> |
| 191 | </body> |
| 192 | </html> |