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: MovePermuteUpImpl 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_move_permute_up_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_move_permute_up_impl-members.html">List of all members</a> </div> |
| 87 | <div class="headertitle"> |
| 88 | <div class="title">MovePermuteUpImpl Class Reference</div> </div> |
| 89 | </div><!--header--> |
| 90 | <div class="contents"> |
| 91 | |
| 92 | <p><code>#include <<a class="el" href="_move_permute_up_8hpp_source.html">MovePermuteUp.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:a5a8476ffc04ce7460bb09ad50d1d23de"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1optimizations_1_1_move_permute_up_impl.html#a5a8476ffc04ce7460bb09ad50d1d23de">Run</a> (<a class="el" href="classarmnn_1_1_graph.html">Graph</a> &graph, <a class="el" href="classarmnn_1_1_input_slot.html">InputSlot</a> &connection) const</td></tr> |
| 97 | <tr class="separator:a5a8476ffc04ce7460bb09ad50d1d23de"><td class="memSeparator" colspan="2"> </td></tr> |
| 98 | </table><table class="memberdecls"> |
| 99 | <tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-methods"></a> |
| 100 | Protected Member Functions</h2></td></tr> |
| 101 | <tr class="memitem:a62800e5070ee59063b2e80f785f32db6"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1optimizations_1_1_move_permute_up_impl.html#a62800e5070ee59063b2e80f785f32db6">MovePermuteUpImpl</a> ()=default</td></tr> |
| 102 | <tr class="separator:a62800e5070ee59063b2e80f785f32db6"><td class="memSeparator" colspan="2"> </td></tr> |
| 103 | <tr class="memitem:a3d6f30a9e9a8f14618dbad38869d1bb2"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classarmnn_1_1optimizations_1_1_move_permute_up_impl.html#a3d6f30a9e9a8f14618dbad38869d1bb2">~MovePermuteUpImpl</a> ()=default</td></tr> |
| 104 | <tr class="separator:a3d6f30a9e9a8f14618dbad38869d1bb2"><td class="memSeparator" colspan="2"> </td></tr> |
| 105 | </table> |
| 106 | <a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2> |
| 107 | <div class="textblock"> |
| 108 | <p class="definition">Definition at line <a class="el" href="_move_permute_up_8hpp_source.html#l00015">15</a> of file <a class="el" href="_move_permute_up_8hpp_source.html">MovePermuteUp.hpp</a>.</p> |
| 109 | </div><h2 class="groupheader">Constructor & Destructor Documentation</h2> |
| 110 | <a id="a62800e5070ee59063b2e80f785f32db6"></a> |
| 111 | <h2 class="memtitle"><span class="permalink"><a href="#a62800e5070ee59063b2e80f785f32db6">◆ </a></span>MovePermuteUpImpl()</h2> |
| 112 | |
| 113 | <div class="memitem"> |
| 114 | <div class="memproto"> |
| 115 | <table class="mlabels"> |
| 116 | <tr> |
| 117 | <td class="mlabels-left"> |
| 118 | <table class="memname"> |
| 119 | <tr> |
| 120 | <td class="memname"><a class="el" href="classarmnn_1_1optimizations_1_1_move_permute_up_impl.html">MovePermuteUpImpl</a> </td> |
| 121 | <td>(</td> |
| 122 | <td class="paramname"></td><td>)</td> |
| 123 | <td></td> |
| 124 | </tr> |
| 125 | </table> |
| 126 | </td> |
| 127 | <td class="mlabels-right"> |
| 128 | <span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">default</span></span> </td> |
| 129 | </tr> |
| 130 | </table> |
| 131 | </div><div class="memdoc"> |
| 132 | |
| 133 | <p class="reference">Referenced by <a class="el" href="_move_permute_up_8hpp_source.html#l00022">MovePermuteUpImpl::Run()</a>.</p> |
| 134 | |
| 135 | </div> |
| 136 | </div> |
| 137 | <a id="a3d6f30a9e9a8f14618dbad38869d1bb2"></a> |
| 138 | <h2 class="memtitle"><span class="permalink"><a href="#a3d6f30a9e9a8f14618dbad38869d1bb2">◆ </a></span>~MovePermuteUpImpl()</h2> |
| 139 | |
| 140 | <div class="memitem"> |
| 141 | <div class="memproto"> |
| 142 | <table class="mlabels"> |
| 143 | <tr> |
| 144 | <td class="mlabels-left"> |
| 145 | <table class="memname"> |
| 146 | <tr> |
| 147 | <td class="memname">~<a class="el" href="classarmnn_1_1optimizations_1_1_move_permute_up_impl.html">MovePermuteUpImpl</a> </td> |
| 148 | <td>(</td> |
| 149 | <td class="paramname"></td><td>)</td> |
| 150 | <td></td> |
| 151 | </tr> |
| 152 | </table> |
| 153 | </td> |
| 154 | <td class="mlabels-right"> |
| 155 | <span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">default</span></span> </td> |
| 156 | </tr> |
| 157 | </table> |
| 158 | </div><div class="memdoc"> |
| 159 | |
| 160 | <p class="reference">Referenced by <a class="el" href="_move_permute_up_8hpp_source.html#l00022">MovePermuteUpImpl::Run()</a>.</p> |
| 161 | |
| 162 | </div> |
| 163 | </div> |
| 164 | <h2 class="groupheader">Member Function Documentation</h2> |
| 165 | <a id="a5a8476ffc04ce7460bb09ad50d1d23de"></a> |
| 166 | <h2 class="memtitle"><span class="permalink"><a href="#a5a8476ffc04ce7460bb09ad50d1d23de">◆ </a></span>Run()</h2> |
| 167 | |
| 168 | <div class="memitem"> |
| 169 | <div class="memproto"> |
| 170 | <table class="mlabels"> |
| 171 | <tr> |
| 172 | <td class="mlabels-left"> |
| 173 | <table class="memname"> |
| 174 | <tr> |
| 175 | <td class="memname">void Run </td> |
| 176 | <td>(</td> |
| 177 | <td class="paramtype"><a class="el" href="classarmnn_1_1_graph.html">Graph</a> & </td> |
| 178 | <td class="paramname"><em>graph</em>, </td> |
| 179 | </tr> |
| 180 | <tr> |
| 181 | <td class="paramkey"></td> |
| 182 | <td></td> |
| 183 | <td class="paramtype"><a class="el" href="classarmnn_1_1_input_slot.html">InputSlot</a> & </td> |
| 184 | <td class="paramname"><em>connection</em> </td> |
| 185 | </tr> |
| 186 | <tr> |
| 187 | <td></td> |
| 188 | <td>)</td> |
| 189 | <td></td><td> const</td> |
| 190 | </tr> |
| 191 | </table> |
| 192 | </td> |
| 193 | <td class="mlabels-right"> |
| 194 | <span class="mlabels"><span class="mlabel">inline</span></span> </td> |
| 195 | </tr> |
| 196 | </table> |
| 197 | </div><div class="memdoc"> |
| 198 | <p>Run for every connection between a base <a class="el" href="classarmnn_1_1_layer.html">Layer</a> (any) and a child <a class="el" href="classarmnn_1_1_permute_layer.html" title="This layer represents a permutation operation. ">PermuteLayer</a>. If the type of the base layer allows it, it moves the permutation to the inputs of the base layer. I.e., adds equivalent permutations before the inputs of the base layer and moves the connections in the output of the child permute layer to the output of the base layer. </p> |
| 199 | |
| 200 | <p class="definition">Definition at line <a class="el" href="_move_permute_up_8hpp_source.html#l00022">22</a> of file <a class="el" href="_move_permute_up_8hpp_source.html">MovePermuteUp.hpp</a>.</p> |
| 201 | |
| 202 | <p class="reference">References <a class="el" href="namespacearmnn.html#a56943a0946e5f15e5e58054b8e7a04a4aa9a62e70841c4d06dd16306a85700d36">armnn::Activation</a>, <a class="el" href="namespacearmnn.html#a56943a0946e5f15e5e58054b8e7a04a4a7c5531bbefed0945814f874baf9e0e0f">armnn::Addition</a>, <a class="el" href="_layer_8hpp_source.html#l00235">Layer::BeginInputSlots()</a>, <a class="el" href="_layer_8hpp_source.html#l00236">Layer::EndInputSlots()</a>, <a class="el" href="namespacearmnn.html#a56943a0946e5f15e5e58054b8e7a04a4a3489c7b05e180496cb2ce8ac73887f48">armnn::FakeQuantization</a>, <a class="el" href="namespacearmnn.html#adf2e5515c4c36a3e7e46bb8b83c6754eaf3f6d0343d56ce88ce7958170ed05cb3">armnn::Floor</a>, <a class="el" href="_layer_8hpp_source.html#l00055">InputSlot::GetConnectedOutputSlot()</a>, <a class="el" href="_layer_8hpp_source.html#l00310">Layer::GetInputSlot()</a>, <a class="el" href="_layer_8hpp_source.html#l00138">OutputSlot::GetNumConnections()</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="_layer_8hpp_source.html#l00052">InputSlot::GetOwningLayer()</a>, <a class="el" href="_layer_8hpp_source.html#l00115">OutputSlot::GetOwningLayer()</a>, <a class="el" href="_layer_8hpp_source.html#l00259">Layer::GetType()</a>, <a class="el" href="_graph_8hpp_source.html#l00409">Graph::InsertNewLayer()</a>, <a class="el" href="namespacearmnn.html#a56943a0946e5f15e5e58054b8e7a04a4a4dd48794eb3305a0f5aece88b111a97b">armnn::MemCopy</a>, <a class="el" href="classarmnn_1_1optimizations_1_1_move_permute_up_impl.html#a62800e5070ee59063b2e80f785f32db6">MovePermuteUpImpl::MovePermuteUpImpl()</a>, <a class="el" href="namespacearmnn.html#a56943a0946e5f15e5e58054b8e7a04a4a27d1a1f7b7c2180e5b20ce9e3d00e2dd">armnn::Multiplication</a>, <a class="el" href="_permute_8cpp_source.html#l00098">armnnUtils::Permuted()</a>, <a class="el" href="_output_handler_8cpp_source.html#l00017">OutputHandler::SetTensorInfo()</a>, and <a class="el" href="classarmnn_1_1optimizations_1_1_move_permute_up_impl.html#a3d6f30a9e9a8f14618dbad38869d1bb2">MovePermuteUpImpl::~MovePermuteUpImpl()</a>.</p> |
| 203 | <div class="fragment"><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>  OutputSlot& baseOutput = *connection.GetConnectedOutputSlot();</div><div class="line"><a name="l00025"></a><span class="lineno"> 25</span> </div><div class="line"><a name="l00026"></a><span class="lineno"> 26</span>  <span class="keywordflow">if</span> (baseOutput.GetNumConnections() == 1U)</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>  Layer& base = baseOutput.GetOwningLayer();</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="keywordflow">if</span> (CanMovePermuteToInputs(base))</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>  <span class="keyword">auto</span> permute = boost::polymorphic_downcast<PermuteLayer*>(&connection.GetOwningLayer());</div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span>  <span class="keyword">const</span> PermutationVector& perm = permute->GetPermutation();</div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span> </div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span>  <span class="comment">// Inserts an equivalent permute before every input of the base layer.</span></div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span>  <span class="keywordflow">for</span> (<span class="keyword">auto</span> baseInput = base.BeginInputSlots(); baseInput != base.EndInputSlots(); ++baseInput)</div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span>  {</div><div class="line"><a name="l00038"></a><span class="lineno"> 38</span>  <span class="comment">// Inserts a new permute layer.</span></div><div class="line"><a name="l00039"></a><span class="lineno"> 39</span>  <span class="keyword">const</span> std::string name = std::string(<span class="stringliteral">"moved_up-"</span>) + permute->GetName();</div><div class="line"><a name="l00040"></a><span class="lineno"> 40</span>  PermuteLayer& permLayer = *graph.InsertNewLayer<PermuteLayer>(*baseInput, perm, name.c_str());</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>  <span class="comment">// Sets output tensor info for the new layer.</span></div><div class="line"><a name="l00043"></a><span class="lineno"> 43</span>  OutputSlot& parentOutput = *permLayer.GetInputSlot(0).GetConnectedOutputSlot();</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span>  <span class="keyword">const</span> TensorInfo permOutInfo = <a class="code" href="namespacearmnn_utils.html#abeaf4f6785039866fd075f4569ba8e84">armnnUtils::Permuted</a>(parentOutput.GetTensorInfo(), perm);</div><div class="line"><a name="l00045"></a><span class="lineno"> 45</span>  permLayer.GetOutputHandler().SetTensorInfo(permOutInfo);</div><div class="line"><a name="l00046"></a><span class="lineno"> 46</span>  }</div><div class="line"><a name="l00047"></a><span class="lineno"> 47</span> </div><div class="line"><a name="l00048"></a><span class="lineno"> 48</span>  <span class="comment">// Sets permuted output tensor info</span></div><div class="line"><a name="l00049"></a><span class="lineno"> 49</span>  <span class="keyword">const</span> TensorInfo& childOutInfo = permute->GetOutputHandler().GetTensorInfo();</div><div class="line"><a name="l00050"></a><span class="lineno"> 50</span>  base.GetOutputHandler().SetTensorInfo(childOutInfo);</div><div class="line"><a name="l00051"></a><span class="lineno"> 51</span> </div><div class="line"><a name="l00052"></a><span class="lineno"> 52</span>  <span class="comment">// Bypasses permute. It will be removed as it's left unconnected.</span></div><div class="line"><a name="l00053"></a><span class="lineno"> 53</span>  permute->GetOutputSlot().MoveAllConnections(base.GetOutputSlot());</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span>  }</div><div class="line"><a name="l00055"></a><span class="lineno"> 55</span>  }</div><div class="line"><a name="l00056"></a><span class="lineno"> 56</span>  }</div><div class="ttc" id="namespacearmnn_utils_html_abeaf4f6785039866fd075f4569ba8e84"><div class="ttname"><a href="namespacearmnn_utils.html#abeaf4f6785039866fd075f4569ba8e84">armnnUtils::Permuted</a></div><div class="ttdeci">armnn::TensorShape Permuted(const armnn::TensorShape &srcShape, const armnn::PermutationVector &mappings)</div><div class="ttdef"><b>Definition:</b> <a href="_permute_8cpp_source.html#l00098">Permute.cpp:98</a></div></div> |
| 204 | </div><!-- fragment --> |
| 205 | </div> |
| 206 | </div> |
| 207 | <hr/>The documentation for this class was generated from the following file:<ul> |
| 208 | <li>src/armnn/optimizations/<a class="el" href="_move_permute_up_8hpp_source.html">MovePermuteUp.hpp</a></li> |
| 209 | </ul> |
| 210 | </div><!-- contents --> |
| 211 | </div><!-- doc-content --> |
| 212 | <!-- start footer part --> |
| 213 | <div id="nav-path" class="navpath"><!-- id is needed for treeview function! --> |
| 214 | <ul> |
| 215 | <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_move_permute_up_impl.html">MovePermuteUpImpl</a></li> |
| 216 | <li class="footer">Generated on Fri Mar 13 2020 16:07:05 for ArmNN by |
| 217 | <a href="http://www.doxygen.org/index.html"> |
| 218 | <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.13 </li> |
| 219 | </ul> |
| 220 | </div> |
| 221 | </body> |
| 222 | </html> |