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: PermutationVector Class 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('classarmnn_1_1_permutation_vector.html','');}); |
| 66 | </script> |
| 67 | <div id="doc-content"> |
| 68 | <!-- window showing the filter options --> |
| 69 | <div id="MSearchSelectWindow" |
| 70 | onmouseover="return searchBox.OnSearchSelectShow()" |
| 71 | onmouseout="return searchBox.OnSearchSelectHide()" |
| 72 | onkeydown="return searchBox.OnSearchSelectKey(event)"> |
| 73 | </div> |
| 74 | |
| 75 | <!-- iframe showing the search results (closed by default) --> |
| 76 | <div id="MSearchResultsWindow"> |
| 77 | <iframe src="javascript:void(0)" frameborder="0" |
| 78 | name="MSearchResults" id="MSearchResults"> |
| 79 | </iframe> |
| 80 | </div> |
| 81 | |
| 82 | <div class="header"> |
| 83 | <div class="summary"> |
| 84 | <a href="#pub-types">Public Types</a> | |
| 85 | <a href="#pub-methods">Public Member Functions</a> | |
| 86 | <a href="classarmnn_1_1_permutation_vector-members.html">List of all members</a> </div> |
| 87 | <div class="headertitle"> |
| 88 | <div class="title">PermutationVector Class Reference</div> </div> |
| 89 | </div><!--header--> |
| 90 | <div class="contents"> |
| 91 | |
| 92 | <p><code>#include <<a class="el" href="_types_8hpp_source.html">Types.hpp</a>></code></p> |
| 93 | <table class="memberdecls"> |
| 94 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-types"></a> |
| 95 | Public Types</h2></td></tr> |
| 96 | <tr class="memitem:a9e70f27e3e424e90566080423b1fe2db"><td class="memItemLeft" align="right" valign="top">using </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_permutation_vector.html#a9e70f27e3e424e90566080423b1fe2db">ValueType</a> = unsigned int</td></tr> |
| 97 | <tr class="separator:a9e70f27e3e424e90566080423b1fe2db"><td class="memSeparator" colspan="2"> </td></tr> |
| 98 | <tr class="memitem:a12b132c42f8e60ebc9669a3b333bb946"><td class="memItemLeft" align="right" valign="top">using </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_permutation_vector.html#a12b132c42f8e60ebc9669a3b333bb946">SizeType</a> = unsigned int</td></tr> |
| 99 | <tr class="separator:a12b132c42f8e60ebc9669a3b333bb946"><td class="memSeparator" colspan="2"> </td></tr> |
| 100 | <tr class="memitem:acaddf65e487df26a73b4e90cbfc0ada9"><td class="memItemLeft" align="right" valign="top">using </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_permutation_vector.html#acaddf65e487df26a73b4e90cbfc0ada9">ArrayType</a> = std::array< <a class="el" href="classarmnn_1_1_permutation_vector.html#a9e70f27e3e424e90566080423b1fe2db">ValueType</a>, <a class="el" href="namespacearmnn.html#abdcd184ed3bd648bb31d385040cafd5d">MaxNumOfTensorDimensions</a> ></td></tr> |
| 101 | <tr class="separator:acaddf65e487df26a73b4e90cbfc0ada9"><td class="memSeparator" colspan="2"> </td></tr> |
| 102 | <tr class="memitem:a065e980f27e65a118d3b071ab077cfda"><td class="memItemLeft" align="right" valign="top">using </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_permutation_vector.html#a065e980f27e65a118d3b071ab077cfda">ConstIterator</a> = typename ArrayType::const_iterator</td></tr> |
| 103 | <tr class="separator:a065e980f27e65a118d3b071ab077cfda"><td class="memSeparator" colspan="2"> </td></tr> |
| 104 | </table><table class="memberdecls"> |
| 105 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> |
| 106 | Public Member Functions</h2></td></tr> |
| 107 | <tr class="memitem:a399359e369b182e7c86840d7b6a38c41"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_permutation_vector.html#a399359e369b182e7c86840d7b6a38c41">PermutationVector</a> (const <a class="el" href="classarmnn_1_1_permutation_vector.html#a9e70f27e3e424e90566080423b1fe2db">ValueType</a> *dimMappings, <a class="el" href="classarmnn_1_1_permutation_vector.html#a12b132c42f8e60ebc9669a3b333bb946">SizeType</a> numDimMappings)</td></tr> |
| 108 | <tr class="separator:a399359e369b182e7c86840d7b6a38c41"><td class="memSeparator" colspan="2"> </td></tr> |
| 109 | <tr class="memitem:adb9aad0dc5def92d5749a0efad1ead58"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_permutation_vector.html#adb9aad0dc5def92d5749a0efad1ead58">PermutationVector</a> (std::initializer_list< <a class="el" href="classarmnn_1_1_permutation_vector.html#a9e70f27e3e424e90566080423b1fe2db">ValueType</a> > dimMappings)</td></tr> |
| 110 | <tr class="separator:adb9aad0dc5def92d5749a0efad1ead58"><td class="memSeparator" colspan="2"> </td></tr> |
| 111 | <tr class="memitem:a86e55f7d14b21da3b31280412be96bd7"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classarmnn_1_1_permutation_vector.html#a9e70f27e3e424e90566080423b1fe2db">ValueType</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_permutation_vector.html#a86e55f7d14b21da3b31280412be96bd7">operator[]</a> (<a class="el" href="classarmnn_1_1_permutation_vector.html#a12b132c42f8e60ebc9669a3b333bb946">SizeType</a> i) const</td></tr> |
| 112 | <tr class="separator:a86e55f7d14b21da3b31280412be96bd7"><td class="memSeparator" colspan="2"> </td></tr> |
| 113 | <tr class="memitem:a490ec6b59006d1fe1ec2ea30e69fb97c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classarmnn_1_1_permutation_vector.html#a12b132c42f8e60ebc9669a3b333bb946">SizeType</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_permutation_vector.html#a490ec6b59006d1fe1ec2ea30e69fb97c">GetSize</a> () const</td></tr> |
| 114 | <tr class="separator:a490ec6b59006d1fe1ec2ea30e69fb97c"><td class="memSeparator" colspan="2"> </td></tr> |
| 115 | <tr class="memitem:ad5fee900c7aee90671038c79225bf8ec"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classarmnn_1_1_permutation_vector.html#a065e980f27e65a118d3b071ab077cfda">ConstIterator</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_permutation_vector.html#ad5fee900c7aee90671038c79225bf8ec">begin</a> () const</td></tr> |
| 116 | <tr class="separator:ad5fee900c7aee90671038c79225bf8ec"><td class="memSeparator" colspan="2"> </td></tr> |
| 117 | <tr class="memitem:a69b6e2a03c835ca5d658a1f16acbaa9c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classarmnn_1_1_permutation_vector.html#a065e980f27e65a118d3b071ab077cfda">ConstIterator</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_permutation_vector.html#a69b6e2a03c835ca5d658a1f16acbaa9c">end</a> () const</td></tr> |
| 118 | <tr class="separator:a69b6e2a03c835ca5d658a1f16acbaa9c"><td class="memSeparator" colspan="2"> </td></tr> |
| 119 | <tr class="memitem:aae44e4154aa80fba7616747450ff69d5"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_permutation_vector.html#aae44e4154aa80fba7616747450ff69d5">IsEqual</a> (const <a class="el" href="classarmnn_1_1_permutation_vector.html">PermutationVector</a> &other) const</td></tr> |
| 120 | <tr class="separator:aae44e4154aa80fba7616747450ff69d5"><td class="memSeparator" colspan="2"> </td></tr> |
| 121 | <tr class="memitem:abca528420d32f4edad0b1425ad90f80e"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1_permutation_vector.html#abca528420d32f4edad0b1425ad90f80e">IsInverse</a> (const <a class="el" href="classarmnn_1_1_permutation_vector.html">PermutationVector</a> &other) const</td></tr> |
| 122 | <tr class="separator:abca528420d32f4edad0b1425ad90f80e"><td class="memSeparator" colspan="2"> </td></tr> |
| 123 | </table> |
| 124 | <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> |
| 125 | <div class="textblock"> |
| 126 | <p class="definition">Definition at line <a class="el" href="_types_8hpp_source.html#l00170">170</a> of file <a class="el" href="_types_8hpp_source.html">Types.hpp</a>.</p> |
| 127 | </div><h2 class="groupheader">Member Typedef Documentation</h2> |
| 128 | <a id="acaddf65e487df26a73b4e90cbfc0ada9"></a> |
| 129 | <h2 class="memtitle"><span class="permalink"><a href="#acaddf65e487df26a73b4e90cbfc0ada9">◆ </a></span>ArrayType</h2> |
| 130 | |
| 131 | <div class="memitem"> |
| 132 | <div class="memproto"> |
| 133 | <table class="memname"> |
| 134 | <tr> |
| 135 | <td class="memname">using <a class="el" href="classarmnn_1_1_permutation_vector.html#acaddf65e487df26a73b4e90cbfc0ada9">ArrayType</a> = std::array<<a class="el" href="classarmnn_1_1_permutation_vector.html#a9e70f27e3e424e90566080423b1fe2db">ValueType</a>, <a class="el" href="namespacearmnn.html#abdcd184ed3bd648bb31d385040cafd5d">MaxNumOfTensorDimensions</a>></td> |
| 136 | </tr> |
| 137 | </table> |
| 138 | </div><div class="memdoc"> |
| 139 | |
| 140 | <p class="definition">Definition at line <a class="el" href="_types_8hpp_source.html#l00175">175</a> of file <a class="el" href="_types_8hpp_source.html">Types.hpp</a>.</p> |
| 141 | |
| 142 | </div> |
| 143 | </div> |
| 144 | <a id="a065e980f27e65a118d3b071ab077cfda"></a> |
| 145 | <h2 class="memtitle"><span class="permalink"><a href="#a065e980f27e65a118d3b071ab077cfda">◆ </a></span>ConstIterator</h2> |
| 146 | |
| 147 | <div class="memitem"> |
| 148 | <div class="memproto"> |
| 149 | <table class="memname"> |
| 150 | <tr> |
| 151 | <td class="memname">using <a class="el" href="classarmnn_1_1_permutation_vector.html#a065e980f27e65a118d3b071ab077cfda">ConstIterator</a> = typename ArrayType::const_iterator</td> |
| 152 | </tr> |
| 153 | </table> |
| 154 | </div><div class="memdoc"> |
| 155 | |
| 156 | <p class="definition">Definition at line <a class="el" href="_types_8hpp_source.html#l00176">176</a> of file <a class="el" href="_types_8hpp_source.html">Types.hpp</a>.</p> |
| 157 | |
| 158 | </div> |
| 159 | </div> |
| 160 | <a id="a12b132c42f8e60ebc9669a3b333bb946"></a> |
| 161 | <h2 class="memtitle"><span class="permalink"><a href="#a12b132c42f8e60ebc9669a3b333bb946">◆ </a></span>SizeType</h2> |
| 162 | |
| 163 | <div class="memitem"> |
| 164 | <div class="memproto"> |
| 165 | <table class="memname"> |
| 166 | <tr> |
| 167 | <td class="memname">using <a class="el" href="classarmnn_1_1_permutation_vector.html#a12b132c42f8e60ebc9669a3b333bb946">SizeType</a> = unsigned int</td> |
| 168 | </tr> |
| 169 | </table> |
| 170 | </div><div class="memdoc"> |
| 171 | |
| 172 | <p class="definition">Definition at line <a class="el" href="_types_8hpp_source.html#l00174">174</a> of file <a class="el" href="_types_8hpp_source.html">Types.hpp</a>.</p> |
| 173 | |
| 174 | </div> |
| 175 | </div> |
| 176 | <a id="a9e70f27e3e424e90566080423b1fe2db"></a> |
| 177 | <h2 class="memtitle"><span class="permalink"><a href="#a9e70f27e3e424e90566080423b1fe2db">◆ </a></span>ValueType</h2> |
| 178 | |
| 179 | <div class="memitem"> |
| 180 | <div class="memproto"> |
| 181 | <table class="memname"> |
| 182 | <tr> |
| 183 | <td class="memname">using <a class="el" href="classarmnn_1_1_permutation_vector.html#a9e70f27e3e424e90566080423b1fe2db">ValueType</a> = unsigned int</td> |
| 184 | </tr> |
| 185 | </table> |
| 186 | </div><div class="memdoc"> |
| 187 | |
| 188 | <p class="definition">Definition at line <a class="el" href="_types_8hpp_source.html#l00173">173</a> of file <a class="el" href="_types_8hpp_source.html">Types.hpp</a>.</p> |
| 189 | |
| 190 | </div> |
| 191 | </div> |
| 192 | <h2 class="groupheader">Constructor & Destructor Documentation</h2> |
| 193 | <a id="a399359e369b182e7c86840d7b6a38c41"></a> |
| 194 | <h2 class="memtitle"><span class="permalink"><a href="#a399359e369b182e7c86840d7b6a38c41">◆ </a></span>PermutationVector() <span class="overload">[1/2]</span></h2> |
| 195 | |
| 196 | <div class="memitem"> |
| 197 | <div class="memproto"> |
| 198 | <table class="memname"> |
| 199 | <tr> |
| 200 | <td class="memname"><a class="el" href="classarmnn_1_1_permutation_vector.html">PermutationVector</a> </td> |
| 201 | <td>(</td> |
| 202 | <td class="paramtype">const <a class="el" href="classarmnn_1_1_permutation_vector.html#a9e70f27e3e424e90566080423b1fe2db">ValueType</a> * </td> |
| 203 | <td class="paramname"><em>dimMappings</em>, </td> |
| 204 | </tr> |
| 205 | <tr> |
| 206 | <td class="paramkey"></td> |
| 207 | <td></td> |
| 208 | <td class="paramtype"><a class="el" href="classarmnn_1_1_permutation_vector.html#a12b132c42f8e60ebc9669a3b333bb946">SizeType</a> </td> |
| 209 | <td class="paramname"><em>numDimMappings</em> </td> |
| 210 | </tr> |
| 211 | <tr> |
| 212 | <td></td> |
| 213 | <td>)</td> |
| 214 | <td></td><td></td> |
| 215 | </tr> |
| 216 | </table> |
| 217 | </div><div class="memdoc"> |
| 218 | <dl class="params"><dt>Parameters</dt><dd> |
| 219 | <table class="params"> |
| 220 | <tr><td class="paramname">dimMappings</td><td>- Indicates how to translate tensor elements from a given source into the target destination, when source and target potentially have different memory layouts.</td></tr> |
| 221 | </table> |
| 222 | </dd> |
| 223 | </dl> |
| 224 | <p>E.g. For a 4-d tensor laid out in a memory with the format (Batch Element, Height, Width, Channels), which is to be passed as an input to ArmNN, each source dimension is mapped to the corresponding ArmNN dimension. The Batch dimension remains the same (0 -> 0). The source Height dimension is mapped to the location of the ArmNN Height dimension (1 -> 2). Similar arguments are made for the Width and Channels (2 -> 3 and 3 -> 1). This will lead to m_DimMappings pointing to the following array: [ 0, 2, 3, 1 ].</p> |
| 225 | <p>Note that the mapping should be reversed if considering the case of ArmNN 4-d outputs (Batch Element, Channels, Height, Width) being written to a destination with the format mentioned above. We now have 0 -> 0, 2 -> 1, 3 -> 2, 1 -> 3, which, when reordered, lead to the following m_DimMappings contents: [ 0, 3, 1, 2 ]. </p> |
| 226 | |
| 227 | <p class="definition">Definition at line <a class="el" href="_descriptors_8cpp_source.html#l00018">18</a> of file <a class="el" href="_descriptors_8cpp_source.html">Descriptors.cpp</a>.</p> |
| 228 | |
| 229 | <p class="reference">References <a class="el" href="_types_8hpp_source.html#l00018">armnn::MaxNumOfTensorDimensions</a>.</p> |
| 230 | <div class="fragment"><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> {</div><div class="line"><a name="l00020"></a><span class="lineno"> 20</span>  <span class="comment">// Validation</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">if</span> (numDimMappings > <a class="code" href="namespacearmnn.html#abdcd184ed3bd648bb31d385040cafd5d">MaxNumOfTensorDimensions</a>)</div><div class="line"><a name="l00023"></a><span class="lineno"> 23</span>  {</div><div class="line"><a name="l00024"></a><span class="lineno"> 24</span>  boost::format fmt(<span class="stringliteral">"The number of mappings (%1%) cannot be greater "</span></div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>  <span class="stringliteral">"than the maximum number of dimensions supported (%2%)"</span>);</div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>  <span class="keywordflow">throw</span> InvalidArgumentException(boost::str(fmt % numDimMappings % <a class="code" href="namespacearmnn.html#abdcd184ed3bd648bb31d385040cafd5d">MaxNumOfTensorDimensions</a>));</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> </div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span>  <span class="keywordflow">if</span> ((dimMappings == <span class="keyword">nullptr</span>) && (numDimMappings != 0))</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="keywordflow">throw</span> InvalidArgumentException(<span class="stringliteral">"Dimension mappings must not be NULL if the number of mappings is positive"</span>);</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> </div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span>  <span class="keywordflow">for</span> (<a class="code" href="classarmnn_1_1_permutation_vector.html#a12b132c42f8e60ebc9669a3b333bb946">SizeType</a> i = 0; i < numDimMappings; ++i)</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="keyword">const</span> <a class="code" href="classarmnn_1_1_permutation_vector.html#a9e70f27e3e424e90566080423b1fe2db">ValueType</a> dstIndex = dimMappings[i];</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  <span class="keywordflow">if</span> (dstIndex >= numDimMappings)</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  {</div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  boost::format fmt(<span class="stringliteral">"Dimension mapping at index %1% is invalid: %2% is outside of the valid range [0,%3%]"</span>);</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  <span class="keywordflow">throw</span> InvalidArgumentException(boost::str(fmt % i % dstIndex % (numDimMappings - 1)));</div><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>  }</div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span> </div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  <span class="comment">// Validation: Detect duplicates</span></div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  {</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  std::array<bool, MaxNumOfTensorDimensions> observedDims;</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span>  observedDims.fill(<span class="keyword">false</span>);</div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span> </div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  <span class="keywordflow">for</span> (<a class="code" href="classarmnn_1_1_permutation_vector.html#a12b132c42f8e60ebc9669a3b333bb946">SizeType</a> i = 0; i < numDimMappings; ++i)</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="keyword">const</span> <a class="code" href="classarmnn_1_1_permutation_vector.html#a9e70f27e3e424e90566080423b1fe2db">ValueType</a> dstIndex = dimMappings[i];</div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  <span class="keywordflow">if</span> (observedDims[dstIndex])</div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  {</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  <span class="keywordflow">throw</span> InvalidArgumentException(<span class="stringliteral">"Invalid dimension mappings: Two or more source dimensions are mapped "</span></div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  <span class="stringliteral">"to the same output dimension"</span>);</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  }</div><div class="line"><a name="l00057"></a><span class="lineno"> 57</span>  observedDims[dstIndex] = <span class="keyword">true</span>;</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>  }</div><div class="line"><a name="l00060"></a><span class="lineno"> 60</span> </div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span>  <span class="comment">// Initialize</span></div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span>  <span class="keywordflow">for</span> (<a class="code" href="classarmnn_1_1_permutation_vector.html#a12b132c42f8e60ebc9669a3b333bb946">SizeType</a> i = 0; i < numDimMappings; ++i)</div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span>  {</div><div class="line"><a name="l00064"></a><span class="lineno"> 64</span>  m_DimMappings[i] = dimMappings[i];</div><div class="line"><a name="l00065"></a><span class="lineno"> 65</span>  }</div><div class="line"><a name="l00066"></a><span class="lineno"> 66</span>  m_NumDimMappings = numDimMappings;</div><div class="line"><a name="l00067"></a><span class="lineno"> 67</span> }</div><div class="ttc" id="classarmnn_1_1_permutation_vector_html_a12b132c42f8e60ebc9669a3b333bb946"><div class="ttname"><a href="classarmnn_1_1_permutation_vector.html#a12b132c42f8e60ebc9669a3b333bb946">armnn::PermutationVector::SizeType</a></div><div class="ttdeci">unsigned int SizeType</div><div class="ttdef"><b>Definition:</b> <a href="_types_8hpp_source.html#l00174">Types.hpp:174</a></div></div> |
| 231 | <div class="ttc" id="namespacearmnn_html_abdcd184ed3bd648bb31d385040cafd5d"><div class="ttname"><a href="namespacearmnn.html#abdcd184ed3bd648bb31d385040cafd5d">armnn::MaxNumOfTensorDimensions</a></div><div class="ttdeci">constexpr unsigned int MaxNumOfTensorDimensions</div><div class="ttdef"><b>Definition:</b> <a href="_types_8hpp_source.html#l00018">Types.hpp:18</a></div></div> |
| 232 | <div class="ttc" id="classarmnn_1_1_permutation_vector_html_a9e70f27e3e424e90566080423b1fe2db"><div class="ttname"><a href="classarmnn_1_1_permutation_vector.html#a9e70f27e3e424e90566080423b1fe2db">armnn::PermutationVector::ValueType</a></div><div class="ttdeci">unsigned int ValueType</div><div class="ttdef"><b>Definition:</b> <a href="_types_8hpp_source.html#l00173">Types.hpp:173</a></div></div> |
| 233 | </div><!-- fragment --> |
| 234 | </div> |
| 235 | </div> |
| 236 | <a id="adb9aad0dc5def92d5749a0efad1ead58"></a> |
| 237 | <h2 class="memtitle"><span class="permalink"><a href="#adb9aad0dc5def92d5749a0efad1ead58">◆ </a></span>PermutationVector() <span class="overload">[2/2]</span></h2> |
| 238 | |
| 239 | <div class="memitem"> |
| 240 | <div class="memproto"> |
| 241 | <table class="memname"> |
| 242 | <tr> |
| 243 | <td class="memname"><a class="el" href="classarmnn_1_1_permutation_vector.html">PermutationVector</a> </td> |
| 244 | <td>(</td> |
| 245 | <td class="paramtype">std::initializer_list< <a class="el" href="classarmnn_1_1_permutation_vector.html#a9e70f27e3e424e90566080423b1fe2db">ValueType</a> > </td> |
| 246 | <td class="paramname"><em>dimMappings</em></td><td>)</td> |
| 247 | <td></td> |
| 248 | </tr> |
| 249 | </table> |
| 250 | </div><div class="memdoc"> |
| 251 | |
| 252 | <p class="definition">Definition at line <a class="el" href="_descriptors_8cpp_source.html#l00069">69</a> of file <a class="el" href="_descriptors_8cpp_source.html">Descriptors.cpp</a>.</p> |
| 253 | <div class="fragment"><div class="line"><a name="l00070"></a><span class="lineno"> 70</span>  : <a class="code" href="classarmnn_1_1_permutation_vector.html#a399359e369b182e7c86840d7b6a38c41">PermutationVector</a>(dimMappings.begin(), boost::numeric_cast<<a class="code" href="classarmnn_1_1_permutation_vector.html#a12b132c42f8e60ebc9669a3b333bb946">SizeType</a>>(dimMappings.size()))</div><div class="line"><a name="l00071"></a><span class="lineno"> 71</span> {</div><div class="line"><a name="l00072"></a><span class="lineno"> 72</span> }</div><div class="ttc" id="classarmnn_1_1_permutation_vector_html_a399359e369b182e7c86840d7b6a38c41"><div class="ttname"><a href="classarmnn_1_1_permutation_vector.html#a399359e369b182e7c86840d7b6a38c41">armnn::PermutationVector::PermutationVector</a></div><div class="ttdeci">PermutationVector(const ValueType *dimMappings, SizeType numDimMappings)</div><div class="ttdef"><b>Definition:</b> <a href="_descriptors_8cpp_source.html#l00018">Descriptors.cpp:18</a></div></div> |
| 254 | <div class="ttc" id="classarmnn_1_1_permutation_vector_html_a12b132c42f8e60ebc9669a3b333bb946"><div class="ttname"><a href="classarmnn_1_1_permutation_vector.html#a12b132c42f8e60ebc9669a3b333bb946">armnn::PermutationVector::SizeType</a></div><div class="ttdeci">unsigned int SizeType</div><div class="ttdef"><b>Definition:</b> <a href="_types_8hpp_source.html#l00174">Types.hpp:174</a></div></div> |
| 255 | </div><!-- fragment --> |
| 256 | </div> |
| 257 | </div> |
| 258 | <h2 class="groupheader">Member Function Documentation</h2> |
| 259 | <a id="ad5fee900c7aee90671038c79225bf8ec"></a> |
| 260 | <h2 class="memtitle"><span class="permalink"><a href="#ad5fee900c7aee90671038c79225bf8ec">◆ </a></span>begin()</h2> |
| 261 | |
| 262 | <div class="memitem"> |
| 263 | <div class="memproto"> |
| 264 | <table class="mlabels"> |
| 265 | <tr> |
| 266 | <td class="mlabels-left"> |
| 267 | <table class="memname"> |
| 268 | <tr> |
| 269 | <td class="memname"><a class="el" href="classarmnn_1_1_permutation_vector.html#a065e980f27e65a118d3b071ab077cfda">ConstIterator</a> begin </td> |
| 270 | <td>(</td> |
| 271 | <td class="paramname"></td><td>)</td> |
| 272 | <td> const</td> |
| 273 | </tr> |
| 274 | </table> |
| 275 | </td> |
| 276 | <td class="mlabels-right"> |
| 277 | <span class="mlabels"><span class="mlabel">inline</span></span> </td> |
| 278 | </tr> |
| 279 | </table> |
| 280 | </div><div class="memdoc"> |
| 281 | |
| 282 | <p class="definition">Definition at line <a class="el" href="_types_8hpp_source.html#l00201">201</a> of file <a class="el" href="_types_8hpp_source.html">Types.hpp</a>.</p> |
| 283 | <div class="fragment"><div class="line"><a name="l00201"></a><span class="lineno"> 201</span> { <span class="keywordflow">return</span> m_DimMappings.begin(); }</div></div><!-- fragment --> |
| 284 | </div> |
| 285 | </div> |
| 286 | <a id="a69b6e2a03c835ca5d658a1f16acbaa9c"></a> |
| 287 | <h2 class="memtitle"><span class="permalink"><a href="#a69b6e2a03c835ca5d658a1f16acbaa9c">◆ </a></span>end()</h2> |
| 288 | |
| 289 | <div class="memitem"> |
| 290 | <div class="memproto"> |
| 291 | <table class="mlabels"> |
| 292 | <tr> |
| 293 | <td class="mlabels-left"> |
| 294 | <table class="memname"> |
| 295 | <tr> |
| 296 | <td class="memname"><a class="el" href="classarmnn_1_1_permutation_vector.html#a065e980f27e65a118d3b071ab077cfda">ConstIterator</a> end </td> |
| 297 | <td>(</td> |
| 298 | <td class="paramname"></td><td>)</td> |
| 299 | <td> const</td> |
| 300 | </tr> |
| 301 | </table> |
| 302 | </td> |
| 303 | <td class="mlabels-right"> |
| 304 | <span class="mlabels"><span class="mlabel">inline</span></span> </td> |
| 305 | </tr> |
| 306 | </table> |
| 307 | </div><div class="memdoc"> |
| 308 | |
| 309 | <p class="definition">Definition at line <a class="el" href="_types_8hpp_source.html#l00202">202</a> of file <a class="el" href="_types_8hpp_source.html">Types.hpp</a>.</p> |
| 310 | <div class="fragment"><div class="line"><a name="l00202"></a><span class="lineno"> 202</span> { <span class="keywordflow">return</span> m_DimMappings.end(); }</div></div><!-- fragment --> |
| 311 | </div> |
| 312 | </div> |
| 313 | <a id="a490ec6b59006d1fe1ec2ea30e69fb97c"></a> |
| 314 | <h2 class="memtitle"><span class="permalink"><a href="#a490ec6b59006d1fe1ec2ea30e69fb97c">◆ </a></span>GetSize()</h2> |
| 315 | |
| 316 | <div class="memitem"> |
| 317 | <div class="memproto"> |
| 318 | <table class="mlabels"> |
| 319 | <tr> |
| 320 | <td class="mlabels-left"> |
| 321 | <table class="memname"> |
| 322 | <tr> |
| 323 | <td class="memname"><a class="el" href="classarmnn_1_1_permutation_vector.html#a12b132c42f8e60ebc9669a3b333bb946">SizeType</a> GetSize </td> |
| 324 | <td>(</td> |
| 325 | <td class="paramname"></td><td>)</td> |
| 326 | <td> const</td> |
| 327 | </tr> |
| 328 | </table> |
| 329 | </td> |
| 330 | <td class="mlabels-right"> |
| 331 | <span class="mlabels"><span class="mlabel">inline</span></span> </td> |
| 332 | </tr> |
| 333 | </table> |
| 334 | </div><div class="memdoc"> |
| 335 | |
| 336 | <p class="definition">Definition at line <a class="el" href="_types_8hpp_source.html#l00199">199</a> of file <a class="el" href="_types_8hpp_source.html">Types.hpp</a>.</p> |
| 337 | |
| 338 | <p class="reference">Referenced by <a class="el" href="_types_8hpp_source.html#l00214">PermutationVector::IsInverse()</a>, <a class="el" href="_permute_8cpp_source.html#l00098">armnnUtils::Permuted()</a>, <a class="el" href="_workload_utils_8cpp_source.html#l00013">armnn::PermuteTensor()</a>, <a class="el" href="_permute_as_reshape_8hpp_source.html#l00018">PermuteAsReshapeImpl::Run()</a>, <a class="el" href="_workload_data_8cpp_source.html#l01272">PermuteQueueDescriptor::Validate()</a>, and <a class="el" href="_serializer_8cpp_source.html#l00797">SerializerVisitor::VisitPermuteLayer()</a>.</p> |
| 339 | <div class="fragment"><div class="line"><a name="l00199"></a><span class="lineno"> 199</span> { <span class="keywordflow">return</span> m_NumDimMappings; }</div></div><!-- fragment --> |
| 340 | </div> |
| 341 | </div> |
| 342 | <a id="aae44e4154aa80fba7616747450ff69d5"></a> |
| 343 | <h2 class="memtitle"><span class="permalink"><a href="#aae44e4154aa80fba7616747450ff69d5">◆ </a></span>IsEqual()</h2> |
| 344 | |
| 345 | <div class="memitem"> |
| 346 | <div class="memproto"> |
| 347 | <table class="mlabels"> |
| 348 | <tr> |
| 349 | <td class="mlabels-left"> |
| 350 | <table class="memname"> |
| 351 | <tr> |
| 352 | <td class="memname">bool IsEqual </td> |
| 353 | <td>(</td> |
| 354 | <td class="paramtype">const <a class="el" href="classarmnn_1_1_permutation_vector.html">PermutationVector</a> & </td> |
| 355 | <td class="paramname"><em>other</em></td><td>)</td> |
| 356 | <td> const</td> |
| 357 | </tr> |
| 358 | </table> |
| 359 | </td> |
| 360 | <td class="mlabels-right"> |
| 361 | <span class="mlabels"><span class="mlabel">inline</span></span> </td> |
| 362 | </tr> |
| 363 | </table> |
| 364 | </div><div class="memdoc"> |
| 365 | |
| 366 | <p class="definition">Definition at line <a class="el" href="_types_8hpp_source.html#l00204">204</a> of file <a class="el" href="_types_8hpp_source.html">Types.hpp</a>.</p> |
| 367 | |
| 368 | <p class="reference">Referenced by <a class="el" href="_permute_layer_8hpp_source.html#l00054">PermuteLayer::IsEqual()</a>, and <a class="el" href="_concat_test_impl_8cpp_source.html#l00171">PermuteInputsForConcat()</a>.</p> |
| 369 | <div class="fragment"><div class="line"><a name="l00205"></a><span class="lineno"> 205</span>  {</div><div class="line"><a name="l00206"></a><span class="lineno"> 206</span>  <span class="keywordflow">if</span> (m_NumDimMappings != other.m_NumDimMappings) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  <span class="keywordflow">for</span> (<span class="keywordtype">unsigned</span> <span class="keywordtype">int</span> i = 0; i < m_NumDimMappings; ++i)</div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  {</div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span>  <span class="keywordflow">if</span> (m_DimMappings[i] != other.m_DimMappings[i]) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00210"></a><span class="lineno"> 210</span>  }</div><div class="line"><a name="l00211"></a><span class="lineno"> 211</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00212"></a><span class="lineno"> 212</span>  }</div></div><!-- fragment --> |
| 370 | </div> |
| 371 | </div> |
| 372 | <a id="abca528420d32f4edad0b1425ad90f80e"></a> |
| 373 | <h2 class="memtitle"><span class="permalink"><a href="#abca528420d32f4edad0b1425ad90f80e">◆ </a></span>IsInverse()</h2> |
| 374 | |
| 375 | <div class="memitem"> |
| 376 | <div class="memproto"> |
| 377 | <table class="mlabels"> |
| 378 | <tr> |
| 379 | <td class="mlabels-left"> |
| 380 | <table class="memname"> |
| 381 | <tr> |
| 382 | <td class="memname">bool IsInverse </td> |
| 383 | <td>(</td> |
| 384 | <td class="paramtype">const <a class="el" href="classarmnn_1_1_permutation_vector.html">PermutationVector</a> & </td> |
| 385 | <td class="paramname"><em>other</em></td><td>)</td> |
| 386 | <td> const</td> |
| 387 | </tr> |
| 388 | </table> |
| 389 | </td> |
| 390 | <td class="mlabels-right"> |
| 391 | <span class="mlabels"><span class="mlabel">inline</span></span> </td> |
| 392 | </tr> |
| 393 | </table> |
| 394 | </div><div class="memdoc"> |
| 395 | |
| 396 | <p class="definition">Definition at line <a class="el" href="_types_8hpp_source.html#l00214">214</a> of file <a class="el" href="_types_8hpp_source.html">Types.hpp</a>.</p> |
| 397 | |
| 398 | <p class="reference">References <a class="el" href="_types_8hpp_source.html#l00199">PermutationVector::GetSize()</a>.</p> |
| 399 | |
| 400 | <p class="reference">Referenced by <a class="el" href="_permute_layer_8hpp_source.html#l00045">PermuteLayer::IsInverse()</a>.</p> |
| 401 | <div class="fragment"><div class="line"><a name="l00215"></a><span class="lineno"> 215</span>  {</div><div class="line"><a name="l00216"></a><span class="lineno"> 216</span>  <span class="keywordtype">bool</span> isInverse = (<a class="code" href="classarmnn_1_1_permutation_vector.html#a490ec6b59006d1fe1ec2ea30e69fb97c">GetSize</a>() == other.GetSize());</div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  <span class="keywordflow">for</span> (<a class="code" href="classarmnn_1_1_permutation_vector.html#a12b132c42f8e60ebc9669a3b333bb946">SizeType</a> i = 0; isInverse && (i < <a class="code" href="classarmnn_1_1_permutation_vector.html#a490ec6b59006d1fe1ec2ea30e69fb97c">GetSize</a>()); ++i)</div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span>  {</div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span>  isInverse = (m_DimMappings[other.m_DimMappings[i]] == i);</div><div class="line"><a name="l00220"></a><span class="lineno"> 220</span>  }</div><div class="line"><a name="l00221"></a><span class="lineno"> 221</span>  <span class="keywordflow">return</span> isInverse;</div><div class="line"><a name="l00222"></a><span class="lineno"> 222</span>  }</div><div class="ttc" id="classarmnn_1_1_permutation_vector_html_a12b132c42f8e60ebc9669a3b333bb946"><div class="ttname"><a href="classarmnn_1_1_permutation_vector.html#a12b132c42f8e60ebc9669a3b333bb946">armnn::PermutationVector::SizeType</a></div><div class="ttdeci">unsigned int SizeType</div><div class="ttdef"><b>Definition:</b> <a href="_types_8hpp_source.html#l00174">Types.hpp:174</a></div></div> |
| 402 | <div class="ttc" id="classarmnn_1_1_permutation_vector_html_a490ec6b59006d1fe1ec2ea30e69fb97c"><div class="ttname"><a href="classarmnn_1_1_permutation_vector.html#a490ec6b59006d1fe1ec2ea30e69fb97c">armnn::PermutationVector::GetSize</a></div><div class="ttdeci">SizeType GetSize() const</div><div class="ttdef"><b>Definition:</b> <a href="_types_8hpp_source.html#l00199">Types.hpp:199</a></div></div> |
| 403 | </div><!-- fragment --> |
| 404 | </div> |
| 405 | </div> |
| 406 | <a id="a86e55f7d14b21da3b31280412be96bd7"></a> |
| 407 | <h2 class="memtitle"><span class="permalink"><a href="#a86e55f7d14b21da3b31280412be96bd7">◆ </a></span>operator[]()</h2> |
| 408 | |
| 409 | <div class="memitem"> |
| 410 | <div class="memproto"> |
| 411 | <table class="mlabels"> |
| 412 | <tr> |
| 413 | <td class="mlabels-left"> |
| 414 | <table class="memname"> |
| 415 | <tr> |
| 416 | <td class="memname"><a class="el" href="classarmnn_1_1_permutation_vector.html#a9e70f27e3e424e90566080423b1fe2db">ValueType</a> operator[] </td> |
| 417 | <td>(</td> |
| 418 | <td class="paramtype"><a class="el" href="classarmnn_1_1_permutation_vector.html#a12b132c42f8e60ebc9669a3b333bb946">SizeType</a> </td> |
| 419 | <td class="paramname"><em>i</em></td><td>)</td> |
| 420 | <td> const</td> |
| 421 | </tr> |
| 422 | </table> |
| 423 | </td> |
| 424 | <td class="mlabels-right"> |
| 425 | <span class="mlabels"><span class="mlabel">inline</span></span> </td> |
| 426 | </tr> |
| 427 | </table> |
| 428 | </div><div class="memdoc"> |
| 429 | |
| 430 | <p class="definition">Definition at line <a class="el" href="_types_8hpp_source.html#l00197">197</a> of file <a class="el" href="_types_8hpp_source.html">Types.hpp</a>.</p> |
| 431 | <div class="fragment"><div class="line"><a name="l00197"></a><span class="lineno"> 197</span> { <span class="keywordflow">return</span> m_DimMappings.at(i); }</div></div><!-- fragment --> |
| 432 | </div> |
| 433 | </div> |
| 434 | <hr/>The documentation for this class was generated from the following files:<ul> |
| 435 | <li>include/armnn/<a class="el" href="_types_8hpp_source.html">Types.hpp</a></li> |
| 436 | <li>src/armnn/<a class="el" href="_descriptors_8cpp_source.html">Descriptors.cpp</a></li> |
| 437 | </ul> |
| 438 | </div><!-- contents --> |
| 439 | </div><!-- doc-content --> |
| 440 | <!-- start footer part --> |
| 441 | <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> |
| 442 | <ul> |
| 443 | <li class="navelem"><a class="el" href="namespacearmnn.html">armnn</a></li><li class="navelem"><a class="el" href="classarmnn_1_1_permutation_vector.html">PermutationVector</a></li> |
| 444 | <li class="footer">Generated on Fri Mar 13 2020 16:07:04 for ArmNN by |
| 445 | <a href="http://www.doxygen.org/index.html"> |
| 446 | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li> |
| 447 | </ul> |
| 448 | </div> |
| 449 | </body> |
| 450 | </html> |