Ryan OShea | de36e4a | 2020-03-13 16:26:19 +0000 | [diff] [blame] | 1 | <!-- Copyright (c) 2020 ARM Limited. --> |
| 2 | <!-- --> |
| 3 | <!-- SPDX-License-Identifier: MIT --> |
| 4 | <!-- --> |
| 5 | <!-- HTML header for doxygen 1.8.13--> |
| 6 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 7 | <html xmlns="http://www.w3.org/1999/xhtml"> |
| 8 | <head> |
| 9 | <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
| 10 | <meta http-equiv="X-UA-Compatible" content="IE=9"/> |
| 11 | <meta name="generator" content="Doxygen 1.8.13"/> |
| 12 | <meta name="robots" content="NOINDEX, NOFOLLOW" /> |
| 13 | <meta name="viewport" content="width=device-width, initial-scale=1"/> |
| 14 | <title>ArmNN: src/backends/backendsCommon/test/layerTests/FullyConnectedTestImpl.hpp File Reference</title> |
| 15 | <link href="tabs.css" rel="stylesheet" type="text/css"/> |
| 16 | <script type="text/javascript" src="jquery.js"></script> |
| 17 | <script type="text/javascript" src="dynsections.js"></script> |
| 18 | <link href="navtree.css" rel="stylesheet" type="text/css"/> |
| 19 | <script type="text/javascript" src="resize.js"></script> |
| 20 | <script type="text/javascript" src="navtreedata.js"></script> |
| 21 | <script type="text/javascript" src="navtree.js"></script> |
| 22 | <script type="text/javascript"> |
| 23 | $(document).ready(initResizable); |
| 24 | </script> |
| 25 | <link href="search/search.css" rel="stylesheet" type="text/css"/> |
| 26 | <script type="text/javascript" src="search/searchdata.js"></script> |
| 27 | <script type="text/javascript" src="search/search.js"></script> |
| 28 | <script type="text/x-mathjax-config"> |
| 29 | MathJax.Hub.Config({ |
| 30 | extensions: ["tex2jax.js"], |
| 31 | jax: ["input/TeX","output/HTML-CSS"], |
| 32 | }); |
| 33 | </script><script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script> |
| 34 | <link href="doxygen.css" rel="stylesheet" type="text/css" /> |
| 35 | <link href="stylesheet.css" rel="stylesheet" type="text/css"/> |
| 36 | </head> |
| 37 | <body> |
| 38 | <div id="top"><!-- do not remove this div, it is closed by doxygen! --> |
| 39 | <div id="titlearea"> |
| 40 | <table cellspacing="0" cellpadding="0"> |
| 41 | <tbody> |
| 42 | <tr style="height: 56px;"> |
| 43 | <img alt="ArmNN" src="Arm_NN_horizontal_blue.png" style="max-width: 10rem; margin-top: .5rem; margin-left 10px"/> |
| 44 | <td style="padding-left: 0.5em;"> |
| 45 | <div id="projectname"> |
| 46 |  <span id="projectnumber">20.02</span> |
| 47 | </div> |
| 48 | </td> |
| 49 | </tr> |
| 50 | </tbody> |
| 51 | </table> |
| 52 | </div> |
| 53 | <!-- end header part --> |
| 54 | <!-- Generated by Doxygen 1.8.13 --> |
| 55 | <script type="text/javascript"> |
| 56 | var searchBox = new SearchBox("searchBox", "search",false,'Search'); |
| 57 | </script> |
| 58 | <script type="text/javascript" src="menudata.js"></script> |
| 59 | <script type="text/javascript" src="menu.js"></script> |
| 60 | <script type="text/javascript"> |
| 61 | $(function() { |
| 62 | initMenu('',true,false,'search.php','Search'); |
| 63 | $(document).ready(function() { init_search(); }); |
| 64 | }); |
| 65 | </script> |
| 66 | <div id="main-nav"></div> |
| 67 | </div><!-- top --> |
| 68 | <div id="side-nav" class="ui-resizable side-nav-resizable"> |
| 69 | <div id="nav-tree"> |
| 70 | <div id="nav-tree-contents"> |
| 71 | <div id="nav-sync" class="sync"></div> |
| 72 | </div> |
| 73 | </div> |
| 74 | <div id="splitbar" style="-moz-user-select:none;" |
| 75 | class="ui-resizable-handle"> |
| 76 | </div> |
| 77 | </div> |
| 78 | <script type="text/javascript"> |
| 79 | $(document).ready(function(){initNavTree('_fully_connected_test_impl_8hpp.xhtml','');}); |
| 80 | </script> |
| 81 | <div id="doc-content"> |
| 82 | <!-- window showing the filter options --> |
| 83 | <div id="MSearchSelectWindow" |
| 84 | onmouseover="return searchBox.OnSearchSelectShow()" |
| 85 | onmouseout="return searchBox.OnSearchSelectHide()" |
| 86 | onkeydown="return searchBox.OnSearchSelectKey(event)"> |
| 87 | </div> |
| 88 | |
| 89 | <!-- iframe showing the search results (closed by default) --> |
| 90 | <div id="MSearchResultsWindow"> |
| 91 | <iframe src="javascript:void(0)" frameborder="0" |
| 92 | name="MSearchResults" id="MSearchResults"> |
| 93 | </iframe> |
| 94 | </div> |
| 95 | |
| 96 | <div class="header"> |
| 97 | <div class="summary"> |
| 98 | <a href="#func-members">Functions</a> </div> |
| 99 | <div class="headertitle"> |
| 100 | <div class="title">FullyConnectedTestImpl.hpp File Reference</div> </div> |
| 101 | </div><!--header--> |
| 102 | <div class="contents"> |
| 103 | <div class="textblock"><code>#include "<a class="el" href="_layer_test_result_8hpp_source.xhtml">LayerTestResult.hpp</a>"</code><br /> |
| 104 | <code>#include <<a class="el" href="_resolve_type_8hpp_source.xhtml">ResolveType.hpp</a>></code><br /> |
| 105 | <code>#include <<a class="el" href="include_2armnn_2backends_2_i_backend_internal_8hpp_source.xhtml">armnn/backends/IBackendInternal.hpp</a>></code><br /> |
| 106 | <code>#include <<a class="el" href="_workload_factory_8hpp_source.xhtml">backendsCommon/WorkloadFactory.hpp</a>></code><br /> |
| 107 | </div> |
| 108 | <p><a href="_fully_connected_test_impl_8hpp_source.xhtml">Go to the source code of this file.</a></p> |
| 109 | <table class="memberdecls"> |
| 110 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a> |
| 111 | Functions</h2></td></tr> |
| 112 | <tr class="memitem:a25b72d9cbe9cca2c89ba997e6f2cfb87"><td class="memTemplParams" colspan="2">template<armnn::DataType ArmnnType, typename T = armnn::ResolveType<ArmnnType>> </td></tr> |
| 113 | <tr class="memitem:a25b72d9cbe9cca2c89ba997e6f2cfb87"><td class="memTemplItemLeft" align="right" valign="top"><a class="el" href="struct_layer_test_result.xhtml">LayerTestResult</a>< T, 2 > </td><td class="memTemplItemRight" valign="bottom"><a class="el" href="_fully_connected_test_impl_8hpp.xhtml#a25b72d9cbe9cca2c89ba997e6f2cfb87">FullyConnectedTest</a> (<a class="el" href="classarmnn_1_1_i_workload_factory.xhtml">armnn::IWorkloadFactory</a> &workloadFactory, const <a class="el" href="classarmnn_1_1_i_backend_internal.xhtml#a693b40e6b94e958836aeb0410ca186bd">armnn::IBackendInternal::IMemoryManagerSharedPtr</a> &memoryManager, bool biasEnabled)</td></tr> |
| 114 | <tr class="separator:a25b72d9cbe9cca2c89ba997e6f2cfb87"><td class="memSeparator" colspan="2"> </td></tr> |
| 115 | <tr class="memitem:a9aa238fbd4c6a6d1259b31d2a51c93b8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct_layer_test_result.xhtml">LayerTestResult</a>< float, 2 > </td><td class="memItemRight" valign="bottom"><a class="el" href="_fully_connected_test_impl_8hpp.xhtml#a9aa238fbd4c6a6d1259b31d2a51c93b8">FullyConnectedFloat32Test</a> (<a class="el" href="classarmnn_1_1_i_workload_factory.xhtml">armnn::IWorkloadFactory</a> &workloadFactory, const <a class="el" href="classarmnn_1_1_i_backend_internal.xhtml#a693b40e6b94e958836aeb0410ca186bd">armnn::IBackendInternal::IMemoryManagerSharedPtr</a> &memoryManager, bool biasEnabled, bool transposeWeights)</td></tr> |
| 116 | <tr class="separator:a9aa238fbd4c6a6d1259b31d2a51c93b8"><td class="memSeparator" colspan="2"> </td></tr> |
| 117 | <tr class="memitem:a0fb6957126b671361ccdd80f3549faa9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="struct_layer_test_result.xhtml">LayerTestResult</a>< float, 2 > </td><td class="memItemRight" valign="bottom"><a class="el" href="_fully_connected_test_impl_8hpp.xhtml#a0fb6957126b671361ccdd80f3549faa9">FullyConnectedLargeTest</a> (<a class="el" href="classarmnn_1_1_i_workload_factory.xhtml">armnn::IWorkloadFactory</a> &workloadFactory, const <a class="el" href="classarmnn_1_1_i_backend_internal.xhtml#a693b40e6b94e958836aeb0410ca186bd">armnn::IBackendInternal::IMemoryManagerSharedPtr</a> &memoryManager, bool transposeWeights)</td></tr> |
| 118 | <tr class="separator:a0fb6957126b671361ccdd80f3549faa9"><td class="memSeparator" colspan="2"> </td></tr> |
| 119 | </table> |
| 120 | <h2 class="groupheader">Function Documentation</h2> |
| 121 | <a id="a9aa238fbd4c6a6d1259b31d2a51c93b8"></a> |
| 122 | <h2 class="memtitle"><span class="permalink"><a href="#a9aa238fbd4c6a6d1259b31d2a51c93b8">◆ </a></span>FullyConnectedFloat32Test()</h2> |
| 123 | |
| 124 | <div class="memitem"> |
| 125 | <div class="memproto"> |
| 126 | <table class="memname"> |
| 127 | <tr> |
| 128 | <td class="memname"><a class="el" href="struct_layer_test_result.xhtml">LayerTestResult</a><float, 2> FullyConnectedFloat32Test </td> |
| 129 | <td>(</td> |
| 130 | <td class="paramtype"><a class="el" href="classarmnn_1_1_i_workload_factory.xhtml">armnn::IWorkloadFactory</a> & </td> |
| 131 | <td class="paramname"><em>workloadFactory</em>, </td> |
| 132 | </tr> |
| 133 | <tr> |
| 134 | <td class="paramkey"></td> |
| 135 | <td></td> |
| 136 | <td class="paramtype">const <a class="el" href="classarmnn_1_1_i_backend_internal.xhtml#a693b40e6b94e958836aeb0410ca186bd">armnn::IBackendInternal::IMemoryManagerSharedPtr</a> & </td> |
| 137 | <td class="paramname"><em>memoryManager</em>, </td> |
| 138 | </tr> |
| 139 | <tr> |
| 140 | <td class="paramkey"></td> |
| 141 | <td></td> |
| 142 | <td class="paramtype">bool </td> |
| 143 | <td class="paramname"><em>biasEnabled</em>, </td> |
| 144 | </tr> |
| 145 | <tr> |
| 146 | <td class="paramkey"></td> |
| 147 | <td></td> |
| 148 | <td class="paramtype">bool </td> |
| 149 | <td class="paramname"><em>transposeWeights</em> </td> |
| 150 | </tr> |
| 151 | <tr> |
| 152 | <td></td> |
| 153 | <td>)</td> |
| 154 | <td></td><td></td> |
| 155 | </tr> |
| 156 | </table> |
| 157 | </div><div class="memdoc"> |
| 158 | |
| 159 | <p class="definition">Definition at line <a class="el" href="_fully_connected_test_impl_8cpp_source.xhtml#l00247">247</a> of file <a class="el" href="_fully_connected_test_impl_8cpp_source.xhtml">FullyConnectedTestImpl.cpp</a>.</p> |
| 160 | |
| 161 | <p class="reference">References <a class="el" href="namespacearmnn.xhtml#ad8ed01ff3ff33333d8e19db4d2818bb6a166495adc0d0f53bee6baecc577f5204">armnn::Float32</a>, <a class="el" href="_layer_test_result_8hpp_source.xhtml#l00041">LayerTestResult< T, n >::outputExpected</a>, and <a class="el" href="_descriptors_8cpp_source.xhtml#l00342">armnn::swap()</a>.</p> |
| 162 | <div class="fragment"><div class="line"><a name="l00252"></a><span class="lineno"> 252</span> {</div><div class="line"><a name="l00253"></a><span class="lineno"> 253</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> inputWidth = 1;</div><div class="line"><a name="l00254"></a><span class="lineno"> 254</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> inputHeight = 1;</div><div class="line"><a name="l00255"></a><span class="lineno"> 255</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> inputChannels = 5;</div><div class="line"><a name="l00256"></a><span class="lineno"> 256</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> inputNum = 2;</div><div class="line"><a name="l00257"></a><span class="lineno"> 257</span> </div><div class="line"><a name="l00258"></a><span class="lineno"> 258</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> outputChannels = 3;</div><div class="line"><a name="l00259"></a><span class="lineno"> 259</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> outputNum = 2;</div><div class="line"><a name="l00260"></a><span class="lineno"> 260</span> </div><div class="line"><a name="l00261"></a><span class="lineno"> 261</span>  <span class="comment">// Define the tensor descriptors.</span></div><div class="line"><a name="l00262"></a><span class="lineno"> 262</span>  <a class="code" href="classarmnn_1_1_tensor_info.xhtml">armnn::TensorInfo</a> inputTensorInfo;</div><div class="line"><a name="l00263"></a><span class="lineno"> 263</span>  <a class="code" href="classarmnn_1_1_tensor_info.xhtml">armnn::TensorInfo</a> outputTensorInfo;</div><div class="line"><a name="l00264"></a><span class="lineno"> 264</span>  <a class="code" href="classarmnn_1_1_tensor_info.xhtml">armnn::TensorInfo</a> weightsDesc;</div><div class="line"><a name="l00265"></a><span class="lineno"> 265</span>  <a class="code" href="classarmnn_1_1_tensor_info.xhtml">armnn::TensorInfo</a> biasesDesc;</div><div class="line"><a name="l00266"></a><span class="lineno"> 266</span> </div><div class="line"><a name="l00267"></a><span class="lineno"> 267</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> inputShape[] = { inputNum, inputChannels, inputHeight, inputWidth };</div><div class="line"><a name="l00268"></a><span class="lineno"> 268</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> outputShape[] = { outputNum, outputChannels };</div><div class="line"><a name="l00269"></a><span class="lineno"> 269</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> weightsShape[] = { inputChannels, outputChannels };</div><div class="line"><a name="l00270"></a><span class="lineno"> 270</span> </div><div class="line"><a name="l00271"></a><span class="lineno"> 271</span>  <span class="keywordflow">if</span> (transposeWeights)</div><div class="line"><a name="l00272"></a><span class="lineno"> 272</span>  {</div><div class="line"><a name="l00273"></a><span class="lineno"> 273</span>  <a class="code" href="namespacearmnn.xhtml#a14d7f180bf51e86850305965c3707e07">std::swap</a>(weightsShape[0], weightsShape[1]);</div><div class="line"><a name="l00274"></a><span class="lineno"> 274</span>  }</div><div class="line"><a name="l00275"></a><span class="lineno"> 275</span> </div><div class="line"><a name="l00276"></a><span class="lineno"> 276</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> biasShape[] = { outputChannels };</div><div class="line"><a name="l00277"></a><span class="lineno"> 277</span> </div><div class="line"><a name="l00278"></a><span class="lineno"> 278</span>  inputTensorInfo = <a class="code" href="classarmnn_1_1_tensor_info.xhtml">armnn::TensorInfo</a>(4, inputShape, <a class="code" href="namespacearmnn.xhtml#ad8ed01ff3ff33333d8e19db4d2818bb6a166495adc0d0f53bee6baecc577f5204">armnn::DataType::Float32</a>);</div><div class="line"><a name="l00279"></a><span class="lineno"> 279</span>  outputTensorInfo = <a class="code" href="classarmnn_1_1_tensor_info.xhtml">armnn::TensorInfo</a>(2, outputShape, <a class="code" href="namespacearmnn.xhtml#ad8ed01ff3ff33333d8e19db4d2818bb6a166495adc0d0f53bee6baecc577f5204">armnn::DataType::Float32</a>);</div><div class="line"><a name="l00280"></a><span class="lineno"> 280</span>  weightsDesc = <a class="code" href="classarmnn_1_1_tensor_info.xhtml">armnn::TensorInfo</a>(2, weightsShape, <a class="code" href="namespacearmnn.xhtml#ad8ed01ff3ff33333d8e19db4d2818bb6a166495adc0d0f53bee6baecc577f5204">armnn::DataType::Float32</a>);</div><div class="line"><a name="l00281"></a><span class="lineno"> 281</span>  biasesDesc = <a class="code" href="classarmnn_1_1_tensor_info.xhtml">armnn::TensorInfo</a>(1, biasShape, <a class="code" href="namespacearmnn.xhtml#ad8ed01ff3ff33333d8e19db4d2818bb6a166495adc0d0f53bee6baecc577f5204">armnn::DataType::Float32</a>);</div><div class="line"><a name="l00282"></a><span class="lineno"> 282</span> </div><div class="line"><a name="l00283"></a><span class="lineno"> 283</span>  <a class="code" href="struct_layer_test_result.xhtml">LayerTestResult<float, 2></a> result(outputTensorInfo);</div><div class="line"><a name="l00284"></a><span class="lineno"> 284</span> </div><div class="line"><a name="l00285"></a><span class="lineno"> 285</span>  boost::multi_array<float, 4> input = MakeTensor<float, 4>(inputTensorInfo, std::vector<float>(</div><div class="line"><a name="l00286"></a><span class="lineno"> 286</span>  {</div><div class="line"><a name="l00287"></a><span class="lineno"> 287</span>  1.0f, 2.0f, 3.0f, 4.0f, 5.0f,</div><div class="line"><a name="l00288"></a><span class="lineno"> 288</span> </div><div class="line"><a name="l00289"></a><span class="lineno"> 289</span>  5.0f, 4.0f, 3.0f, 2.0f, 1.0f</div><div class="line"><a name="l00290"></a><span class="lineno"> 290</span>  })</div><div class="line"><a name="l00291"></a><span class="lineno"> 291</span>  );</div><div class="line"><a name="l00292"></a><span class="lineno"> 292</span> </div><div class="line"><a name="l00293"></a><span class="lineno"> 293</span>  boost::multi_array<float, 2> weights = MakeTensor<float, 2>(weightsDesc, std::vector<float>(</div><div class="line"><a name="l00294"></a><span class="lineno"> 294</span>  {</div><div class="line"><a name="l00295"></a><span class="lineno"> 295</span>  .5f, 2.f, .5f,</div><div class="line"><a name="l00296"></a><span class="lineno"> 296</span>  .5f, 2.f, 1.f,</div><div class="line"><a name="l00297"></a><span class="lineno"> 297</span>  .5f, 2.f, 2.f,</div><div class="line"><a name="l00298"></a><span class="lineno"> 298</span>  .5f, 2.f, 3.f,</div><div class="line"><a name="l00299"></a><span class="lineno"> 299</span>  .5f, 2.f, 4.f</div><div class="line"><a name="l00300"></a><span class="lineno"> 300</span>  }));</div><div class="line"><a name="l00301"></a><span class="lineno"> 301</span> </div><div class="line"><a name="l00302"></a><span class="lineno"> 302</span>  <span class="keywordflow">if</span> (transposeWeights)</div><div class="line"><a name="l00303"></a><span class="lineno"> 303</span>  {</div><div class="line"><a name="l00304"></a><span class="lineno"> 304</span>  weights = MakeTensor<float, 2>(weightsDesc, std::vector<float>(</div><div class="line"><a name="l00305"></a><span class="lineno"> 305</span>  {</div><div class="line"><a name="l00306"></a><span class="lineno"> 306</span>  .5f, .5f, .5f, .5f, .5f,</div><div class="line"><a name="l00307"></a><span class="lineno"> 307</span>  2.f, 2.f, 2.f, 2.f, 2.f,</div><div class="line"><a name="l00308"></a><span class="lineno"> 308</span>  .5f, 1.f, 2.f, 3.f, 4.f</div><div class="line"><a name="l00309"></a><span class="lineno"> 309</span>  }));</div><div class="line"><a name="l00310"></a><span class="lineno"> 310</span>  }</div><div class="line"><a name="l00311"></a><span class="lineno"> 311</span> </div><div class="line"><a name="l00312"></a><span class="lineno"> 312</span> </div><div class="line"><a name="l00313"></a><span class="lineno"> 313</span>  std::vector<float> biasValues({0.f, 0.f, 0.f});</div><div class="line"><a name="l00314"></a><span class="lineno"> 314</span>  <span class="keywordflow">if</span> (biasEnabled)</div><div class="line"><a name="l00315"></a><span class="lineno"> 315</span>  {</div><div class="line"><a name="l00316"></a><span class="lineno"> 316</span>  biasValues = std::vector<float>({10.f, 20.f, 30.f});</div><div class="line"><a name="l00317"></a><span class="lineno"> 317</span>  }</div><div class="line"><a name="l00318"></a><span class="lineno"> 318</span>  boost::multi_array<float, 1> bias = MakeTensor<float, 1>(biasesDesc, biasValues);</div><div class="line"><a name="l00319"></a><span class="lineno"> 319</span> </div><div class="line"><a name="l00320"></a><span class="lineno"> 320</span>  result = SimpleFullyConnectedTestImpl<float>(</div><div class="line"><a name="l00321"></a><span class="lineno"> 321</span>  workloadFactory,</div><div class="line"><a name="l00322"></a><span class="lineno"> 322</span>  memoryManager,</div><div class="line"><a name="l00323"></a><span class="lineno"> 323</span>  inputTensorInfo, outputTensorInfo,</div><div class="line"><a name="l00324"></a><span class="lineno"> 324</span>  weightsDesc, biasesDesc,</div><div class="line"><a name="l00325"></a><span class="lineno"> 325</span>  weights, bias, input,</div><div class="line"><a name="l00326"></a><span class="lineno"> 326</span>  biasEnabled, transposeWeights</div><div class="line"><a name="l00327"></a><span class="lineno"> 327</span>  );</div><div class="line"><a name="l00328"></a><span class="lineno"> 328</span> </div><div class="line"><a name="l00329"></a><span class="lineno"> 329</span>  result.outputExpected = MakeTensor<float, 2>(outputTensorInfo, std::vector<float>(</div><div class="line"><a name="l00330"></a><span class="lineno"> 330</span>  {</div><div class="line"><a name="l00331"></a><span class="lineno"> 331</span>  0.5f + 1.0f + 1.5f + 2.0f + 2.5f + biasValues[0],</div><div class="line"><a name="l00332"></a><span class="lineno"> 332</span>  2.0f + 4.0f + 6.0f + 8.0f + 10.f + biasValues[1],</div><div class="line"><a name="l00333"></a><span class="lineno"> 333</span>  0.5f + 2.0f + 6.0f + 12.f + 20.f + biasValues[2],</div><div class="line"><a name="l00334"></a><span class="lineno"> 334</span> </div><div class="line"><a name="l00335"></a><span class="lineno"> 335</span>  2.5f + 2.0f + 1.5f + 1.0f + 0.5f + biasValues[0],</div><div class="line"><a name="l00336"></a><span class="lineno"> 336</span>  10.0f + 8.0f + 6.0f + 4.0f + 2.f + biasValues[1],</div><div class="line"><a name="l00337"></a><span class="lineno"> 337</span>  2.5f + 4.0f + 6.0f + 6.f + 4.f + biasValues[2]</div><div class="line"><a name="l00338"></a><span class="lineno"> 338</span>  })</div><div class="line"><a name="l00339"></a><span class="lineno"> 339</span>  );</div><div class="line"><a name="l00340"></a><span class="lineno"> 340</span> </div><div class="line"><a name="l00341"></a><span class="lineno"> 341</span>  <span class="keywordflow">return</span> result;</div><div class="line"><a name="l00342"></a><span class="lineno"> 342</span> }</div><div class="ttc" id="namespacearmnn_xhtml_a14d7f180bf51e86850305965c3707e07"><div class="ttname"><a href="namespacearmnn.xhtml#a14d7f180bf51e86850305965c3707e07">armnn::swap</a></div><div class="ttdeci">void swap(OriginsDescriptor &first, OriginsDescriptor &second)</div><div class="ttdef"><b>Definition:</b> <a href="_descriptors_8cpp_source.xhtml#l00342">Descriptors.cpp:342</a></div></div> |
| 163 | <div class="ttc" id="classarmnn_1_1_tensor_info_xhtml"><div class="ttname"><a href="classarmnn_1_1_tensor_info.xhtml">armnn::TensorInfo</a></div><div class="ttdef"><b>Definition:</b> <a href="_tensor_8hpp_source.xhtml#l00053">Tensor.hpp:53</a></div></div> |
| 164 | <div class="ttc" id="namespacearmnn_xhtml_ad8ed01ff3ff33333d8e19db4d2818bb6a166495adc0d0f53bee6baecc577f5204"><div class="ttname"><a href="namespacearmnn.xhtml#ad8ed01ff3ff33333d8e19db4d2818bb6a166495adc0d0f53bee6baecc577f5204">armnn::DataType::Float32</a></div></div> |
| 165 | <div class="ttc" id="struct_layer_test_result_xhtml"><div class="ttname"><a href="struct_layer_test_result.xhtml">LayerTestResult</a></div><div class="ttdef"><b>Definition:</b> <a href="_layer_test_result_8hpp_source.xhtml#l00029">LayerTestResult.hpp:29</a></div></div> |
| 166 | </div><!-- fragment --> |
| 167 | </div> |
| 168 | </div> |
| 169 | <a id="a0fb6957126b671361ccdd80f3549faa9"></a> |
| 170 | <h2 class="memtitle"><span class="permalink"><a href="#a0fb6957126b671361ccdd80f3549faa9">◆ </a></span>FullyConnectedLargeTest()</h2> |
| 171 | |
| 172 | <div class="memitem"> |
| 173 | <div class="memproto"> |
| 174 | <table class="memname"> |
| 175 | <tr> |
| 176 | <td class="memname"><a class="el" href="struct_layer_test_result.xhtml">LayerTestResult</a><float, 2> FullyConnectedLargeTest </td> |
| 177 | <td>(</td> |
| 178 | <td class="paramtype"><a class="el" href="classarmnn_1_1_i_workload_factory.xhtml">armnn::IWorkloadFactory</a> & </td> |
| 179 | <td class="paramname"><em>workloadFactory</em>, </td> |
| 180 | </tr> |
| 181 | <tr> |
| 182 | <td class="paramkey"></td> |
| 183 | <td></td> |
| 184 | <td class="paramtype">const <a class="el" href="classarmnn_1_1_i_backend_internal.xhtml#a693b40e6b94e958836aeb0410ca186bd">armnn::IBackendInternal::IMemoryManagerSharedPtr</a> & </td> |
| 185 | <td class="paramname"><em>memoryManager</em>, </td> |
| 186 | </tr> |
| 187 | <tr> |
| 188 | <td class="paramkey"></td> |
| 189 | <td></td> |
| 190 | <td class="paramtype">bool </td> |
| 191 | <td class="paramname"><em>transposeWeights</em> </td> |
| 192 | </tr> |
| 193 | <tr> |
| 194 | <td></td> |
| 195 | <td>)</td> |
| 196 | <td></td><td></td> |
| 197 | </tr> |
| 198 | </table> |
| 199 | </div><div class="memdoc"> |
| 200 | |
| 201 | <p class="definition">Definition at line <a class="el" href="_fully_connected_test_impl_8cpp_source.xhtml#l00344">344</a> of file <a class="el" href="_fully_connected_test_impl_8cpp_source.xhtml">FullyConnectedTestImpl.cpp</a>.</p> |
| 202 | <div class="fragment"><div class="line"><a name="l00348"></a><span class="lineno"> 348</span> {</div><div class="line"><a name="l00349"></a><span class="lineno"> 349</span>  <span class="keywordflow">return</span> FullyConnectedLargeTestCommon<armnn::DataType::Float32>(workloadFactory, memoryManager, transposeWeights);</div><div class="line"><a name="l00350"></a><span class="lineno"> 350</span> }</div></div><!-- fragment --> |
| 203 | </div> |
| 204 | </div> |
| 205 | <a id="a25b72d9cbe9cca2c89ba997e6f2cfb87"></a> |
| 206 | <h2 class="memtitle"><span class="permalink"><a href="#a25b72d9cbe9cca2c89ba997e6f2cfb87">◆ </a></span>FullyConnectedTest()</h2> |
| 207 | |
| 208 | <div class="memitem"> |
| 209 | <div class="memproto"> |
| 210 | <table class="memname"> |
| 211 | <tr> |
| 212 | <td class="memname"><a class="el" href="struct_layer_test_result.xhtml">LayerTestResult</a><T, 2> FullyConnectedTest </td> |
| 213 | <td>(</td> |
| 214 | <td class="paramtype"><a class="el" href="classarmnn_1_1_i_workload_factory.xhtml">armnn::IWorkloadFactory</a> & </td> |
| 215 | <td class="paramname"><em>workloadFactory</em>, </td> |
| 216 | </tr> |
| 217 | <tr> |
| 218 | <td class="paramkey"></td> |
| 219 | <td></td> |
| 220 | <td class="paramtype">const <a class="el" href="classarmnn_1_1_i_backend_internal.xhtml#a693b40e6b94e958836aeb0410ca186bd">armnn::IBackendInternal::IMemoryManagerSharedPtr</a> & </td> |
| 221 | <td class="paramname"><em>memoryManager</em>, </td> |
| 222 | </tr> |
| 223 | <tr> |
| 224 | <td class="paramkey"></td> |
| 225 | <td></td> |
| 226 | <td class="paramtype">bool </td> |
| 227 | <td class="paramname"><em>biasEnabled</em> </td> |
| 228 | </tr> |
| 229 | <tr> |
| 230 | <td></td> |
| 231 | <td>)</td> |
| 232 | <td></td><td></td> |
| 233 | </tr> |
| 234 | </table> |
| 235 | </div><div class="memdoc"> |
| 236 | |
| 237 | <p class="definition">Definition at line <a class="el" href="_fully_connected_test_impl_8cpp_source.xhtml#l00071">71</a> of file <a class="el" href="_fully_connected_test_impl_8cpp_source.xhtml">FullyConnectedTestImpl.cpp</a>.</p> |
| 238 | |
| 239 | <p class="reference">References <a class="el" href="_layer_support_rules_8hpp_source.xhtml#l00014">armnn::GetBiasTypeFromWeightsType()</a>, <a class="el" href="_layer_test_result_8hpp_source.xhtml#l00041">LayerTestResult< T, n >::outputExpected</a>, <a class="el" href="_tensor_8cpp_source.xhtml#l00259">TensorInfo::SetQuantizationScale()</a>, and <a class="el" href="_cl_layer_tests_8cpp_source.xhtml#l00202">true</a>.</p> |
| 240 | <div class="fragment"><div class="line"><a name="l00075"></a><span class="lineno"> 75</span> {</div><div class="line"><a name="l00076"></a><span class="lineno"> 76</span>  constexpr <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> inputWidth = 3u;</div><div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  constexpr <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> inputHeight = 2u;</div><div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  constexpr <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> inputChannels = 1u;</div><div class="line"><a name="l00079"></a><span class="lineno"> 79</span> </div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  constexpr <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> inputSize = inputWidth * inputHeight * inputChannels;</div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span> </div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  constexpr <span class="keyword">static</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> outputChannels = 2u;</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span> </div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  <a class="code" href="classarmnn_1_1_tensor_info.xhtml">armnn::TensorInfo</a> inputTensorInfo({ 1, inputChannels, inputHeight, inputWidth }, ArmnnType);</div><div class="line"><a name="l00085"></a><span class="lineno"> 85</span>  inputTensorInfo.<a class="code" href="classarmnn_1_1_tensor_info.xhtml#a685739c4eb65a580e075282cfe6787d6">SetQuantizationScale</a>(0.1f);</div><div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  inputTensorInfo.SetQuantizationOffset(63);</div><div class="line"><a name="l00087"></a><span class="lineno"> 87</span> </div><div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  <a class="code" href="classarmnn_1_1_tensor_info.xhtml">armnn::TensorInfo</a> outputTensorInfo({ 1, outputChannels }, ArmnnType);</div><div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  outputTensorInfo.<a class="code" href="classarmnn_1_1_tensor_info.xhtml#a685739c4eb65a580e075282cfe6787d6">SetQuantizationScale</a>(5.f);</div><div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  outputTensorInfo.SetQuantizationOffset(biasEnabled ? -50 : 10);</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span> </div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  <a class="code" href="classarmnn_1_1_tensor_info.xhtml">armnn::TensorInfo</a> weightsDesc({ outputChannels, inputSize }, ArmnnType);</div><div class="line"><a name="l00093"></a><span class="lineno"> 93</span>  weightsDesc.<a class="code" href="classarmnn_1_1_tensor_info.xhtml#a685739c4eb65a580e075282cfe6787d6">SetQuantizationScale</a>(0.2f);</div><div class="line"><a name="l00094"></a><span class="lineno"> 94</span>  weightsDesc.SetQuantizationOffset(93);</div><div class="line"><a name="l00095"></a><span class="lineno"> 95</span> </div><div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  <a class="code" href="classarmnn_1_1_tensor_info.xhtml">armnn::TensorInfo</a> biasesDesc({ outputChannels }, <a class="code" href="namespacearmnn.xhtml#a83c4a275acf59f62b8387f389d0929d5">GetBiasTypeFromWeightsType</a>(weightsDesc.GetDataType()).value());</div><div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  biasesDesc.<a class="code" href="classarmnn_1_1_tensor_info.xhtml#a685739c4eb65a580e075282cfe6787d6">SetQuantizationScale</a>(inputTensorInfo.GetQuantizationScale() * weightsDesc.GetQuantizationScale());</div><div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  biasesDesc.SetQuantizationOffset(0);</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span> </div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  <a class="code" href="struct_layer_test_result.xhtml">LayerTestResult<T, 2></a> result(outputTensorInfo);</div><div class="line"><a name="l00101"></a><span class="lineno"> 101</span> </div><div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  <span class="keyword">auto</span> input = MakeTensor<T, 4>(inputTensorInfo, ConvertToDataType<ArmnnType>(</div><div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  {</div><div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  -1.2f, 6.1f, -3.5f,</div><div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  18.8f, -5.5f, 2.9f</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  },</div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  inputTensorInfo));</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span> </div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  <span class="keyword">auto</span> weights = MakeTensor<T, 2>(weightsDesc, ConvertToDataType<ArmnnType>(</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  {</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  -8.4f, 20.0f, -10.4f, -8, 16.4f, -11.8f,</div><div class="line"><a name="l00112"></a><span class="lineno"> 112</span>  23.4f, 10.4f, -14.0f, -3.8f, -11.8f, 11.4f</div><div class="line"><a name="l00113"></a><span class="lineno"> 113</span>  },</div><div class="line"><a name="l00114"></a><span class="lineno"> 114</span>  weightsDesc));</div><div class="line"><a name="l00115"></a><span class="lineno"> 115</span> </div><div class="line"><a name="l00116"></a><span class="lineno"> 116</span>  <span class="keyword">auto</span> bias = MakeTensor<int32_t, 1>(biasesDesc, std::vector<int32_t>{9250, 67500});</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span> </div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  result = SimpleFullyConnectedTestImpl<T>(</div><div class="line"><a name="l00119"></a><span class="lineno"> 119</span>  workloadFactory,</div><div class="line"><a name="l00120"></a><span class="lineno"> 120</span>  memoryManager,</div><div class="line"><a name="l00121"></a><span class="lineno"> 121</span>  inputTensorInfo, outputTensorInfo,</div><div class="line"><a name="l00122"></a><span class="lineno"> 122</span>  weightsDesc, biasesDesc,</div><div class="line"><a name="l00123"></a><span class="lineno"> 123</span>  weights, bias, input,</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  biasEnabled, <a class="code" href="_cl_layer_tests_8cpp.xhtml#a37f1c3ccc9fc906be85185350dd83d48">true</a></div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  );</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span> </div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  <span class="keywordflow">if</span> (biasEnabled)</div><div class="line"><a name="l00128"></a><span class="lineno"> 128</span>  {</div><div class="line"><a name="l00129"></a><span class="lineno"> 129</span>  result.outputExpected = MakeTensor<T, 2>(outputTensorInfo,</div><div class="line"><a name="l00130"></a><span class="lineno"> 130</span>  ConvertToDataType<ArmnnType>({80.f, 1460.f}, outputTensorInfo));</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">else</span></div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  {</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  result.outputExpected = MakeTensor<T, 2>(outputTensorInfo,</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  ConvertToDataType<ArmnnType>({-107.04f, 110.f}, outputTensorInfo));</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> </div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  <span class="keywordflow">return</span> result;</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span> }</div><div class="ttc" id="classarmnn_1_1_tensor_info_xhtml"><div class="ttname"><a href="classarmnn_1_1_tensor_info.xhtml">armnn::TensorInfo</a></div><div class="ttdef"><b>Definition:</b> <a href="_tensor_8hpp_source.xhtml#l00053">Tensor.hpp:53</a></div></div> |
| 241 | <div class="ttc" id="_cl_layer_tests_8cpp_xhtml_a37f1c3ccc9fc906be85185350dd83d48"><div class="ttname"><a href="_cl_layer_tests_8cpp.xhtml#a37f1c3ccc9fc906be85185350dd83d48">true</a></div><div class="ttdeci">DataLayout::NCHW DataLayout::NCHW DataLayout::NHWC DataLayout::NHWC true</div><div class="ttdef"><b>Definition:</b> <a href="_cl_layer_tests_8cpp_source.xhtml#l00202">ClLayerTests.cpp:202</a></div></div> |
| 242 | <div class="ttc" id="namespacearmnn_xhtml_a83c4a275acf59f62b8387f389d0929d5"><div class="ttname"><a href="namespacearmnn.xhtml#a83c4a275acf59f62b8387f389d0929d5">armnn::GetBiasTypeFromWeightsType</a></div><div class="ttdeci">armnn::Optional< armnn::DataType > GetBiasTypeFromWeightsType(armnn::Optional< armnn::DataType > weightsType)</div><div class="ttdef"><b>Definition:</b> <a href="_layer_support_rules_8hpp_source.xhtml#l00014">LayerSupportRules.hpp:14</a></div></div> |
| 243 | <div class="ttc" id="classarmnn_1_1_tensor_info_xhtml_a685739c4eb65a580e075282cfe6787d6"><div class="ttname"><a href="classarmnn_1_1_tensor_info.xhtml#a685739c4eb65a580e075282cfe6787d6">armnn::TensorInfo::SetQuantizationScale</a></div><div class="ttdeci">void SetQuantizationScale(float scale)</div><div class="ttdef"><b>Definition:</b> <a href="_tensor_8cpp_source.xhtml#l00259">Tensor.cpp:259</a></div></div> |
| 244 | <div class="ttc" id="struct_layer_test_result_xhtml"><div class="ttname"><a href="struct_layer_test_result.xhtml">LayerTestResult</a></div><div class="ttdef"><b>Definition:</b> <a href="_layer_test_result_8hpp_source.xhtml#l00029">LayerTestResult.hpp:29</a></div></div> |
| 245 | </div><!-- fragment --> |
| 246 | </div> |
| 247 | </div> |
| 248 | </div><!-- contents --> |
| 249 | </div><!-- doc-content --> |
| 250 | <!-- start footer part --> |
| 251 | <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> |
| 252 | <ul> |
| 253 | <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.xhtml">src</a></li><li class="navelem"><a class="el" href="dir_0f3cdec46afbc61a1ded8e1687c9c9a0.xhtml">backends</a></li><li class="navelem"><a class="el" href="dir_797a213d7d01b98ef12d53b0820ea64e.xhtml">backendsCommon</a></li><li class="navelem"><a class="el" href="dir_28bfe507f7e135bdae07c2a6b7f66696.xhtml">test</a></li><li class="navelem"><a class="el" href="dir_99a30439342d160875b21dac3498ad7f.xhtml">layerTests</a></li><li class="navelem"><a class="el" href="_fully_connected_test_impl_8hpp.xhtml">FullyConnectedTestImpl.hpp</a></li> |
| 254 | <li class="footer">Generated on Fri Mar 13 2020 16:09:14 for ArmNN by |
| 255 | <a href="http://www.doxygen.org/index.html"> |
| 256 | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li> |
| 257 | </ul> |
| 258 | </div> |
| 259 | </body> |
| 260 | </html> |