Nikhil Raj | cb06309 | 2022-11-23 11:05:29 +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: TransposeAsReshapeImpl Class 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">22.11</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('classarmnn_1_1optimizations_1_1_transpose_as_reshape_impl.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="#pub-methods">Public Member Functions</a> | |
| 99 | <a href="#pro-methods">Protected Member Functions</a> | |
| 100 | <a href="classarmnn_1_1optimizations_1_1_transpose_as_reshape_impl-members.xhtml">List of all members</a> </div> |
| 101 | <div class="headertitle"> |
| 102 | <div class="title">TransposeAsReshapeImpl Class Reference</div> </div> |
| 103 | </div><!--header--> |
| 104 | <div class="contents"> |
| 105 | |
| 106 | <p><code>#include <<a class="el" href="_transpose_as_reshape_8hpp_source.xhtml">TransposeAsReshape.hpp</a>></code></p> |
| 107 | <table class="memberdecls"> |
| 108 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> |
| 109 | Public Member Functions</h2></td></tr> |
| 110 | <tr class="memitem:a19561272a3ac41cb5cb0175eb4567044"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1optimizations_1_1_transpose_as_reshape_impl.xhtml#a19561272a3ac41cb5cb0175eb4567044">Run</a> (<a class="el" href="classarmnn_1_1_graph.xhtml">Graph</a> &graph, <a class="el" href="classarmnn_1_1_transpose_layer.xhtml">TransposeLayer</a> &transpose) const</td></tr> |
| 111 | <tr class="memdesc:a19561272a3ac41cb5cb0175eb4567044"><td class="mdescLeft"> </td><td class="mdescRight">Run for every <a class="el" href="classarmnn_1_1_transpose_layer.xhtml" title="This layer represents a transpose operation. ">TransposeLayer</a>. Replaces it with a <a class="el" href="classarmnn_1_1_reshape_layer.xhtml" title="This layer represents a reshape operation. ">ReshapeLayer</a> if they are equivalent. <a href="#a19561272a3ac41cb5cb0175eb4567044">More...</a><br /></td></tr> |
| 112 | <tr class="separator:a19561272a3ac41cb5cb0175eb4567044"><td class="memSeparator" colspan="2"> </td></tr> |
| 113 | </table><table class="memberdecls"> |
| 114 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a> |
| 115 | Protected Member Functions</h2></td></tr> |
| 116 | <tr class="memitem:abb9b7c45f4778dbcccf54e70f0052a77"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1optimizations_1_1_transpose_as_reshape_impl.xhtml#abb9b7c45f4778dbcccf54e70f0052a77">TransposeAsReshapeImpl</a> ()=default</td></tr> |
| 117 | <tr class="separator:abb9b7c45f4778dbcccf54e70f0052a77"><td class="memSeparator" colspan="2"> </td></tr> |
| 118 | <tr class="memitem:a18c7efcc9689f0d8dfdd9fe556eda140"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1optimizations_1_1_transpose_as_reshape_impl.xhtml#a18c7efcc9689f0d8dfdd9fe556eda140">~TransposeAsReshapeImpl</a> ()=default</td></tr> |
| 119 | <tr class="separator:a18c7efcc9689f0d8dfdd9fe556eda140"><td class="memSeparator" colspan="2"> </td></tr> |
| 120 | </table> |
| 121 | <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> |
| 122 | <div class="textblock"> |
| 123 | <p class="definition">Definition at line <a class="el" href="_transpose_as_reshape_8hpp_source.xhtml#l00014">14</a> of file <a class="el" href="_transpose_as_reshape_8hpp_source.xhtml">TransposeAsReshape.hpp</a>.</p> |
| 124 | </div><h2 class="groupheader">Constructor & Destructor Documentation</h2> |
| 125 | <a id="abb9b7c45f4778dbcccf54e70f0052a77"></a> |
| 126 | <h2 class="memtitle"><span class="permalink"><a href="#abb9b7c45f4778dbcccf54e70f0052a77">◆ </a></span>TransposeAsReshapeImpl()</h2> |
| 127 | |
| 128 | <div class="memitem"> |
| 129 | <div class="memproto"> |
| 130 | <table class="mlabels"> |
| 131 | <tr> |
| 132 | <td class="mlabels-left"> |
| 133 | <table class="memname"> |
| 134 | <tr> |
| 135 | <td class="memname"><a class="el" href="classarmnn_1_1optimizations_1_1_transpose_as_reshape_impl.xhtml">TransposeAsReshapeImpl</a> </td> |
| 136 | <td>(</td> |
| 137 | <td class="paramname"></td><td>)</td> |
| 138 | <td></td> |
| 139 | </tr> |
| 140 | </table> |
| 141 | </td> |
| 142 | <td class="mlabels-right"> |
| 143 | <span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">default</span></span> </td> |
| 144 | </tr> |
| 145 | </table> |
| 146 | </div><div class="memdoc"> |
| 147 | |
| 148 | <p class="reference">Referenced by <a class="el" href="_transpose_as_reshape_8hpp_source.xhtml#l00018">TransposeAsReshapeImpl::Run()</a>.</p> |
| 149 | |
| 150 | </div> |
| 151 | </div> |
| 152 | <a id="a18c7efcc9689f0d8dfdd9fe556eda140"></a> |
| 153 | <h2 class="memtitle"><span class="permalink"><a href="#a18c7efcc9689f0d8dfdd9fe556eda140">◆ </a></span>~TransposeAsReshapeImpl()</h2> |
| 154 | |
| 155 | <div class="memitem"> |
| 156 | <div class="memproto"> |
| 157 | <table class="mlabels"> |
| 158 | <tr> |
| 159 | <td class="mlabels-left"> |
| 160 | <table class="memname"> |
| 161 | <tr> |
| 162 | <td class="memname">~<a class="el" href="classarmnn_1_1optimizations_1_1_transpose_as_reshape_impl.xhtml">TransposeAsReshapeImpl</a> </td> |
| 163 | <td>(</td> |
| 164 | <td class="paramname"></td><td>)</td> |
| 165 | <td></td> |
| 166 | </tr> |
| 167 | </table> |
| 168 | </td> |
| 169 | <td class="mlabels-right"> |
| 170 | <span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">default</span></span> </td> |
| 171 | </tr> |
| 172 | </table> |
| 173 | </div><div class="memdoc"> |
| 174 | |
| 175 | <p class="reference">Referenced by <a class="el" href="_transpose_as_reshape_8hpp_source.xhtml#l00018">TransposeAsReshapeImpl::Run()</a>.</p> |
| 176 | |
| 177 | </div> |
| 178 | </div> |
| 179 | <h2 class="groupheader">Member Function Documentation</h2> |
| 180 | <a id="a19561272a3ac41cb5cb0175eb4567044"></a> |
| 181 | <h2 class="memtitle"><span class="permalink"><a href="#a19561272a3ac41cb5cb0175eb4567044">◆ </a></span>Run()</h2> |
| 182 | |
| 183 | <div class="memitem"> |
| 184 | <div class="memproto"> |
| 185 | <table class="mlabels"> |
| 186 | <tr> |
| 187 | <td class="mlabels-left"> |
| 188 | <table class="memname"> |
| 189 | <tr> |
| 190 | <td class="memname">void Run </td> |
| 191 | <td>(</td> |
| 192 | <td class="paramtype"><a class="el" href="classarmnn_1_1_graph.xhtml">Graph</a> & </td> |
| 193 | <td class="paramname"><em>graph</em>, </td> |
| 194 | </tr> |
| 195 | <tr> |
| 196 | <td class="paramkey"></td> |
| 197 | <td></td> |
| 198 | <td class="paramtype"><a class="el" href="classarmnn_1_1_transpose_layer.xhtml">TransposeLayer</a> & </td> |
| 199 | <td class="paramname"><em>transpose</em> </td> |
| 200 | </tr> |
| 201 | <tr> |
| 202 | <td></td> |
| 203 | <td>)</td> |
| 204 | <td></td><td> const</td> |
| 205 | </tr> |
| 206 | </table> |
| 207 | </td> |
| 208 | <td class="mlabels-right"> |
| 209 | <span class="mlabels"><span class="mlabel">inline</span></span> </td> |
| 210 | </tr> |
| 211 | </table> |
| 212 | </div><div class="memdoc"> |
| 213 | |
| 214 | <p>Run for every <a class="el" href="classarmnn_1_1_transpose_layer.xhtml" title="This layer represents a transpose operation. ">TransposeLayer</a>. Replaces it with a <a class="el" href="classarmnn_1_1_reshape_layer.xhtml" title="This layer represents a reshape operation. ">ReshapeLayer</a> if they are equivalent. </p> |
| 215 | |
| 216 | <p class="definition">Definition at line <a class="el" href="_transpose_as_reshape_8hpp_source.xhtml#l00018">18</a> of file <a class="el" href="_transpose_as_reshape_8hpp_source.xhtml">TransposeAsReshape.hpp</a>.</p> |
| 217 | |
| 218 | <p class="reference">References <a class="el" href="_layer_8hpp_source.xhtml#l00324">Layer::GetInputSlot()</a>, <a class="el" href="_layer_8hpp_source.xhtml#l00319">Layer::GetName()</a>, <a class="el" href="_layer_8hpp_source.xhtml#l00232">Layer::GetOutputHandler()</a>, <a class="el" href="_layer_8hpp_source.xhtml#l00326">Layer::GetOutputSlot()</a>, <a class="el" href="_transpose_layer_8hpp_source.xhtml#l00038">TransposeLayer::GetPermutation()</a>, <a class="el" href="_tensor_8hpp_source.xhtml#l00191">TensorInfo::GetShape()</a>, <a class="el" href="_types_8hpp_source.xhtml#l00338">PermutationVector::GetSize()</a>, <a class="el" href="_output_handler_8hpp_source.xhtml#l00042">OutputHandler::GetTensorInfo()</a>, <a class="el" href="_graph_8hpp_source.xhtml#l00471">Graph::InsertNewLayer()</a>, <a class="el" href="_layer_8cpp_source.xhtml#l00145">OutputSlot::MoveAllConnections()</a>, <a class="el" href="classarmnn_1_1optimizations_1_1_transpose_as_reshape_impl.xhtml#abb9b7c45f4778dbcccf54e70f0052a77">TransposeAsReshapeImpl::TransposeAsReshapeImpl()</a>, and <a class="el" href="classarmnn_1_1optimizations_1_1_transpose_as_reshape_impl.xhtml#a18c7efcc9689f0d8dfdd9fe556eda140">TransposeAsReshapeImpl::~TransposeAsReshapeImpl()</a>.</p> |
| 219 | <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="keywordflow">if</span> (IsReshape(transpose))</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="keyword">const</span> TensorInfo& outInfo = transpose.GetOutputHandler().GetTensorInfo();</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>  <span class="keyword">const</span> std::string name = std::string(<span class="stringliteral">"as_reshape-"</span>) + transpose.GetName();</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span>  <span class="keyword">const</span> ReshapeDescriptor descriptor{outInfo.GetShape()};</div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>  <span class="comment">// Inserts NewLayer so layers don't need to be re-sorted.</span></div><div class="line"><a name="l00027"></a><span class="lineno"> 27</span>  <span class="keyword">auto</span> reshape = graph.InsertNewLayer<ReshapeLayer>(transpose.GetInputSlot(0), descriptor, name.c_str());</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="comment">// Bypass transpose. It will be deleted since it's left unconnected.</span></div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  transpose.GetOutputSlot().MoveAllConnections(reshape->GetOutputSlot());</div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  }</div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span>  }</div></div><!-- fragment --> |
| 220 | </div> |
| 221 | </div> |
| 222 | <hr/>The documentation for this class was generated from the following file:<ul> |
| 223 | <li>src/armnn/optimizations/<a class="el" href="_transpose_as_reshape_8hpp_source.xhtml">TransposeAsReshape.hpp</a></li> |
| 224 | </ul> |
| 225 | </div><!-- contents --> |
| 226 | </div><!-- doc-content --> |
| 227 | <!-- start footer part --> |
| 228 | <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> |
| 229 | <ul> |
| 230 | <li class="navelem"><a class="el" href="namespacearmnn.xhtml">armnn</a></li><li class="navelem"><a class="el" href="namespacearmnn_1_1optimizations.xhtml">optimizations</a></li><li class="navelem"><a class="el" href="classarmnn_1_1optimizations_1_1_transpose_as_reshape_impl.xhtml">TransposeAsReshapeImpl</a></li> |
| 231 | <li class="footer">Generated on Wed Nov 23 2022 10:57:43 for ArmNN by |
| 232 | <a href="http://www.doxygen.org/index.html"> |
| 233 | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li> |
| 234 | </ul> |
| 235 | </div> |
| 236 | </body> |
| 237 | </html> |