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: CreateNetworkImpl< IParser > Struct Template 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('struct_create_network_impl.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="#pub-types">Public Types</a> | |
| 85 | <a href="#pub-static-methods">Static Public Member Functions</a> | |
| 86 | <a href="struct_create_network_impl-members.html">List of all members</a> </div> |
| 87 | <div class="headertitle"> |
| 88 | <div class="title">CreateNetworkImpl< IParser > Struct Template Reference</div> </div> |
| 89 | </div><!--header--> |
| 90 | <div class="contents"> |
| 91 | |
| 92 | <p><code>#include <<a class="el" href="_inference_model_8hpp_source.html">InferenceModel.hpp</a>></code></p> |
| 93 | <table class="memberdecls"> |
| 94 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a> |
| 95 | Public Types</h2></td></tr> |
| 96 | <tr class="memitem:a2e61c7404108440828ef7a45f310e229"><td class="memItemLeft" align="right" valign="top">using </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_create_network_impl.html#a2e61c7404108440828ef7a45f310e229">Params</a> = <a class="el" href="struct_inference_model_internal_1_1_params.html">InferenceModelInternal::Params</a></td></tr> |
| 97 | <tr class="separator:a2e61c7404108440828ef7a45f310e229"><td class="memSeparator" colspan="2"> </td></tr> |
| 98 | </table><table class="memberdecls"> |
| 99 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a> |
| 100 | Static Public Member Functions</h2></td></tr> |
| 101 | <tr class="memitem:a4cbece5e7793be85f9a1e8a0ab9e02f8"><td class="memItemLeft" align="right" valign="top">static <a class="el" href="namespacearmnn.html#ace74f6f9feb95a964a49d79458232703">armnn::INetworkPtr</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_create_network_impl.html#a4cbece5e7793be85f9a1e8a0ab9e02f8">Create</a> (const <a class="el" href="struct_create_network_impl.html#a2e61c7404108440828ef7a45f310e229">Params</a> &params, std::vector< <a class="el" href="namespacearmnn.html#a280670a263dc4fd40491f6d0a2737f44">armnn::BindingPointInfo</a> > &inputBindings, std::vector< <a class="el" href="namespacearmnn.html#a280670a263dc4fd40491f6d0a2737f44">armnn::BindingPointInfo</a> > &outputBindings)</td></tr> |
| 102 | <tr class="separator:a4cbece5e7793be85f9a1e8a0ab9e02f8"><td class="memSeparator" colspan="2"> </td></tr> |
| 103 | </table> |
| 104 | <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> |
| 105 | <div class="textblock"><h3>template<typename IParser><br /> |
| 106 | struct CreateNetworkImpl< IParser ></h3> |
| 107 | |
| 108 | |
| 109 | <p class="definition">Definition at line <a class="el" href="_inference_model_8hpp_source.html#l00111">111</a> of file <a class="el" href="_inference_model_8hpp_source.html">InferenceModel.hpp</a>.</p> |
| 110 | </div><h2 class="groupheader">Member Typedef Documentation</h2> |
| 111 | <a id="a2e61c7404108440828ef7a45f310e229"></a> |
| 112 | <h2 class="memtitle"><span class="permalink"><a href="#a2e61c7404108440828ef7a45f310e229">◆ </a></span>Params</h2> |
| 113 | |
| 114 | <div class="memitem"> |
| 115 | <div class="memproto"> |
| 116 | <table class="memname"> |
| 117 | <tr> |
| 118 | <td class="memname">using <a class="el" href="struct_create_network_impl.html#a2e61c7404108440828ef7a45f310e229">Params</a> = <a class="el" href="struct_inference_model_internal_1_1_params.html">InferenceModelInternal::Params</a></td> |
| 119 | </tr> |
| 120 | </table> |
| 121 | </div><div class="memdoc"> |
| 122 | |
| 123 | <p class="definition">Definition at line <a class="el" href="_inference_model_8hpp_source.html#l00114">114</a> of file <a class="el" href="_inference_model_8hpp_source.html">InferenceModel.hpp</a>.</p> |
| 124 | |
| 125 | </div> |
| 126 | </div> |
| 127 | <h2 class="groupheader">Member Function Documentation</h2> |
| 128 | <a id="a4cbece5e7793be85f9a1e8a0ab9e02f8"></a> |
| 129 | <h2 class="memtitle"><span class="permalink"><a href="#a4cbece5e7793be85f9a1e8a0ab9e02f8">◆ </a></span>Create()</h2> |
| 130 | |
| 131 | <div class="memitem"> |
| 132 | <div class="memproto"> |
| 133 | <table class="mlabels"> |
| 134 | <tr> |
| 135 | <td class="mlabels-left"> |
| 136 | <table class="memname"> |
| 137 | <tr> |
| 138 | <td class="memname">static <a class="el" href="namespacearmnn.html#ace74f6f9feb95a964a49d79458232703">armnn::INetworkPtr</a> Create </td> |
| 139 | <td>(</td> |
| 140 | <td class="paramtype">const <a class="el" href="struct_create_network_impl.html#a2e61c7404108440828ef7a45f310e229">Params</a> & </td> |
| 141 | <td class="paramname"><em>params</em>, </td> |
| 142 | </tr> |
| 143 | <tr> |
| 144 | <td class="paramkey"></td> |
| 145 | <td></td> |
| 146 | <td class="paramtype">std::vector< <a class="el" href="namespacearmnn.html#a280670a263dc4fd40491f6d0a2737f44">armnn::BindingPointInfo</a> > & </td> |
| 147 | <td class="paramname"><em>inputBindings</em>, </td> |
| 148 | </tr> |
| 149 | <tr> |
| 150 | <td class="paramkey"></td> |
| 151 | <td></td> |
| 152 | <td class="paramtype">std::vector< <a class="el" href="namespacearmnn.html#a280670a263dc4fd40491f6d0a2737f44">armnn::BindingPointInfo</a> > & </td> |
| 153 | <td class="paramname"><em>outputBindings</em> </td> |
| 154 | </tr> |
| 155 | <tr> |
| 156 | <td></td> |
| 157 | <td>)</td> |
| 158 | <td></td><td></td> |
| 159 | </tr> |
| 160 | </table> |
| 161 | </td> |
| 162 | <td class="mlabels-right"> |
| 163 | <span class="mlabels"><span class="mlabel">inline</span><span class="mlabel">static</span></span> </td> |
| 164 | </tr> |
| 165 | </table> |
| 166 | </div><div class="memdoc"> |
| 167 | |
| 168 | <p class="definition">Definition at line <a class="el" href="_inference_model_8hpp_source.html#l00116">116</a> of file <a class="el" href="_inference_model_8hpp_source.html">InferenceModel.hpp</a>.</p> |
| 169 | |
| 170 | <p class="reference">References <a class="el" href="_heap_profiling_8hpp_source.html#l00045">ARMNN_SCOPED_HEAP_PROFILING</a>, <a class="el" href="_exceptions_8hpp_source.html#l00169">CHECK_LOCATION</a>, <a class="el" href="_i_deserializer_8hpp_source.html#l00020">BindingPointInfo::m_BindingId</a>, <a class="el" href="_inference_model_8hpp_source.html#l00085">Params::m_InputBindings</a>, <a class="el" href="_inference_model_8hpp_source.html#l00086">Params::m_InputShapes</a>, <a class="el" href="_inference_model_8hpp_source.html#l00091">Params::m_IsModelBinary</a>, <a class="el" href="_inference_model_8hpp_source.html#l00084">Params::m_ModelPath</a>, <a class="el" href="_inference_model_8hpp_source.html#l00087">Params::m_OutputBindings</a>, <a class="el" href="_inference_model_8hpp_source.html#l00095">Params::m_ParseUnsupported</a>, <a class="el" href="_inference_model_8hpp_source.html#l00090">Params::m_SubgraphId</a>, <a class="el" href="_i_deserializer_8hpp_source.html#l00021">BindingPointInfo::m_TensorInfo</a>, and <a class="el" href="_file_only_profiling_decorator_tests_8cpp_source.html#l00045">options</a>.</p> |
| 171 | |
| 172 | <p class="reference">Referenced by <a class="el" href="_inference_model_8hpp_source.html#l00371">InferenceModel< IParser, TDataType >::InferenceModel()</a>.</p> |
| 173 | <div class="fragment"><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  {</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  <span class="keyword">const</span> std::string& modelPath = params.m_ModelPath;</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>  <span class="comment">// Create a network from a file on disk</span></div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  <span class="keyword">auto</span> parser(IParser::Create());</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span> </div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  std::map<std::string, armnn::TensorShape> inputShapes;</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  <span class="keywordflow">if</span> (!params.m_InputShapes.empty())</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  {</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  <span class="keyword">const</span> <span class="keywordtype">size_t</span> numInputShapes = params.m_InputShapes.size();</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  <span class="keyword">const</span> <span class="keywordtype">size_t</span> numInputBindings = params.m_InputBindings.size();</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  <span class="keywordflow">if</span> (numInputShapes < numInputBindings)</div><div class="line"><a name="l00131"></a><span class="lineno"> 131</span>  {</div><div class="line"><a name="l00132"></a><span class="lineno"> 132</span>  <span class="keywordflow">throw</span> <a class="code" href="classarmnn_1_1_exception.html">armnn::Exception</a>(boost::str(boost::format(</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  <span class="stringliteral">"Not every input has its tensor shape specified: expected=%1%, got=%2%"</span>)</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  % numInputBindings % numInputShapes));</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  }</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span> </div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i < numInputShapes; i++)</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  {</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  inputShapes[params.m_InputBindings[i]] = params.m_InputShapes[i];</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  }</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="line"><a name="l00143"></a><span class="lineno"> 143</span>  std::vector<std::string> requestedOutputs = params.m_OutputBindings;</div><div class="line"><a name="l00144"></a><span class="lineno"> 144</span>  <a class="code" href="namespacearmnn.html#ace74f6f9feb95a964a49d79458232703">armnn::INetworkPtr</a> network{<span class="keyword">nullptr</span>, [](<a class="code" href="classarmnn_1_1_i_network.html">armnn::INetwork</a> *){}};</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span> </div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span>  {</div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  <a class="code" href="_heap_profiling_8hpp.html#aeeb927880fc4ffc2eea754a67d884a53">ARMNN_SCOPED_HEAP_PROFILING</a>(<span class="stringliteral">"Parsing"</span>);</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  <span class="comment">// Handle text and binary input differently by calling the corresponding parser function</span></div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  network = (params.m_IsModelBinary ?</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  parser->CreateNetworkFromBinaryFile(modelPath.c_str(), inputShapes, requestedOutputs) :</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  parser->CreateNetworkFromTextFile(modelPath.c_str(), inputShapes, requestedOutputs));</div><div class="line"><a name="l00152"></a><span class="lineno"> 152</span>  }</div><div class="line"><a name="l00153"></a><span class="lineno"> 153</span> </div><div class="line"><a name="l00154"></a><span class="lineno"> 154</span>  <span class="keywordflow">for</span> (<span class="keyword">const</span> std::string& inputLayerName : params.m_InputBindings)</div><div class="line"><a name="l00155"></a><span class="lineno"> 155</span>  {</div><div class="line"><a name="l00156"></a><span class="lineno"> 156</span>  inputBindings.push_back(parser->GetNetworkInputBindingInfo(inputLayerName));</div><div class="line"><a name="l00157"></a><span class="lineno"> 157</span>  }</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span> </div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span>  <span class="keywordflow">for</span> (<span class="keyword">const</span> std::string& outputLayerName : params.m_OutputBindings)</div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  {</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  outputBindings.push_back(parser->GetNetworkOutputBindingInfo(outputLayerName));</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  }</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span> </div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  <span class="keywordflow">return</span> network;</div><div class="line"><a name="l00165"></a><span class="lineno"> 165</span>  }</div><div class="ttc" id="classarmnn_1_1_i_network_html"><div class="ttname"><a href="classarmnn_1_1_i_network.html">armnn::INetwork</a></div><div class="ttdef"><b>Definition:</b> <a href="_i_network_8hpp_source.html#l00089">INetwork.hpp:89</a></div></div> |
| 174 | <div class="ttc" id="_heap_profiling_8hpp_html_aeeb927880fc4ffc2eea754a67d884a53"><div class="ttname"><a href="_heap_profiling_8hpp.html#aeeb927880fc4ffc2eea754a67d884a53">ARMNN_SCOPED_HEAP_PROFILING</a></div><div class="ttdeci">#define ARMNN_SCOPED_HEAP_PROFILING(TAG)</div><div class="ttdef"><b>Definition:</b> <a href="_heap_profiling_8hpp_source.html#l00045">HeapProfiling.hpp:45</a></div></div> |
| 175 | <div class="ttc" id="classarmnn_1_1_exception_html"><div class="ttname"><a href="classarmnn_1_1_exception.html">armnn::Exception</a></div><div class="ttdoc">Base class for all ArmNN exceptions so that users can filter to just those. </div><div class="ttdef"><b>Definition:</b> <a href="_exceptions_8hpp_source.html#l00046">Exceptions.hpp:46</a></div></div> |
| 176 | <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> |
| 177 | </div><!-- fragment --> |
| 178 | </div> |
| 179 | </div> |
| 180 | <hr/>The documentation for this struct was generated from the following file:<ul> |
| 181 | <li>tests/<a class="el" href="_inference_model_8hpp_source.html">InferenceModel.hpp</a></li> |
| 182 | </ul> |
| 183 | </div><!-- contents --> |
| 184 | </div><!-- doc-content --> |
| 185 | <!-- start footer part --> |
| 186 | <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> |
| 187 | <ul> |
| 188 | <li class="navelem"><a class="el" href="struct_create_network_impl.html">CreateNetworkImpl</a></li> |
| 189 | <li class="footer">Generated on Fri Mar 13 2020 16:07:01 for ArmNN by |
| 190 | <a href="http://www.doxygen.org/index.html"> |
| 191 | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li> |
| 192 | </ul> |
| 193 | </div> |
| 194 | </body> |
| 195 | </html> |