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/backends/backendsCommon/test/CommonTestUtils.hpp 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('_common_test_utils_8hpp.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">CommonTestUtils.hpp File Reference</div> </div> |
| 87 | </div><!--header--> |
| 88 | <div class="contents"> |
| 89 | <div class="textblock"><code>#include <<a class="el" href="_graph_8hpp_source.html">Graph.hpp</a>></code><br /> |
| 90 | <code>#include <<a class="el" href="_subgraph_view_8hpp_source.html">SubgraphView.hpp</a>></code><br /> |
| 91 | <code>#include <<a class="el" href="_subgraph_view_selector_8hpp_source.html">SubgraphViewSelector.hpp</a>></code><br /> |
| 92 | <code>#include <<a class="el" href="_backend_registry_8hpp_source.html">armnn/BackendRegistry.hpp</a>></code><br /> |
| 93 | <code>#include <<a class="el" href="_cpu_tensor_handle_8hpp_source.html">backendsCommon/CpuTensorHandle.hpp</a>></code><br /> |
| 94 | <code>#include <<a class="el" href="_test_utils_8hpp_source.html">test/TestUtils.hpp</a>></code><br /> |
| 95 | <code>#include <algorithm></code><br /> |
| 96 | </div> |
| 97 | <p><a href="_common_test_utils_8hpp_source.html">Go to the source code of this file.</a></p> |
| 98 | <table class="memberdecls"> |
| 99 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> |
| 100 | Functions</h2></td></tr> |
| 101 | <tr class="memitem:a551d3e8e273f6ff0f4fc4b0b56e1895d"><td class="memTemplParams" colspan="2">template<typename CollectionType > </td></tr> |
| 102 | <tr class="memitem:a551d3e8e273f6ff0f4fc4b0b56e1895d"><td class="memTemplItemLeft" align="right" valign="top">bool </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="_common_test_utils_8hpp.html#a551d3e8e273f6ff0f4fc4b0b56e1895d">AreEqual</a> (const CollectionType &lhs, const CollectionType &rhs)</td></tr> |
| 103 | <tr class="separator:a551d3e8e273f6ff0f4fc4b0b56e1895d"><td class="memSeparator" colspan="2"> </td></tr> |
| 104 | <tr class="memitem:a5fa64e793b38cf9074e6fcdb2c9c7293"><td class="memTemplParams" colspan="2">template<typename CollectionType > </td></tr> |
| 105 | <tr class="memitem:a5fa64e793b38cf9074e6fcdb2c9c7293"><td class="memTemplItemLeft" align="right" valign="top">bool </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="_common_test_utils_8hpp.html#a5fa64e793b38cf9074e6fcdb2c9c7293">Contains</a> (const CollectionType &collection, const typename CollectionType::value_type &item)</td></tr> |
| 106 | <tr class="separator:a5fa64e793b38cf9074e6fcdb2c9c7293"><td class="memSeparator" colspan="2"> </td></tr> |
| 107 | <tr class="memitem:a34600ef61efcbbf11322f11ce2cfacab"><td class="memTemplParams" colspan="2">template<typename MapType > </td></tr> |
| 108 | <tr class="memitem:a34600ef61efcbbf11322f11ce2cfacab"><td class="memTemplItemLeft" align="right" valign="top">bool </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="_common_test_utils_8hpp.html#a34600ef61efcbbf11322f11ce2cfacab">Contains</a> (const MapType &map, const typename MapType::key_type &key)</td></tr> |
| 109 | <tr class="separator:a34600ef61efcbbf11322f11ce2cfacab"><td class="memSeparator" colspan="2"> </td></tr> |
| 110 | <tr class="memitem:acacca57727df8ccf5c5597e6026da814"><td class="memTemplParams" colspan="2">template<typename ConvolutionLayer > </td></tr> |
| 111 | <tr class="memitem:acacca57727df8ccf5c5597e6026da814"><td class="memTemplItemLeft" align="right" valign="top">void </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="_common_test_utils_8hpp.html#acacca57727df8ccf5c5597e6026da814">SetWeightAndBias</a> (ConvolutionLayer *layer, const <a class="el" href="classarmnn_1_1_tensor_info.html">armnn::TensorInfo</a> &weightInfo, const <a class="el" href="classarmnn_1_1_tensor_info.html">armnn::TensorInfo</a> &biasInfo)</td></tr> |
| 112 | <tr class="separator:acacca57727df8ccf5c5597e6026da814"><td class="memSeparator" colspan="2"> </td></tr> |
| 113 | <tr class="memitem:ac0a6b75ad3de58ac7d36f88bd8866078"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classarmnn_1_1_subgraph_view.html#a5cc65e15002dbc33a5c8a7d6680e9a9d">armnn::SubgraphView::InputSlots</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="_common_test_utils_8hpp.html#ac0a6b75ad3de58ac7d36f88bd8866078">CreateInputsFrom</a> (const std::vector< <a class="el" href="classarmnn_1_1_layer.html">armnn::Layer</a> *> &layers)</td></tr> |
| 114 | <tr class="separator:ac0a6b75ad3de58ac7d36f88bd8866078"><td class="memSeparator" colspan="2"> </td></tr> |
| 115 | <tr class="memitem:aff493fee27236e9ddc581e48c4b931a9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classarmnn_1_1_subgraph_view.html#a78293334750ec5279eb9c96d56deaf08">armnn::SubgraphView::OutputSlots</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="_common_test_utils_8hpp.html#aff493fee27236e9ddc581e48c4b931a9">CreateOutputsFrom</a> (const std::vector< <a class="el" href="classarmnn_1_1_layer.html">armnn::Layer</a> *> &layers)</td></tr> |
| 116 | <tr class="separator:aff493fee27236e9ddc581e48c4b931a9"><td class="memSeparator" colspan="2"> </td></tr> |
| 117 | <tr class="memitem:abf999283bc03f1bafd01680149ed7e3e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classarmnn_1_1_subgraph_view.html#a4684a457c7786484375f06e9ab2d2265">armnn::SubgraphView::SubgraphViewPtr</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="_common_test_utils_8hpp.html#abf999283bc03f1bafd01680149ed7e3e">CreateSubgraphViewFrom</a> (<a class="el" href="classarmnn_1_1_subgraph_view.html#a5cc65e15002dbc33a5c8a7d6680e9a9d">armnn::SubgraphView::InputSlots</a> &&inputs, <a class="el" href="classarmnn_1_1_subgraph_view.html#a78293334750ec5279eb9c96d56deaf08">armnn::SubgraphView::OutputSlots</a> &&outputs, <a class="el" href="classarmnn_1_1_subgraph_view.html#a74798938fdaeae75c8adfa4a7439e7f9">armnn::SubgraphView::Layers</a> &&layers)</td></tr> |
| 118 | <tr class="separator:abf999283bc03f1bafd01680149ed7e3e"><td class="memSeparator" colspan="2"> </td></tr> |
| 119 | <tr class="memitem:a7a4090354279f08b1e27244bab25aa86"><td class="memItemLeft" align="right" valign="top"><a class="el" href="namespacearmnn.html#ade0af9dacaa52cafdd701bef2e901c77">armnn::IBackendInternalUniquePtr</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="_common_test_utils_8hpp.html#a7a4090354279f08b1e27244bab25aa86">CreateBackendObject</a> (const <a class="el" href="classarmnn_1_1_backend_id.html">armnn::BackendId</a> &backendId)</td></tr> |
| 120 | <tr class="separator:a7a4090354279f08b1e27244bab25aa86"><td class="memSeparator" colspan="2"> </td></tr> |
| 121 | <tr class="memitem:a46d07efd379e728fc3df18a88ec878b0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classarmnn_1_1_tensor_shape.html">armnn::TensorShape</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="_common_test_utils_8hpp.html#a46d07efd379e728fc3df18a88ec878b0">MakeTensorShape</a> (unsigned int batches, unsigned int channels, unsigned int height, unsigned int width, <a class="el" href="namespacearmnn.html#ad1d5cce2d9e9a5d61c243e5c989112e0">armnn::DataLayout</a> layout)</td></tr> |
| 122 | <tr class="separator:a46d07efd379e728fc3df18a88ec878b0"><td class="memSeparator" colspan="2"> </td></tr> |
| 123 | </table> |
| 124 | <h2 class="groupheader">Function Documentation</h2> |
| 125 | <a id="a551d3e8e273f6ff0f4fc4b0b56e1895d"></a> |
| 126 | <h2 class="memtitle"><span class="permalink"><a href="#a551d3e8e273f6ff0f4fc4b0b56e1895d">◆ </a></span>AreEqual()</h2> |
| 127 | |
| 128 | <div class="memitem"> |
| 129 | <div class="memproto"> |
| 130 | <table class="memname"> |
| 131 | <tr> |
| 132 | <td class="memname">bool AreEqual </td> |
| 133 | <td>(</td> |
| 134 | <td class="paramtype">const CollectionType & </td> |
| 135 | <td class="paramname"><em>lhs</em>, </td> |
| 136 | </tr> |
| 137 | <tr> |
| 138 | <td class="paramkey"></td> |
| 139 | <td></td> |
| 140 | <td class="paramtype">const CollectionType & </td> |
| 141 | <td class="paramname"><em>rhs</em> </td> |
| 142 | </tr> |
| 143 | <tr> |
| 144 | <td></td> |
| 145 | <td>)</td> |
| 146 | <td></td><td></td> |
| 147 | </tr> |
| 148 | </table> |
| 149 | </div><div class="memdoc"> |
| 150 | |
| 151 | <p class="definition">Definition at line <a class="el" href="_common_test_utils_8hpp_source.html#l00024">24</a> of file <a class="el" href="_common_test_utils_8hpp_source.html">CommonTestUtils.hpp</a>.</p> |
| 152 | <div class="fragment"><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> {</div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>  <span class="keywordflow">if</span> (lhs.size() != rhs.size())</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>  {</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>  }</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> </div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  <span class="keyword">auto</span> lhs_it = std::find_if(lhs.begin(), lhs.end(), [&rhs](<span class="keyword">auto</span>& item)</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  {</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  <span class="keywordflow">return</span> std::find(rhs.begin(), rhs.end(), item) == rhs.end();</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  });</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> </div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  <span class="keywordflow">return</span> lhs_it == lhs.end();</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> }</div></div><!-- fragment --> |
| 153 | </div> |
| 154 | </div> |
| 155 | <a id="a5fa64e793b38cf9074e6fcdb2c9c7293"></a> |
| 156 | <h2 class="memtitle"><span class="permalink"><a href="#a5fa64e793b38cf9074e6fcdb2c9c7293">◆ </a></span>Contains() <span class="overload">[1/2]</span></h2> |
| 157 | |
| 158 | <div class="memitem"> |
| 159 | <div class="memproto"> |
| 160 | <table class="memname"> |
| 161 | <tr> |
| 162 | <td class="memname">bool Contains </td> |
| 163 | <td>(</td> |
| 164 | <td class="paramtype">const CollectionType & </td> |
| 165 | <td class="paramname"><em>collection</em>, </td> |
| 166 | </tr> |
| 167 | <tr> |
| 168 | <td class="paramkey"></td> |
| 169 | <td></td> |
| 170 | <td class="paramtype">const typename CollectionType::value_type & </td> |
| 171 | <td class="paramname"><em>item</em> </td> |
| 172 | </tr> |
| 173 | <tr> |
| 174 | <td></td> |
| 175 | <td>)</td> |
| 176 | <td></td><td></td> |
| 177 | </tr> |
| 178 | </table> |
| 179 | </div><div class="memdoc"> |
| 180 | |
| 181 | <p class="definition">Definition at line <a class="el" href="_common_test_utils_8hpp_source.html#l00041">41</a> of file <a class="el" href="_common_test_utils_8hpp_source.html">CommonTestUtils.hpp</a>.</p> |
| 182 | <div class="fragment"><div class="line"><a name="l00042"></a><span class="lineno"> 42</span> {</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  <span class="keywordflow">return</span> std::find(collection.begin(), collection.end(), item) != collection.end();</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span> }</div></div><!-- fragment --> |
| 183 | </div> |
| 184 | </div> |
| 185 | <a id="a34600ef61efcbbf11322f11ce2cfacab"></a> |
| 186 | <h2 class="memtitle"><span class="permalink"><a href="#a34600ef61efcbbf11322f11ce2cfacab">◆ </a></span>Contains() <span class="overload">[2/2]</span></h2> |
| 187 | |
| 188 | <div class="memitem"> |
| 189 | <div class="memproto"> |
| 190 | <table class="memname"> |
| 191 | <tr> |
| 192 | <td class="memname">bool Contains </td> |
| 193 | <td>(</td> |
| 194 | <td class="paramtype">const MapType & </td> |
| 195 | <td class="paramname"><em>map</em>, </td> |
| 196 | </tr> |
| 197 | <tr> |
| 198 | <td class="paramkey"></td> |
| 199 | <td></td> |
| 200 | <td class="paramtype">const typename MapType::key_type & </td> |
| 201 | <td class="paramname"><em>key</em> </td> |
| 202 | </tr> |
| 203 | <tr> |
| 204 | <td></td> |
| 205 | <td>)</td> |
| 206 | <td></td><td></td> |
| 207 | </tr> |
| 208 | </table> |
| 209 | </div><div class="memdoc"> |
| 210 | |
| 211 | <p class="definition">Definition at line <a class="el" href="_common_test_utils_8hpp_source.html#l00048">48</a> of file <a class="el" href="_common_test_utils_8hpp_source.html">CommonTestUtils.hpp</a>.</p> |
| 212 | <div class="fragment"><div class="line"><a name="l00049"></a><span class="lineno"> 49</span> {</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  <span class="keywordflow">return</span> map.find(key) != map.end();</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span> }</div></div><!-- fragment --> |
| 213 | </div> |
| 214 | </div> |
| 215 | <a id="a7a4090354279f08b1e27244bab25aa86"></a> |
| 216 | <h2 class="memtitle"><span class="permalink"><a href="#a7a4090354279f08b1e27244bab25aa86">◆ </a></span>CreateBackendObject()</h2> |
| 217 | |
| 218 | <div class="memitem"> |
| 219 | <div class="memproto"> |
| 220 | <table class="memname"> |
| 221 | <tr> |
| 222 | <td class="memname"><a class="el" href="namespacearmnn.html#ade0af9dacaa52cafdd701bef2e901c77">armnn::IBackendInternalUniquePtr</a> CreateBackendObject </td> |
| 223 | <td>(</td> |
| 224 | <td class="paramtype">const <a class="el" href="classarmnn_1_1_backend_id.html">armnn::BackendId</a> & </td> |
| 225 | <td class="paramname"><em>backendId</em></td><td>)</td> |
| 226 | <td></td> |
| 227 | </tr> |
| 228 | </table> |
| 229 | </div><div class="memdoc"> |
| 230 | |
| 231 | <p class="definition">Definition at line <a class="el" href="_common_test_utils_8cpp_source.html#l00045">45</a> of file <a class="el" href="_common_test_utils_8cpp_source.html">CommonTestUtils.cpp</a>.</p> |
| 232 | |
| 233 | <p class="reference">References <a class="el" href="_backend_registry_8cpp_source.html#l00013">armnn::BackendRegistryInstance()</a>.</p> |
| 234 | |
| 235 | <p class="reference">Referenced by <a class="el" href="_common_test_utils_8hpp_source.html#l00054">SetWeightAndBias()</a>.</p> |
| 236 | <div class="fragment"><div class="line"><a name="l00046"></a><span class="lineno"> 46</span> {</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  <span class="keyword">auto</span>& backendRegistry = <a class="code" href="namespacearmnn.html#ac2807505b850738bc8a1991ce669dd47">BackendRegistryInstance</a>();</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  <span class="keyword">auto</span> backendFactory = backendRegistry.GetFactory(backendId);</div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  <span class="keyword">auto</span> backendObjPtr = backendFactory();</div><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>  <span class="keywordflow">return</span> backendObjPtr;</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span> }</div><div class="ttc" id="namespacearmnn_html_ac2807505b850738bc8a1991ce669dd47"><div class="ttname"><a href="namespacearmnn.html#ac2807505b850738bc8a1991ce669dd47">armnn::BackendRegistryInstance</a></div><div class="ttdeci">BackendRegistry & BackendRegistryInstance()</div><div class="ttdef"><b>Definition:</b> <a href="_backend_registry_8cpp_source.html#l00013">BackendRegistry.cpp:13</a></div></div> |
| 237 | </div><!-- fragment --> |
| 238 | </div> |
| 239 | </div> |
| 240 | <a id="ac0a6b75ad3de58ac7d36f88bd8866078"></a> |
| 241 | <h2 class="memtitle"><span class="permalink"><a href="#ac0a6b75ad3de58ac7d36f88bd8866078">◆ </a></span>CreateInputsFrom()</h2> |
| 242 | |
| 243 | <div class="memitem"> |
| 244 | <div class="memproto"> |
| 245 | <table class="memname"> |
| 246 | <tr> |
| 247 | <td class="memname"><a class="el" href="classarmnn_1_1_subgraph_view.html#a5cc65e15002dbc33a5c8a7d6680e9a9d">armnn::SubgraphView::InputSlots</a> CreateInputsFrom </td> |
| 248 | <td>(</td> |
| 249 | <td class="paramtype">const std::vector< <a class="el" href="classarmnn_1_1_layer.html">armnn::Layer</a> *> & </td> |
| 250 | <td class="paramname"><em>layers</em></td><td>)</td> |
| 251 | <td></td> |
| 252 | </tr> |
| 253 | </table> |
| 254 | </div><div class="memdoc"> |
| 255 | |
| 256 | <p class="definition">Definition at line <a class="el" href="_common_test_utils_8cpp_source.html#l00012">12</a> of file <a class="el" href="_common_test_utils_8cpp_source.html">CommonTestUtils.cpp</a>.</p> |
| 257 | |
| 258 | <p class="reference">Referenced by <a class="el" href="_subgraph_view_tests_8cpp_source.html#l00134">BOOST_AUTO_TEST_CASE()</a>, and <a class="el" href="_common_test_utils_8hpp_source.html#l00054">SetWeightAndBias()</a>.</p> |
| 259 | <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>  <a class="code" href="classarmnn_1_1_subgraph_view.html#a5cc65e15002dbc33a5c8a7d6680e9a9d">SubgraphView::InputSlots</a> result;</div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span>  <span class="keywordflow">for</span> (<span class="keyword">auto</span>&& layer : layers)</div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span>  {</div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span>  <span class="keywordflow">for</span> (<span class="keyword">auto</span>&& it = layer->BeginInputSlots(); it != layer->EndInputSlots(); ++it)</div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span>  {</div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span>  result.push_back(&(*it));</div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>  }</div><div class="line"><a name="l00021"></a><span class="lineno"> 21</span>  }</div><div class="line"><a name="l00022"></a><span class="lineno"> 22</span>  <span class="keywordflow">return</span> result;</div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span> }</div><div class="ttc" id="classarmnn_1_1_subgraph_view_html_a5cc65e15002dbc33a5c8a7d6680e9a9d"><div class="ttname"><a href="classarmnn_1_1_subgraph_view.html#a5cc65e15002dbc33a5c8a7d6680e9a9d">armnn::SubgraphView::InputSlots</a></div><div class="ttdeci">std::vector< InputSlot * > InputSlots</div><div class="ttdef"><b>Definition:</b> <a href="_subgraph_view_8hpp_source.html#l00038">SubgraphView.hpp:38</a></div></div> |
| 260 | </div><!-- fragment --> |
| 261 | </div> |
| 262 | </div> |
| 263 | <a id="aff493fee27236e9ddc581e48c4b931a9"></a> |
| 264 | <h2 class="memtitle"><span class="permalink"><a href="#aff493fee27236e9ddc581e48c4b931a9">◆ </a></span>CreateOutputsFrom()</h2> |
| 265 | |
| 266 | <div class="memitem"> |
| 267 | <div class="memproto"> |
| 268 | <table class="memname"> |
| 269 | <tr> |
| 270 | <td class="memname"><a class="el" href="classarmnn_1_1_subgraph_view.html#a78293334750ec5279eb9c96d56deaf08">armnn::SubgraphView::OutputSlots</a> CreateOutputsFrom </td> |
| 271 | <td>(</td> |
| 272 | <td class="paramtype">const std::vector< <a class="el" href="classarmnn_1_1_layer.html">armnn::Layer</a> *> & </td> |
| 273 | <td class="paramname"><em>layers</em></td><td>)</td> |
| 274 | <td></td> |
| 275 | </tr> |
| 276 | </table> |
| 277 | </div><div class="memdoc"> |
| 278 | |
| 279 | <p class="definition">Definition at line <a class="el" href="_common_test_utils_8cpp_source.html#l00025">25</a> of file <a class="el" href="_common_test_utils_8cpp_source.html">CommonTestUtils.cpp</a>.</p> |
| 280 | |
| 281 | <p class="reference">Referenced by <a class="el" href="_subgraph_view_tests_8cpp_source.html#l00134">BOOST_AUTO_TEST_CASE()</a>, and <a class="el" href="_common_test_utils_8hpp_source.html#l00054">SetWeightAndBias()</a>.</p> |
| 282 | <div class="fragment"><div class="line"><a name="l00026"></a><span class="lineno"> 26</span> {</div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>  <a class="code" href="classarmnn_1_1_subgraph_view.html#a78293334750ec5279eb9c96d56deaf08">SubgraphView::OutputSlots</a> result;</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  <span class="keywordflow">for</span> (<span class="keyword">auto</span> && layer : layers)</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>  {</div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  <span class="keywordflow">for</span> (<span class="keyword">auto</span>&& it = layer->BeginOutputSlots(); it != layer->EndOutputSlots(); ++it)</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  {</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  result.push_back(&(*it));</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  }</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  }</div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  <span class="keywordflow">return</span> result;</div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> }</div><div class="ttc" id="classarmnn_1_1_subgraph_view_html_a78293334750ec5279eb9c96d56deaf08"><div class="ttname"><a href="classarmnn_1_1_subgraph_view.html#a78293334750ec5279eb9c96d56deaf08">armnn::SubgraphView::OutputSlots</a></div><div class="ttdeci">std::vector< OutputSlot * > OutputSlots</div><div class="ttdef"><b>Definition:</b> <a href="_subgraph_view_8hpp_source.html#l00039">SubgraphView.hpp:39</a></div></div> |
| 283 | </div><!-- fragment --> |
| 284 | </div> |
| 285 | </div> |
| 286 | <a id="abf999283bc03f1bafd01680149ed7e3e"></a> |
| 287 | <h2 class="memtitle"><span class="permalink"><a href="#abf999283bc03f1bafd01680149ed7e3e">◆ </a></span>CreateSubgraphViewFrom()</h2> |
| 288 | |
| 289 | <div class="memitem"> |
| 290 | <div class="memproto"> |
| 291 | <table class="memname"> |
| 292 | <tr> |
| 293 | <td class="memname"><a class="el" href="classarmnn_1_1_subgraph_view.html#a4684a457c7786484375f06e9ab2d2265">armnn::SubgraphView::SubgraphViewPtr</a> CreateSubgraphViewFrom </td> |
| 294 | <td>(</td> |
| 295 | <td class="paramtype"><a class="el" href="classarmnn_1_1_subgraph_view.html#a5cc65e15002dbc33a5c8a7d6680e9a9d">armnn::SubgraphView::InputSlots</a> && </td> |
| 296 | <td class="paramname"><em>inputs</em>, </td> |
| 297 | </tr> |
| 298 | <tr> |
| 299 | <td class="paramkey"></td> |
| 300 | <td></td> |
| 301 | <td class="paramtype"><a class="el" href="classarmnn_1_1_subgraph_view.html#a78293334750ec5279eb9c96d56deaf08">armnn::SubgraphView::OutputSlots</a> && </td> |
| 302 | <td class="paramname"><em>outputs</em>, </td> |
| 303 | </tr> |
| 304 | <tr> |
| 305 | <td class="paramkey"></td> |
| 306 | <td></td> |
| 307 | <td class="paramtype"><a class="el" href="classarmnn_1_1_subgraph_view.html#a74798938fdaeae75c8adfa4a7439e7f9">armnn::SubgraphView::Layers</a> && </td> |
| 308 | <td class="paramname"><em>layers</em> </td> |
| 309 | </tr> |
| 310 | <tr> |
| 311 | <td></td> |
| 312 | <td>)</td> |
| 313 | <td></td><td></td> |
| 314 | </tr> |
| 315 | </table> |
| 316 | </div><div class="memdoc"> |
| 317 | |
| 318 | <p class="definition">Definition at line <a class="el" href="_common_test_utils_8cpp_source.html#l00038">38</a> of file <a class="el" href="_common_test_utils_8cpp_source.html">CommonTestUtils.cpp</a>.</p> |
| 319 | |
| 320 | <p class="reference">Referenced by <a class="el" href="_subgraph_view_tests_8cpp_source.html#l00134">BOOST_AUTO_TEST_CASE()</a>, and <a class="el" href="_common_test_utils_8hpp_source.html#l00054">SetWeightAndBias()</a>.</p> |
| 321 | <div class="fragment"><div class="line"><a name="l00041"></a><span class="lineno"> 41</span> {</div><div class="line"><a name="l00042"></a><span class="lineno"> 42</span>  <span class="keywordflow">return</span> std::make_unique<SubgraphView>(std::move(inputs), std::move(outputs), std::move(layers));</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span> }</div></div><!-- fragment --> |
| 322 | </div> |
| 323 | </div> |
| 324 | <a id="a46d07efd379e728fc3df18a88ec878b0"></a> |
| 325 | <h2 class="memtitle"><span class="permalink"><a href="#a46d07efd379e728fc3df18a88ec878b0">◆ </a></span>MakeTensorShape()</h2> |
| 326 | |
| 327 | <div class="memitem"> |
| 328 | <div class="memproto"> |
| 329 | <table class="memname"> |
| 330 | <tr> |
| 331 | <td class="memname"><a class="el" href="classarmnn_1_1_tensor_shape.html">armnn::TensorShape</a> MakeTensorShape </td> |
| 332 | <td>(</td> |
| 333 | <td class="paramtype">unsigned int </td> |
| 334 | <td class="paramname"><em>batches</em>, </td> |
| 335 | </tr> |
| 336 | <tr> |
| 337 | <td class="paramkey"></td> |
| 338 | <td></td> |
| 339 | <td class="paramtype">unsigned int </td> |
| 340 | <td class="paramname"><em>channels</em>, </td> |
| 341 | </tr> |
| 342 | <tr> |
| 343 | <td class="paramkey"></td> |
| 344 | <td></td> |
| 345 | <td class="paramtype">unsigned int </td> |
| 346 | <td class="paramname"><em>height</em>, </td> |
| 347 | </tr> |
| 348 | <tr> |
| 349 | <td class="paramkey"></td> |
| 350 | <td></td> |
| 351 | <td class="paramtype">unsigned int </td> |
| 352 | <td class="paramname"><em>width</em>, </td> |
| 353 | </tr> |
| 354 | <tr> |
| 355 | <td class="paramkey"></td> |
| 356 | <td></td> |
| 357 | <td class="paramtype"><a class="el" href="namespacearmnn.html#ad1d5cce2d9e9a5d61c243e5c989112e0">armnn::DataLayout</a> </td> |
| 358 | <td class="paramname"><em>layout</em> </td> |
| 359 | </tr> |
| 360 | <tr> |
| 361 | <td></td> |
| 362 | <td>)</td> |
| 363 | <td></td><td></td> |
| 364 | </tr> |
| 365 | </table> |
| 366 | </div><div class="memdoc"> |
| 367 | |
| 368 | <p class="definition">Definition at line <a class="el" href="_common_test_utils_8cpp_source.html#l00054">54</a> of file <a class="el" href="_common_test_utils_8cpp_source.html">CommonTestUtils.cpp</a>.</p> |
| 369 | |
| 370 | <p class="reference">References <a class="el" href="_types_utils_8hpp_source.html#l00186">armnn::GetDataLayoutName()</a>, <a class="el" href="namespacearmnn.html#ad1d5cce2d9e9a5d61c243e5c989112e0a6b99f356fe3b30a2a850b5ea897c289f">armnn::NCHW</a>, and <a class="el" href="namespacearmnn.html#ad1d5cce2d9e9a5d61c243e5c989112e0ad066db54b89b0912e7e7c6da51e2da51">armnn::NHWC</a>.</p> |
| 371 | |
| 372 | <p class="reference">Referenced by <a class="el" href="_common_test_utils_8hpp_source.html#l00054">SetWeightAndBias()</a>, and <a class="el" href="_transpose_convolution2d_end_to_end_test_impl_8hpp_source.html#l00048">TransposeConvolution2dEndToEnd()</a>.</p> |
| 373 | <div class="fragment"><div class="line"><a name="l00059"></a><span class="lineno"> 59</span> {</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  <span class="keyword">using namespace </span><a class="code" href="namespacearmnn.html">armnn</a>;</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  <span class="keywordflow">switch</span> (layout)</div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  {</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  <span class="keywordflow">case</span> <a class="code" href="namespacearmnn.html#ad1d5cce2d9e9a5d61c243e5c989112e0a6b99f356fe3b30a2a850b5ea897c289f">DataLayout::NCHW</a>:</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  <span class="keywordflow">return</span> <a class="code" href="classarmnn_1_1_tensor_shape.html">TensorShape</a>{ batches, channels, height, width };</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  <span class="keywordflow">case</span> <a class="code" href="namespacearmnn.html#ad1d5cce2d9e9a5d61c243e5c989112e0ad066db54b89b0912e7e7c6da51e2da51">DataLayout::NHWC</a>:</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  <span class="keywordflow">return</span> <a class="code" href="classarmnn_1_1_tensor_shape.html">TensorShape</a>{ batches, height, width, channels };</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  <span class="keywordflow">default</span>:</div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  <span class="keywordflow">throw</span> <a class="code" href="classarmnn_1_1_invalid_argument_exception.html">InvalidArgumentException</a>(std::string(<span class="stringliteral">"Unsupported data layout: "</span>) + <a class="code" href="namespacearmnn.html#aeef70b7611ae71e97ab55c75ef72b210">GetDataLayoutName</a>(layout));</div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  }</div><div class="line"><a name="l00070"></a><span class="lineno"> 70</span> }</div><div class="ttc" id="namespacearmnn_html_ad1d5cce2d9e9a5d61c243e5c989112e0a6b99f356fe3b30a2a850b5ea897c289f"><div class="ttname"><a href="namespacearmnn.html#ad1d5cce2d9e9a5d61c243e5c989112e0a6b99f356fe3b30a2a850b5ea897c289f">armnn::DataLayout::NCHW</a></div></div> |
| 374 | <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> |
| 375 | <div class="ttc" id="namespacearmnn_html"><div class="ttname"><a href="namespacearmnn.html">armnn</a></div><div class="ttdef"><b>Definition:</b> <a href="_backend_helper_8hpp_source.html#l00011">BackendHelper.hpp:11</a></div></div> |
| 376 | <div class="ttc" id="namespacearmnn_html_aeef70b7611ae71e97ab55c75ef72b210"><div class="ttname"><a href="namespacearmnn.html#aeef70b7611ae71e97ab55c75ef72b210">armnn::GetDataLayoutName</a></div><div class="ttdeci">constexpr const char * GetDataLayoutName(DataLayout dataLayout)</div><div class="ttdef"><b>Definition:</b> <a href="_types_utils_8hpp_source.html#l00186">TypesUtils.hpp:186</a></div></div> |
| 377 | <div class="ttc" id="classarmnn_1_1_tensor_shape_html"><div class="ttname"><a href="classarmnn_1_1_tensor_shape.html">armnn::TensorShape</a></div><div class="ttdef"><b>Definition:</b> <a href="_tensor_8hpp_source.html#l00020">Tensor.hpp:20</a></div></div> |
| 378 | <div class="ttc" id="namespacearmnn_html_ad1d5cce2d9e9a5d61c243e5c989112e0ad066db54b89b0912e7e7c6da51e2da51"><div class="ttname"><a href="namespacearmnn.html#ad1d5cce2d9e9a5d61c243e5c989112e0ad066db54b89b0912e7e7c6da51e2da51">armnn::DataLayout::NHWC</a></div></div> |
| 379 | </div><!-- fragment --> |
| 380 | </div> |
| 381 | </div> |
| 382 | <a id="acacca57727df8ccf5c5597e6026da814"></a> |
| 383 | <h2 class="memtitle"><span class="permalink"><a href="#acacca57727df8ccf5c5597e6026da814">◆ </a></span>SetWeightAndBias()</h2> |
| 384 | |
| 385 | <div class="memitem"> |
| 386 | <div class="memproto"> |
| 387 | <table class="memname"> |
| 388 | <tr> |
| 389 | <td class="memname">void SetWeightAndBias </td> |
| 390 | <td>(</td> |
| 391 | <td class="paramtype">ConvolutionLayer * </td> |
| 392 | <td class="paramname"><em>layer</em>, </td> |
| 393 | </tr> |
| 394 | <tr> |
| 395 | <td class="paramkey"></td> |
| 396 | <td></td> |
| 397 | <td class="paramtype">const <a class="el" href="classarmnn_1_1_tensor_info.html">armnn::TensorInfo</a> & </td> |
| 398 | <td class="paramname"><em>weightInfo</em>, </td> |
| 399 | </tr> |
| 400 | <tr> |
| 401 | <td class="paramkey"></td> |
| 402 | <td></td> |
| 403 | <td class="paramtype">const <a class="el" href="classarmnn_1_1_tensor_info.html">armnn::TensorInfo</a> & </td> |
| 404 | <td class="paramname"><em>biasInfo</em> </td> |
| 405 | </tr> |
| 406 | <tr> |
| 407 | <td></td> |
| 408 | <td>)</td> |
| 409 | <td></td><td></td> |
| 410 | </tr> |
| 411 | </table> |
| 412 | </div><div class="memdoc"> |
| 413 | |
| 414 | <p class="definition">Definition at line <a class="el" href="_common_test_utils_8hpp_source.html#l00054">54</a> of file <a class="el" href="_common_test_utils_8hpp_source.html">CommonTestUtils.hpp</a>.</p> |
| 415 | |
| 416 | <p class="reference">References <a class="el" href="_common_test_utils_8cpp_source.html#l00045">CreateBackendObject()</a>, <a class="el" href="_common_test_utils_8cpp_source.html#l00012">CreateInputsFrom()</a>, <a class="el" href="_common_test_utils_8cpp_source.html#l00025">CreateOutputsFrom()</a>, <a class="el" href="_common_test_utils_8cpp_source.html#l00038">CreateSubgraphViewFrom()</a>, and <a class="el" href="_common_test_utils_8cpp_source.html#l00054">MakeTensorShape()</a>.</p> |
| 417 | <div class="fragment"><div class="line"><a name="l00055"></a><span class="lineno"> 55</span> {</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  layer->m_Weight = std::make_unique<armnn::ScopedCpuTensorHandle>(weightInfo);</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  layer->m_Bias = std::make_unique<armnn::ScopedCpuTensorHandle>(biasInfo);</div><div class="line"><a name="l00058"></a><span class="lineno"> 58</span> </div><div class="line"><a name="l00059"></a><span class="lineno"> 59</span>  layer->m_Weight->Allocate();</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  layer->m_Bias->Allocate();</div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span> }</div></div><!-- fragment --> |
| 418 | </div> |
| 419 | </div> |
| 420 | </div><!-- contents --> |
| 421 | </div><!-- doc-content --> |
| 422 | <!-- start footer part --> |
| 423 | <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> |
| 424 | <ul> |
| 425 | <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_0f3cdec46afbc61a1ded8e1687c9c9a0.html">backends</a></li><li class="navelem"><a class="el" href="dir_797a213d7d01b98ef12d53b0820ea64e.html">backendsCommon</a></li><li class="navelem"><a class="el" href="dir_28bfe507f7e135bdae07c2a6b7f66696.html">test</a></li><li class="navelem"><a class="el" href="_common_test_utils_8hpp.html">CommonTestUtils.hpp</a></li> |
| 426 | <li class="footer">Generated on Fri Mar 13 2020 16:07:00 for ArmNN by |
| 427 | <a href="http://www.doxygen.org/index.html"> |
| 428 | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li> |
| 429 | </ul> |
| 430 | </div> |
| 431 | </body> |
| 432 | </html> |