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: PermuteAsReshapeImpl 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_1optimizations_1_1_permute_as_reshape_impl.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-methods">Public Member Functions</a> | |
| 85 | <a href="#pro-methods">Protected Member Functions</a> | |
| 86 | <a href="classarmnn_1_1optimizations_1_1_permute_as_reshape_impl-members.html">List of all members</a> </div> |
| 87 | <div class="headertitle"> |
| 88 | <div class="title">PermuteAsReshapeImpl Class Reference</div> </div> |
| 89 | </div><!--header--> |
| 90 | <div class="contents"> |
| 91 | |
| 92 | <p><code>#include <<a class="el" href="_permute_as_reshape_8hpp_source.html">PermuteAsReshape.hpp</a>></code></p> |
| 93 | <table class="memberdecls"> |
| 94 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a> |
| 95 | Public Member Functions</h2></td></tr> |
| 96 | <tr class="memitem:a7cfd1a6e7722db6e3002642e2f6e89e0"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1optimizations_1_1_permute_as_reshape_impl.html#a7cfd1a6e7722db6e3002642e2f6e89e0">Run</a> (<a class="el" href="classarmnn_1_1_graph.html">Graph</a> &graph, <a class="el" href="classarmnn_1_1_permute_layer.html">PermuteLayer</a> &permute) const</td></tr> |
| 97 | <tr class="memdesc:a7cfd1a6e7722db6e3002642e2f6e89e0"><td class="mdescLeft"> </td><td class="mdescRight">Run for every <a class="el" href="classarmnn_1_1_permute_layer.html" title="This layer represents a permutation operation. ">PermuteLayer</a>. Replaces it with a <a class="el" href="classarmnn_1_1_reshape_layer.html" title="This layer represents a reshape operation. ">ReshapeLayer</a> if they are equivalent. <a href="#a7cfd1a6e7722db6e3002642e2f6e89e0">More...</a><br /></td></tr> |
| 98 | <tr class="separator:a7cfd1a6e7722db6e3002642e2f6e89e0"><td class="memSeparator" colspan="2"> </td></tr> |
| 99 | </table><table class="memberdecls"> |
| 100 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a> |
| 101 | Protected Member Functions</h2></td></tr> |
| 102 | <tr class="memitem:a3c81542d57760fefbc213f38e9cae7b4"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1optimizations_1_1_permute_as_reshape_impl.html#a3c81542d57760fefbc213f38e9cae7b4">PermuteAsReshapeImpl</a> ()=default</td></tr> |
| 103 | <tr class="separator:a3c81542d57760fefbc213f38e9cae7b4"><td class="memSeparator" colspan="2"> </td></tr> |
| 104 | <tr class="memitem:aeb8116e5ff0ef44c6803ee3b9659a180"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1optimizations_1_1_permute_as_reshape_impl.html#aeb8116e5ff0ef44c6803ee3b9659a180">~PermuteAsReshapeImpl</a> ()=default</td></tr> |
| 105 | <tr class="separator:aeb8116e5ff0ef44c6803ee3b9659a180"><td class="memSeparator" colspan="2"> </td></tr> |
| 106 | </table> |
| 107 | <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> |
| 108 | <div class="textblock"> |
| 109 | <p class="definition">Definition at line <a class="el" href="_permute_as_reshape_8hpp_source.html#l00014">14</a> of file <a class="el" href="_permute_as_reshape_8hpp_source.html">PermuteAsReshape.hpp</a>.</p> |
| 110 | </div><h2 class="groupheader">Constructor & Destructor Documentation</h2> |
| 111 | <a id="a3c81542d57760fefbc213f38e9cae7b4"></a> |
| 112 | <h2 class="memtitle"><span class="permalink"><a href="#a3c81542d57760fefbc213f38e9cae7b4">◆ </a></span>PermuteAsReshapeImpl()</h2> |
| 113 | |
| 114 | <div class="memitem"> |
| 115 | <div class="memproto"> |
| 116 | <table class="mlabels"> |
| 117 | <tr> |
| 118 | <td class="mlabels-left"> |
| 119 | <table class="memname"> |
| 120 | <tr> |
| 121 | <td class="memname"><a class="el" href="classarmnn_1_1optimizations_1_1_permute_as_reshape_impl.html">PermuteAsReshapeImpl</a> </td> |
| 122 | <td>(</td> |
| 123 | <td class="paramname"></td><td>)</td> |
| 124 | <td></td> |
| 125 | </tr> |
| 126 | </table> |
| 127 | </td> |
| 128 | <td class="mlabels-right"> |
| 129 | <span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">default</span></span> </td> |
| 130 | </tr> |
| 131 | </table> |
| 132 | </div><div class="memdoc"> |
| 133 | |
| 134 | <p class="reference">Referenced by <a class="el" href="_permute_as_reshape_8hpp_source.html#l00018">PermuteAsReshapeImpl::Run()</a>.</p> |
| 135 | |
| 136 | </div> |
| 137 | </div> |
| 138 | <a id="aeb8116e5ff0ef44c6803ee3b9659a180"></a> |
| 139 | <h2 class="memtitle"><span class="permalink"><a href="#aeb8116e5ff0ef44c6803ee3b9659a180">◆ </a></span>~PermuteAsReshapeImpl()</h2> |
| 140 | |
| 141 | <div class="memitem"> |
| 142 | <div class="memproto"> |
| 143 | <table class="mlabels"> |
| 144 | <tr> |
| 145 | <td class="mlabels-left"> |
| 146 | <table class="memname"> |
| 147 | <tr> |
| 148 | <td class="memname">~<a class="el" href="classarmnn_1_1optimizations_1_1_permute_as_reshape_impl.html">PermuteAsReshapeImpl</a> </td> |
| 149 | <td>(</td> |
| 150 | <td class="paramname"></td><td>)</td> |
| 151 | <td></td> |
| 152 | </tr> |
| 153 | </table> |
| 154 | </td> |
| 155 | <td class="mlabels-right"> |
| 156 | <span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">default</span></span> </td> |
| 157 | </tr> |
| 158 | </table> |
| 159 | </div><div class="memdoc"> |
| 160 | |
| 161 | <p class="reference">Referenced by <a class="el" href="_permute_as_reshape_8hpp_source.html#l00018">PermuteAsReshapeImpl::Run()</a>.</p> |
| 162 | |
| 163 | </div> |
| 164 | </div> |
| 165 | <h2 class="groupheader">Member Function Documentation</h2> |
| 166 | <a id="a7cfd1a6e7722db6e3002642e2f6e89e0"></a> |
| 167 | <h2 class="memtitle"><span class="permalink"><a href="#a7cfd1a6e7722db6e3002642e2f6e89e0">◆ </a></span>Run()</h2> |
| 168 | |
| 169 | <div class="memitem"> |
| 170 | <div class="memproto"> |
| 171 | <table class="mlabels"> |
| 172 | <tr> |
| 173 | <td class="mlabels-left"> |
| 174 | <table class="memname"> |
| 175 | <tr> |
| 176 | <td class="memname">void Run </td> |
| 177 | <td>(</td> |
| 178 | <td class="paramtype"><a class="el" href="classarmnn_1_1_graph.html">Graph</a> & </td> |
| 179 | <td class="paramname"><em>graph</em>, </td> |
| 180 | </tr> |
| 181 | <tr> |
| 182 | <td class="paramkey"></td> |
| 183 | <td></td> |
| 184 | <td class="paramtype"><a class="el" href="classarmnn_1_1_permute_layer.html">PermuteLayer</a> & </td> |
| 185 | <td class="paramname"><em>permute</em> </td> |
| 186 | </tr> |
| 187 | <tr> |
| 188 | <td></td> |
| 189 | <td>)</td> |
| 190 | <td></td><td> const</td> |
| 191 | </tr> |
| 192 | </table> |
| 193 | </td> |
| 194 | <td class="mlabels-right"> |
| 195 | <span class="mlabels"><span class="mlabel">inline</span></span> </td> |
| 196 | </tr> |
| 197 | </table> |
| 198 | </div><div class="memdoc"> |
| 199 | |
| 200 | <p>Run for every <a class="el" href="classarmnn_1_1_permute_layer.html" title="This layer represents a permutation operation. ">PermuteLayer</a>. Replaces it with a <a class="el" href="classarmnn_1_1_reshape_layer.html" title="This layer represents a reshape operation. ">ReshapeLayer</a> if they are equivalent. </p> |
| 201 | |
| 202 | <p class="definition">Definition at line <a class="el" href="_permute_as_reshape_8hpp_source.html#l00018">18</a> of file <a class="el" href="_permute_as_reshape_8hpp_source.html">PermuteAsReshape.hpp</a>.</p> |
| 203 | |
| 204 | <p class="reference">References <a class="el" href="_layer_8hpp_source.html#l00310">Layer::GetInputSlot()</a>, <a class="el" href="_layer_8hpp_source.html#l00305">Layer::GetName()</a>, <a class="el" href="_layer_8hpp_source.html#l00221">Layer::GetOutputHandler()</a>, <a class="el" href="_layer_8hpp_source.html#l00312">Layer::GetOutputSlot()</a>, <a class="el" href="_permute_layer_8hpp_source.html#l00037">PermuteLayer::GetPermutation()</a>, <a class="el" href="_tensor_8hpp_source.html#l00088">TensorInfo::GetShape()</a>, <a class="el" href="_types_8hpp_source.html#l00199">PermutationVector::GetSize()</a>, <a class="el" href="_output_handler_8hpp_source.html#l00044">OutputHandler::GetTensorInfo()</a>, <a class="el" href="_graph_8hpp_source.html#l00409">Graph::InsertNewLayer()</a>, <a class="el" href="_layer_8cpp_source.html#l00112">OutputSlot::MoveAllConnections()</a>, <a class="el" href="classarmnn_1_1optimizations_1_1_permute_as_reshape_impl.html#a3c81542d57760fefbc213f38e9cae7b4">PermuteAsReshapeImpl::PermuteAsReshapeImpl()</a>, <a class="el" href="_output_handler_8cpp_source.html#l00017">OutputHandler::SetTensorInfo()</a>, and <a class="el" href="classarmnn_1_1optimizations_1_1_permute_as_reshape_impl.html#aeb8116e5ff0ef44c6803ee3b9659a180">PermuteAsReshapeImpl::~PermuteAsReshapeImpl()</a>.</p> |
| 205 | <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(permute))</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 = permute.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>) + permute.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>(permute.GetInputSlot(0), descriptor, name.c_str());</div><div class="line"><a name="l00028"></a><span class="lineno"> 28</span>  reshape->GetOutputHandler().SetTensorInfo(outInfo);</div><div class="line"><a name="l00029"></a><span class="lineno"> 29</span> </div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span>  <span class="comment">// Bypass permute. It will be deleted since it's left unconnected.</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span>  permute.GetOutputSlot().MoveAllConnections(reshape->GetOutputSlot());</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><!-- fragment --> |
| 206 | </div> |
| 207 | </div> |
| 208 | <hr/>The documentation for this class was generated from the following file:<ul> |
| 209 | <li>src/armnn/optimizations/<a class="el" href="_permute_as_reshape_8hpp_source.html">PermuteAsReshape.hpp</a></li> |
| 210 | </ul> |
| 211 | </div><!-- contents --> |
| 212 | </div><!-- doc-content --> |
| 213 | <!-- start footer part --> |
| 214 | <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> |
| 215 | <ul> |
| 216 | <li class="navelem"><a class="el" href="namespacearmnn.html">armnn</a></li><li class="navelem"><a class="el" href="namespacearmnn_1_1optimizations.html">optimizations</a></li><li class="navelem"><a class="el" href="classarmnn_1_1optimizations_1_1_permute_as_reshape_impl.html">PermuteAsReshapeImpl</a></li> |
| 217 | <li class="footer">Generated on Fri Mar 13 2020 16:07:05 for ArmNN by |
| 218 | <a href="http://www.doxygen.org/index.html"> |
| 219 | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li> |
| 220 | </ul> |
| 221 | </div> |
| 222 | </body> |
| 223 | </html> |