Nikhil Raj | 1dc83fe | 2024-05-16 09:47:51 +0100 | [diff] [blame^] | 1 | <!-- HTML header for doxygen 1.8.17--> |
| 2 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 3 | <html xmlns="http://www.w3.org/1999/xhtml"> |
| 4 | <head> |
| 5 | <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
| 6 | <meta http-equiv="X-UA-Compatible" content="IE=9"/> |
| 7 | <meta name="generator" content="Doxygen 1.8.17"/> |
| 8 | <meta name="viewport" content="width=device-width, initial-scale=1"/> |
| 9 | <title>Arm NN: src/armnnTestUtils/CommonTestUtils.hpp Source File</title> |
| 10 | <link href="tabs.css" rel="stylesheet" type="text/css"/> |
| 11 | <script type="text/javascript" src="jquery.js"></script> |
| 12 | <script type="text/javascript" src="dynsections.js"></script> |
| 13 | <link href="navtree.css" rel="stylesheet" type="text/css"/> |
| 14 | <script type="text/javascript" src="resize.js"></script> |
| 15 | <script type="text/javascript" src="navtreedata.js"></script> |
| 16 | <script type="text/javascript" src="navtree.js"></script> |
| 17 | <link href="search/search.css" rel="stylesheet" type="text/css"/> |
| 18 | <script type="text/javascript" src="search/searchdata.js"></script> |
| 19 | <script type="text/javascript" src="search/search.js"></script> |
| 20 | <script type="text/x-mathjax-config"> |
| 21 | MathJax.Hub.Config({ |
| 22 | extensions: ["tex2jax.js"], |
| 23 | jax: ["input/TeX","output/HTML-CSS"], |
| 24 | }); |
| 25 | </script> |
| 26 | <script type="text/javascript" async="async" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js"></script> |
| 27 | <link href="doxygen.css" rel="stylesheet" type="text/css" /> |
| 28 | <link href="customdoxygen.css" rel="stylesheet" type="text/css"/> |
| 29 | </head> |
| 30 | <body> |
| 31 | <div id="top"><!-- do not remove this div, it is closed by doxygen! --> |
| 32 | <div id="titlearea"> |
| 33 | <table cellspacing="0" cellpadding="0"> |
| 34 | <tbody> |
| 35 | <tr style="height: 56px;"> |
| 36 | <img alt="ArmNN" src="Arm_NN_horizontal_blue.png" style="max-width: 15rem; margin-top: .5rem; margin-left 13px"/> |
| 37 | <td id="projectalign" style="padding-left: 0.9em;"> |
| 38 | <div id="projectname"> |
| 39 |  <span id="projectnumber">24.05</span> |
| 40 | </div> |
| 41 | </td> |
| 42 | </tr> |
| 43 | </tbody> |
| 44 | </table> |
| 45 | </div> |
| 46 | <!-- end header part --> |
| 47 | <!-- Generated by Doxygen 1.8.17 --> |
| 48 | <script type="text/javascript"> |
| 49 | /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ |
| 50 | var searchBox = new SearchBox("searchBox", "search",false,'Search'); |
| 51 | /* @license-end */ |
| 52 | </script> |
| 53 | <script type="text/javascript" src="menudata.js"></script> |
| 54 | <script type="text/javascript" src="menu.js"></script> |
| 55 | <script type="text/javascript"> |
| 56 | /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ |
| 57 | $(function() { |
| 58 | initMenu('',true,false,'search.php','Search'); |
| 59 | $(document).ready(function() { init_search(); }); |
| 60 | }); |
| 61 | /* @license-end */</script> |
| 62 | <div id="main-nav"></div> |
| 63 | </div><!-- top --> |
| 64 | <div id="side-nav" class="ui-resizable side-nav-resizable"> |
| 65 | <div id="nav-tree"> |
| 66 | <div id="nav-tree-contents"> |
| 67 | <div id="nav-sync" class="sync"></div> |
| 68 | </div> |
| 69 | </div> |
| 70 | <div id="splitbar" style="-moz-user-select:none;" |
| 71 | class="ui-resizable-handle"> |
| 72 | </div> |
| 73 | </div> |
| 74 | <script type="text/javascript"> |
| 75 | /* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&dn=gpl-2.0.txt GPL-v2 */ |
| 76 | $(document).ready(function(){initNavTree('_common_test_utils_8hpp_source.html',''); initResizable(); }); |
| 77 | /* @license-end */ |
| 78 | </script> |
| 79 | <div id="doc-content"> |
| 80 | <!-- window showing the filter options --> |
| 81 | <div id="MSearchSelectWindow" |
| 82 | onmouseover="return searchBox.OnSearchSelectShow()" |
| 83 | onmouseout="return searchBox.OnSearchSelectHide()" |
| 84 | onkeydown="return searchBox.OnSearchSelectKey(event)"> |
| 85 | </div> |
| 86 | |
| 87 | <!-- iframe showing the search results (closed by default) --> |
| 88 | <div id="MSearchResultsWindow"> |
| 89 | <iframe src="javascript:void(0)" frameborder="0" |
| 90 | name="MSearchResults" id="MSearchResults"> |
| 91 | </iframe> |
| 92 | </div> |
| 93 | |
| 94 | <div class="header"> |
| 95 | <div class="headertitle"> |
| 96 | <div class="title">CommonTestUtils.hpp</div> </div> |
| 97 | </div><!--header--> |
| 98 | <div class="contents"> |
| 99 | <a href="_common_test_utils_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno"> 1</span> <span class="comment">//</span></div> |
| 100 | <div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment">// Copyright © 2017,2022 Arm Ltd and Contributors. All rights reserved.</span></div> |
| 101 | <div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment">// SPDX-License-Identifier: MIT</span></div> |
| 102 | <div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment">//</span></div> |
| 103 | <div class="line"><a name="l00005"></a><span class="lineno"> 5</span>  </div> |
| 104 | <div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="preprocessor">#pragma once</span></div> |
| 105 | <div class="line"><a name="l00007"></a><span class="lineno"> 7</span>  </div> |
| 106 | <div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="preprocessor">#include "<a class="code" href="_test_utils_8hpp.html">TestUtils.hpp</a>"</span></div> |
| 107 | <div class="line"><a name="l00009"></a><span class="lineno"> 9</span>  </div> |
| 108 | <div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="preprocessor">#include <<a class="code" href="_graph_8hpp.html">Graph.hpp</a>></span></div> |
| 109 | <div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="preprocessor">#include <<a class="code" href="_resolve_type_8hpp.html">ResolveType.hpp</a>></span></div> |
| 110 | <div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="preprocessor">#include <<a class="code" href="_subgraph_view_selector_8hpp.html">SubgraphViewSelector.hpp</a>></span></div> |
| 111 | <div class="line"><a name="l00013"></a><span class="lineno"> 13</span>  </div> |
| 112 | <div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="preprocessor">#include <<a class="code" href="_backend_registry_8hpp.html">armnn/BackendRegistry.hpp</a>></span></div> |
| 113 | <div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="preprocessor">#include <<a class="code" href="_types_8hpp.html">armnn/Types.hpp</a>></span></div> |
| 114 | <div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="preprocessor">#include <<a class="code" href="_subgraph_view_8hpp.html">armnn/backends/SubgraphView.hpp</a>></span></div> |
| 115 | <div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="preprocessor">#include <<a class="code" href="_tensor_handle_8hpp.html">armnn/backends/TensorHandle.hpp</a>></span></div> |
| 116 | <div class="line"><a name="l00018"></a><span class="lineno"> 18</span>  </div> |
| 117 | <div class="line"><a name="l00019"></a><span class="lineno"> 19</span> <span class="preprocessor">#include <algorithm></span></div> |
| 118 | <div class="line"><a name="l00020"></a><span class="lineno"> 20</span> <span class="preprocessor">#include <random></span></div> |
| 119 | <div class="line"><a name="l00021"></a><span class="lineno"> 21</span> <span class="preprocessor">#include <vector></span></div> |
| 120 | <div class="line"><a name="l00022"></a><span class="lineno"> 22</span>  </div> |
| 121 | <div class="line"><a name="l00023"></a><span class="lineno"> 23</span> <span class="comment">// Checks that two collections have the exact same contents (in any order)</span></div> |
| 122 | <div class="line"><a name="l00024"></a><span class="lineno"> 24</span> <span class="comment">// The given collections do not have to contain duplicates</span></div> |
| 123 | <div class="line"><a name="l00025"></a><span class="lineno"> 25</span> <span class="comment">// Cannot use std::sort here because std lists have their own std::list::sort method</span></div> |
| 124 | <div class="line"><a name="l00026"></a><span class="lineno"> 26</span> <span class="keyword">template</span> <<span class="keyword">typename</span> CollectionType></div> |
| 125 | <div class="line"><a name="l00027"></a><span class="lineno"><a class="line" href="_common_test_utils_8hpp.html#a551d3e8e273f6ff0f4fc4b0b56e1895d"> 27</a></span> <span class="keywordtype">bool</span> <a class="code" href="_common_test_utils_8hpp.html#a551d3e8e273f6ff0f4fc4b0b56e1895d">AreEqual</a>(<span class="keyword">const</span> CollectionType& lhs, <span class="keyword">const</span> CollectionType& rhs)</div> |
| 126 | <div class="line"><a name="l00028"></a><span class="lineno"> 28</span> {</div> |
| 127 | <div class="line"><a name="l00029"></a><span class="lineno"> 29</span>  <span class="keywordflow">if</span> (lhs.size() != rhs.size())</div> |
| 128 | <div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  {</div> |
| 129 | <div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  <span class="keywordflow">return</span> <span class="keyword">false</span>;</div> |
| 130 | <div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  }</div> |
| 131 | <div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  </div> |
| 132 | <div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  <span class="keyword">auto</span> lhs_it = std::find_if(lhs.begin(), lhs.end(), [&rhs](<span class="keyword">auto</span>& item)</div> |
| 133 | <div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  {</div> |
| 134 | <div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  return std::find(rhs.begin(), rhs.end(), item) == rhs.end();</div> |
| 135 | <div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  });</div> |
| 136 | <div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  </div> |
| 137 | <div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  <span class="keywordflow">return</span> lhs_it == lhs.end();</div> |
| 138 | <div class="line"><a name="l00040"></a><span class="lineno"> 40</span> }</div> |
| 139 | <div class="line"><a name="l00041"></a><span class="lineno"> 41</span>  </div> |
| 140 | <div class="line"><a name="l00042"></a><span class="lineno"> 42</span> <span class="comment">// Checks that the given collection contains the specified item</span></div> |
| 141 | <div class="line"><a name="l00043"></a><span class="lineno"> 43</span> <span class="keyword">template</span> <<span class="keyword">typename</span> CollectionType></div> |
| 142 | <div class="line"><a name="l00044"></a><span class="lineno"><a class="line" href="_common_test_utils_8hpp.html#a5fa64e793b38cf9074e6fcdb2c9c7293"> 44</a></span> <span class="keywordtype">bool</span> <a class="code" href="_common_test_utils_8hpp.html#a5fa64e793b38cf9074e6fcdb2c9c7293">Contains</a>(<span class="keyword">const</span> CollectionType& collection, <span class="keyword">const</span> <span class="keyword">typename</span> CollectionType::value_type& item)</div> |
| 143 | <div class="line"><a name="l00045"></a><span class="lineno"> 45</span> {</div> |
| 144 | <div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  <span class="keywordflow">return</span> std::find(collection.begin(), collection.end(), item) != collection.end();</div> |
| 145 | <div class="line"><a name="l00047"></a><span class="lineno"> 47</span> }</div> |
| 146 | <div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  </div> |
| 147 | <div class="line"><a name="l00049"></a><span class="lineno"> 49</span> <span class="comment">// Checks that the given map contains the specified key</span></div> |
| 148 | <div class="line"><a name="l00050"></a><span class="lineno"> 50</span> <span class="keyword">template</span> <<span class="keyword">typename</span> MapType></div> |
| 149 | <div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="_common_test_utils_8hpp.html#a34600ef61efcbbf11322f11ce2cfacab"> 51</a></span> <span class="keywordtype">bool</span> <a class="code" href="_common_test_utils_8hpp.html#a5fa64e793b38cf9074e6fcdb2c9c7293">Contains</a>(<span class="keyword">const</span> MapType& map, <span class="keyword">const</span> <span class="keyword">typename</span> MapType::key_type& key)</div> |
| 150 | <div class="line"><a name="l00052"></a><span class="lineno"> 52</span> {</div> |
| 151 | <div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  <span class="keywordflow">return</span> map.find(key) != map.end();</div> |
| 152 | <div class="line"><a name="l00054"></a><span class="lineno"> 54</span> }</div> |
| 153 | <div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  </div> |
| 154 | <div class="line"><a name="l00056"></a><span class="lineno"> 56</span> <span class="comment">// Utility template for comparing tensor elements</span></div> |
| 155 | <div class="line"><a name="l00057"></a><span class="lineno"> 57</span> <span class="keyword">template</span><armnn::DataType ArmnnType, <span class="keyword">typename</span> T = armnn::ResolveType<ArmnnType>></div> |
| 156 | <div class="line"><a name="l00058"></a><span class="lineno"><a class="line" href="_common_test_utils_8hpp.html#ae828f1d70436f4ad1e74a5c4ecf96929"> 58</a></span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="_common_test_utils_8hpp.html#ae828f1d70436f4ad1e74a5c4ecf96929">Compare</a>(T a, T b, <span class="keywordtype">float</span> tolerance = 0.000001f)</div> |
| 157 | <div class="line"><a name="l00059"></a><span class="lineno"> 59</span> {</div> |
| 158 | <div class="line"><a name="l00060"></a><span class="lineno"> 60</span>  <span class="keywordflow">if</span> (ArmnnType == <a class="code" href="namespacearmnn.html#ad8ed01ff3ff33333d8e19db4d2818bb6a27226c864bac7454a8504f8edb15d95b">armnn::DataType::Boolean</a>)</div> |
| 159 | <div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  {</div> |
| 160 | <div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  <span class="comment">// NOTE: Boolean is represented as uint8_t (with zero equals</span></div> |
| 161 | <div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  <span class="comment">// false and everything else equals true), therefore values</span></div> |
| 162 | <div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  <span class="comment">// need to be casted to bool before comparing them</span></div> |
| 163 | <div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  <span class="keywordflow">return</span> <span class="keyword">static_cast<</span><span class="keywordtype">bool</span><span class="keyword">></span>(a) == <span class="keyword">static_cast<</span><span class="keywordtype">bool</span><span class="keyword">></span>(b);</div> |
| 164 | <div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  }</div> |
| 165 | <div class="line"><a name="l00067"></a><span class="lineno"> 67</span>  </div> |
| 166 | <div class="line"><a name="l00068"></a><span class="lineno"> 68</span>  <span class="comment">// NOTE: All other types can be cast to float and compared with</span></div> |
| 167 | <div class="line"><a name="l00069"></a><span class="lineno"> 69</span>  <span class="comment">// a certain level of tolerance</span></div> |
| 168 | <div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  <span class="keywordflow">return</span> std::fabs(<span class="keyword">static_cast<</span><span class="keywordtype">float</span><span class="keyword">></span>(a) - <span class="keyword">static_cast<</span><span class="keywordtype">float</span><span class="keyword">></span>(b)) <= tolerance;</div> |
| 169 | <div class="line"><a name="l00071"></a><span class="lineno"> 71</span> }</div> |
| 170 | <div class="line"><a name="l00072"></a><span class="lineno"> 72</span>  </div> |
| 171 | <div class="line"><a name="l00073"></a><span class="lineno"> 73</span> <a class="code" href="classarmnn_1_1_subgraph_view.html#a5cc65e15002dbc33a5c8a7d6680e9a9d">armnn::SubgraphView::InputSlots</a> <a class="code" href="_common_test_utils_8hpp.html#a0fb7899a6c5808108263d16f187d2ff3">CreateInputsFrom</a>(<a class="code" href="classarmnn_1_1_layer.html">armnn::Layer</a>* layer,</div> |
| 172 | <div class="line"><a name="l00074"></a><span class="lineno"> 74</span>  std::vector<unsigned int> ignoreSlots = {});</div> |
| 173 | <div class="line"><a name="l00075"></a><span class="lineno"> 75</span>  </div> |
| 174 | <div class="line"><a name="l00076"></a><span class="lineno"> 76</span> <a class="code" href="classarmnn_1_1_subgraph_view.html#a5cc65e15002dbc33a5c8a7d6680e9a9d">armnn::SubgraphView::InputSlots</a> <a class="code" href="_common_test_utils_8hpp.html#a0fb7899a6c5808108263d16f187d2ff3">CreateInputsFrom</a>(<span class="keyword">const</span> std::vector<armnn::Layer*>& layers,</div> |
| 175 | <div class="line"><a name="l00077"></a><span class="lineno"> 77</span>  std::vector<unsigned int> ignoreSlots = {});</div> |
| 176 | <div class="line"><a name="l00078"></a><span class="lineno"> 78</span>  </div> |
| 177 | <div class="line"><a name="l00079"></a><span class="lineno"> 79</span> <a class="code" href="classarmnn_1_1_subgraph_view.html#a78293334750ec5279eb9c96d56deaf08">armnn::SubgraphView::OutputSlots</a> <a class="code" href="_common_test_utils_8hpp.html#a42a94b723fe2a28cd2d942dc54321d02">CreateOutputsFrom</a>(<span class="keyword">const</span> std::vector<armnn::Layer*>& layers);</div> |
| 178 | <div class="line"><a name="l00080"></a><span class="lineno"> 80</span>  </div> |
| 179 | <div class="line"><a name="l00081"></a><span class="lineno"> 81</span> <a class="code" href="classarmnn_1_1_subgraph_view.html#ad5fc1b5213dcb72c0d4ac9dfb46ef677">armnn::SubgraphView::SubgraphViewPtr</a> <a class="code" href="_common_test_utils_8hpp.html#abf999283bc03f1bafd01680149ed7e3e">CreateSubgraphViewFrom</a>(<a class="code" href="classarmnn_1_1_subgraph_view.html#a5cc65e15002dbc33a5c8a7d6680e9a9d">armnn::SubgraphView::InputSlots</a>&& inputs,</div> |
| 180 | <div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  <a class="code" href="classarmnn_1_1_subgraph_view.html#a78293334750ec5279eb9c96d56deaf08">armnn::SubgraphView::OutputSlots</a>&& outputs,</div> |
| 181 | <div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  <a class="code" href="classarmnn_1_1_subgraph_view.html#a74798938fdaeae75c8adfa4a7439e7f9">armnn::SubgraphView::Layers</a>&& layers);</div> |
| 182 | <div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  </div> |
| 183 | <div class="line"><a name="l00085"></a><span class="lineno"> 85</span> <a class="code" href="namespacearmnn.html#ade0af9dacaa52cafdd701bef2e901c77">armnn::IBackendInternalUniquePtr</a> <a class="code" href="_common_test_utils_8hpp.html#a7a4090354279f08b1e27244bab25aa86">CreateBackendObject</a>(<span class="keyword">const</span> <a class="code" href="classarmnn_1_1_backend_id.html">armnn::BackendId</a>& backendId);</div> |
| 184 | <div class="line"><a name="l00086"></a><span class="lineno"> 86</span>  </div> |
| 185 | <div class="line"><a name="l00087"></a><span class="lineno"> 87</span> <a class="code" href="classarmnn_1_1_tensor_shape.html">armnn::TensorShape</a> <a class="code" href="_common_test_utils_8hpp.html#a46d07efd379e728fc3df18a88ec878b0">MakeTensorShape</a>(<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> batches,</div> |
| 186 | <div class="line"><a name="l00088"></a><span class="lineno"> 88</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> channels,</div> |
| 187 | <div class="line"><a name="l00089"></a><span class="lineno"> 89</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> height,</div> |
| 188 | <div class="line"><a name="l00090"></a><span class="lineno"> 90</span>  <span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> width,</div> |
| 189 | <div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  <a class="code" href="namespacearmnn.html#ad1d5cce2d9e9a5d61c243e5c989112e0">armnn::DataLayout</a> layout);</div> |
| 190 | <div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  </div> |
| 191 | <div class="line"><a name="l00093"></a><span class="lineno"> 93</span> <span class="keyword">template</span><<span class="keyword">typename</span> DataType></div> |
| 192 | <div class="line"><a name="l00094"></a><span class="lineno"> 94</span> <span class="keyword">static</span> std::vector<DataType> GenerateRandomData(<span class="keywordtype">size_t</span> size)</div> |
| 193 | <div class="line"><a name="l00095"></a><span class="lineno"> 95</span> {</div> |
| 194 | <div class="line"><a name="l00096"></a><span class="lineno"> 96</span>  constexpr <span class="keywordtype">bool</span> isIntegerType = std::is_integral<DataType>::value;</div> |
| 195 | <div class="line"><a name="l00097"></a><span class="lineno"> 97</span>  <span class="keyword">using</span> Distribution =</div> |
| 196 | <div class="line"><a name="l00098"></a><span class="lineno"> 98</span>  <span class="keyword">typename</span> std::conditional<isIntegerType,</div> |
| 197 | <div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  std::uniform_int_distribution<DataType>,</div> |
| 198 | <div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  std::uniform_real_distribution<DataType>>::type;</div> |
| 199 | <div class="line"><a name="l00101"></a><span class="lineno"> 101</span>  </div> |
| 200 | <div class="line"><a name="l00102"></a><span class="lineno"> 102</span>  <span class="keyword">static</span> constexpr <a class="code" href="namespacearmnn.html#ad8ed01ff3ff33333d8e19db4d2818bb6">DataType</a> lowerLimit = std::numeric_limits<DataType>::min();</div> |
| 201 | <div class="line"><a name="l00103"></a><span class="lineno"> 103</span>  <span class="keyword">static</span> constexpr <a class="code" href="namespacearmnn.html#ad8ed01ff3ff33333d8e19db4d2818bb6">DataType</a> upperLimit = std::numeric_limits<DataType>::max();</div> |
| 202 | <div class="line"><a name="l00104"></a><span class="lineno"> 104</span>  </div> |
| 203 | <div class="line"><a name="l00105"></a><span class="lineno"> 105</span>  <span class="keyword">static</span> Distribution distribution(lowerLimit, upperLimit);</div> |
| 204 | <div class="line"><a name="l00106"></a><span class="lineno"> 106</span>  <span class="keyword">static</span> std::default_random_engine generator;</div> |
| 205 | <div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  </div> |
| 206 | <div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  std::vector<DataType> randomData(size);</div> |
| 207 | <div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  generate(randomData.begin(), randomData.end(), []() { return distribution(generator); });</div> |
| 208 | <div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  </div> |
| 209 | <div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  <span class="keywordflow">return</span> randomData;</div> |
| 210 | <div class="line"><a name="l00112"></a><span class="lineno"> 112</span> }</div> |
| 211 | </div><!-- fragment --></div><!-- contents --> |
| 212 | </div><!-- doc-content --> |
| 213 | <div class="ttc" id="anamespacearmnn_html_ad8ed01ff3ff33333d8e19db4d2818bb6a27226c864bac7454a8504f8edb15d95b"><div class="ttname"><a href="namespacearmnn.html#ad8ed01ff3ff33333d8e19db4d2818bb6a27226c864bac7454a8504f8edb15d95b">armnn::DataType::Boolean</a></div><div class="ttdeci">@ Boolean</div></div> |
| 214 | <div class="ttc" id="anamespacearmnn_html_ad1d5cce2d9e9a5d61c243e5c989112e0"><div class="ttname"><a href="namespacearmnn.html#ad1d5cce2d9e9a5d61c243e5c989112e0">armnn::DataLayout</a></div><div class="ttdeci">DataLayout</div><div class="ttdef"><b>Definition:</b> <a href="_types_8hpp_source.html#l00062">Types.hpp:62</a></div></div> |
| 215 | <div class="ttc" id="a_subgraph_view_selector_8hpp_html"><div class="ttname"><a href="_subgraph_view_selector_8hpp.html">SubgraphViewSelector.hpp</a></div></div> |
| 216 | <div class="ttc" id="a_common_test_utils_8hpp_html_a5fa64e793b38cf9074e6fcdb2c9c7293"><div class="ttname"><a href="_common_test_utils_8hpp.html#a5fa64e793b38cf9074e6fcdb2c9c7293">Contains</a></div><div class="ttdeci">bool Contains(const CollectionType &collection, const typename CollectionType::value_type &item)</div><div class="ttdef"><b>Definition:</b> <a href="_common_test_utils_8hpp_source.html#l00044">CommonTestUtils.hpp:44</a></div></div> |
| 217 | <div class="ttc" id="a_common_test_utils_8hpp_html_a0fb7899a6c5808108263d16f187d2ff3"><div class="ttname"><a href="_common_test_utils_8hpp.html#a0fb7899a6c5808108263d16f187d2ff3">CreateInputsFrom</a></div><div class="ttdeci">armnn::SubgraphView::InputSlots CreateInputsFrom(armnn::Layer *layer, std::vector< unsigned int > ignoreSlots={})</div><div class="ttdef"><b>Definition:</b> <a href="_common_test_utils_8cpp_source.html#l00012">CommonTestUtils.cpp:12</a></div></div> |
| 218 | <div class="ttc" id="aclassarmnn_1_1_subgraph_view_html_a74798938fdaeae75c8adfa4a7439e7f9"><div class="ttname"><a href="classarmnn_1_1_subgraph_view.html#a74798938fdaeae75c8adfa4a7439e7f9">armnn::SubgraphView::Layers</a></div><div class="ttdeci">std::list< Layer * > Layers</div><div class="ttdef"><b>Definition:</b> <a href="_subgraph_view_8hpp_source.html#l00061">SubgraphView.hpp:61</a></div></div> |
| 219 | <div class="ttc" id="a_graph_8hpp_html"><div class="ttname"><a href="_graph_8hpp.html">Graph.hpp</a></div></div> |
| 220 | <div class="ttc" id="a_common_test_utils_8hpp_html_a551d3e8e273f6ff0f4fc4b0b56e1895d"><div class="ttname"><a href="_common_test_utils_8hpp.html#a551d3e8e273f6ff0f4fc4b0b56e1895d">AreEqual</a></div><div class="ttdeci">bool AreEqual(const CollectionType &lhs, const CollectionType &rhs)</div><div class="ttdef"><b>Definition:</b> <a href="_common_test_utils_8hpp_source.html#l00027">CommonTestUtils.hpp:27</a></div></div> |
| 221 | <div class="ttc" id="a_resolve_type_8hpp_html"><div class="ttname"><a href="_resolve_type_8hpp.html">ResolveType.hpp</a></div></div> |
| 222 | <div class="ttc" id="a_backend_registry_8hpp_html"><div class="ttname"><a href="_backend_registry_8hpp.html">BackendRegistry.hpp</a></div></div> |
| 223 | <div class="ttc" id="aclassarmnn_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#l00057">SubgraphView.hpp:57</a></div></div> |
| 224 | <div class="ttc" id="aclassarmnn_1_1_layer_html"><div class="ttname"><a href="classarmnn_1_1_layer.html">armnn::Layer</a></div><div class="ttdef"><b>Definition:</b> <a href="_layer_8hpp_source.html#l00230">Layer.hpp:230</a></div></div> |
| 225 | <div class="ttc" id="aclassarmnn_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> |
| 226 | <div class="ttc" id="anamespacearmnn_html_ad8ed01ff3ff33333d8e19db4d2818bb6"><div class="ttname"><a href="namespacearmnn.html#ad8ed01ff3ff33333d8e19db4d2818bb6">armnn::DataType</a></div><div class="ttdeci">DataType</div><div class="ttdef"><b>Definition:</b> <a href="_types_8hpp_source.html#l00048">Types.hpp:48</a></div></div> |
| 227 | <div class="ttc" id="aclassarmnn_1_1_subgraph_view_html_ad5fc1b5213dcb72c0d4ac9dfb46ef677"><div class="ttname"><a href="classarmnn_1_1_subgraph_view.html#ad5fc1b5213dcb72c0d4ac9dfb46ef677">armnn::SubgraphView::SubgraphViewPtr</a></div><div class="ttdeci">std::shared_ptr< SubgraphView > SubgraphViewPtr</div><div class="ttdef"><b>Definition:</b> <a href="_subgraph_view_8hpp_source.html#l00056">SubgraphView.hpp:56</a></div></div> |
| 228 | <div class="ttc" id="a_test_utils_8hpp_html"><div class="ttname"><a href="_test_utils_8hpp.html">TestUtils.hpp</a></div></div> |
| 229 | <div class="ttc" id="a_common_test_utils_8hpp_html_ae828f1d70436f4ad1e74a5c4ecf96929"><div class="ttname"><a href="_common_test_utils_8hpp.html#ae828f1d70436f4ad1e74a5c4ecf96929">Compare</a></div><div class="ttdeci">bool Compare(T a, T b, float tolerance=0.000001f)</div><div class="ttdef"><b>Definition:</b> <a href="_common_test_utils_8hpp_source.html#l00058">CommonTestUtils.hpp:58</a></div></div> |
| 230 | <div class="ttc" id="a_subgraph_view_8hpp_html"><div class="ttname"><a href="_subgraph_view_8hpp.html">SubgraphView.hpp</a></div></div> |
| 231 | <div class="ttc" id="a_tensor_handle_8hpp_html"><div class="ttname"><a href="_tensor_handle_8hpp.html">TensorHandle.hpp</a></div></div> |
| 232 | <div class="ttc" id="a_common_test_utils_8hpp_html_a46d07efd379e728fc3df18a88ec878b0"><div class="ttname"><a href="_common_test_utils_8hpp.html#a46d07efd379e728fc3df18a88ec878b0">MakeTensorShape</a></div><div class="ttdeci">armnn::TensorShape MakeTensorShape(unsigned int batches, unsigned int channels, unsigned int height, unsigned int width, armnn::DataLayout layout)</div><div class="ttdef"><b>Definition:</b> <a href="_common_test_utils_8cpp_source.html#l00081">CommonTestUtils.cpp:81</a></div></div> |
| 233 | <div class="ttc" id="aclassarmnn_1_1_backend_id_html"><div class="ttname"><a href="classarmnn_1_1_backend_id.html">armnn::BackendId</a></div><div class="ttdef"><b>Definition:</b> <a href="_backend_id_8hpp_source.html#l00075">BackendId.hpp:75</a></div></div> |
| 234 | <div class="ttc" id="aclassarmnn_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#l00059">SubgraphView.hpp:59</a></div></div> |
| 235 | <div class="ttc" id="a_types_8hpp_html"><div class="ttname"><a href="_types_8hpp.html">Types.hpp</a></div></div> |
| 236 | <div class="ttc" id="a_common_test_utils_8hpp_html_abf999283bc03f1bafd01680149ed7e3e"><div class="ttname"><a href="_common_test_utils_8hpp.html#abf999283bc03f1bafd01680149ed7e3e">CreateSubgraphViewFrom</a></div><div class="ttdeci">armnn::SubgraphView::SubgraphViewPtr CreateSubgraphViewFrom(armnn::SubgraphView::InputSlots &&inputs, armnn::SubgraphView::OutputSlots &&outputs, armnn::SubgraphView::Layers &&layers)</div><div class="ttdef"><b>Definition:</b> <a href="_common_test_utils_8cpp_source.html#l00065">CommonTestUtils.cpp:65</a></div></div> |
| 237 | <div class="ttc" id="a_common_test_utils_8hpp_html_a7a4090354279f08b1e27244bab25aa86"><div class="ttname"><a href="_common_test_utils_8hpp.html#a7a4090354279f08b1e27244bab25aa86">CreateBackendObject</a></div><div class="ttdeci">armnn::IBackendInternalUniquePtr CreateBackendObject(const armnn::BackendId &backendId)</div><div class="ttdef"><b>Definition:</b> <a href="_common_test_utils_8cpp_source.html#l00072">CommonTestUtils.cpp:72</a></div></div> |
| 238 | <div class="ttc" id="a_common_test_utils_8hpp_html_a42a94b723fe2a28cd2d942dc54321d02"><div class="ttname"><a href="_common_test_utils_8hpp.html#a42a94b723fe2a28cd2d942dc54321d02">CreateOutputsFrom</a></div><div class="ttdeci">armnn::SubgraphView::OutputSlots CreateOutputsFrom(const std::vector< armnn::Layer * > &layers)</div><div class="ttdef"><b>Definition:</b> <a href="_common_test_utils_8cpp_source.html#l00052">CommonTestUtils.cpp:52</a></div></div> |
| 239 | <div class="ttc" id="anamespacearmnn_html_ade0af9dacaa52cafdd701bef2e901c77"><div class="ttname"><a href="namespacearmnn.html#ade0af9dacaa52cafdd701bef2e901c77">armnn::IBackendInternalUniquePtr</a></div><div class="ttdeci">std::unique_ptr< IBackendInternal > IBackendInternalUniquePtr</div><div class="ttdef"><b>Definition:</b> <a href="_backend_registry_8hpp_source.html#l00032">BackendRegistry.hpp:32</a></div></div> |
| 240 | <!-- start footer part --> |
| 241 | <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> |
| 242 | <ul> |
| 243 | <li class="navelem"><a class="el" href="dir_68267d1309a1af8e8297ef4c3efbcdba.html">src</a></li><li class="navelem"><a class="el" href="dir_f574f3650e467f7ec35d628d20229555.html">armnnTestUtils</a></li><li class="navelem"><a class="el" href="_common_test_utils_8hpp.html">CommonTestUtils.hpp</a></li> |
| 244 | <li class="footer">Generated on Thu May 16 2024 09:31:45 for Arm NN by |
| 245 | <a href="http://www.doxygen.org/index.html"> |
| 246 | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.17 </li> |
| 247 | </ul> |
| 248 | </div> |
| 249 | </body> |
| 250 | </html> |