| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml"> |
| <head> |
| <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> |
| <meta http-equiv="X-UA-Compatible" content="IE=9"/> |
| <meta name="generator" content="Doxygen 1.8.13"/> |
| <meta name="viewport" content="width=device-width, initial-scale=1"/> |
| <title>mxnet: /work/mxnet/3rdparty/mshadow/mshadow/tensor.h Source File</title> |
| <link href="tabs.css" rel="stylesheet" type="text/css"/> |
| <script type="text/javascript" src="jquery.js"></script> |
| <script type="text/javascript" src="dynsections.js"></script> |
| <link href="search/search.css" rel="stylesheet" type="text/css"/> |
| <script type="text/javascript" src="search/searchdata.js"></script> |
| <script type="text/javascript" src="search/search.js"></script> |
| <link href="doxygen.css" rel="stylesheet" type="text/css" /> |
| </head> |
| <body> |
| <div id="top"><!-- do not remove this div, it is closed by doxygen! --> |
| <div id="titlearea"> |
| <table cellspacing="0" cellpadding="0"> |
| <tbody> |
| <tr style="height: 56px;"> |
| <td id="projectalign" style="padding-left: 0.5em;"> |
| <div id="projectname">mxnet |
| </div> |
| </td> |
| </tr> |
| </tbody> |
| </table> |
| </div> |
| <!-- end header part --> |
| <!-- Generated by Doxygen 1.8.13 --> |
| <script type="text/javascript"> |
| var searchBox = new SearchBox("searchBox", "search",false,'Search'); |
| </script> |
| <script type="text/javascript" src="menudata.js"></script> |
| <script type="text/javascript" src="menu.js"></script> |
| <script type="text/javascript"> |
| $(function() { |
| initMenu('',true,false,'search.php','Search'); |
| $(document).ready(function() { init_search(); }); |
| }); |
| </script> |
| <div id="main-nav"></div> |
| <!-- window showing the filter options --> |
| <div id="MSearchSelectWindow" |
| onmouseover="return searchBox.OnSearchSelectShow()" |
| onmouseout="return searchBox.OnSearchSelectHide()" |
| onkeydown="return searchBox.OnSearchSelectKey(event)"> |
| </div> |
| |
| <!-- iframe showing the search results (closed by default) --> |
| <div id="MSearchResultsWindow"> |
| <iframe src="javascript:void(0)" frameborder="0" |
| name="MSearchResults" id="MSearchResults"> |
| </iframe> |
| </div> |
| |
| <div id="nav-path" class="navpath"> |
| <ul> |
| <li class="navelem"><a class="el" href="dir_8cab8f464681f7cc51cee77e79a434cd.html">3rdparty</a></li><li class="navelem"><a class="el" href="dir_3e48ced36faa4eaa1b41f6d960bf0edb.html">mshadow</a></li><li class="navelem"><a class="el" href="dir_00b035bb2ad81894e6ad291054ea5f82.html">mshadow</a></li> </ul> |
| </div> |
| </div><!-- top --> |
| <div class="header"> |
| <div class="headertitle"> |
| <div class="title">tensor.h</div> </div> |
| </div><!--header--> |
| <div class="contents"> |
| <a href="tensor_8h.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><div class="line"><a name="l00002"></a><span class="lineno"> 2</span> <span class="comment"> * Licensed to the Apache Software Foundation (ASF) under one</span></div><div class="line"><a name="l00003"></a><span class="lineno"> 3</span> <span class="comment"> * or more contributor license agreements. See the NOTICE file</span></div><div class="line"><a name="l00004"></a><span class="lineno"> 4</span> <span class="comment"> * distributed with this work for additional information</span></div><div class="line"><a name="l00005"></a><span class="lineno"> 5</span> <span class="comment"> * regarding copyright ownership. The ASF licenses this file</span></div><div class="line"><a name="l00006"></a><span class="lineno"> 6</span> <span class="comment"> * to you under the Apache License, Version 2.0 (the</span></div><div class="line"><a name="l00007"></a><span class="lineno"> 7</span> <span class="comment"> * "License"); you may not use this file except in compliance</span></div><div class="line"><a name="l00008"></a><span class="lineno"> 8</span> <span class="comment"> * with the License. You may obtain a copy of the License at</span></div><div class="line"><a name="l00009"></a><span class="lineno"> 9</span> <span class="comment"> *</span></div><div class="line"><a name="l00010"></a><span class="lineno"> 10</span> <span class="comment"> * http://www.apache.org/licenses/LICENSE-2.0</span></div><div class="line"><a name="l00011"></a><span class="lineno"> 11</span> <span class="comment"> *</span></div><div class="line"><a name="l00012"></a><span class="lineno"> 12</span> <span class="comment"> * Unless required by applicable law or agreed to in writing,</span></div><div class="line"><a name="l00013"></a><span class="lineno"> 13</span> <span class="comment"> * software distributed under the License is distributed on an</span></div><div class="line"><a name="l00014"></a><span class="lineno"> 14</span> <span class="comment"> * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY</span></div><div class="line"><a name="l00015"></a><span class="lineno"> 15</span> <span class="comment"> * KIND, either express or implied. See the License for the</span></div><div class="line"><a name="l00016"></a><span class="lineno"> 16</span> <span class="comment"> * specific language governing permissions and limitations</span></div><div class="line"><a name="l00017"></a><span class="lineno"> 17</span> <span class="comment"> * under the License.</span></div><div class="line"><a name="l00018"></a><span class="lineno"> 18</span> <span class="comment"> */</span></div><div class="line"><a name="l00019"></a><span class="lineno"> 19</span> </div><div class="line"><a name="l00030"></a><span class="lineno"> 30</span> <span class="preprocessor">#ifndef MSHADOW_TENSOR_H_</span></div><div class="line"><a name="l00031"></a><span class="lineno"> 31</span> <span class="preprocessor">#define MSHADOW_TENSOR_H_</span></div><div class="line"><a name="l00032"></a><span class="lineno"> 32</span> <span class="preprocessor">#include <string></span></div><div class="line"><a name="l00033"></a><span class="lineno"> 33</span> <span class="preprocessor">#include <iostream></span></div><div class="line"><a name="l00034"></a><span class="lineno"> 34</span> <span class="preprocessor">#include "<a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html">./base.h</a>"</span></div><div class="line"><a name="l00035"></a><span class="lineno"> 35</span> <span class="preprocessor">#include "<a class="code" href="expression_8h.html">./expression.h</a>"</span></div><div class="line"><a name="l00036"></a><span class="lineno"> 36</span> </div><div class="line"><a name="l00037"></a><span class="lineno"> 37</span> <span class="keyword">namespace </span><a class="code" href="namespacemshadow.html">mshadow</a> {</div><div class="line"><a name="l00039"></a><span class="lineno"><a class="line" href="structmshadow_1_1cpu.html"> 39</a></span> <span class="keyword">struct </span><a class="code" href="structmshadow_1_1cpu.html">cpu</a> {</div><div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="structmshadow_1_1cpu.html#a02cb5d79392d3ccf5d5f16beabf69171"> 41</a></span>  <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">bool</span> <a class="code" href="structmshadow_1_1cpu.html#a02cb5d79392d3ccf5d5f16beabf69171">kDevCPU</a> = <span class="keyword">true</span>;</div><div class="line"><a name="l00043"></a><span class="lineno"><a class="line" href="structmshadow_1_1cpu.html#a57f74b500825e21c0c246ad5b4e5016b"> 43</a></span>  <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="structmshadow_1_1cpu.html#a57f74b500825e21c0c246ad5b4e5016b">kDevMask</a> = 1 << 0;</div><div class="line"><a name="l00044"></a><span class="lineno"> 44</span> };</div><div class="line"><a name="l00046"></a><span class="lineno"><a class="line" href="structmshadow_1_1gpu.html"> 46</a></span> <span class="keyword">struct </span><a class="code" href="structmshadow_1_1gpu.html">gpu</a> {</div><div class="line"><a name="l00048"></a><span class="lineno"><a class="line" href="structmshadow_1_1gpu.html#a52623e299b7672805922121519501594"> 48</a></span>  <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">bool</span> <a class="code" href="structmshadow_1_1cpu.html#a02cb5d79392d3ccf5d5f16beabf69171">kDevCPU</a> = <span class="keyword">false</span>;</div><div class="line"><a name="l00050"></a><span class="lineno"><a class="line" href="structmshadow_1_1gpu.html#a15467f39ddeed96fa259efda7c988f05"> 50</a></span>  <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> <a class="code" href="structmshadow_1_1cpu.html#a57f74b500825e21c0c246ad5b4e5016b">kDevMask</a> = 1 << 1;</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="keyword">template</span><<span class="keywordtype">int</span> ndim></div><div class="line"><a name="l00053"></a><span class="lineno"><a class="line" href="structmshadow_1_1Shape.html"> 53</a></span> <span class="keyword">struct </span><a class="code" href="structmshadow_1_1Shape.html">Shape</a>;</div><div class="line"><a name="l00054"></a><span class="lineno"> 54</span> </div><div class="line"><a name="l00061"></a><span class="lineno"> 61</span> <span class="keyword">template</span><<span class="keywordtype">int</span> ndim></div><div class="line"><a name="l00062"></a><span class="lineno"> 62</span> <span class="keyword">inline</span> std::ostream &operator<<(std::ostream &os, const Shape<ndim> &shape); <span class="comment">// NOLINT(*)</span></div><div class="line"><a name="l00063"></a><span class="lineno"> 63</span> </div><div class="line"><a name="l00068"></a><span class="lineno"> 68</span> <span class="keyword">template</span><<span class="keywordtype">int</span> dimension></div><div class="line"><a name="l00069"></a><span class="lineno"> 69</span> <span class="keyword">struct </span><a class="code" href="structmshadow_1_1Shape.html">Shape</a> {</div><div class="line"><a name="l00071"></a><span class="lineno"><a class="line" href="structmshadow_1_1Shape.html#a04b162e49196e5799465fd8201de04b1"> 71</a></span>  <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> kDimension = dimension;</div><div class="line"><a name="l00073"></a><span class="lineno"><a class="line" href="structmshadow_1_1Shape.html#a67c9939bcaa6fa12f5dc949041a0ef58"> 73</a></span>  <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> kSubdim = dimension - 1;</div><div class="line"><a name="l00075"></a><span class="lineno"><a class="line" href="structmshadow_1_1Shape.html#a398d94165ccfbaf1ba0e8fcbedfe48c6"> 75</a></span>  <a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> shape_[kDimension];</div><div class="line"><a name="l00077"></a><span class="lineno"><a class="line" href="structmshadow_1_1Shape.html#a841dd46bcd4bc0abf0f8c124e4f3a607"> 77</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <a class="code" href="structmshadow_1_1Shape.html#a841dd46bcd4bc0abf0f8c124e4f3a607">Shape</a>(<span class="keywordtype">void</span>) {}</div><div class="line"><a name="l00079"></a><span class="lineno"><a class="line" href="structmshadow_1_1Shape.html#a9fe553a887023d1ef284dbb018456fe8"> 79</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <a class="code" href="structmshadow_1_1Shape.html#a9fe553a887023d1ef284dbb018456fe8">Shape</a>(<span class="keyword">const</span> <a class="code" href="structmshadow_1_1Shape.html">Shape<kDimension></a> &s) {</div><div class="line"><a name="l00080"></a><span class="lineno"> 80</span> <span class="preprocessor"> #pragma unroll</span></div><div class="line"><a name="l00081"></a><span class="lineno"> 81</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < kDimension; ++i) {</div><div class="line"><a name="l00082"></a><span class="lineno"> 82</span>  this->shape_[i] = s[i];</div><div class="line"><a name="l00083"></a><span class="lineno"> 83</span>  }</div><div class="line"><a name="l00084"></a><span class="lineno"> 84</span>  }</div><div class="line"><a name="l00090"></a><span class="lineno"><a class="line" href="structmshadow_1_1Shape.html#aec509cb541250181ba664a4db41896e9"> 90</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> &<a class="code" href="structmshadow_1_1Shape.html#aec509cb541250181ba664a4db41896e9">operator[]</a>(<span class="keywordtype">int</span> idx) {</div><div class="line"><a name="l00091"></a><span class="lineno"> 91</span>  <span class="keywordflow">return</span> shape_[idx];</div><div class="line"><a name="l00092"></a><span class="lineno"> 92</span>  }</div><div class="line"><a name="l00098"></a><span class="lineno"><a class="line" href="structmshadow_1_1Shape.html#a250af849ef7ee71f440cb91366c43473"> 98</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <span class="keyword">const</span> <a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> &<a class="code" href="structmshadow_1_1Shape.html#a250af849ef7ee71f440cb91366c43473">operator[]</a>(<span class="keywordtype">int</span> idx)<span class="keyword"> const </span>{</div><div class="line"><a name="l00099"></a><span class="lineno"> 99</span>  <span class="keywordflow">return</span> shape_[idx];</div><div class="line"><a name="l00100"></a><span class="lineno"> 100</span>  }</div><div class="line"><a name="l00105"></a><span class="lineno"><a class="line" href="structmshadow_1_1Shape.html#ac101e89c424c3f5d2c37a369d8d7bb79"> 105</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <span class="keywordtype">bool</span> <a class="code" href="structmshadow_1_1Shape.html#ac101e89c424c3f5d2c37a369d8d7bb79">operator==</a>(<span class="keyword">const</span> <a class="code" href="structmshadow_1_1Shape.html">Shape<kDimension></a> &s)<span class="keyword"> const </span>{</div><div class="line"><a name="l00106"></a><span class="lineno"> 106</span> <span class="preprocessor"> #pragma unroll</span></div><div class="line"><a name="l00107"></a><span class="lineno"> 107</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < kDimension; ++i) {</div><div class="line"><a name="l00108"></a><span class="lineno"> 108</span>  <span class="keywordflow">if</span> (s.<a class="code" href="structmshadow_1_1Shape.html#a398d94165ccfbaf1ba0e8fcbedfe48c6">shape_</a>[i] != this->shape_[i]) <span class="keywordflow">return</span> <span class="keyword">false</span>;</div><div class="line"><a name="l00109"></a><span class="lineno"> 109</span>  }</div><div class="line"><a name="l00110"></a><span class="lineno"> 110</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00111"></a><span class="lineno"> 111</span>  }</div><div class="line"><a name="l00116"></a><span class="lineno"><a class="line" href="structmshadow_1_1Shape.html#a610750c35aa0c76bb987458fc3fce90b"> 116</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <span class="keywordtype">bool</span> <a class="code" href="structmshadow_1_1Shape.html#a610750c35aa0c76bb987458fc3fce90b">operator!=</a>(<span class="keyword">const</span> <a class="code" href="structmshadow_1_1Shape.html">Shape<kDimension></a> &s)<span class="keyword"> const </span>{</div><div class="line"><a name="l00117"></a><span class="lineno"> 117</span>  <span class="keywordflow">return</span> !(*<span class="keyword">this</span> == s);</div><div class="line"><a name="l00118"></a><span class="lineno"> 118</span>  }</div><div class="line"><a name="l00123"></a><span class="lineno"><a class="line" href="structmshadow_1_1Shape.html#a09790c1034fa223d2782736a0d053a75"> 123</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <a class="code" href="structmshadow_1_1Shape.html">Shape<1></a> <a class="code" href="structmshadow_1_1Shape.html#a09790c1034fa223d2782736a0d053a75">FlatTo1D</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{</div><div class="line"><a name="l00124"></a><span class="lineno"> 124</span>  <a class="code" href="structmshadow_1_1Shape.html">Shape<1></a> s;</div><div class="line"><a name="l00125"></a><span class="lineno"> 125</span>  s[0] = this->Size();</div><div class="line"><a name="l00126"></a><span class="lineno"> 126</span>  <span class="keywordflow">return</span> s;</div><div class="line"><a name="l00127"></a><span class="lineno"> 127</span>  }</div><div class="line"><a name="l00132"></a><span class="lineno"><a class="line" href="structmshadow_1_1Shape.html#a91c0fd04c351199f119950b044ad9c99"> 132</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <a class="code" href="structmshadow_1_1Shape.html">Shape<2></a> <a class="code" href="structmshadow_1_1Shape.html#a91c0fd04c351199f119950b044ad9c99">FlatTo2D</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{</div><div class="line"><a name="l00133"></a><span class="lineno"> 133</span>  <a class="code" href="structmshadow_1_1Shape.html">Shape<2></a> s;</div><div class="line"><a name="l00134"></a><span class="lineno"> 134</span>  s.<a class="code" href="structmshadow_1_1Shape.html#a398d94165ccfbaf1ba0e8fcbedfe48c6">shape_</a>[1] = this->shape_[kDimension - 1];</div><div class="line"><a name="l00135"></a><span class="lineno"> 135</span>  <a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> ymax = 1;</div><div class="line"><a name="l00136"></a><span class="lineno"> 136</span> <span class="preprocessor"> #pragma unroll</span></div><div class="line"><a name="l00137"></a><span class="lineno"> 137</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < kDimension - 1; ++i) {</div><div class="line"><a name="l00138"></a><span class="lineno"> 138</span>  ymax *= this->shape_[i];</div><div class="line"><a name="l00139"></a><span class="lineno"> 139</span>  }</div><div class="line"><a name="l00140"></a><span class="lineno"> 140</span>  s.<a class="code" href="structmshadow_1_1Shape.html#a398d94165ccfbaf1ba0e8fcbedfe48c6">shape_</a>[0] = ymax;</div><div class="line"><a name="l00141"></a><span class="lineno"> 141</span>  <span class="keywordflow">return</span> s;</div><div class="line"><a name="l00142"></a><span class="lineno"> 142</span>  }</div><div class="line"><a name="l00144"></a><span class="lineno"><a class="line" href="structmshadow_1_1Shape.html#ac6d667fde1a8180b64f475f5d33ea58f"> 144</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> <a class="code" href="structmshadow_1_1Shape.html#ac6d667fde1a8180b64f475f5d33ea58f">Size</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{</div><div class="line"><a name="l00145"></a><span class="lineno"> 145</span>  <a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> size = this->shape_[0];</div><div class="line"><a name="l00146"></a><span class="lineno"> 146</span> <span class="preprocessor"> #pragma unroll</span></div><div class="line"><a name="l00147"></a><span class="lineno"> 147</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 1; i < kDimension; ++i) {</div><div class="line"><a name="l00148"></a><span class="lineno"> 148</span>  size *= this->shape_[i];</div><div class="line"><a name="l00149"></a><span class="lineno"> 149</span>  }</div><div class="line"><a name="l00150"></a><span class="lineno"> 150</span>  <span class="keywordflow">return</span> size;</div><div class="line"><a name="l00151"></a><span class="lineno"> 151</span>  }</div><div class="line"><a name="l00157"></a><span class="lineno"><a class="line" href="structmshadow_1_1Shape.html#a437b236671a35475edcf7aa5df2c6360"> 157</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> <a class="code" href="structmshadow_1_1Shape.html#a437b236671a35475edcf7aa5df2c6360">ProdShape</a>(<span class="keywordtype">int</span> dimstart, <span class="keywordtype">int</span> dimend)<span class="keyword"> const </span>{</div><div class="line"><a name="l00158"></a><span class="lineno"> 158</span>  <a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> num = 1;</div><div class="line"><a name="l00159"></a><span class="lineno"> 159</span> <span class="preprocessor"> #pragma unroll</span></div><div class="line"><a name="l00160"></a><span class="lineno"> 160</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = dimstart; i < dimend; ++i) {</div><div class="line"><a name="l00161"></a><span class="lineno"> 161</span>  num *= this->shape_[i];</div><div class="line"><a name="l00162"></a><span class="lineno"> 162</span>  }</div><div class="line"><a name="l00163"></a><span class="lineno"> 163</span>  <span class="keywordflow">return</span> num;</div><div class="line"><a name="l00164"></a><span class="lineno"> 164</span>  }</div><div class="line"><a name="l00169"></a><span class="lineno"><a class="line" href="structmshadow_1_1Shape.html#a40f409ff54982ded075f373aec6147a2"> 169</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <a class="code" href="structmshadow_1_1Shape.html">Shape<kSubdim></a> <a class="code" href="structmshadow_1_1Shape.html#a40f409ff54982ded075f373aec6147a2">SubShape</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{</div><div class="line"><a name="l00170"></a><span class="lineno"> 170</span>  <a class="code" href="structmshadow_1_1Shape.html">Shape<kSubdim></a> s;</div><div class="line"><a name="l00171"></a><span class="lineno"> 171</span>  <span class="comment">// for cuda</span></div><div class="line"><a name="l00172"></a><span class="lineno"> 172</span> <span class="preprocessor"> #pragma unroll</span></div><div class="line"><a name="l00173"></a><span class="lineno"> 173</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = 0; i < kSubdim; ++i) {</div><div class="line"><a name="l00174"></a><span class="lineno"> 174</span>  s.<a class="code" href="structmshadow_1_1Shape.html#a398d94165ccfbaf1ba0e8fcbedfe48c6">shape_</a>[i] = this->shape_[i + 1];</div><div class="line"><a name="l00175"></a><span class="lineno"> 175</span>  }</div><div class="line"><a name="l00176"></a><span class="lineno"> 176</span>  <span class="keywordflow">return</span> s;</div><div class="line"><a name="l00177"></a><span class="lineno"> 177</span>  }</div><div class="line"><a name="l00184"></a><span class="lineno"> 184</span>  <span class="keyword">template</span><<span class="keywordtype">int</span> dimstart, <span class="keywordtype">int</span> dimend></div><div class="line"><a name="l00185"></a><span class="lineno"><a class="line" href="structmshadow_1_1Shape.html#a9cb540dcf4dec5d78456140505763bfa"> 185</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <a class="code" href="structmshadow_1_1Shape.html">Shape</a><dimend - dimstart> <a class="code" href="structmshadow_1_1Shape.html#a9cb540dcf4dec5d78456140505763bfa">Slice</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{</div><div class="line"><a name="l00186"></a><span class="lineno"> 186</span>  <a class="code" href="structmshadow_1_1Shape.html">Shape</a><dimend - dimstart> s;</div><div class="line"><a name="l00187"></a><span class="lineno"> 187</span> <span class="preprocessor"> #pragma unroll</span></div><div class="line"><a name="l00188"></a><span class="lineno"> 188</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = dimstart; i < dimend; ++i) {</div><div class="line"><a name="l00189"></a><span class="lineno"> 189</span>  s[i - dimstart] = this->shape_[i];</div><div class="line"><a name="l00190"></a><span class="lineno"> 190</span>  }</div><div class="line"><a name="l00191"></a><span class="lineno"> 191</span>  <span class="keywordflow">return</span> s;</div><div class="line"><a name="l00192"></a><span class="lineno"> 192</span>  }</div><div class="line"><a name="l00194"></a><span class="lineno"> 194</span>  <span class="keyword">template</span><<span class="keywordtype">int</span> dim></div><div class="line"><a name="l00195"></a><span class="lineno"> 195</span>  <span class="keyword">friend</span> std::ostream &operator<<(std::ostream &os, const Shape<dim> &shape); <span class="comment">// NOLINT(*)</span></div><div class="line"><a name="l00197"></a><span class="lineno"> 197</span> <span class="comment"></span>}; <span class="comment">// Shape</span></div><div class="line"><a name="l00198"></a><span class="lineno"> 198</span> <span class="comment">//------------------------------------------------</span></div><div class="line"><a name="l00199"></a><span class="lineno"> 199</span> <span class="comment">// useful construction functions to generate shape</span></div><div class="line"><a name="l00200"></a><span class="lineno"> 200</span> <span class="comment">//-------------------------------------------------</span></div><div class="line"><a name="l00206"></a><span class="lineno"><a class="line" href="namespacemshadow.html#a05e468ef4d8882fccce53ae951b7bdbd"> 206</a></span> <span class="comment"></span><a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <a class="code" href="structmshadow_1_1Shape.html">Shape<1></a> <a class="code" href="namespacemshadow.html#a05e468ef4d8882fccce53ae951b7bdbd">Shape1</a>(<a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> s0) {</div><div class="line"><a name="l00207"></a><span class="lineno"> 207</span>  <a class="code" href="structmshadow_1_1Shape.html">Shape<1></a> s; s[0] = s0;</div><div class="line"><a name="l00208"></a><span class="lineno"> 208</span>  <span class="keywordflow">return</span> s;</div><div class="line"><a name="l00209"></a><span class="lineno"> 209</span> }</div><div class="line"><a name="l00216"></a><span class="lineno"><a class="line" href="namespacemshadow.html#ad2853583180a7dbe9cbf6b0e15ae60ef"> 216</a></span> <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <a class="code" href="structmshadow_1_1Shape.html">Shape<2></a> <a class="code" href="namespacemshadow.html#ad2853583180a7dbe9cbf6b0e15ae60ef">Shape2</a>(<a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> s0, <a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> s1) {</div><div class="line"><a name="l00217"></a><span class="lineno"> 217</span>  <a class="code" href="structmshadow_1_1Shape.html">Shape<2></a> s; s[0] = s0; s[1] = s1;</div><div class="line"><a name="l00218"></a><span class="lineno"> 218</span>  <span class="keywordflow">return</span> s;</div><div class="line"><a name="l00219"></a><span class="lineno"> 219</span> }</div><div class="line"><a name="l00227"></a><span class="lineno"><a class="line" href="namespacemshadow.html#a2be3eab8d3469aa48c40d38881558bb9"> 227</a></span> <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <a class="code" href="structmshadow_1_1Shape.html">Shape<3></a> <a class="code" href="namespacemshadow.html#a2be3eab8d3469aa48c40d38881558bb9">Shape3</a>(<a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> s0, <a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> s1, <a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> s2) {</div><div class="line"><a name="l00228"></a><span class="lineno"> 228</span>  <a class="code" href="structmshadow_1_1Shape.html">Shape<3></a> s;</div><div class="line"><a name="l00229"></a><span class="lineno"> 229</span>  s[0] = s0; s[1] = s1; s[2] = s2;</div><div class="line"><a name="l00230"></a><span class="lineno"> 230</span>  <span class="keywordflow">return</span> s;</div><div class="line"><a name="l00231"></a><span class="lineno"> 231</span> }</div><div class="line"><a name="l00240"></a><span class="lineno"><a class="line" href="namespacemshadow.html#a8fc5237744c6eda97f3070ddcb0c715e"> 240</a></span> <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <a class="code" href="structmshadow_1_1Shape.html">Shape<4></a> <a class="code" href="namespacemshadow.html#a8fc5237744c6eda97f3070ddcb0c715e">Shape4</a>(<a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> s0, <a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> s1,</div><div class="line"><a name="l00241"></a><span class="lineno"> 241</span>  <a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> s2, <a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> s3) {</div><div class="line"><a name="l00242"></a><span class="lineno"> 242</span>  <a class="code" href="structmshadow_1_1Shape.html">Shape<4></a> s;</div><div class="line"><a name="l00243"></a><span class="lineno"> 243</span>  s[0] = s0; s[1] = s1; s[2] = s2; s[3] = s3;</div><div class="line"><a name="l00244"></a><span class="lineno"> 244</span>  <span class="keywordflow">return</span> s;</div><div class="line"><a name="l00245"></a><span class="lineno"> 245</span> }</div><div class="line"><a name="l00255"></a><span class="lineno"><a class="line" href="namespacemshadow.html#a5db935b0945f538add8022fac93c9c0a"> 255</a></span> <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <a class="code" href="structmshadow_1_1Shape.html">Shape<5></a> <a class="code" href="namespacemshadow.html#a5db935b0945f538add8022fac93c9c0a">Shape5</a>(<a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> s0, <a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> s1, <a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> s2,</div><div class="line"><a name="l00256"></a><span class="lineno"> 256</span>  <a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> s3, <a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> s4) {</div><div class="line"><a name="l00257"></a><span class="lineno"> 257</span>  <a class="code" href="structmshadow_1_1Shape.html">Shape<5></a> s;</div><div class="line"><a name="l00258"></a><span class="lineno"> 258</span>  s[0] = s0; s[1] = s1; s[2] = s2; s[3] = s3; s[4] = s4;</div><div class="line"><a name="l00259"></a><span class="lineno"> 259</span>  <span class="keywordflow">return</span> s;</div><div class="line"><a name="l00260"></a><span class="lineno"> 260</span> }</div><div class="line"><a name="l00261"></a><span class="lineno"> 261</span> </div><div class="line"><a name="l00269"></a><span class="lineno"><a class="line" href="namespacemshadow.html#a446431abbca1ddc0a525d6e2ce9d2fbc"> 269</a></span> <span class="keyword">inline</span> <a class="code" href="structmshadow_1_1Shape.html">Shape<3></a> <a class="code" href="namespacemshadow.html#a446431abbca1ddc0a525d6e2ce9d2fbc">ConvertLayout</a>(<span class="keyword">const</span> <a class="code" href="structmshadow_1_1Shape.html">Shape<3></a>& src, <span class="keywordtype">int</span> src_layout, <span class="keywordtype">int</span> dst_layout) {</div><div class="line"><a name="l00270"></a><span class="lineno"> 270</span>  <a class="code" href="structmshadow_1_1Shape.html">Shape<3></a> dst;</div><div class="line"><a name="l00271"></a><span class="lineno"> 271</span>  <span class="keywordflow">switch</span> (src_layout) {</div><div class="line"><a name="l00272"></a><span class="lineno"> 272</span>  <span class="keywordflow">case</span> <a class="code" href="namespacemshadow.html#abbe2dc827052234b64ab2d40a5b2fdb4a0cfb685a803481d9ff4fe19d813b261a">kNCW</a>:</div><div class="line"><a name="l00273"></a><span class="lineno"> 273</span>  dst = src;</div><div class="line"><a name="l00274"></a><span class="lineno"> 274</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00275"></a><span class="lineno"> 275</span>  <span class="keywordflow">case</span> <a class="code" href="namespacemshadow.html#abbe2dc827052234b64ab2d40a5b2fdb4a3f4908b910c47da082d60aa719c43fc3">kNWC</a>:</div><div class="line"><a name="l00276"></a><span class="lineno"> 276</span>  dst[0] = src[0];</div><div class="line"><a name="l00277"></a><span class="lineno"> 277</span>  dst[1] = src[2];</div><div class="line"><a name="l00278"></a><span class="lineno"> 278</span>  dst[2] = src[1];</div><div class="line"><a name="l00279"></a><span class="lineno"> 279</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00280"></a><span class="lineno"> 280</span>  <span class="keywordflow">default</span>:</div><div class="line"><a name="l00281"></a><span class="lineno"> 281</span>  LOG(FATAL) << <span class="stringliteral">"Invalid layout for 3d shape "</span> << src_layout;</div><div class="line"><a name="l00282"></a><span class="lineno"> 282</span>  }</div><div class="line"><a name="l00283"></a><span class="lineno"> 283</span>  <span class="keywordflow">switch</span> (dst_layout) {</div><div class="line"><a name="l00284"></a><span class="lineno"> 284</span>  <span class="keywordflow">case</span> <a class="code" href="namespacemshadow.html#abbe2dc827052234b64ab2d40a5b2fdb4a0cfb685a803481d9ff4fe19d813b261a">kNCW</a>:</div><div class="line"><a name="l00285"></a><span class="lineno"> 285</span>  <span class="keywordflow">return</span> dst;</div><div class="line"><a name="l00286"></a><span class="lineno"> 286</span>  <span class="keywordflow">case</span> <a class="code" href="namespacemshadow.html#abbe2dc827052234b64ab2d40a5b2fdb4a3f4908b910c47da082d60aa719c43fc3">kNWC</a>:</div><div class="line"><a name="l00287"></a><span class="lineno"> 287</span>  {</div><div class="line"><a name="l00288"></a><span class="lineno"> 288</span>  <a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> tmp = dst[1];</div><div class="line"><a name="l00289"></a><span class="lineno"> 289</span>  dst[1] = dst[2];</div><div class="line"><a name="l00290"></a><span class="lineno"> 290</span>  dst[2] = tmp;</div><div class="line"><a name="l00291"></a><span class="lineno"> 291</span>  }</div><div class="line"><a name="l00292"></a><span class="lineno"> 292</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00293"></a><span class="lineno"> 293</span>  <span class="keywordflow">default</span>:</div><div class="line"><a name="l00294"></a><span class="lineno"> 294</span>  LOG(FATAL) << <span class="stringliteral">"Invalid layout for 3d shape "</span> << src_layout;</div><div class="line"><a name="l00295"></a><span class="lineno"> 295</span>  }</div><div class="line"><a name="l00296"></a><span class="lineno"> 296</span>  <span class="keywordflow">return</span> dst;</div><div class="line"><a name="l00297"></a><span class="lineno"> 297</span> }</div><div class="line"><a name="l00298"></a><span class="lineno"> 298</span> </div><div class="line"><a name="l00306"></a><span class="lineno"><a class="line" href="namespacemshadow.html#a05319639a02ccfcdee6caa554de04468"> 306</a></span> <span class="keyword">inline</span> <a class="code" href="structmshadow_1_1Shape.html">Shape<4></a> <a class="code" href="namespacemshadow.html#a446431abbca1ddc0a525d6e2ce9d2fbc">ConvertLayout</a>(<span class="keyword">const</span> <a class="code" href="structmshadow_1_1Shape.html">Shape<4></a>& src, <span class="keywordtype">int</span> src_layout, <span class="keywordtype">int</span> dst_layout) {</div><div class="line"><a name="l00307"></a><span class="lineno"> 307</span>  <a class="code" href="structmshadow_1_1Shape.html">Shape<4></a> dst;</div><div class="line"><a name="l00308"></a><span class="lineno"> 308</span>  <span class="keywordflow">switch</span> (src_layout) {</div><div class="line"><a name="l00309"></a><span class="lineno"> 309</span>  <span class="keywordflow">case</span> <a class="code" href="namespacemshadow.html#abbe2dc827052234b64ab2d40a5b2fdb4ae633c123a9c9897779d5c00ea5381775">kNCHW</a>:</div><div class="line"><a name="l00310"></a><span class="lineno"> 310</span>  dst = src;</div><div class="line"><a name="l00311"></a><span class="lineno"> 311</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00312"></a><span class="lineno"> 312</span>  <span class="keywordflow">case</span> <a class="code" href="namespacemshadow.html#abbe2dc827052234b64ab2d40a5b2fdb4ad9ef54b427a838279a62e95204aa3281">kNHWC</a>:</div><div class="line"><a name="l00313"></a><span class="lineno"> 313</span>  dst[0] = src[0];</div><div class="line"><a name="l00314"></a><span class="lineno"> 314</span>  dst[2] = src[1];</div><div class="line"><a name="l00315"></a><span class="lineno"> 315</span>  dst[3] = src[2];</div><div class="line"><a name="l00316"></a><span class="lineno"> 316</span>  dst[1] = src[3];</div><div class="line"><a name="l00317"></a><span class="lineno"> 317</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00318"></a><span class="lineno"> 318</span>  <span class="keywordflow">default</span>:</div><div class="line"><a name="l00319"></a><span class="lineno"> 319</span>  LOG(FATAL) << <span class="stringliteral">"Invalid layout for 4d shape "</span> << src_layout;</div><div class="line"><a name="l00320"></a><span class="lineno"> 320</span>  dst = src; <span class="comment">// fixes compiler warning</span></div><div class="line"><a name="l00321"></a><span class="lineno"> 321</span>  }</div><div class="line"><a name="l00322"></a><span class="lineno"> 322</span>  <a class="code" href="structmshadow_1_1Shape.html">Shape<4></a> dst2;</div><div class="line"><a name="l00323"></a><span class="lineno"> 323</span>  <span class="keywordflow">switch</span> (dst_layout) {</div><div class="line"><a name="l00324"></a><span class="lineno"> 324</span>  <span class="keywordflow">case</span> <a class="code" href="namespacemshadow.html#abbe2dc827052234b64ab2d40a5b2fdb4ae633c123a9c9897779d5c00ea5381775">kNCHW</a>:</div><div class="line"><a name="l00325"></a><span class="lineno"> 325</span>  <span class="keywordflow">return</span> dst;</div><div class="line"><a name="l00326"></a><span class="lineno"> 326</span>  <span class="keywordflow">case</span> <a class="code" href="namespacemshadow.html#abbe2dc827052234b64ab2d40a5b2fdb4ad9ef54b427a838279a62e95204aa3281">kNHWC</a>:</div><div class="line"><a name="l00327"></a><span class="lineno"> 327</span>  dst2[0] = dst[0];</div><div class="line"><a name="l00328"></a><span class="lineno"> 328</span>  dst2[1] = dst[2];</div><div class="line"><a name="l00329"></a><span class="lineno"> 329</span>  dst2[2] = dst[3];</div><div class="line"><a name="l00330"></a><span class="lineno"> 330</span>  dst2[3] = dst[1];</div><div class="line"><a name="l00331"></a><span class="lineno"> 331</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00332"></a><span class="lineno"> 332</span>  <span class="keywordflow">default</span>:</div><div class="line"><a name="l00333"></a><span class="lineno"> 333</span>  LOG(FATAL) << <span class="stringliteral">"Invalid layout for 4d shape "</span> << src_layout;</div><div class="line"><a name="l00334"></a><span class="lineno"> 334</span>  dst2 = src; <span class="comment">// fixes compiler warning</span></div><div class="line"><a name="l00335"></a><span class="lineno"> 335</span>  }</div><div class="line"><a name="l00336"></a><span class="lineno"> 336</span>  <span class="keywordflow">return</span> dst2;</div><div class="line"><a name="l00337"></a><span class="lineno"> 337</span> }</div><div class="line"><a name="l00338"></a><span class="lineno"> 338</span> </div><div class="line"><a name="l00346"></a><span class="lineno"><a class="line" href="namespacemshadow.html#ada254ce6c3f8ff0c89e4483c3b7924b7"> 346</a></span> <span class="keyword">inline</span> <a class="code" href="structmshadow_1_1Shape.html">Shape<5></a> <a class="code" href="namespacemshadow.html#a446431abbca1ddc0a525d6e2ce9d2fbc">ConvertLayout</a>(<span class="keyword">const</span> <a class="code" href="structmshadow_1_1Shape.html">Shape<5></a>& src, <span class="keywordtype">int</span> src_layout, <span class="keywordtype">int</span> dst_layout) {</div><div class="line"><a name="l00347"></a><span class="lineno"> 347</span>  <a class="code" href="structmshadow_1_1Shape.html">Shape<5></a> dst;</div><div class="line"><a name="l00348"></a><span class="lineno"> 348</span>  <span class="keywordflow">switch</span> (src_layout) {</div><div class="line"><a name="l00349"></a><span class="lineno"> 349</span>  <span class="keywordflow">case</span> <a class="code" href="namespacemshadow.html#abbe2dc827052234b64ab2d40a5b2fdb4aa332dc48875dac0ef29ef245e5609822">kNCDHW</a>:</div><div class="line"><a name="l00350"></a><span class="lineno"> 350</span>  dst = src;</div><div class="line"><a name="l00351"></a><span class="lineno"> 351</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00352"></a><span class="lineno"> 352</span>  <span class="keywordflow">case</span> <a class="code" href="namespacemshadow.html#abbe2dc827052234b64ab2d40a5b2fdb4a37c45177ee0fe2468d562a9e5e3e38dd">kNDHWC</a>:</div><div class="line"><a name="l00353"></a><span class="lineno"> 353</span>  dst[0] = src[0];</div><div class="line"><a name="l00354"></a><span class="lineno"> 354</span>  dst[2] = src[1];</div><div class="line"><a name="l00355"></a><span class="lineno"> 355</span>  dst[3] = src[2];</div><div class="line"><a name="l00356"></a><span class="lineno"> 356</span>  dst[4] = src[3];</div><div class="line"><a name="l00357"></a><span class="lineno"> 357</span>  dst[1] = src[4];</div><div class="line"><a name="l00358"></a><span class="lineno"> 358</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00359"></a><span class="lineno"> 359</span>  <span class="keywordflow">default</span>:</div><div class="line"><a name="l00360"></a><span class="lineno"> 360</span>  LOG(FATAL) << <span class="stringliteral">"Invalid layout for 5d shape "</span> << src_layout;</div><div class="line"><a name="l00361"></a><span class="lineno"> 361</span>  }</div><div class="line"><a name="l00362"></a><span class="lineno"> 362</span>  <a class="code" href="structmshadow_1_1Shape.html">Shape<5></a> dst2;</div><div class="line"><a name="l00363"></a><span class="lineno"> 363</span>  <span class="keywordflow">switch</span> (dst_layout) {</div><div class="line"><a name="l00364"></a><span class="lineno"> 364</span>  <span class="keywordflow">case</span> <a class="code" href="namespacemshadow.html#abbe2dc827052234b64ab2d40a5b2fdb4aa332dc48875dac0ef29ef245e5609822">kNCDHW</a>:</div><div class="line"><a name="l00365"></a><span class="lineno"> 365</span>  <span class="keywordflow">return</span> dst;</div><div class="line"><a name="l00366"></a><span class="lineno"> 366</span>  <span class="keywordflow">case</span> <a class="code" href="namespacemshadow.html#abbe2dc827052234b64ab2d40a5b2fdb4a37c45177ee0fe2468d562a9e5e3e38dd">kNDHWC</a>:</div><div class="line"><a name="l00367"></a><span class="lineno"> 367</span>  dst2[0] = dst[0];</div><div class="line"><a name="l00368"></a><span class="lineno"> 368</span>  dst2[1] = dst[2];</div><div class="line"><a name="l00369"></a><span class="lineno"> 369</span>  dst2[2] = dst[3];</div><div class="line"><a name="l00370"></a><span class="lineno"> 370</span>  dst2[3] = dst[4];</div><div class="line"><a name="l00371"></a><span class="lineno"> 371</span>  dst2[4] = dst[1];</div><div class="line"><a name="l00372"></a><span class="lineno"> 372</span>  <span class="keywordflow">break</span>;</div><div class="line"><a name="l00373"></a><span class="lineno"> 373</span>  <span class="keywordflow">default</span>:</div><div class="line"><a name="l00374"></a><span class="lineno"> 374</span>  LOG(FATAL) << <span class="stringliteral">"Invalid layout for 5d shape "</span> << src_layout;</div><div class="line"><a name="l00375"></a><span class="lineno"> 375</span>  }</div><div class="line"><a name="l00376"></a><span class="lineno"> 376</span>  <span class="keywordflow">return</span> dst2;</div><div class="line"><a name="l00377"></a><span class="lineno"> 377</span> }</div><div class="line"><a name="l00378"></a><span class="lineno"> 378</span> </div><div class="line"><a name="l00382"></a><span class="lineno"> 382</span> <span class="keyword">template</span><<span class="keyword">typename</span> Device></div><div class="line"><a name="l00383"></a><span class="lineno"><a class="line" href="structmshadow_1_1Stream.html"> 383</a></span> <span class="keyword">struct </span><a class="code" href="structmshadow_1_1Stream.html">Stream</a> {</div><div class="line"><a name="l00384"></a><span class="lineno"> 384</span>  <span class="comment">// this is only a dummy implementation for CPU</span></div><div class="line"><a name="l00385"></a><span class="lineno"> 385</span>  <span class="comment">// for GPU, the actual implementation will be specialized in tensor_gpu-inl.h</span></div><div class="line"><a name="l00390"></a><span class="lineno"><a class="line" href="structmshadow_1_1Stream.html#ab17a2b049aacf5d71d8860262c4a98fd"> 390</a></span> <span class="comment"></span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="structmshadow_1_1Stream.html#ab17a2b049aacf5d71d8860262c4a98fd">Wait</a>(<span class="keywordtype">void</span>) {}</div><div class="line"><a name="l00395"></a><span class="lineno"><a class="line" href="structmshadow_1_1Stream.html#a7e5f0ac7f35dc725d6d03623a3cb454b"> 395</a></span>  <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="structmshadow_1_1Stream.html#a7e5f0ac7f35dc725d6d03623a3cb454b">CheckIdle</a>(<span class="keywordtype">void</span>) {</div><div class="line"><a name="l00396"></a><span class="lineno"> 396</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00397"></a><span class="lineno"> 397</span>  }</div><div class="line"><a name="l00399"></a><span class="lineno"><a class="line" href="structmshadow_1_1Stream.html#a20c547a7a44d975f23bad59d4c45f482"> 399</a></span>  <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="structmshadow_1_1Stream.html#a20c547a7a44d975f23bad59d4c45f482">CreateBlasHandle</a>() {}</div><div class="line"><a name="l00400"></a><span class="lineno"> 400</span> };</div><div class="line"><a name="l00408"></a><span class="lineno"> 408</span> <span class="keyword">template</span><<span class="keyword">typename</span> Container, <span class="keyword">typename</span> Device, <span class="keywordtype">int</span> dimension, <span class="keyword">typename</span> DType></div><div class="line"><a name="l00409"></a><span class="lineno"><a class="line" href="structmshadow_1_1TRValue.html"> 409</a></span> <span class="keyword">struct </span><a class="code" href="structmshadow_1_1TRValue.html">TRValue</a>: <span class="keyword">public</span> <a class="code" href="classmshadow_1_1expr_1_1RValueExp.html">expr::RValueExp</a><Container, DType> {</div><div class="line"><a name="l00410"></a><span class="lineno"> 410</span> };</div><div class="line"><a name="l00411"></a><span class="lineno"> 411</span> <span class="comment">// more compact template</span></div><div class="line"><a name="l00418"></a><span class="lineno"> 418</span> <span class="comment"></span><span class="keyword">template</span><<span class="keyword">typename</span> Device, <span class="keywordtype">int</span> dimension,</div><div class="line"><a name="l00419"></a><span class="lineno"> 419</span>  <span class="keyword">typename</span> DType <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#a1588e3cdf209b0cf13609d1c0e3838c7">MSHADOW_DEFAULT_DTYPE</a>></div><div class="line"><a name="l00420"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor.html"> 420</a></span> <span class="keyword">struct </span><a class="code" href="structmshadow_1_1Tensor.html">Tensor</a>: <span class="keyword">public</span> <a class="code" href="structmshadow_1_1TRValue.html">TRValue</a><Tensor<Device, dimension, DType>,</div><div class="line"><a name="l00421"></a><span class="lineno"> 421</span>  Device, dimension, DType> {</div><div class="line"><a name="l00422"></a><span class="lineno"> 422</span>  <span class="keyword">public</span>:</div><div class="line"><a name="l00423"></a><span class="lineno"> 423</span>  <span class="comment">//--------------------------------</span></div><div class="line"><a name="l00424"></a><span class="lineno"> 424</span>  <span class="comment">// struct memembers</span></div><div class="line"><a name="l00425"></a><span class="lineno"> 425</span>  <span class="comment">//--------------------------------</span></div><div class="line"><a name="l00427"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor.html#ac0d4fee2fcb7f11ee3aaf751df960d20"> 427</a></span> <span class="comment"></span> <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">bool</span> <a class="code" href="structmshadow_1_1cpu.html#a02cb5d79392d3ccf5d5f16beabf69171">kDevCPU</a> = Device::kDevCPU;</div><div class="line"><a name="l00429"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor.html#a21893468e1d5a595c040e26c77ce8ae2"> 429</a></span>  <span class="keyword">static</span> <span class="keyword">const</span> <span class="keywordtype">int</span> kSubdim = dimension - 1;</div><div class="line"><a name="l00430"></a><span class="lineno"> 430</span>  <span class="comment">//--------------------------------</span></div><div class="line"><a name="l00431"></a><span class="lineno"> 431</span>  <span class="comment">// struct memembers</span></div><div class="line"><a name="l00432"></a><span class="lineno"> 432</span>  <span class="comment">//--------------------------------</span></div><div class="line"><a name="l00434"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor.html#ad86d6759c585efb5229b3a0659973838"> 434</a></span> <span class="comment"></span> DType *dptr_ = <span class="keyword">nullptr</span>;</div><div class="line"><a name="l00436"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor.html#ad10c7414c5948e789e8761df2083c4e5"> 436</a></span>  <a class="code" href="structmshadow_1_1Shape.html">Shape<dimension></a> <a class="code" href="structmshadow_1_1Tensor.html#ad10c7414c5948e789e8761df2083c4e5">shape_</a>;</div><div class="line"><a name="l00441"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor.html#afee556f188e29bbd0ecc45fe98d3c1c3"> 441</a></span>  <a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> <a class="code" href="structmshadow_1_1Tensor.html#afee556f188e29bbd0ecc45fe98d3c1c3">stride_</a>;</div><div class="line"><a name="l00446"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor.html#a485d1558eaa9eded0b8fd23ed82c6298"> 446</a></span>  <a class="code" href="structmshadow_1_1Stream.html">Stream<Device></a> *<a class="code" href="structmshadow_1_1Tensor.html#a485d1558eaa9eded0b8fd23ed82c6298">stream_</a>;</div><div class="line"><a name="l00447"></a><span class="lineno"> 447</span>  <span class="comment">//--------------------------------</span></div><div class="line"><a name="l00448"></a><span class="lineno"> 448</span>  <span class="comment">// functions</span></div><div class="line"><a name="l00449"></a><span class="lineno"> 449</span>  <span class="comment">//--------------------------------</span></div><div class="line"><a name="l00451"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor.html#a8ca611225170e609e8de31abc577474b"> 451</a></span> <span class="comment"></span> <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <a class="code" href="structmshadow_1_1Tensor.html#a8ca611225170e609e8de31abc577474b">Tensor</a>(<span class="keywordtype">void</span>) : stream_(NULL) {}</div><div class="line"><a name="l00453"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor.html#a653a1a6ac33e797c18fe5178c99aeb63"> 453</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <a class="code" href="structmshadow_1_1Tensor.html#a653a1a6ac33e797c18fe5178c99aeb63">Tensor</a>(<span class="keyword">const</span> <a class="code" href="structmshadow_1_1Shape.html">Shape<dimension></a> &shape)</div><div class="line"><a name="l00454"></a><span class="lineno"> 454</span>  : shape_(shape), stream_(NULL) {}</div><div class="line"><a name="l00456"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor.html#ac2d6efce5c9db0b5615669b504cf5a62"> 456</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <a class="code" href="structmshadow_1_1Tensor.html#ac2d6efce5c9db0b5615669b504cf5a62">Tensor</a>(DType *dptr, <span class="keyword">const</span> <a class="code" href="structmshadow_1_1Shape.html">Shape<dimension></a> &shape)</div><div class="line"><a name="l00457"></a><span class="lineno"> 457</span>  : dptr_(dptr), shape_(shape), stride_(shape[kSubdim]), stream_(NULL) {}</div><div class="line"><a name="l00459"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor.html#a56f52a10e9aa77cba64ec497fa764322"> 459</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <a class="code" href="structmshadow_1_1Tensor.html#a56f52a10e9aa77cba64ec497fa764322">Tensor</a>(DType *dptr, <span class="keyword">const</span> <a class="code" href="structmshadow_1_1Shape.html">Shape<dimension></a> &shape,</div><div class="line"><a name="l00460"></a><span class="lineno"> 460</span>  <a class="code" href="structmshadow_1_1Stream.html">Stream<Device></a> *stream)</div><div class="line"><a name="l00461"></a><span class="lineno"> 461</span>  : dptr_(dptr), shape_(shape), stride_(shape[kSubdim]), stream_(stream) {}</div><div class="line"><a name="l00463"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor.html#a46c74e5aea791724344d059e107cfa34"> 463</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <a class="code" href="structmshadow_1_1Tensor.html#a46c74e5aea791724344d059e107cfa34">Tensor</a>(DType *dptr,</div><div class="line"><a name="l00464"></a><span class="lineno"> 464</span>  <span class="keyword">const</span> <a class="code" href="structmshadow_1_1Shape.html">Shape<dimension></a> &shape,</div><div class="line"><a name="l00465"></a><span class="lineno"> 465</span>  <a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> stride, <a class="code" href="structmshadow_1_1Stream.html">Stream<Device></a> *stream)</div><div class="line"><a name="l00466"></a><span class="lineno"> 466</span>  : dptr_(dptr), shape_(shape), stride_(stride), stream_(stream) {}</div><div class="line"><a name="l00471"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor.html#a6f19dfd9e4181e6b5500b50d48cf7e5c"> 471</a></span>  <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="structmshadow_1_1Tensor.html#a6f19dfd9e4181e6b5500b50d48cf7e5c">set_stream</a>(<a class="code" href="structmshadow_1_1Stream.html">Stream<Device></a> *stream) {</div><div class="line"><a name="l00472"></a><span class="lineno"> 472</span>  this->stream_ = stream;</div><div class="line"><a name="l00473"></a><span class="lineno"> 473</span>  }</div><div class="line"><a name="l00478"></a><span class="lineno"> 478</span>  <span class="keyword">template</span><<span class="keywordtype">int</span> startdim></div><div class="line"><a name="l00479"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor.html#a810b0902ab38d4b6a6d55b86a1febd80"> 479</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> <a class="code" href="structmshadow_1_1Tensor.html#a810b0902ab38d4b6a6d55b86a1febd80">MemSize</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{</div><div class="line"><a name="l00480"></a><span class="lineno"> 480</span>  <a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> memsz = this->stride_;</div><div class="line"><a name="l00481"></a><span class="lineno"> 481</span> <span class="preprocessor"> #pragma unroll</span></div><div class="line"><a name="l00482"></a><span class="lineno"> 482</span>  <span class="keywordflow">for</span> (<span class="keywordtype">int</span> i = startdim; i < kSubdim; ++i) {</div><div class="line"><a name="l00483"></a><span class="lineno"> 483</span>  memsz *= this->shape_[i];</div><div class="line"><a name="l00484"></a><span class="lineno"> 484</span>  }</div><div class="line"><a name="l00485"></a><span class="lineno"> 485</span>  <span class="keywordflow">return</span> memsz;</div><div class="line"><a name="l00486"></a><span class="lineno"> 486</span>  }</div><div class="line"><a name="l00491"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor.html#a9cc7d01a1eb0825d7a3fcdabc8e58f07"> 491</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <span class="keywordtype">bool</span> <a class="code" href="structmshadow_1_1Tensor.html#a9cc7d01a1eb0825d7a3fcdabc8e58f07">CheckContiguous</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{</div><div class="line"><a name="l00492"></a><span class="lineno"> 492</span>  <span class="keywordflow">return</span> this->shape_[dimension - 1] == stride_;</div><div class="line"><a name="l00493"></a><span class="lineno"> 493</span>  }</div><div class="line"><a name="l00497"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor.html#a01a586757f1d2abba12d0f4fdf2fdeb1"> 497</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> <a class="code" href="structmshadow_1_1Tensor.html#a01a586757f1d2abba12d0f4fdf2fdeb1">MSize</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{</div><div class="line"><a name="l00498"></a><span class="lineno"> 498</span>  <span class="keywordflow">return</span> this->MemSize<0>();</div><div class="line"><a name="l00499"></a><span class="lineno"> 499</span>  }</div><div class="line"><a name="l00505"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor.html#a88cbcae11653307bfa4c99804320b638"> 505</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> <a class="code" href="structmshadow_1_1Tensor.html#a88cbcae11653307bfa4c99804320b638">size</a>(<span class="keywordtype">int</span> idx)<span class="keyword"> const </span>{</div><div class="line"><a name="l00506"></a><span class="lineno"> 506</span>  <span class="keywordflow">return</span> shape_[idx];</div><div class="line"><a name="l00507"></a><span class="lineno"> 507</span>  }</div><div class="line"><a name="l00512"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor.html#a66c736a2899eba9f83ee9ced3d02a944"> 512</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html">Tensor<Device, 1, DType></a> <a class="code" href="structmshadow_1_1Tensor.html#a66c736a2899eba9f83ee9ced3d02a944">FlatTo1D</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{</div><div class="line"><a name="l00513"></a><span class="lineno"> 513</span>  <span class="keywordflow">return</span> <a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html">Tensor<Device, 1, DType></a>(dptr_, shape_.<a class="code" href="structmshadow_1_1Shape.html#a09790c1034fa223d2782736a0d053a75">FlatTo1D</a>(), stride_, stream_);</div><div class="line"><a name="l00514"></a><span class="lineno"> 514</span>  }</div><div class="line"><a name="l00519"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor.html#a48a5927e810fbc45e43e92cfe397d9f2"> 519</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<Device, 2, DType></a> <a class="code" href="structmshadow_1_1Tensor.html#a48a5927e810fbc45e43e92cfe397d9f2">FlatTo2D</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{</div><div class="line"><a name="l00520"></a><span class="lineno"> 520</span>  <span class="keywordflow">return</span> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<Device, 2, DType></a>(dptr_, shape_.<a class="code" href="structmshadow_1_1Shape.html#a91c0fd04c351199f119950b044ad9c99">FlatTo2D</a>(), stride_, stream_);</div><div class="line"><a name="l00521"></a><span class="lineno"> 521</span>  }</div><div class="line"><a name="l00527"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor.html#ad6d595c2864496f21f9642f102678711"> 527</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<Device, kSubdim, DType></a> <a class="code" href="structmshadow_1_1Tensor.html#ad6d595c2864496f21f9642f102678711">operator[]</a>(<a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> idx)<span class="keyword"> const </span>{</div><div class="line"><a name="l00528"></a><span class="lineno"> 528</span>  <span class="keywordflow">return</span> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<Device, kSubdim, DType></a>(dptr_ + this->MemSize<1>() * idx,</div><div class="line"><a name="l00529"></a><span class="lineno"> 529</span>  shape_.<a class="code" href="structmshadow_1_1Shape.html#a40f409ff54982ded075f373aec6147a2">SubShape</a>(), stride_, stream_);</div><div class="line"><a name="l00530"></a><span class="lineno"> 530</span>  }</div><div class="line"><a name="l00537"></a><span class="lineno"> 537</span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<Device, dimension, DType></a></div><div class="line"><a name="l00538"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor.html#a95a73cfaf27ceeca3c54cf50fad665e9"> 538</a></span>  <a class="code" href="structmshadow_1_1Tensor.html#a95a73cfaf27ceeca3c54cf50fad665e9">Slice</a>(<a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> begin, <a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> end)<span class="keyword"> const </span>{</div><div class="line"><a name="l00539"></a><span class="lineno"> 539</span>  <a class="code" href="structmshadow_1_1Shape.html">Shape<dimension></a> s = this->shape_;</div><div class="line"><a name="l00540"></a><span class="lineno"> 540</span>  s[0] = end - begin;</div><div class="line"><a name="l00541"></a><span class="lineno"> 541</span>  <span class="keywordflow">return</span> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<Device, dimension, DType></a>(dptr_ + this->MemSize<1>() * begin,</div><div class="line"><a name="l00542"></a><span class="lineno"> 542</span>  s, stride_, stream_);</div><div class="line"><a name="l00543"></a><span class="lineno"> 543</span>  }</div><div class="line"><a name="l00545"></a><span class="lineno"> 545</span>  <span class="keyword">inline</span> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<Device, dimension, DType></a> &</div><div class="line"><a name="l00546"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor.html#abbe0542a36bb2ba0f5837a83b47b809d"> 546</a></span>  <a class="code" href="structmshadow_1_1Tensor.html#abbe0542a36bb2ba0f5837a83b47b809d">operator=</a>(<span class="keyword">const</span> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<Device, dimension, DType></a> &exp) {</div><div class="line"><a name="l00547"></a><span class="lineno"> 547</span>  dptr_ = exp.<a class="code" href="structmshadow_1_1Tensor.html#ad86d6759c585efb5229b3a0659973838">dptr_</a>;</div><div class="line"><a name="l00548"></a><span class="lineno"> 548</span>  shape_ = exp.<a class="code" href="structmshadow_1_1Tensor.html#ad10c7414c5948e789e8761df2083c4e5">shape_</a>;</div><div class="line"><a name="l00549"></a><span class="lineno"> 549</span>  stride_ = exp.<a class="code" href="structmshadow_1_1Tensor.html#afee556f188e29bbd0ecc45fe98d3c1c3">stride_</a>;</div><div class="line"><a name="l00550"></a><span class="lineno"> 550</span>  stream_ = exp.<a class="code" href="structmshadow_1_1Tensor.html#a485d1558eaa9eded0b8fd23ed82c6298">stream_</a>;</div><div class="line"><a name="l00551"></a><span class="lineno"> 551</span>  <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div><div class="line"><a name="l00552"></a><span class="lineno"> 552</span>  }</div><div class="line"><a name="l00554"></a><span class="lineno"> 554</span>  <span class="keyword">template</span><<span class="keyword">typename</span> E, <span class="keywordtype">int</span> etype></div><div class="line"><a name="l00555"></a><span class="lineno"> 555</span>  <span class="keyword">inline</span> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<Device, dimension, DType></a> &</div><div class="line"><a name="l00556"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor.html#a9792526b9a83108c63471788d0c8fa0b"> 556</a></span>  <a class="code" href="structmshadow_1_1Tensor.html#a9792526b9a83108c63471788d0c8fa0b">operator=</a>(<span class="keyword">const</span> <a class="code" href="structmshadow_1_1expr_1_1Exp.html">expr::Exp<E, DType, etype></a> &exp) {</div><div class="line"><a name="l00557"></a><span class="lineno"> 557</span>  <span class="keywordflow">return</span> this->__assign(exp);</div><div class="line"><a name="l00558"></a><span class="lineno"> 558</span>  }</div><div class="line"><a name="l00560"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor.html#add6431b4c399ae29151780ce37a9d843"> 560</a></span>  <span class="keyword">inline</span> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<Device, dimension, DType></a> &<a class="code" href="structmshadow_1_1Tensor.html#add6431b4c399ae29151780ce37a9d843">operator=</a>(<span class="keyword">const</span> DType &exp) {</div><div class="line"><a name="l00561"></a><span class="lineno"> 561</span>  <span class="keywordflow">return</span> this->__assign(exp);</div><div class="line"><a name="l00562"></a><span class="lineno"> 562</span>  }</div><div class="line"><a name="l00563"></a><span class="lineno"> 563</span> };</div><div class="line"><a name="l00564"></a><span class="lineno"> 564</span> <span class="comment">/*</span></div><div class="line"><a name="l00565"></a><span class="lineno"> 565</span> <span class="comment"> * respecialized class Tensor1D, thei is due to different implementation in operator[]</span></div><div class="line"><a name="l00566"></a><span class="lineno"> 566</span> <span class="comment"> */</span></div><div class="line"><a name="l00567"></a><span class="lineno"> 567</span> <span class="keyword">template</span><<span class="keyword">typename</span> Device, <span class="keyword">typename</span> DType></div><div class="line"><a name="l00568"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html"> 568</a></span> <span class="keyword">struct </span><a class="code" href="structmshadow_1_1Tensor.html">Tensor</a><Device, 1, DType>:</div><div class="line"><a name="l00569"></a><span class="lineno"> 569</span>  <span class="keyword">public</span> <a class="code" href="structmshadow_1_1TRValue.html">TRValue</a><Tensor<Device, 1, DType>, Device, 1, DType> {</div><div class="line"><a name="l00570"></a><span class="lineno"> 570</span>  <span class="keyword">public</span>:</div><div class="line"><a name="l00571"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a98c523db2418f25f868842fb32c16a35"> 571</a></span>  DType *<a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a98c523db2418f25f868842fb32c16a35">dptr_</a>;</div><div class="line"><a name="l00572"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#ad48d29c0aa2a12ab9b1580cda44f1a34"> 572</a></span>  <a class="code" href="structmshadow_1_1Shape.html">Shape<1></a> <a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#ad48d29c0aa2a12ab9b1580cda44f1a34">shape_</a>;</div><div class="line"><a name="l00573"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a4b43b01c513d310a17864a409c96fa39"> 573</a></span>  <a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> <a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a4b43b01c513d310a17864a409c96fa39">stride_</a>;</div><div class="line"><a name="l00574"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a9790363151a34829fcb18aa51b25a95f"> 574</a></span>  <a class="code" href="structmshadow_1_1Stream.html">Stream<Device></a> *<a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a9790363151a34829fcb18aa51b25a95f">stream_</a>;</div><div class="line"><a name="l00575"></a><span class="lineno"> 575</span>  <span class="comment">// constructor</span></div><div class="line"><a name="l00576"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a68955bd28e0e1a7e8266fb6c1760057e"> 576</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a68955bd28e0e1a7e8266fb6c1760057e">Tensor</a>(<span class="keywordtype">void</span>) : stream_(NULL) {}</div><div class="line"><a name="l00577"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a6eb477e0583cd20d275819d9be01e9c1"> 577</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a6eb477e0583cd20d275819d9be01e9c1">Tensor</a>(<span class="keyword">const</span> <a class="code" href="structmshadow_1_1Shape.html">Shape<1></a> &shape)</div><div class="line"><a name="l00578"></a><span class="lineno"> 578</span>  : shape_(shape), stream_(NULL) {}</div><div class="line"><a name="l00579"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a90469a0f8652b389c02c88bbe911e4f5"> 579</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a90469a0f8652b389c02c88bbe911e4f5">Tensor</a>(DType *dptr, <a class="code" href="structmshadow_1_1Shape.html">Shape<1></a> shape)</div><div class="line"><a name="l00580"></a><span class="lineno"> 580</span>  : dptr_(dptr), shape_(shape), stride_(shape[0]), stream_(NULL) {}</div><div class="line"><a name="l00581"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a13db380a3f72ccc85a0205320244b1f9"> 581</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a13db380a3f72ccc85a0205320244b1f9">Tensor</a>(DType *dptr, <a class="code" href="structmshadow_1_1Shape.html">Shape<1></a> shape, <a class="code" href="structmshadow_1_1Stream.html">Stream<Device></a> *stream)</div><div class="line"><a name="l00582"></a><span class="lineno"> 582</span>  : dptr_(dptr), shape_(shape), stride_(shape[0]), stream_(stream) {}</div><div class="line"><a name="l00583"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a6f5216f1cc1d6743592d8a59a103b259"> 583</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a6f5216f1cc1d6743592d8a59a103b259">Tensor</a>(DType *dptr, <a class="code" href="structmshadow_1_1Shape.html">Shape<1></a> shape,</div><div class="line"><a name="l00584"></a><span class="lineno"> 584</span>  <a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> stride, <a class="code" href="structmshadow_1_1Stream.html">Stream<Device></a> *stream)</div><div class="line"><a name="l00585"></a><span class="lineno"> 585</span>  : dptr_(dptr), shape_(shape), stride_(stride), stream_(stream) {}</div><div class="line"><a name="l00586"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a7143b0339fae5b9dc20d3d158c4c3b15"> 586</a></span>  <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a7143b0339fae5b9dc20d3d158c4c3b15">set_stream</a>(<a class="code" href="structmshadow_1_1Stream.html">Stream<Device></a> *stream) {</div><div class="line"><a name="l00587"></a><span class="lineno"> 587</span>  this->stream_ = stream;</div><div class="line"><a name="l00588"></a><span class="lineno"> 588</span>  }</div><div class="line"><a name="l00589"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#aee3127de201bce405eada043f1868468"> 589</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html">Tensor<Device, 1, DType></a> <a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#aee3127de201bce405eada043f1868468">FlatTo1D</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{</div><div class="line"><a name="l00590"></a><span class="lineno"> 590</span>  <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div><div class="line"><a name="l00591"></a><span class="lineno"> 591</span>  }</div><div class="line"><a name="l00592"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#aaaafeee143e9974943bf21f7bac9ad49"> 592</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<Device, 2, DType></a> <a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#aaaafeee143e9974943bf21f7bac9ad49">FlatTo2D</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{</div><div class="line"><a name="l00593"></a><span class="lineno"> 593</span>  <span class="keywordflow">return</span> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<Device, 2, DType></a>(dptr_, shape_.<a class="code" href="structmshadow_1_1Shape.html#a91c0fd04c351199f119950b044ad9c99">FlatTo2D</a>(), stride_, stream_);</div><div class="line"><a name="l00594"></a><span class="lineno"> 594</span>  }</div><div class="line"><a name="l00595"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#ab226ac2741b111ecdf3c2b1bd3564f24"> 595</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html">Tensor<Device, 1, DType></a> <a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#ab226ac2741b111ecdf3c2b1bd3564f24">Slice</a>(<a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> begin, <a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> end)<span class="keyword"> const </span>{</div><div class="line"><a name="l00596"></a><span class="lineno"> 596</span>  <a class="code" href="structmshadow_1_1Shape.html">Shape<1></a> s;</div><div class="line"><a name="l00597"></a><span class="lineno"> 597</span>  s[0] = end - begin;</div><div class="line"><a name="l00598"></a><span class="lineno"> 598</span>  <span class="keywordflow">return</span> <a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html">Tensor<Device, 1, DType></a>(dptr_ + begin, s, s[0], stream_);</div><div class="line"><a name="l00599"></a><span class="lineno"> 599</span>  }</div><div class="line"><a name="l00600"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a23c9cc5c4fb298a5514c3a31d350087f"> 600</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <span class="keywordtype">bool</span> <a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a23c9cc5c4fb298a5514c3a31d350087f">CheckContiguous</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{</div><div class="line"><a name="l00601"></a><span class="lineno"> 601</span>  <span class="keywordflow">return</span> <span class="keyword">true</span>;</div><div class="line"><a name="l00602"></a><span class="lineno"> 602</span>  }</div><div class="line"><a name="l00603"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a114d8b89115fae0b6d38f211f43f6adc"> 603</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> <a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a114d8b89115fae0b6d38f211f43f6adc">MSize</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{</div><div class="line"><a name="l00604"></a><span class="lineno"> 604</span>  <span class="keywordflow">return</span> shape_[0];</div><div class="line"><a name="l00605"></a><span class="lineno"> 605</span>  }</div><div class="line"><a name="l00606"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#ad58f6139a1d680c2dab2919cd448a9cf"> 606</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> <a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#ad58f6139a1d680c2dab2919cd448a9cf">size</a>(<a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> i)<span class="keyword"> const </span>{</div><div class="line"><a name="l00607"></a><span class="lineno"> 607</span>  <span class="keywordflow">return</span> shape_[0];</div><div class="line"><a name="l00608"></a><span class="lineno"> 608</span>  }</div><div class="line"><a name="l00609"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#ace41d40048eeabbb52b0c09dc2087c98"> 609</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> DType &<a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#ace41d40048eeabbb52b0c09dc2087c98">operator[]</a>(<a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> idx) {</div><div class="line"><a name="l00610"></a><span class="lineno"> 610</span>  <span class="keywordflow">return</span> dptr_[idx];</div><div class="line"><a name="l00611"></a><span class="lineno"> 611</span>  }</div><div class="line"><a name="l00612"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#ac9d84c69612ffe3de4ea539882cb0b91"> 612</a></span>  <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a> <span class="keyword">const</span> DType &<a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#ac9d84c69612ffe3de4ea539882cb0b91">operator[]</a>(<a class="code" href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">index_t</a> idx)<span class="keyword"> const </span>{</div><div class="line"><a name="l00613"></a><span class="lineno"> 613</span>  <span class="keywordflow">return</span> dptr_[idx];</div><div class="line"><a name="l00614"></a><span class="lineno"> 614</span>  }</div><div class="line"><a name="l00616"></a><span class="lineno"> 616</span>  <span class="keyword">inline</span> <a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html">Tensor<Device, 1, DType></a> &</div><div class="line"><a name="l00617"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a0bd39c6d12a8a00bab6f5963b87cec33"> 617</a></span>  <a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a0bd39c6d12a8a00bab6f5963b87cec33">operator=</a>(<span class="keyword">const</span> <a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html">Tensor<Device, 1, DType></a> &exp) {</div><div class="line"><a name="l00618"></a><span class="lineno"> 618</span>  dptr_ = exp.<a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a98c523db2418f25f868842fb32c16a35">dptr_</a>;</div><div class="line"><a name="l00619"></a><span class="lineno"> 619</span>  shape_ = exp.<a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#ad48d29c0aa2a12ab9b1580cda44f1a34">shape_</a>;</div><div class="line"><a name="l00620"></a><span class="lineno"> 620</span>  stride_ = exp.<a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a4b43b01c513d310a17864a409c96fa39">stride_</a>;</div><div class="line"><a name="l00621"></a><span class="lineno"> 621</span>  stream_ = exp.<a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a9790363151a34829fcb18aa51b25a95f">stream_</a>;</div><div class="line"><a name="l00622"></a><span class="lineno"> 622</span>  <span class="keywordflow">return</span> *<span class="keyword">this</span>;</div><div class="line"><a name="l00623"></a><span class="lineno"> 623</span>  }</div><div class="line"><a name="l00624"></a><span class="lineno"> 624</span>  <span class="keyword">template</span><<span class="keyword">typename</span> E, <span class="keywordtype">int</span> etype></div><div class="line"><a name="l00625"></a><span class="lineno"> 625</span>  <span class="keyword">inline</span> <a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html">Tensor<Device, 1, DType></a> &</div><div class="line"><a name="l00626"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#ae73374ca91b919e869881f19f9754747"> 626</a></span>  <a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#ae73374ca91b919e869881f19f9754747">operator=</a>(<span class="keyword">const</span> <a class="code" href="structmshadow_1_1expr_1_1Exp.html">expr::Exp<E, DType, etype></a> &exp) {</div><div class="line"><a name="l00627"></a><span class="lineno"> 627</span>  <span class="keywordflow">return</span> this->__assign(exp);</div><div class="line"><a name="l00628"></a><span class="lineno"> 628</span>  }</div><div class="line"><a name="l00629"></a><span class="lineno"><a class="line" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#aa33a34930f1f85e5e071fd5870a0c76b"> 629</a></span>  <span class="keyword">inline</span> <a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html">Tensor<Device, 1, DType></a> &<a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#aa33a34930f1f85e5e071fd5870a0c76b">operator=</a>(<span class="keyword">const</span> DType &exp) {</div><div class="line"><a name="l00630"></a><span class="lineno"> 630</span>  <span class="keywordflow">return</span> this->__assign(exp);</div><div class="line"><a name="l00631"></a><span class="lineno"> 631</span>  }</div><div class="line"><a name="l00632"></a><span class="lineno"> 632</span> };</div><div class="line"><a name="l00633"></a><span class="lineno"> 633</span> <span class="comment">//------------------------</span></div><div class="line"><a name="l00634"></a><span class="lineno"> 634</span> <span class="comment">// Function Declarations</span></div><div class="line"><a name="l00635"></a><span class="lineno"> 635</span> <span class="comment">//-----------------------</span></div><div class="line"><a name="l00643"></a><span class="lineno"> 643</span> <span class="comment"></span><span class="keyword">template</span><<span class="keyword">typename</span> Device></div><div class="line"><a name="l00644"></a><span class="lineno"> 644</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespacemshadow.html#a6b745d61d1080fe259e44807488e1eb3">InitTensorEngine</a>(<span class="keywordtype">int</span> device_id = 0);</div><div class="line"><a name="l00651"></a><span class="lineno"> 651</span> <span class="keyword">template</span><<span class="keyword">typename</span> Device></div><div class="line"><a name="l00652"></a><span class="lineno"> 652</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespacemshadow.html#a7b4e440ab207c132ec525d65620d39b9">ShutdownTensorEngine</a>(<span class="keywordtype">void</span>);</div><div class="line"><a name="l00658"></a><span class="lineno"> 658</span> <span class="keyword">template</span><<span class="keyword">typename</span> Device></div><div class="line"><a name="l00659"></a><span class="lineno"> 659</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespacemshadow.html#abb4c36a0703ec671a5e74b0a8d37a47a">SetDevice</a>(<span class="keywordtype">int</span> devid);</div><div class="line"><a name="l00668"></a><span class="lineno"> 668</span> <span class="keyword">template</span><<span class="keyword">typename</span> Device></div><div class="line"><a name="l00669"></a><span class="lineno"> 669</span> <span class="keyword">inline</span> <a class="code" href="structmshadow_1_1Stream.html">Stream<Device></a> *<a class="code" href="namespacemshadow.html#a9653fd4a06f2b2c7eb099daec4dbdee9">NewStream</a>(<span class="keywordtype">bool</span> create_blas_handle,</div><div class="line"><a name="l00670"></a><span class="lineno"> 670</span>  <span class="keywordtype">bool</span> create_dnn_handle,</div><div class="line"><a name="l00671"></a><span class="lineno"> 671</span>  <span class="keywordtype">int</span> dev_id = -1);</div><div class="line"><a name="l00676"></a><span class="lineno"> 676</span> <span class="keyword">template</span><<span class="keyword">typename</span> Device></div><div class="line"><a name="l00677"></a><span class="lineno"><a class="line" href="namespacemshadow.html#aade27b4799d889b4bf3f1b3ba48479f2"> 677</a></span> <span class="keyword">inline</span> <a class="code" href="structmshadow_1_1Stream.html">Stream<Device></a> *<a class="code" href="namespacemshadow.html#a9653fd4a06f2b2c7eb099daec4dbdee9">NewStream</a>(<span class="keywordtype">int</span> dev_id) {</div><div class="line"><a name="l00678"></a><span class="lineno"> 678</span>  <span class="keywordflow">return</span> NewStream<Device>(<span class="keyword">true</span>, <span class="keyword">false</span>, dev_id);</div><div class="line"><a name="l00679"></a><span class="lineno"> 679</span> }</div><div class="line"><a name="l00684"></a><span class="lineno"> 684</span> <span class="keyword">template</span><<span class="keyword">typename</span> Device></div><div class="line"><a name="l00685"></a><span class="lineno"> 685</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespacemshadow.html#af301ba1d360a6a46aecdcb5ec8031aa0">DeleteStream</a>(<a class="code" href="structmshadow_1_1Stream.html">Stream<Device></a> *stream);</div><div class="line"><a name="l00697"></a><span class="lineno"> 697</span> <span class="keyword">template</span><<span class="keywordtype">int</span> dim, <span class="keyword">typename</span> DType></div><div class="line"><a name="l00698"></a><span class="lineno"> 698</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespacemshadow.html#aef49c3cef522198322017315341ac689">AllocSpace</a>(<a class="code" href="structmshadow_1_1Tensor.html">Tensor<cpu, dim, DType></a> *obj,</div><div class="line"><a name="l00699"></a><span class="lineno"> 699</span>  <span class="keywordtype">bool</span> <a class="code" href="namespacemshadow_1_1expr.html#a97c45c821ac8275dd75fa585f47b9e00">pad</a> = <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#a72d4e933c0003ccdc01b5d5f054dcf39">MSHADOW_ALLOC_PAD</a>);</div><div class="line"><a name="l00711"></a><span class="lineno"> 711</span> <span class="keyword">template</span><<span class="keywordtype">int</span> dim, <span class="keyword">typename</span> DType></div><div class="line"><a name="l00712"></a><span class="lineno"> 712</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespacemshadow.html#aef49c3cef522198322017315341ac689">AllocSpace</a>(<a class="code" href="structmshadow_1_1Tensor.html">Tensor<gpu, dim, DType></a> *obj,</div><div class="line"><a name="l00713"></a><span class="lineno"> 713</span>  <span class="keywordtype">bool</span> <a class="code" href="namespacemshadow_1_1expr.html#a97c45c821ac8275dd75fa585f47b9e00">pad</a> = <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#a72d4e933c0003ccdc01b5d5f054dcf39">MSHADOW_ALLOC_PAD</a>);</div><div class="line"><a name="l00720"></a><span class="lineno"> 720</span> <span class="keyword">template</span><<span class="keywordtype">int</span> dim, <span class="keyword">typename</span> DType></div><div class="line"><a name="l00721"></a><span class="lineno"> 721</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespacemshadow.html#a3e8485c882dab873525b4b241e5db7ab">FreeSpace</a>(<a class="code" href="structmshadow_1_1Tensor.html">Tensor<cpu, dim, DType></a> *obj);</div><div class="line"><a name="l00728"></a><span class="lineno"> 728</span> <span class="keyword">template</span><<span class="keywordtype">int</span> dim, <span class="keyword">typename</span> DType></div><div class="line"><a name="l00729"></a><span class="lineno"> 729</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespacemshadow.html#a3e8485c882dab873525b4b241e5db7ab">FreeSpace</a>(<a class="code" href="structmshadow_1_1Tensor.html">Tensor<gpu, dim, DType></a> *obj);</div><div class="line"><a name="l00742"></a><span class="lineno"> 742</span> <span class="keyword">template</span><<span class="keyword">typename</span> Device, <span class="keyword">typename</span> DType, <span class="keywordtype">int</span> dim></div><div class="line"><a name="l00743"></a><span class="lineno"> 743</span> <span class="keyword">inline</span> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<Device, dim, DType></a> <a class="code" href="namespacemshadow.html#a3f19232d4c6ea393abccc5288675d345">NewTensor</a>(<span class="keyword">const</span> <a class="code" href="structmshadow_1_1Shape.html">Shape<dim></a> &shape,</div><div class="line"><a name="l00744"></a><span class="lineno"> 744</span>  DType initv,</div><div class="line"><a name="l00745"></a><span class="lineno"> 745</span>  <span class="keywordtype">bool</span> <a class="code" href="namespacemshadow_1_1expr.html#a97c45c821ac8275dd75fa585f47b9e00">pad</a> = <a class="code" href="3rdparty_2mshadow_2mshadow_2base_8h.html#a72d4e933c0003ccdc01b5d5f054dcf39">MSHADOW_ALLOC_PAD</a>,</div><div class="line"><a name="l00746"></a><span class="lineno"> 746</span>  <a class="code" href="structmshadow_1_1Stream.html">Stream<Device></a> *stream = NULL);</div><div class="line"><a name="l00755"></a><span class="lineno"> 755</span> <span class="keyword">template</span><<span class="keywordtype">int</span> dim, <span class="keyword">typename</span> DType></div><div class="line"><a name="l00756"></a><span class="lineno"> 756</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespacemshadow.html#a0435f827863555e4ed19bbc0cc81fa39">Copy</a>(<a class="code" href="structmshadow_1_1Tensor.html">Tensor<cpu, dim, DType></a> dst,</div><div class="line"><a name="l00757"></a><span class="lineno"> 757</span>  <span class="keyword">const</span> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<cpu, dim, DType></a> &src,</div><div class="line"><a name="l00758"></a><span class="lineno"> 758</span>  <a class="code" href="structmshadow_1_1Stream.html">Stream<cpu></a> *stream = NULL);</div><div class="line"><a name="l00767"></a><span class="lineno"> 767</span> <span class="keyword">template</span><<span class="keywordtype">int</span> dim, <span class="keyword">typename</span> DType></div><div class="line"><a name="l00768"></a><span class="lineno"> 768</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespacemshadow.html#a0435f827863555e4ed19bbc0cc81fa39">Copy</a>(<a class="code" href="structmshadow_1_1Tensor.html">Tensor<cpu, dim, DType></a> dst,</div><div class="line"><a name="l00769"></a><span class="lineno"> 769</span>  <span class="keyword">const</span> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<gpu, dim, DType></a> &src,</div><div class="line"><a name="l00770"></a><span class="lineno"> 770</span>  <a class="code" href="structmshadow_1_1Stream_3_01gpu_01_4.html">Stream<gpu></a> *stream = NULL);</div><div class="line"><a name="l00779"></a><span class="lineno"> 779</span> <span class="keyword">template</span><<span class="keywordtype">int</span> dim, <span class="keyword">typename</span> DType></div><div class="line"><a name="l00780"></a><span class="lineno"> 780</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespacemshadow.html#a0435f827863555e4ed19bbc0cc81fa39">Copy</a>(<a class="code" href="structmshadow_1_1Tensor.html">Tensor<gpu, dim, DType></a> dst,</div><div class="line"><a name="l00781"></a><span class="lineno"> 781</span>  <span class="keyword">const</span> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<cpu, dim, DType></a> &src,</div><div class="line"><a name="l00782"></a><span class="lineno"> 782</span>  <a class="code" href="structmshadow_1_1Stream_3_01gpu_01_4.html">Stream<gpu></a> *stream = NULL);</div><div class="line"><a name="l00791"></a><span class="lineno"> 791</span> <span class="keyword">template</span><<span class="keywordtype">int</span> dim, <span class="keyword">typename</span> DType></div><div class="line"><a name="l00792"></a><span class="lineno"> 792</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespacemshadow.html#a0435f827863555e4ed19bbc0cc81fa39">Copy</a>(<a class="code" href="structmshadow_1_1Tensor.html">Tensor<gpu, dim, DType></a> dst,</div><div class="line"><a name="l00793"></a><span class="lineno"> 793</span>  <span class="keyword">const</span> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<gpu, dim, DType></a> &src,</div><div class="line"><a name="l00794"></a><span class="lineno"> 794</span>  <a class="code" href="structmshadow_1_1Stream_3_01gpu_01_4.html">Stream<gpu></a> *stream = NULL);</div><div class="line"><a name="l00800"></a><span class="lineno"> 800</span> <span class="keyword">template</span><<span class="keyword">typename</span> DType></div><div class="line"><a name="l00801"></a><span class="lineno"> 801</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespacemshadow.html#a75161ef5ed964dcf6518e3a7e59e6fb6">Softmax</a>(<a class="code" href="structmshadow_1_1Tensor.html">Tensor<cpu, 2, DType></a> dst, <span class="keyword">const</span> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<cpu, 2, DType></a> &energy);</div><div class="line"><a name="l00807"></a><span class="lineno"> 807</span> <span class="keyword">template</span><<span class="keyword">typename</span> DType></div><div class="line"><a name="l00808"></a><span class="lineno"> 808</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespacemshadow.html#a75161ef5ed964dcf6518e3a7e59e6fb6">Softmax</a>(<a class="code" href="structmshadow_1_1Tensor.html">Tensor<gpu, 2, DType></a> dst, <span class="keyword">const</span> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<gpu, 2, DType></a> &energy);</div><div class="line"><a name="l00809"></a><span class="lineno"> 809</span> </div><div class="line"><a name="l00816"></a><span class="lineno"> 816</span> <span class="keyword">template</span><<span class="keyword">typename</span> DType></div><div class="line"><a name="l00817"></a><span class="lineno"> 817</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespacemshadow.html#a3409c8a836e7dab83bec25556164261c">SoftmaxGrad</a>(<a class="code" href="structmshadow_1_1Tensor.html">Tensor<cpu, 2, DType></a> dst,</div><div class="line"><a name="l00818"></a><span class="lineno"> 818</span>  <span class="keyword">const</span> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<cpu, 2, DType></a> &src,</div><div class="line"><a name="l00819"></a><span class="lineno"> 819</span>  <span class="keyword">const</span> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<cpu, 1, DType></a> &label);</div><div class="line"><a name="l00826"></a><span class="lineno"> 826</span> <span class="keyword">template</span><<span class="keyword">typename</span> DType></div><div class="line"><a name="l00827"></a><span class="lineno"> 827</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespacemshadow.html#a3409c8a836e7dab83bec25556164261c">SoftmaxGrad</a>(<span class="keyword">const</span> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<gpu, 2, DType></a> &dst,</div><div class="line"><a name="l00828"></a><span class="lineno"> 828</span>  <span class="keyword">const</span> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<gpu, 2, DType></a> &src,</div><div class="line"><a name="l00829"></a><span class="lineno"> 829</span>  <span class="keyword">const</span> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<gpu, 1, DType></a> &label);</div><div class="line"><a name="l00838"></a><span class="lineno"> 838</span> <span class="keyword">template</span><<span class="keywordtype">bool</span> clip = true, <span class="keyword">typename</span> IndexType, <span class="keyword">typename</span> DType></div><div class="line"><a name="l00839"></a><span class="lineno"> 839</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespacemshadow.html#a802d44c652195053e87b63881c7d4d1c">AddTakeGrad</a>(<a class="code" href="structmshadow_1_1Tensor.html">Tensor<cpu, 2, DType></a> dst,</div><div class="line"><a name="l00840"></a><span class="lineno"> 840</span>  <span class="keyword">const</span> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<cpu, 1, IndexType></a>& index,</div><div class="line"><a name="l00841"></a><span class="lineno"> 841</span>  <span class="keyword">const</span> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<cpu, 2, DType></a> &src);</div><div class="line"><a name="l00850"></a><span class="lineno"> 850</span> <span class="keyword">template</span><<span class="keywordtype">bool</span> clip = true, <span class="keyword">typename</span> IndexType, <span class="keyword">typename</span> DType></div><div class="line"><a name="l00851"></a><span class="lineno"> 851</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespacemshadow.html#a802d44c652195053e87b63881c7d4d1c">AddTakeGrad</a>(<a class="code" href="structmshadow_1_1Tensor.html">Tensor<gpu, 2, DType></a> dst,</div><div class="line"><a name="l00852"></a><span class="lineno"> 852</span>  <span class="keyword">const</span> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<gpu, 1, IndexType></a>& index,</div><div class="line"><a name="l00853"></a><span class="lineno"> 853</span>  <span class="keyword">const</span> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<gpu, 2, DType></a> &src);</div><div class="line"><a name="l00863"></a><span class="lineno"> 863</span> <span class="keyword">template</span><<span class="keyword">typename</span> IndexType, <span class="keyword">typename</span> DType></div><div class="line"><a name="l00864"></a><span class="lineno"> 864</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespacemshadow.html#ad2320213151030353ae90f92a0da808d">AddTakeGradLargeBatch</a>(<a class="code" href="structmshadow_1_1Tensor.html">Tensor<cpu, 2, DType></a> dst,</div><div class="line"><a name="l00865"></a><span class="lineno"> 865</span>  <span class="keyword">const</span> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<cpu, 1, IndexType></a>& sorted,</div><div class="line"><a name="l00866"></a><span class="lineno"> 866</span>  <span class="keyword">const</span> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<cpu, 1, IndexType></a>& index,</div><div class="line"><a name="l00867"></a><span class="lineno"> 867</span>  <span class="keyword">const</span> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<cpu, 2, DType></a> &src);</div><div class="line"><a name="l00877"></a><span class="lineno"> 877</span> <span class="keyword">template</span><<span class="keyword">typename</span> IndexType, <span class="keyword">typename</span> DType></div><div class="line"><a name="l00878"></a><span class="lineno"> 878</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespacemshadow.html#ad2320213151030353ae90f92a0da808d">AddTakeGradLargeBatch</a>(<a class="code" href="structmshadow_1_1Tensor.html">Tensor<gpu, 2, DType></a> dst,</div><div class="line"><a name="l00879"></a><span class="lineno"> 879</span>  <span class="keyword">const</span> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<gpu, 1, IndexType></a>& sorted,</div><div class="line"><a name="l00880"></a><span class="lineno"> 880</span>  <span class="keyword">const</span> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<gpu, 1, IndexType></a>& index,</div><div class="line"><a name="l00881"></a><span class="lineno"> 881</span>  <span class="keyword">const</span> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<gpu, 2, DType></a> &src);</div><div class="line"><a name="l00890"></a><span class="lineno"> 890</span> <span class="keyword">template</span><<span class="keyword">typename</span> IndexType, <span class="keyword">typename</span> DType></div><div class="line"><a name="l00891"></a><span class="lineno"> 891</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespacemshadow.html#a77348ebaaac4581773b4fe78448c8fa6">IndexFill</a>(<a class="code" href="structmshadow_1_1Tensor.html">Tensor<cpu, 2, DType></a> dst,</div><div class="line"><a name="l00892"></a><span class="lineno"> 892</span>  <span class="keyword">const</span> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<cpu, 1, IndexType></a>& index,</div><div class="line"><a name="l00893"></a><span class="lineno"> 893</span>  <span class="keyword">const</span> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<cpu, 2, DType></a> &src);</div><div class="line"><a name="l00902"></a><span class="lineno"> 902</span> <span class="keyword">template</span><<span class="keyword">typename</span> IndexType, <span class="keyword">typename</span> DType></div><div class="line"><a name="l00903"></a><span class="lineno"> 903</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespacemshadow.html#a77348ebaaac4581773b4fe78448c8fa6">IndexFill</a>(<a class="code" href="structmshadow_1_1Tensor.html">Tensor<gpu, 2, DType></a> dst,</div><div class="line"><a name="l00904"></a><span class="lineno"> 904</span>  <span class="keyword">const</span> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<gpu, 1, IndexType></a>& index,</div><div class="line"><a name="l00905"></a><span class="lineno"> 905</span>  <span class="keyword">const</span> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<gpu, 2, DType></a> &src);</div><div class="line"><a name="l00912"></a><span class="lineno"> 912</span> <span class="keyword">template</span><<span class="keyword">typename</span> KDType, <span class="keyword">typename</span> VDType></div><div class="line"><a name="l00913"></a><span class="lineno"> 913</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespacemshadow.html#a3476fdf7d39add6f57beddafbc1b9625">SortByKey</a>(<a class="code" href="structmshadow_1_1Tensor.html">Tensor<cpu, 1, KDType></a> keys, <a class="code" href="structmshadow_1_1Tensor.html">Tensor<cpu, 1, VDType></a> values,</div><div class="line"><a name="l00914"></a><span class="lineno"> 914</span>  <span class="keywordtype">bool</span> is_ascend = <span class="keyword">true</span>);</div><div class="line"><a name="l00921"></a><span class="lineno"> 921</span> <span class="keyword">template</span><<span class="keyword">typename</span> KDType, <span class="keyword">typename</span> VDType></div><div class="line"><a name="l00922"></a><span class="lineno"> 922</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespacemshadow.html#a3476fdf7d39add6f57beddafbc1b9625">SortByKey</a>(<a class="code" href="structmshadow_1_1Tensor.html">Tensor<gpu, 1, KDType></a> keys, <a class="code" href="structmshadow_1_1Tensor.html">Tensor<gpu, 1, VDType></a> values,</div><div class="line"><a name="l00923"></a><span class="lineno"> 923</span>  <span class="keywordtype">bool</span> is_ascend = <span class="keyword">true</span>);</div><div class="line"><a name="l00932"></a><span class="lineno"> 932</span> <span class="keyword">template</span><<span class="keyword">typename</span> Device, <span class="keyword">typename</span> VDType, <span class="keyword">typename</span> SDType></div><div class="line"><a name="l00933"></a><span class="lineno"> 933</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespacemshadow.html#ab3f080439f035e05501cc7f202e58c0e">VectorizedSort</a>(<a class="code" href="structmshadow_1_1Tensor.html">Tensor<Device, 1, VDType></a> values, <a class="code" href="structmshadow_1_1Tensor.html">Tensor<Device, 1, SDType></a> segments);</div><div class="line"><a name="l00934"></a><span class="lineno"> 934</span> </div><div class="line"><a name="l00935"></a><span class="lineno"> 935</span> <span class="comment">// function declarations to support expression, no need to understand them</span></div><div class="line"><a name="l00936"></a><span class="lineno"> 936</span> <span class="comment">// these functions do not need to be directly used</span></div><div class="line"><a name="l00949"></a><span class="lineno"> 949</span> <span class="comment"></span><span class="keyword">template</span><<span class="keyword">typename</span> Saver, <span class="keyword">typename</span> R, <span class="keywordtype">int</span> dim,</div><div class="line"><a name="l00950"></a><span class="lineno"> 950</span>  <span class="keyword">typename</span> DType, <span class="keyword">typename</span> E, <span class="keywordtype">int</span> etype></div><div class="line"><a name="l00951"></a><span class="lineno"> 951</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespacemshadow.html#a4bdc2c62fd5dcee696cadd2351bf85e2">MapExp</a>(<a class="code" href="structmshadow_1_1TRValue.html">TRValue<R, cpu, dim, DType></a> *dst,</div><div class="line"><a name="l00952"></a><span class="lineno"> 952</span>  <span class="keyword">const</span> <a class="code" href="structmshadow_1_1expr_1_1Exp.html">expr::Exp<E, DType, etype></a> &exp);</div><div class="line"><a name="l00965"></a><span class="lineno"> 965</span> <span class="keyword">template</span><<span class="keyword">typename</span> Saver, <span class="keyword">typename</span> R, <span class="keywordtype">int</span> dim,</div><div class="line"><a name="l00966"></a><span class="lineno"> 966</span>  <span class="keyword">typename</span> DType, <span class="keyword">typename</span> E, <span class="keywordtype">int</span> etype></div><div class="line"><a name="l00967"></a><span class="lineno"> 967</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespacemshadow.html#a4bdc2c62fd5dcee696cadd2351bf85e2">MapExp</a>(<a class="code" href="structmshadow_1_1TRValue.html">TRValue<R, gpu, dim, DType></a> *dst,</div><div class="line"><a name="l00968"></a><span class="lineno"> 968</span>  <span class="keyword">const</span> <a class="code" href="structmshadow_1_1expr_1_1Exp.html">expr::Exp<E, DType, etype></a> &exp);</div><div class="line"><a name="l00982"></a><span class="lineno"> 982</span> <span class="keyword">template</span><<span class="keyword">typename</span> Saver, <span class="keyword">typename</span> Reducer,</div><div class="line"><a name="l00983"></a><span class="lineno"> 983</span>  <span class="keyword">typename</span> R, <span class="keyword">typename</span> DType, <span class="keyword">typename</span> E, <span class="keywordtype">int</span> etype></div><div class="line"><a name="l00984"></a><span class="lineno"> 984</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespacemshadow.html#ae1734eb7939fe9627de46d62494fe9dc">MapReduceKeepLowest</a>(<a class="code" href="structmshadow_1_1TRValue.html">TRValue<R, cpu, 1, DType></a> *dst,</div><div class="line"><a name="l00985"></a><span class="lineno"> 985</span>  <span class="keyword">const</span> <a class="code" href="structmshadow_1_1expr_1_1Exp.html">expr::Exp<E, DType, etype></a> &exp,</div><div class="line"><a name="l00986"></a><span class="lineno"> 986</span>  DType scale = 1);</div><div class="line"><a name="l01000"></a><span class="lineno"> 1000</span> <span class="keyword">template</span><<span class="keyword">typename</span> Saver, <span class="keyword">typename</span> Reducer, <span class="keyword">typename</span> R,</div><div class="line"><a name="l01001"></a><span class="lineno"> 1001</span>  <span class="keyword">typename</span> DType, <span class="keyword">typename</span> E, <span class="keywordtype">int</span> etype></div><div class="line"><a name="l01002"></a><span class="lineno"> 1002</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespacemshadow.html#ae1734eb7939fe9627de46d62494fe9dc">MapReduceKeepLowest</a>(<a class="code" href="structmshadow_1_1TRValue.html">TRValue<R, gpu, 1, DType></a> *dst,</div><div class="line"><a name="l01003"></a><span class="lineno"> 1003</span>  <span class="keyword">const</span> <a class="code" href="structmshadow_1_1expr_1_1Exp.html">expr::Exp<E, DType, etype></a> &exp,</div><div class="line"><a name="l01004"></a><span class="lineno"> 1004</span>  DType scale = 1);</div><div class="line"><a name="l01019"></a><span class="lineno"> 1019</span> <span class="keyword">template</span><<span class="keyword">typename</span> Saver, <span class="keyword">typename</span> Reducer, <span class="keywordtype">int</span> dimkeep,</div><div class="line"><a name="l01020"></a><span class="lineno"> 1020</span>  <span class="keyword">typename</span> R, <span class="keyword">typename</span> DType, <span class="keyword">typename</span> E, <span class="keywordtype">int</span> etype></div><div class="line"><a name="l01021"></a><span class="lineno"> 1021</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespacemshadow.html#a5fce5c2df842439cc7d2d7a90e2cf7d4">MapReduceKeepHighDim</a>(<a class="code" href="structmshadow_1_1TRValue.html">TRValue<R, cpu, 1, DType></a> *dst,</div><div class="line"><a name="l01022"></a><span class="lineno"> 1022</span>  <span class="keyword">const</span> <a class="code" href="structmshadow_1_1expr_1_1Exp.html">expr::Exp<E, DType, etype></a> &exp,</div><div class="line"><a name="l01023"></a><span class="lineno"> 1023</span>  DType scale = 1);</div><div class="line"><a name="l01038"></a><span class="lineno"> 1038</span> <span class="keyword">template</span><<span class="keyword">typename</span> Saver, <span class="keyword">typename</span> Reducer, <span class="keywordtype">int</span> dimkeep,</div><div class="line"><a name="l01039"></a><span class="lineno"> 1039</span>  <span class="keyword">typename</span> R, <span class="keyword">typename</span> DType, <span class="keyword">typename</span> E, <span class="keywordtype">int</span> etype></div><div class="line"><a name="l01040"></a><span class="lineno"> 1040</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespacemshadow.html#a5fce5c2df842439cc7d2d7a90e2cf7d4">MapReduceKeepHighDim</a>(<a class="code" href="structmshadow_1_1TRValue.html">TRValue<R, gpu, 1, DType></a> *dst,</div><div class="line"><a name="l01041"></a><span class="lineno"> 1041</span>  <span class="keyword">const</span> <a class="code" href="structmshadow_1_1expr_1_1Exp.html">expr::Exp<E, DType, etype></a> &exp,</div><div class="line"><a name="l01042"></a><span class="lineno"> 1042</span>  DType scale = 1);</div><div class="line"><a name="l01049"></a><span class="lineno"> 1049</span> <span class="keyword">template</span><<span class="keyword">typename</span> Device, <span class="keyword">typename</span> DType></div><div class="line"><a name="l01050"></a><span class="lineno"> 1050</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespacemshadow.html#ad4c4674a33dfb486802427058375a055">VectorDot</a>(<a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html">Tensor<Device, 1, DType></a> dst,</div><div class="line"><a name="l01051"></a><span class="lineno"> 1051</span>  <span class="keyword">const</span> <a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html">Tensor<Device, 1, DType></a> &lhs,</div><div class="line"><a name="l01052"></a><span class="lineno"> 1052</span>  <span class="keyword">const</span> <a class="code" href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html">Tensor<Device, 1, DType></a> &rhs);</div><div class="line"><a name="l01062"></a><span class="lineno"> 1062</span> <span class="keyword">template</span><<span class="keywordtype">bool</span> transpose_left, <span class="keywordtype">bool</span> transpose_right, <span class="keyword">typename</span> Device, <span class="keyword">typename</span> DType></div><div class="line"><a name="l01063"></a><span class="lineno"> 1063</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="namespacemshadow.html#a04a223d0f4e8af8c3f504bb5d324ad43">BatchGEMM</a>(<a class="code" href="structmshadow_1_1Tensor.html">Tensor<Device, 3, DType></a> dst,</div><div class="line"><a name="l01064"></a><span class="lineno"> 1064</span>  <span class="keyword">const</span> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<Device, 3, DType></a> &lhs,</div><div class="line"><a name="l01065"></a><span class="lineno"> 1065</span>  <span class="keyword">const</span> <a class="code" href="structmshadow_1_1Tensor.html">Tensor<Device, 3, DType></a> &rhs,</div><div class="line"><a name="l01066"></a><span class="lineno"> 1066</span>  DType alpha,</div><div class="line"><a name="l01067"></a><span class="lineno"> 1067</span>  DType beta,</div><div class="line"><a name="l01068"></a><span class="lineno"> 1068</span>  <a class="code" href="structmshadow_1_1Tensor.html">Tensor<Device, 1, DType*></a> workspace);</div><div class="line"><a name="l01069"></a><span class="lineno"> 1069</span> } <span class="comment">// namespace mshadow</span></div><div class="line"><a name="l01070"></a><span class="lineno"> 1070</span> <span class="comment">// include headers</span></div><div class="line"><a name="l01071"></a><span class="lineno"> 1071</span> <span class="preprocessor">#include "<a class="code" href="stream__gpu-inl_8h.html">./stream_gpu-inl.h</a>"</span></div><div class="line"><a name="l01072"></a><span class="lineno"> 1072</span> <span class="preprocessor">#include "<a class="code" href="extension_8h.html">./extension.h</a>"</span></div><div class="line"><a name="l01073"></a><span class="lineno"> 1073</span> <span class="preprocessor">#include "<a class="code" href="expr__engine-inl_8h.html">./expr_engine-inl.h</a>"</span></div><div class="line"><a name="l01074"></a><span class="lineno"> 1074</span> <span class="preprocessor">#include "<a class="code" href="tensor__cpu-inl_8h.html">./tensor_cpu-inl.h</a>"</span></div><div class="line"><a name="l01075"></a><span class="lineno"> 1075</span> <span class="preprocessor">#include "<a class="code" href="tensor__gpu-inl_8h.html">./tensor_gpu-inl.h</a>"</span></div><div class="line"><a name="l01076"></a><span class="lineno"> 1076</span> <span class="preprocessor">#include "<a class="code" href="3rdparty_2mshadow_2mshadow_2io_8h.html">./io.h</a>"</span></div><div class="line"><a name="l01077"></a><span class="lineno"> 1077</span> <span class="preprocessor">#include "<a class="code" href="tensor__container_8h.html">./tensor_container.h</a>"</span></div><div class="line"><a name="l01078"></a><span class="lineno"> 1078</span> <span class="preprocessor">#include "<a class="code" href="random_8h.html">./random.h</a>"</span></div><div class="line"><a name="l01079"></a><span class="lineno"> 1079</span> <span class="comment">// add definition of scalar related operators</span></div><div class="line"><a name="l01080"></a><span class="lineno"> 1080</span> <span class="preprocessor">#ifdef MSHADOW_SCALAR_</span></div><div class="line"><a name="l01081"></a><span class="lineno"> 1081</span> <span class="preprocessor"> #error "MSHADOW_SCALAR_ must not be defined"</span></div><div class="line"><a name="l01082"></a><span class="lineno"> 1082</span> <span class="preprocessor">#endif</span></div><div class="line"><a name="l01083"></a><span class="lineno"> 1083</span> <span class="comment">// enumerate all the scalar data type we aim to be good at</span></div><div class="line"><a name="l01084"></a><span class="lineno"> 1084</span> <span class="preprocessor">#define MSHADOW_SCALAR_ float</span></div><div class="line"><a name="l01085"></a><span class="lineno"> 1085</span> <span class="preprocessor">#include "<a class="code" href="expr__scalar-inl_8h.html">./expr_scalar-inl.h</a>"</span></div><div class="line"><a name="l01086"></a><span class="lineno"> 1086</span> <span class="preprocessor">#undef MSHADOW_SCALAR_</span></div><div class="line"><a name="l01087"></a><span class="lineno"> 1087</span> <span class="preprocessor">#define MSHADOW_SCALAR_ double</span></div><div class="line"><a name="l01088"></a><span class="lineno"> 1088</span> <span class="preprocessor">#include "<a class="code" href="expr__scalar-inl_8h.html">./expr_scalar-inl.h</a>"</span></div><div class="line"><a name="l01089"></a><span class="lineno"> 1089</span> <span class="preprocessor">#undef MSHADOW_SCALAR_</span></div><div class="line"><a name="l01090"></a><span class="lineno"> 1090</span> <span class="preprocessor">#define MSHADOW_SCALAR_ int32_t</span></div><div class="line"><a name="l01091"></a><span class="lineno"> 1091</span> <span class="preprocessor">#include "<a class="code" href="expr__scalar-inl_8h.html">./expr_scalar-inl.h</a>"</span></div><div class="line"><a name="l01092"></a><span class="lineno"> 1092</span> <span class="preprocessor">#undef MSHADOW_SCALAR_</span></div><div class="line"><a name="l01093"></a><span class="lineno"> 1093</span> <span class="preprocessor">#define MSHADOW_SCALAR_ int64_t</span></div><div class="line"><a name="l01094"></a><span class="lineno"> 1094</span> <span class="preprocessor">#include "<a class="code" href="expr__scalar-inl_8h.html">./expr_scalar-inl.h</a>"</span></div><div class="line"><a name="l01095"></a><span class="lineno"> 1095</span> <span class="preprocessor">#undef MSHADOW_SCALAR_</span></div><div class="line"><a name="l01096"></a><span class="lineno"><a class="line" href="tensor_8h.html#aa0b60d7de7151387e5ecc0d41c82259d"> 1096</a></span> <span class="preprocessor">#define MSHADOW_SCALAR_ mshadow::half::half_t</span></div><div class="line"><a name="l01097"></a><span class="lineno"> 1097</span> <span class="preprocessor">#include "<a class="code" href="expr__scalar-inl_8h.html">./expr_scalar-inl.h</a>"</span></div><div class="line"><a name="l01098"></a><span class="lineno"> 1098</span> <span class="preprocessor">#undef MSHADOW_SCALAR_</span></div><div class="line"><a name="l01099"></a><span class="lineno"> 1099</span> <span class="preprocessor">#endif // MSHADOW_TENSOR_H_</span></div><div class="ttc" id="structmshadow_1_1Shape_html_ac101e89c424c3f5d2c37a369d8d7bb79"><div class="ttname"><a href="structmshadow_1_1Shape.html#ac101e89c424c3f5d2c37a369d8d7bb79">mshadow::Shape::operator==</a></div><div class="ttdeci">MSHADOW_XINLINE bool operator==(const Shape< kDimension > &s) const</div><div class="ttdef"><b>Definition:</b> tensor.h:105</div></div> |
| <div class="ttc" id="namespacemshadow_html_ad4c4674a33dfb486802427058375a055"><div class="ttname"><a href="namespacemshadow.html#ad4c4674a33dfb486802427058375a055">mshadow::VectorDot</a></div><div class="ttdeci">void VectorDot(Tensor< Device, 1, DType > dst, const Tensor< Device, 1, DType > &lhs, const Tensor< Device, 1, DType > &rhs)</div><div class="ttdoc">CPU/GPU: 1 dimension vector dot. </div><div class="ttdef"><b>Definition:</b> tensor_cpu-inl.h:597</div></div> |
| <div class="ttc" id="namespacemshadow_html_a3e8485c882dab873525b4b241e5db7ab"><div class="ttname"><a href="namespacemshadow.html#a3e8485c882dab873525b4b241e5db7ab">mshadow::FreeSpace</a></div><div class="ttdeci">void FreeSpace(Tensor< cpu, dim, DType > *obj)</div><div class="ttdoc">CPU/GPU: free the space of tensor, will set obj.dptr to NULL. </div><div class="ttdef"><b>Definition:</b> tensor_cpu-inl.h:140</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4_html_a9790363151a34829fcb18aa51b25a95f"><div class="ttname"><a href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a9790363151a34829fcb18aa51b25a95f">mshadow::Tensor< Device, 1, DType >::stream_</a></div><div class="ttdeci">Stream< Device > * stream_</div><div class="ttdef"><b>Definition:</b> tensor.h:574</div></div> |
| <div class="ttc" id="structmshadow_1_1Shape_html_aec509cb541250181ba664a4db41896e9"><div class="ttname"><a href="structmshadow_1_1Shape.html#aec509cb541250181ba664a4db41896e9">mshadow::Shape::operator[]</a></div><div class="ttdeci">MSHADOW_XINLINE index_t & operator[](int idx)</div><div class="ttdoc">get corresponding index </div><div class="ttdef"><b>Definition:</b> tensor.h:90</div></div> |
| <div class="ttc" id="namespacemshadow_html_a77348ebaaac4581773b4fe78448c8fa6"><div class="ttname"><a href="namespacemshadow.html#a77348ebaaac4581773b4fe78448c8fa6">mshadow::IndexFill</a></div><div class="ttdeci">void IndexFill(Tensor< cpu, 2, DType > dst, const Tensor< cpu, 1, IndexType > &index, const Tensor< cpu, 2, DType > &src)</div><div class="ttdoc">CPU/GPU: Fill the values of the destination matrix to specific rows in the source matrix...</div><div class="ttdef"><b>Definition:</b> tensor_cpu-inl.h:547</div></div> |
| <div class="ttc" id="namespacemshadow_html_abbe2dc827052234b64ab2d40a5b2fdb4aa332dc48875dac0ef29ef245e5609822"><div class="ttname"><a href="namespacemshadow.html#abbe2dc827052234b64ab2d40a5b2fdb4aa332dc48875dac0ef29ef245e5609822">mshadow::kNCDHW</a></div><div class="ttdef"><b>Definition:</b> base.h:496</div></div> |
| <div class="ttc" id="namespacemshadow_html_a3409c8a836e7dab83bec25556164261c"><div class="ttname"><a href="namespacemshadow.html#a3409c8a836e7dab83bec25556164261c">mshadow::SoftmaxGrad</a></div><div class="ttdeci">void SoftmaxGrad(Tensor< cpu, 2, DType > dst, const Tensor< cpu, 2, DType > &src, const Tensor< cpu, 1, DType > &label)</div><div class="ttdoc">CPU/GPU: softmax gradient. </div><div class="ttdef"><b>Definition:</b> tensor_cpu-inl.h:306</div></div> |
| <div class="ttc" id="namespacemshadow_1_1expr_html_a97c45c821ac8275dd75fa585f47b9e00"><div class="ttname"><a href="namespacemshadow_1_1expr.html#a97c45c821ac8275dd75fa585f47b9e00">mshadow::expr::pad</a></div><div class="ttdeci">PaddingExp< SrcExp, DType, ExpInfo< SrcExp >::kDim > pad(const Exp< SrcExp, DType, etype > &src, index_t pad)</div><div class="ttdoc">padding expression, pad a image with zeros on boundaries, padding affects shape[0], and shape[1] </div><div class="ttdef"><b>Definition:</b> pad.h:71</div></div> |
| <div class="ttc" id="namespacemshadow_html_a04a223d0f4e8af8c3f504bb5d324ad43"><div class="ttname"><a href="namespacemshadow.html#a04a223d0f4e8af8c3f504bb5d324ad43">mshadow::BatchGEMM</a></div><div class="ttdeci">void BatchGEMM(Tensor< Device, 3, DType > dst, const Tensor< Device, 3, DType > &lhs, const Tensor< Device, 3, DType > &rhs, DType alpha, DType beta, Tensor< Device, 1, DType *> workspace)</div><div class="ttdoc">CPU/GPU: dst = alpha * op(lhs) op(rhs) + beta * dst. </div><div class="ttdef"><b>Definition:</b> tensor_cpu-inl.h:610</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_html_ad86d6759c585efb5229b3a0659973838"><div class="ttname"><a href="structmshadow_1_1Tensor.html#ad86d6759c585efb5229b3a0659973838">mshadow::Tensor::dptr_</a></div><div class="ttdeci">DType * dptr_</div><div class="ttdoc">pointer to the data </div><div class="ttdef"><b>Definition:</b> tensor.h:434</div></div> |
| <div class="ttc" id="structmshadow_1_1TRValue_html"><div class="ttname"><a href="structmshadow_1_1TRValue.html">mshadow::TRValue</a></div><div class="ttdoc">Tensor RValue, this is the super type of all kinds of possible tensors. </div><div class="ttdef"><b>Definition:</b> tensor.h:409</div></div> |
| <div class="ttc" id="namespacemshadow_html_a9653fd4a06f2b2c7eb099daec4dbdee9"><div class="ttname"><a href="namespacemshadow.html#a9653fd4a06f2b2c7eb099daec4dbdee9">mshadow::NewStream</a></div><div class="ttdeci">Stream< Device > * NewStream(bool create_blas_handle, bool create_dnn_handle, int dev_id=-1)</div><div class="ttdoc">create a new stream from system </div></div> |
| <div class="ttc" id="namespacemshadow_html_a0435f827863555e4ed19bbc0cc81fa39"><div class="ttname"><a href="namespacemshadow.html#a0435f827863555e4ed19bbc0cc81fa39">mshadow::Copy</a></div><div class="ttdeci">void Copy(Tensor< cpu, dim, DType > dst, const Tensor< cpu, dim, DType > &src, Stream< cpu > *stream=NULL)</div><div class="ttdoc">copy data from one tensor to another, with same shape </div><div class="ttdef"><b>Definition:</b> tensor_cpu-inl.h:145</div></div> |
| <div class="ttc" id="namespacemshadow_html_a7b4e440ab207c132ec525d65620d39b9"><div class="ttname"><a href="namespacemshadow.html#a7b4e440ab207c132ec525d65620d39b9">mshadow::ShutdownTensorEngine</a></div><div class="ttdeci">void ShutdownTensorEngine(void)</div><div class="ttdoc">Shutdown tensor engine on current device this function should be called after all GPU tensor operatio...</div></div> |
| <div class="ttc" id="structmshadow_1_1Shape_html"><div class="ttname"><a href="structmshadow_1_1Shape.html">mshadow::Shape</a></div><div class="ttdoc">shape of a tensor </div><div class="ttdef"><b>Definition:</b> tensor.h:53</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_html_a01a586757f1d2abba12d0f4fdf2fdeb1"><div class="ttname"><a href="structmshadow_1_1Tensor.html#a01a586757f1d2abba12d0f4fdf2fdeb1">mshadow::Tensor::MSize</a></div><div class="ttdeci">MSHADOW_XINLINE index_t MSize(void) const</div><div class="ttdef"><b>Definition:</b> tensor.h:497</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4_html_a13db380a3f72ccc85a0205320244b1f9"><div class="ttname"><a href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a13db380a3f72ccc85a0205320244b1f9">mshadow::Tensor< Device, 1, DType >::Tensor</a></div><div class="ttdeci">MSHADOW_XINLINE Tensor(DType *dptr, Shape< 1 > shape, Stream< Device > *stream)</div><div class="ttdef"><b>Definition:</b> tensor.h:581</div></div> |
| <div class="ttc" id="namespacemshadow_html_a4bdc2c62fd5dcee696cadd2351bf85e2"><div class="ttname"><a href="namespacemshadow.html#a4bdc2c62fd5dcee696cadd2351bf85e2">mshadow::MapExp</a></div><div class="ttdeci">void MapExp(TRValue< R, cpu, dim, DType > *dst, const expr::Exp< E, DType, etype > &exp)</div><div class="ttdoc">CPU/GPU: map a expression to a tensor, this function calls MapPlan. </div><div class="ttdef"><b>Definition:</b> tensor_cpu-inl.h:207</div></div> |
| <div class="ttc" id="structmshadow_1_1Stream_3_01gpu_01_4_html"><div class="ttname"><a href="structmshadow_1_1Stream_3_01gpu_01_4.html">mshadow::Stream< gpu ></a></div><div class="ttdef"><b>Definition:</b> stream_gpu-inl.h:37</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_html_ac2d6efce5c9db0b5615669b504cf5a62"><div class="ttname"><a href="structmshadow_1_1Tensor.html#ac2d6efce5c9db0b5615669b504cf5a62">mshadow::Tensor::Tensor</a></div><div class="ttdeci">MSHADOW_XINLINE Tensor(DType *dptr, const Shape< dimension > &shape)</div><div class="ttdoc">constructor from data pointer and shape, without stride </div><div class="ttdef"><b>Definition:</b> tensor.h:456</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_html_ad10c7414c5948e789e8761df2083c4e5"><div class="ttname"><a href="structmshadow_1_1Tensor.html#ad10c7414c5948e789e8761df2083c4e5">mshadow::Tensor::shape_</a></div><div class="ttdeci">Shape< dimension > shape_</div><div class="ttdoc">shape of the tensor </div><div class="ttdef"><b>Definition:</b> tensor.h:436</div></div> |
| <div class="ttc" id="namespacemshadow_html_a8fc5237744c6eda97f3070ddcb0c715e"><div class="ttname"><a href="namespacemshadow.html#a8fc5237744c6eda97f3070ddcb0c715e">mshadow::Shape4</a></div><div class="ttdeci">MSHADOW_XINLINE Shape< 4 > Shape4(index_t s0, index_t s1, index_t s2, index_t s3)</div><div class="ttdoc">construct a four dimension shape, stride will equal s0 </div><div class="ttdef"><b>Definition:</b> tensor.h:240</div></div> |
| <div class="ttc" id="namespacemshadow_html_a3476fdf7d39add6f57beddafbc1b9625"><div class="ttname"><a href="namespacemshadow.html#a3476fdf7d39add6f57beddafbc1b9625">mshadow::SortByKey</a></div><div class="ttdeci">void SortByKey(Tensor< cpu, 1, KDType > keys, Tensor< cpu, 1, VDType > values, bool is_ascend=true)</div><div class="ttdoc">CPU/GPU: Sort key-value pairs stored in separate places. (Stable sort is performed!) ...</div><div class="ttdef"><b>Definition:</b> tensor_cpu-inl.h:558</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_html_a9792526b9a83108c63471788d0c8fa0b"><div class="ttname"><a href="structmshadow_1_1Tensor.html#a9792526b9a83108c63471788d0c8fa0b">mshadow::Tensor::operator=</a></div><div class="ttdeci">Tensor< Device, dimension, DType > & operator=(const expr::Exp< E, DType, etype > &exp)</div><div class="ttdoc">functions to fit expression template </div><div class="ttdef"><b>Definition:</b> tensor.h:556</div></div> |
| <div class="ttc" id="namespacemshadow_html_a75161ef5ed964dcf6518e3a7e59e6fb6"><div class="ttname"><a href="namespacemshadow.html#a75161ef5ed964dcf6518e3a7e59e6fb6">mshadow::Softmax</a></div><div class="ttdeci">void Softmax(Tensor< cpu, 2, DType > dst, const Tensor< cpu, 2, DType > &energy)</div><div class="ttdoc">CPU/GPU: normalize softmax: dst[i][j] = exp(energy[i][j]) /(sum_j exp(energy[i][j])) ...</div><div class="ttdef"><b>Definition:</b> tensor_cpu-inl.h:483</div></div> |
| <div class="ttc" id="structmshadow_1_1Shape_html_a40f409ff54982ded075f373aec6147a2"><div class="ttname"><a href="structmshadow_1_1Shape.html#a40f409ff54982ded075f373aec6147a2">mshadow::Shape::SubShape</a></div><div class="ttdeci">MSHADOW_XINLINE Shape< kSubdim > SubShape(void) const</div><div class="ttdoc">get subshape that takes off largest dimension v * </div><div class="ttdef"><b>Definition:</b> tensor.h:169</div></div> |
| <div class="ttc" id="namespacemshadow_html_ab3f080439f035e05501cc7f202e58c0e"><div class="ttname"><a href="namespacemshadow.html#ab3f080439f035e05501cc7f202e58c0e">mshadow::VectorizedSort</a></div><div class="ttdeci">void VectorizedSort(Tensor< Device, 1, VDType > values, Tensor< Device, 1, SDType > segments)</div><div class="ttdoc">CPU/GPU: Sort the keys within each segment. (Stable sort is performed!) Segments is defined as an asc...</div><div class="ttdef"><b>Definition:</b> tensor_cpu-inl.h:589</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_html_a6f19dfd9e4181e6b5500b50d48cf7e5c"><div class="ttname"><a href="structmshadow_1_1Tensor.html#a6f19dfd9e4181e6b5500b50d48cf7e5c">mshadow::Tensor::set_stream</a></div><div class="ttdeci">void set_stream(Stream< Device > *stream)</div><div class="ttdoc">set the stream to do computation of current tensor </div><div class="ttdef"><b>Definition:</b> tensor.h:471</div></div> |
| <div class="ttc" id="classmshadow_1_1expr_1_1RValueExp_html"><div class="ttname"><a href="classmshadow_1_1expr_1_1RValueExp.html">mshadow::expr::RValueExp</a></div><div class="ttdoc">base class of all rvalues </div><div class="ttdef"><b>Definition:</b> expression.h:148</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4_html_a114d8b89115fae0b6d38f211f43f6adc"><div class="ttname"><a href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a114d8b89115fae0b6d38f211f43f6adc">mshadow::Tensor< Device, 1, DType >::MSize</a></div><div class="ttdeci">MSHADOW_XINLINE index_t MSize(void) const</div><div class="ttdef"><b>Definition:</b> tensor.h:603</div></div> |
| <div class="ttc" id="namespacemshadow_html_abbe2dc827052234b64ab2d40a5b2fdb4ae633c123a9c9897779d5c00ea5381775"><div class="ttname"><a href="namespacemshadow.html#abbe2dc827052234b64ab2d40a5b2fdb4ae633c123a9c9897779d5c00ea5381775">mshadow::kNCHW</a></div><div class="ttdef"><b>Definition:</b> base.h:488</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4_html_ab226ac2741b111ecdf3c2b1bd3564f24"><div class="ttname"><a href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#ab226ac2741b111ecdf3c2b1bd3564f24">mshadow::Tensor< Device, 1, DType >::Slice</a></div><div class="ttdeci">MSHADOW_XINLINE Tensor< Device, 1, DType > Slice(index_t begin, index_t end) const</div><div class="ttdef"><b>Definition:</b> tensor.h:595</div></div> |
| <div class="ttc" id="structmshadow_1_1cpu_html_a02cb5d79392d3ccf5d5f16beabf69171"><div class="ttname"><a href="structmshadow_1_1cpu.html#a02cb5d79392d3ccf5d5f16beabf69171">mshadow::cpu::kDevCPU</a></div><div class="ttdeci">static const bool kDevCPU</div><div class="ttdoc">whether this device is CPU or not </div><div class="ttdef"><b>Definition:</b> tensor.h:41</div></div> |
| <div class="ttc" id="namespacemshadow_html_af301ba1d360a6a46aecdcb5ec8031aa0"><div class="ttname"><a href="namespacemshadow.html#af301ba1d360a6a46aecdcb5ec8031aa0">mshadow::DeleteStream</a></div><div class="ttdeci">void DeleteStream(Stream< Device > *stream)</div><div class="ttdoc">delete the computing stream </div></div> |
| <div class="ttc" id="namespacemshadow_html_ae1734eb7939fe9627de46d62494fe9dc"><div class="ttname"><a href="namespacemshadow.html#ae1734eb7939fe9627de46d62494fe9dc">mshadow::MapReduceKeepLowest</a></div><div class="ttdeci">void MapReduceKeepLowest(TRValue< R, cpu, 1, DType > *dst, const expr::Exp< E, DType, etype > &exp, DType scale=1)</div><div class="ttdoc">CPU/GPU: map a expression, do reduction to 1D Tensor in lowest dimension (dimension 0) ...</div><div class="ttdef"><b>Definition:</b> tensor_cpu-inl.h:223</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4_html_a90469a0f8652b389c02c88bbe911e4f5"><div class="ttname"><a href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a90469a0f8652b389c02c88bbe911e4f5">mshadow::Tensor< Device, 1, DType >::Tensor</a></div><div class="ttdeci">MSHADOW_XINLINE Tensor(DType *dptr, Shape< 1 > shape)</div><div class="ttdef"><b>Definition:</b> tensor.h:579</div></div> |
| <div class="ttc" id="structmshadow_1_1Shape_html_a9cb540dcf4dec5d78456140505763bfa"><div class="ttname"><a href="structmshadow_1_1Shape.html#a9cb540dcf4dec5d78456140505763bfa">mshadow::Shape::Slice</a></div><div class="ttdeci">MSHADOW_XINLINE Shape< dimend - dimstart > Slice(void) const</div><div class="ttdoc">slice the shape from start to end </div><div class="ttdef"><b>Definition:</b> tensor.h:185</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4_html_ac9d84c69612ffe3de4ea539882cb0b91"><div class="ttname"><a href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#ac9d84c69612ffe3de4ea539882cb0b91">mshadow::Tensor< Device, 1, DType >::operator[]</a></div><div class="ttdeci">MSHADOW_XINLINE const DType & operator[](index_t idx) const</div><div class="ttdef"><b>Definition:</b> tensor.h:612</div></div> |
| <div class="ttc" id="3rdparty_2mshadow_2mshadow_2base_8h_html_a72d4e933c0003ccdc01b5d5f054dcf39"><div class="ttname"><a href="3rdparty_2mshadow_2mshadow_2base_8h.html#a72d4e933c0003ccdc01b5d5f054dcf39">MSHADOW_ALLOC_PAD</a></div><div class="ttdeci">#define MSHADOW_ALLOC_PAD</div><div class="ttdoc">whether do padding during allocation </div><div class="ttdef"><b>Definition:</b> base.h:72</div></div> |
| <div class="ttc" id="namespacemshadow_html_abbe2dc827052234b64ab2d40a5b2fdb4ad9ef54b427a838279a62e95204aa3281"><div class="ttname"><a href="namespacemshadow.html#abbe2dc827052234b64ab2d40a5b2fdb4ad9ef54b427a838279a62e95204aa3281">mshadow::kNHWC</a></div><div class="ttdef"><b>Definition:</b> base.h:489</div></div> |
| <div class="ttc" id="structmshadow_1_1cpu_html"><div class="ttname"><a href="structmshadow_1_1cpu.html">mshadow::cpu</a></div><div class="ttdoc">device name CPU </div><div class="ttdef"><b>Definition:</b> tensor.h:39</div></div> |
| <div class="ttc" id="structmshadow_1_1Shape_html_a09790c1034fa223d2782736a0d053a75"><div class="ttname"><a href="structmshadow_1_1Shape.html#a09790c1034fa223d2782736a0d053a75">mshadow::Shape::FlatTo1D</a></div><div class="ttdeci">MSHADOW_XINLINE Shape< 1 > FlatTo1D(void) const</div><div class="ttdef"><b>Definition:</b> tensor.h:123</div></div> |
| <div class="ttc" id="structmshadow_1_1gpu_html"><div class="ttname"><a href="structmshadow_1_1gpu.html">mshadow::gpu</a></div><div class="ttdoc">device name GPU </div><div class="ttdef"><b>Definition:</b> tensor.h:46</div></div> |
| <div class="ttc" id="structmshadow_1_1Stream_html_a7e5f0ac7f35dc725d6d03623a3cb454b"><div class="ttname"><a href="structmshadow_1_1Stream.html#a7e5f0ac7f35dc725d6d03623a3cb454b">mshadow::Stream::CheckIdle</a></div><div class="ttdeci">bool CheckIdle(void)</div><div class="ttdoc">query whether the the stream is idle </div><div class="ttdef"><b>Definition:</b> tensor.h:395</div></div> |
| <div class="ttc" id="3rdparty_2mshadow_2mshadow_2base_8h_html_af205b8ab4d8733133d590df7d2639d69"><div class="ttname"><a href="3rdparty_2mshadow_2mshadow_2base_8h.html#af205b8ab4d8733133d590df7d2639d69">MSHADOW_XINLINE</a></div><div class="ttdeci">#define MSHADOW_XINLINE</div><div class="ttdef"><b>Definition:</b> base.h:230</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4_html_a0bd39c6d12a8a00bab6f5963b87cec33"><div class="ttname"><a href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a0bd39c6d12a8a00bab6f5963b87cec33">mshadow::Tensor< Device, 1, DType >::operator=</a></div><div class="ttdeci">Tensor< Device, 1, DType > & operator=(const Tensor< Device, 1, DType > &exp)</div><div class="ttdoc">implement the assignment of same type </div><div class="ttdef"><b>Definition:</b> tensor.h:617</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_html_a8ca611225170e609e8de31abc577474b"><div class="ttname"><a href="structmshadow_1_1Tensor.html#a8ca611225170e609e8de31abc577474b">mshadow::Tensor::Tensor</a></div><div class="ttdeci">MSHADOW_XINLINE Tensor(void)</div><div class="ttdoc">default constructor </div><div class="ttdef"><b>Definition:</b> tensor.h:451</div></div> |
| <div class="ttc" id="expression_8h_html"><div class="ttname"><a href="expression_8h.html">expression.h</a></div><div class="ttdoc">definitions of abstract expressions and expressions template </div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4_html_ad58f6139a1d680c2dab2919cd448a9cf"><div class="ttname"><a href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#ad58f6139a1d680c2dab2919cd448a9cf">mshadow::Tensor< Device, 1, DType >::size</a></div><div class="ttdeci">MSHADOW_XINLINE index_t size(index_t i) const</div><div class="ttdef"><b>Definition:</b> tensor.h:606</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_html_abbe0542a36bb2ba0f5837a83b47b809d"><div class="ttname"><a href="structmshadow_1_1Tensor.html#abbe0542a36bb2ba0f5837a83b47b809d">mshadow::Tensor::operator=</a></div><div class="ttdeci">Tensor< Device, dimension, DType > & operator=(const Tensor< Device, dimension, DType > &exp)</div><div class="ttdoc">implement the assignment of same type </div><div class="ttdef"><b>Definition:</b> tensor.h:546</div></div> |
| <div class="ttc" id="namespacemshadow_html_a446431abbca1ddc0a525d6e2ce9d2fbc"><div class="ttname"><a href="namespacemshadow.html#a446431abbca1ddc0a525d6e2ce9d2fbc">mshadow::ConvertLayout</a></div><div class="ttdeci">Shape< 3 > ConvertLayout(const Shape< 3 > &src, int src_layout, int dst_layout)</div><div class="ttdoc">Convert shape in src_layout to shape in dst_layout. </div><div class="ttdef"><b>Definition:</b> tensor.h:269</div></div> |
| <div class="ttc" id="structmshadow_1_1Stream_html_a20c547a7a44d975f23bad59d4c45f482"><div class="ttname"><a href="structmshadow_1_1Stream.html#a20c547a7a44d975f23bad59d4c45f482">mshadow::Stream::CreateBlasHandle</a></div><div class="ttdeci">void CreateBlasHandle()</div><div class="ttdoc">create a blas handle </div><div class="ttdef"><b>Definition:</b> tensor.h:399</div></div> |
| <div class="ttc" id="namespacemshadow_html_adcbc2e1131386fccb1474b0bdf045926"><div class="ttname"><a href="namespacemshadow.html#adcbc2e1131386fccb1474b0bdf045926">mshadow::index_t</a></div><div class="ttdeci">int32_t index_t</div><div class="ttdoc">type that will be used for index </div><div class="ttdef"><b>Definition:</b> base.h:343</div></div> |
| <div class="ttc" id="structmshadow_1_1Shape_html_a610750c35aa0c76bb987458fc3fce90b"><div class="ttname"><a href="structmshadow_1_1Shape.html#a610750c35aa0c76bb987458fc3fce90b">mshadow::Shape::operator!=</a></div><div class="ttdeci">MSHADOW_XINLINE bool operator!=(const Shape< kDimension > &s) const</div><div class="ttdef"><b>Definition:</b> tensor.h:116</div></div> |
| <div class="ttc" id="namespacemshadow_html_aef49c3cef522198322017315341ac689"><div class="ttname"><a href="namespacemshadow.html#aef49c3cef522198322017315341ac689">mshadow::AllocSpace</a></div><div class="ttdeci">void AllocSpace(Tensor< cpu, dim, DType > *obj, bool pad=MSHADOW_ALLOC_PAD)</div><div class="ttdoc">CPU/CPU: allocate space for CTensor, according to the shape in the obj this function is responsible t...</div><div class="ttdef"><b>Definition:</b> tensor_cpu-inl.h:116</div></div> |
| <div class="ttc" id="structmshadow_1_1Shape_html_a91c0fd04c351199f119950b044ad9c99"><div class="ttname"><a href="structmshadow_1_1Shape.html#a91c0fd04c351199f119950b044ad9c99">mshadow::Shape::FlatTo2D</a></div><div class="ttdeci">MSHADOW_XINLINE Shape< 2 > FlatTo2D(void) const</div><div class="ttdef"><b>Definition:</b> tensor.h:132</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4_html_a98c523db2418f25f868842fb32c16a35"><div class="ttname"><a href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a98c523db2418f25f868842fb32c16a35">mshadow::Tensor< Device, 1, DType >::dptr_</a></div><div class="ttdeci">DType * dptr_</div><div class="ttdef"><b>Definition:</b> tensor.h:571</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_html_a48a5927e810fbc45e43e92cfe397d9f2"><div class="ttname"><a href="structmshadow_1_1Tensor.html#a48a5927e810fbc45e43e92cfe397d9f2">mshadow::Tensor::FlatTo2D</a></div><div class="ttdeci">MSHADOW_XINLINE Tensor< Device, 2, DType > FlatTo2D(void) const</div><div class="ttdoc">flatten the tensor to 2 dimension, collapse the higher dimensions together </div><div class="ttdef"><b>Definition:</b> tensor.h:519</div></div> |
| <div class="ttc" id="expr__engine-inl_8h_html"><div class="ttname"><a href="expr__engine-inl_8h.html">expr_engine-inl.h</a></div><div class="ttdoc">definitions of how expressions should be evaluated </div></div> |
| <div class="ttc" id="expr__scalar-inl_8h_html"><div class="ttname"><a href="expr__scalar-inl_8h.html">expr_scalar-inl.h</a></div><div class="ttdoc">definitions of operators in expression with respect to scalar this file will be included several time...</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_html_a88cbcae11653307bfa4c99804320b638"><div class="ttname"><a href="structmshadow_1_1Tensor.html#a88cbcae11653307bfa4c99804320b638">mshadow::Tensor::size</a></div><div class="ttdeci">MSHADOW_XINLINE index_t size(int idx) const</div><div class="ttdoc">return size of i-th dimension, start counting from highest dimension </div><div class="ttdef"><b>Definition:</b> tensor.h:505</div></div> |
| <div class="ttc" id="namespacemshadow_html_ad2320213151030353ae90f92a0da808d"><div class="ttname"><a href="namespacemshadow.html#ad2320213151030353ae90f92a0da808d">mshadow::AddTakeGradLargeBatch</a></div><div class="ttdeci">void AddTakeGradLargeBatch(Tensor< cpu, 2, DType > dst, const Tensor< cpu, 1, IndexType > &sorted, const Tensor< cpu, 1, IndexType > &index, const Tensor< cpu, 2, DType > &src)</div><div class="ttdoc">CPU/GPU: Gradient accumulate of embedding matrix. dst[sorted[i]] += src[index[i]] Called when the bat...</div><div class="ttdef"><b>Definition:</b> tensor_cpu-inl.h:537</div></div> |
| <div class="ttc" id="namespacemshadow_html_a5db935b0945f538add8022fac93c9c0a"><div class="ttname"><a href="namespacemshadow.html#a5db935b0945f538add8022fac93c9c0a">mshadow::Shape5</a></div><div class="ttdeci">MSHADOW_XINLINE Shape< 5 > Shape5(index_t s0, index_t s1, index_t s2, index_t s3, index_t s4)</div><div class="ttdoc">construct a five dimension shape, stride will equal s0 </div><div class="ttdef"><b>Definition:</b> tensor.h:255</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_html_a9cc7d01a1eb0825d7a3fcdabc8e58f07"><div class="ttname"><a href="structmshadow_1_1Tensor.html#a9cc7d01a1eb0825d7a3fcdabc8e58f07">mshadow::Tensor::CheckContiguous</a></div><div class="ttdeci">MSHADOW_XINLINE bool CheckContiguous(void) const</div><div class="ttdef"><b>Definition:</b> tensor.h:491</div></div> |
| <div class="ttc" id="namespacemshadow_html_abb4c36a0703ec671a5e74b0a8d37a47a"><div class="ttname"><a href="namespacemshadow.html#abb4c36a0703ec671a5e74b0a8d37a47a">mshadow::SetDevice</a></div><div class="ttdeci">void SetDevice(int devid)</div><div class="ttdoc">set the device of current thread to work on </div></div> |
| <div class="ttc" id="structmshadow_1_1Shape_html_a9fe553a887023d1ef284dbb018456fe8"><div class="ttname"><a href="structmshadow_1_1Shape.html#a9fe553a887023d1ef284dbb018456fe8">mshadow::Shape::Shape</a></div><div class="ttdeci">MSHADOW_XINLINE Shape(const Shape< kDimension > &s)</div><div class="ttdoc">constuctor </div><div class="ttdef"><b>Definition:</b> tensor.h:79</div></div> |
| <div class="ttc" id="extension_8h_html"><div class="ttname"><a href="extension_8h.html">extension.h</a></div><div class="ttdoc">some extension of expressions, used to support something beyond elementwise op </div></div> |
| <div class="ttc" id="namespacemshadow_html_a05e468ef4d8882fccce53ae951b7bdbd"><div class="ttname"><a href="namespacemshadow.html#a05e468ef4d8882fccce53ae951b7bdbd">mshadow::Shape1</a></div><div class="ttdeci">MSHADOW_XINLINE Shape< 1 > Shape1(index_t s0)</div><div class="ttdoc">construct a one dimension shape, stride will equal s0 </div><div class="ttdef"><b>Definition:</b> tensor.h:206</div></div> |
| <div class="ttc" id="structmshadow_1_1Shape_html_a398d94165ccfbaf1ba0e8fcbedfe48c6"><div class="ttname"><a href="structmshadow_1_1Shape.html#a398d94165ccfbaf1ba0e8fcbedfe48c6">mshadow::Shape::shape_</a></div><div class="ttdeci">index_t shape_[kDimension]</div><div class="ttdoc">storing the dimension information </div><div class="ttdef"><b>Definition:</b> tensor.h:75</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4_html_a6eb477e0583cd20d275819d9be01e9c1"><div class="ttname"><a href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a6eb477e0583cd20d275819d9be01e9c1">mshadow::Tensor< Device, 1, DType >::Tensor</a></div><div class="ttdeci">MSHADOW_XINLINE Tensor(const Shape< 1 > &shape)</div><div class="ttdef"><b>Definition:</b> tensor.h:577</div></div> |
| <div class="ttc" id="structmshadow_1_1Shape_html_a841dd46bcd4bc0abf0f8c124e4f3a607"><div class="ttname"><a href="structmshadow_1_1Shape.html#a841dd46bcd4bc0abf0f8c124e4f3a607">mshadow::Shape::Shape</a></div><div class="ttdeci">MSHADOW_XINLINE Shape(void)</div><div class="ttdoc">default constructor, do nothing </div><div class="ttdef"><b>Definition:</b> tensor.h:77</div></div> |
| <div class="ttc" id="namespacemshadow_html_a6b745d61d1080fe259e44807488e1eb3"><div class="ttname"><a href="namespacemshadow.html#a6b745d61d1080fe259e44807488e1eb3">mshadow::InitTensorEngine</a></div><div class="ttdeci">void InitTensorEngine(int device_id=0)</div><div class="ttdoc">initialize tensor engine, used to call intialization functions of dependent libs this function should...</div></div> |
| <div class="ttc" id="namespacemshadow_html_ad2853583180a7dbe9cbf6b0e15ae60ef"><div class="ttname"><a href="namespacemshadow.html#ad2853583180a7dbe9cbf6b0e15ae60ef">mshadow::Shape2</a></div><div class="ttdeci">MSHADOW_XINLINE Shape< 2 > Shape2(index_t s0, index_t s1)</div><div class="ttdoc">construct a two dimension shape, stride will equal s0 </div><div class="ttdef"><b>Definition:</b> tensor.h:216</div></div> |
| <div class="ttc" id="namespacemshadow_html_abbe2dc827052234b64ab2d40a5b2fdb4a37c45177ee0fe2468d562a9e5e3e38dd"><div class="ttname"><a href="namespacemshadow.html#abbe2dc827052234b64ab2d40a5b2fdb4a37c45177ee0fe2468d562a9e5e3e38dd">mshadow::kNDHWC</a></div><div class="ttdef"><b>Definition:</b> base.h:497</div></div> |
| <div class="ttc" id="stream__gpu-inl_8h_html"><div class="ttname"><a href="stream__gpu-inl_8h.html">stream_gpu-inl.h</a></div><div class="ttdoc">implementation of GPU code </div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_html_a66c736a2899eba9f83ee9ced3d02a944"><div class="ttname"><a href="structmshadow_1_1Tensor.html#a66c736a2899eba9f83ee9ced3d02a944">mshadow::Tensor::FlatTo1D</a></div><div class="ttdeci">MSHADOW_XINLINE Tensor< Device, 1, DType > FlatTo1D(void) const</div><div class="ttdoc">flatten the tensor to 1 dimension </div><div class="ttdef"><b>Definition:</b> tensor.h:512</div></div> |
| <div class="ttc" id="structmshadow_1_1cpu_html_a57f74b500825e21c0c246ad5b4e5016b"><div class="ttname"><a href="structmshadow_1_1cpu.html#a57f74b500825e21c0c246ad5b4e5016b">mshadow::cpu::kDevMask</a></div><div class="ttdeci">static const int kDevMask</div><div class="ttdoc">device flag number, identifies this device </div><div class="ttdef"><b>Definition:</b> tensor.h:43</div></div> |
| <div class="ttc" id="namespacemshadow_html_abbe2dc827052234b64ab2d40a5b2fdb4a0cfb685a803481d9ff4fe19d813b261a"><div class="ttname"><a href="namespacemshadow.html#abbe2dc827052234b64ab2d40a5b2fdb4a0cfb685a803481d9ff4fe19d813b261a">mshadow::kNCW</a></div><div class="ttdef"><b>Definition:</b> base.h:492</div></div> |
| <div class="ttc" id="structmshadow_1_1Shape_html_a437b236671a35475edcf7aa5df2c6360"><div class="ttname"><a href="structmshadow_1_1Shape.html#a437b236671a35475edcf7aa5df2c6360">mshadow::Shape::ProdShape</a></div><div class="ttdeci">MSHADOW_XINLINE index_t ProdShape(int dimstart, int dimend) const</div><div class="ttdef"><b>Definition:</b> tensor.h:157</div></div> |
| <div class="ttc" id="structmshadow_1_1Stream_html_ab17a2b049aacf5d71d8860262c4a98fd"><div class="ttname"><a href="structmshadow_1_1Stream.html#ab17a2b049aacf5d71d8860262c4a98fd">mshadow::Stream::Wait</a></div><div class="ttdeci">void Wait(void)</div><div class="ttdoc">wait for all the computations associated with this stream to complete </div><div class="ttdef"><b>Definition:</b> tensor.h:390</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_html_a46c74e5aea791724344d059e107cfa34"><div class="ttname"><a href="structmshadow_1_1Tensor.html#a46c74e5aea791724344d059e107cfa34">mshadow::Tensor::Tensor</a></div><div class="ttdeci">MSHADOW_XINLINE Tensor(DType *dptr, const Shape< dimension > &shape, index_t stride, Stream< Device > *stream)</div><div class="ttdoc">constructor from data pointer and shape </div><div class="ttdef"><b>Definition:</b> tensor.h:463</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_html_a810b0902ab38d4b6a6d55b86a1febd80"><div class="ttname"><a href="structmshadow_1_1Tensor.html#a810b0902ab38d4b6a6d55b86a1febd80">mshadow::Tensor::MemSize</a></div><div class="ttdeci">MSHADOW_XINLINE index_t MemSize(void) const</div><div class="ttdef"><b>Definition:</b> tensor.h:479</div></div> |
| <div class="ttc" id="namespacemshadow_html_a5fce5c2df842439cc7d2d7a90e2cf7d4"><div class="ttname"><a href="namespacemshadow.html#a5fce5c2df842439cc7d2d7a90e2cf7d4">mshadow::MapReduceKeepHighDim</a></div><div class="ttdeci">void MapReduceKeepHighDim(TRValue< R, cpu, 1, DType > *dst, const expr::Exp< E, DType, etype > &exp, DType scale=1)</div><div class="ttdoc">CPU/GPU: map a expression, do reduction to 1D Tensor in third dimension (dimension 2) ...</div><div class="ttdef"><b>Definition:</b> tensor_cpu-inl.h:250</div></div> |
| <div class="ttc" id="namespacemshadow_html_abbe2dc827052234b64ab2d40a5b2fdb4a3f4908b910c47da082d60aa719c43fc3"><div class="ttname"><a href="namespacemshadow.html#abbe2dc827052234b64ab2d40a5b2fdb4a3f4908b910c47da082d60aa719c43fc3">mshadow::kNWC</a></div><div class="ttdef"><b>Definition:</b> base.h:493</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_html_a653a1a6ac33e797c18fe5178c99aeb63"><div class="ttname"><a href="structmshadow_1_1Tensor.html#a653a1a6ac33e797c18fe5178c99aeb63">mshadow::Tensor::Tensor</a></div><div class="ttdeci">MSHADOW_XINLINE Tensor(const Shape< dimension > &shape)</div><div class="ttdoc">constructor from shape </div><div class="ttdef"><b>Definition:</b> tensor.h:453</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4_html_a4b43b01c513d310a17864a409c96fa39"><div class="ttname"><a href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a4b43b01c513d310a17864a409c96fa39">mshadow::Tensor< Device, 1, DType >::stride_</a></div><div class="ttdeci">index_t stride_</div><div class="ttdef"><b>Definition:</b> tensor.h:573</div></div> |
| <div class="ttc" id="namespacemshadow_html_a3f19232d4c6ea393abccc5288675d345"><div class="ttname"><a href="namespacemshadow.html#a3f19232d4c6ea393abccc5288675d345">mshadow::NewTensor</a></div><div class="ttdeci">Tensor< Device, dim, DType > NewTensor(const Shape< dim > &shape, DType initv, bool pad=MSHADOW_ALLOC_PAD, Stream< Device > *stream=NULL)</div><div class="ttdoc">CPU/GPU: short cut to allocate and initialize a Tensor. </div><div class="ttdef"><b>Definition:</b> tensor_cpu-inl.h:132</div></div> |
| <div class="ttc" id="structmshadow_1_1expr_1_1Exp_html"><div class="ttname"><a href="structmshadow_1_1expr_1_1Exp.html">mshadow::expr::Exp</a></div><div class="ttdoc">defines how expression exp can be evaluated and stored into dst </div><div class="ttdef"><b>Definition:</b> expression.h:79</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_html_a56f52a10e9aa77cba64ec497fa764322"><div class="ttname"><a href="structmshadow_1_1Tensor.html#a56f52a10e9aa77cba64ec497fa764322">mshadow::Tensor::Tensor</a></div><div class="ttdeci">MSHADOW_XINLINE Tensor(DType *dptr, const Shape< dimension > &shape, Stream< Device > *stream)</div><div class="ttdoc">constructor from data pointer and shape, without stride </div><div class="ttdef"><b>Definition:</b> tensor.h:459</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4_html_ae73374ca91b919e869881f19f9754747"><div class="ttname"><a href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#ae73374ca91b919e869881f19f9754747">mshadow::Tensor< Device, 1, DType >::operator=</a></div><div class="ttdeci">Tensor< Device, 1, DType > & operator=(const expr::Exp< E, DType, etype > &exp)</div><div class="ttdef"><b>Definition:</b> tensor.h:626</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4_html_a23c9cc5c4fb298a5514c3a31d350087f"><div class="ttname"><a href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a23c9cc5c4fb298a5514c3a31d350087f">mshadow::Tensor< Device, 1, DType >::CheckContiguous</a></div><div class="ttdeci">MSHADOW_XINLINE bool CheckContiguous(void) const</div><div class="ttdef"><b>Definition:</b> tensor.h:600</div></div> |
| <div class="ttc" id="tensor__gpu-inl_8h_html"><div class="ttname"><a href="tensor__gpu-inl_8h.html">tensor_gpu-inl.h</a></div><div class="ttdoc">implementation of GPU host code </div></div> |
| <div class="ttc" id="tensor__container_8h_html"><div class="ttname"><a href="tensor__container_8h.html">tensor_container.h</a></div><div class="ttdoc">tensor container that does memory allocation and resize like STL </div></div> |
| <div class="ttc" id="namespacemshadow_html_a802d44c652195053e87b63881c7d4d1c"><div class="ttname"><a href="namespacemshadow.html#a802d44c652195053e87b63881c7d4d1c">mshadow::AddTakeGrad</a></div><div class="ttdeci">void AddTakeGrad(Tensor< cpu, 2, DType > dst, const Tensor< cpu, 1, IndexType > &index, const Tensor< cpu, 2, DType > &src)</div><div class="ttdoc">CPU/GPU: Gradient accumulate of embedding matrix. dst[index[i]] += src[i] Called when the featuredim ...</div><div class="ttdef"><b>Definition:</b> tensor_cpu-inl.h:516</div></div> |
| <div class="ttc" id="structmshadow_1_1Shape_html_a250af849ef7ee71f440cb91366c43473"><div class="ttname"><a href="structmshadow_1_1Shape.html#a250af849ef7ee71f440cb91366c43473">mshadow::Shape::operator[]</a></div><div class="ttdeci">MSHADOW_XINLINE const index_t & operator[](int idx) const</div><div class="ttdoc">get corresponding index </div><div class="ttdef"><b>Definition:</b> tensor.h:98</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4_html"><div class="ttname"><a href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html">mshadow::Tensor< Device, 1, DType ></a></div><div class="ttdef"><b>Definition:</b> tensor.h:568</div></div> |
| <div class="ttc" id="namespacemshadow_html_a2be3eab8d3469aa48c40d38881558bb9"><div class="ttname"><a href="namespacemshadow.html#a2be3eab8d3469aa48c40d38881558bb9">mshadow::Shape3</a></div><div class="ttdeci">MSHADOW_XINLINE Shape< 3 > Shape3(index_t s0, index_t s1, index_t s2)</div><div class="ttdoc">construct a three dimension shape, stride will equal s0 </div><div class="ttdef"><b>Definition:</b> tensor.h:227</div></div> |
| <div class="ttc" id="namespacemshadow_html"><div class="ttname"><a href="namespacemshadow.html">mshadow</a></div><div class="ttdoc">overloaded + operator between half_t and bf16_t </div><div class="ttdef"><b>Definition:</b> base.h:334</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4_html_a7143b0339fae5b9dc20d3d158c4c3b15"><div class="ttname"><a href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a7143b0339fae5b9dc20d3d158c4c3b15">mshadow::Tensor< Device, 1, DType >::set_stream</a></div><div class="ttdeci">void set_stream(Stream< Device > *stream)</div><div class="ttdef"><b>Definition:</b> tensor.h:586</div></div> |
| <div class="ttc" id="random_8h_html"><div class="ttname"><a href="random_8h.html">random.h</a></div><div class="ttdoc">Random inline functions for tensor. </div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4_html_ace41d40048eeabbb52b0c09dc2087c98"><div class="ttname"><a href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#ace41d40048eeabbb52b0c09dc2087c98">mshadow::Tensor< Device, 1, DType >::operator[]</a></div><div class="ttdeci">MSHADOW_XINLINE DType & operator[](index_t idx)</div><div class="ttdef"><b>Definition:</b> tensor.h:609</div></div> |
| <div class="ttc" id="3rdparty_2mshadow_2mshadow_2io_8h_html"><div class="ttname"><a href="3rdparty_2mshadow_2mshadow_2io_8h.html">io.h</a></div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4_html_a6f5216f1cc1d6743592d8a59a103b259"><div class="ttname"><a href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a6f5216f1cc1d6743592d8a59a103b259">mshadow::Tensor< Device, 1, DType >::Tensor</a></div><div class="ttdeci">MSHADOW_XINLINE Tensor(DType *dptr, Shape< 1 > shape, index_t stride, Stream< Device > *stream)</div><div class="ttdef"><b>Definition:</b> tensor.h:583</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4_html_aee3127de201bce405eada043f1868468"><div class="ttname"><a href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#aee3127de201bce405eada043f1868468">mshadow::Tensor< Device, 1, DType >::FlatTo1D</a></div><div class="ttdeci">MSHADOW_XINLINE Tensor< Device, 1, DType > FlatTo1D(void) const</div><div class="ttdef"><b>Definition:</b> tensor.h:589</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_html_afee556f188e29bbd0ecc45fe98d3c1c3"><div class="ttname"><a href="structmshadow_1_1Tensor.html#afee556f188e29bbd0ecc45fe98d3c1c3">mshadow::Tensor::stride_</a></div><div class="ttdeci">index_t stride_</div><div class="ttdoc">storing the stride information in x dimension this is used to deal with pitch allocation in gpu or ss...</div><div class="ttdef"><b>Definition:</b> tensor.h:441</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4_html_aaaafeee143e9974943bf21f7bac9ad49"><div class="ttname"><a href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#aaaafeee143e9974943bf21f7bac9ad49">mshadow::Tensor< Device, 1, DType >::FlatTo2D</a></div><div class="ttdeci">MSHADOW_XINLINE Tensor< Device, 2, DType > FlatTo2D(void) const</div><div class="ttdef"><b>Definition:</b> tensor.h:592</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4_html_aa33a34930f1f85e5e071fd5870a0c76b"><div class="ttname"><a href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#aa33a34930f1f85e5e071fd5870a0c76b">mshadow::Tensor< Device, 1, DType >::operator=</a></div><div class="ttdeci">Tensor< Device, 1, DType > & operator=(const DType &exp)</div><div class="ttdef"><b>Definition:</b> tensor.h:629</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_html_a95a73cfaf27ceeca3c54cf50fad665e9"><div class="ttname"><a href="structmshadow_1_1Tensor.html#a95a73cfaf27ceeca3c54cf50fad665e9">mshadow::Tensor::Slice</a></div><div class="ttdeci">MSHADOW_XINLINE Tensor< Device, dimension, DType > Slice(index_t begin, index_t end) const</div><div class="ttdoc">slice the tensor in highest dimension [begin,end) </div><div class="ttdef"><b>Definition:</b> tensor.h:538</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_html"><div class="ttname"><a href="structmshadow_1_1Tensor.html">mshadow::Tensor</a></div><div class="ttdoc">general tensor </div><div class="ttdef"><b>Definition:</b> tensor.h:420</div></div> |
| <div class="ttc" id="tensor__cpu-inl_8h_html"><div class="ttname"><a href="tensor__cpu-inl_8h.html">tensor_cpu-inl.h</a></div><div class="ttdoc">implementation of CPU host code </div></div> |
| <div class="ttc" id="3rdparty_2mshadow_2mshadow_2base_8h_html"><div class="ttname"><a href="3rdparty_2mshadow_2mshadow_2base_8h.html">base.h</a></div></div> |
| <div class="ttc" id="3rdparty_2mshadow_2mshadow_2base_8h_html_a1588e3cdf209b0cf13609d1c0e3838c7"><div class="ttname"><a href="3rdparty_2mshadow_2mshadow_2base_8h.html#a1588e3cdf209b0cf13609d1c0e3838c7">MSHADOW_DEFAULT_DTYPE</a></div><div class="ttdeci">#define MSHADOW_DEFAULT_DTYPE</div><div class="ttdoc">default data type for tensor string in code release, change it to default_real_t during development...</div><div class="ttdef"><b>Definition:</b> base.h:249</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4_html_a68955bd28e0e1a7e8266fb6c1760057e"><div class="ttname"><a href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#a68955bd28e0e1a7e8266fb6c1760057e">mshadow::Tensor< Device, 1, DType >::Tensor</a></div><div class="ttdeci">MSHADOW_XINLINE Tensor(void)</div><div class="ttdef"><b>Definition:</b> tensor.h:576</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_html_a485d1558eaa9eded0b8fd23ed82c6298"><div class="ttname"><a href="structmshadow_1_1Tensor.html#a485d1558eaa9eded0b8fd23ed82c6298">mshadow::Tensor::stream_</a></div><div class="ttdeci">Stream< Device > * stream_</div><div class="ttdoc">stream where the computation lies stream is a device dependency concept where each computation ...</div><div class="ttdef"><b>Definition:</b> tensor.h:446</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4_html_ad48d29c0aa2a12ab9b1580cda44f1a34"><div class="ttname"><a href="structmshadow_1_1Tensor_3_01Device_00_011_00_01DType_01_4.html#ad48d29c0aa2a12ab9b1580cda44f1a34">mshadow::Tensor< Device, 1, DType >::shape_</a></div><div class="ttdeci">Shape< 1 > shape_</div><div class="ttdef"><b>Definition:</b> tensor.h:572</div></div> |
| <div class="ttc" id="structmshadow_1_1Shape_html_ac6d667fde1a8180b64f475f5d33ea58f"><div class="ttname"><a href="structmshadow_1_1Shape.html#ac6d667fde1a8180b64f475f5d33ea58f">mshadow::Shape::Size</a></div><div class="ttdeci">MSHADOW_XINLINE index_t Size(void) const</div><div class="ttdef"><b>Definition:</b> tensor.h:144</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_html_ad6d595c2864496f21f9642f102678711"><div class="ttname"><a href="structmshadow_1_1Tensor.html#ad6d595c2864496f21f9642f102678711">mshadow::Tensor::operator[]</a></div><div class="ttdeci">MSHADOW_XINLINE Tensor< Device, kSubdim, DType > operator[](index_t idx) const</div><div class="ttdoc">get a element of dimension - 1 </div><div class="ttdef"><b>Definition:</b> tensor.h:527</div></div> |
| <div class="ttc" id="structmshadow_1_1Tensor_html_add6431b4c399ae29151780ce37a9d843"><div class="ttname"><a href="structmshadow_1_1Tensor.html#add6431b4c399ae29151780ce37a9d843">mshadow::Tensor::operator=</a></div><div class="ttdeci">Tensor< Device, dimension, DType > & operator=(const DType &exp)</div><div class="ttdoc">functions to fit expression template </div><div class="ttdef"><b>Definition:</b> tensor.h:560</div></div> |
| <div class="ttc" id="structmshadow_1_1Stream_html"><div class="ttname"><a href="structmshadow_1_1Stream.html">mshadow::Stream</a></div><div class="ttdoc">computaion stream structure, used for asynchronous computations </div><div class="ttdef"><b>Definition:</b> tensor.h:383</div></div> |
| </div><!-- fragment --></div><!-- contents --> |
| <!-- start footer part --> |
| <hr class="footer"/><address class="footer"><small> |
| Generated on Thu Jan 5 2023 00:58:42 for mxnet by  <a href="http://www.doxygen.org/index.html"> |
| <img class="footer" src="doxygen.png" alt="doxygen"/> |
| </a> 1.8.13 |
| </small></address> |
| </body> |
| </html> |