matrix.html 789.1 KB
Newer Older
1 2


Y
Yu Yang 已提交
3 4 5 6 7 8 9 10
<!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/html; charset=utf-8" />
    
11
    <title>Matrix &#8212; PaddlePaddle  documentation</title>
Y
Yu Yang 已提交
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
    
    <link rel="stylesheet" href="../../../_static/classic.css" type="text/css" />
    <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../../../',
        VERSION:     '',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../../_static/underscore.js"></script>
    <script type="text/javascript" src="../../../_static/doctools.js"></script>
    <script type="text/javascript" src="https://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
29 30
    <link rel="index" title="Index" href="../../../genindex.html" />
    <link rel="search" title="Search" href="../../../search.html" />
Y
Yu Yang 已提交
31 32 33 34
    <link rel="top" title="PaddlePaddle  documentation" href="../../../index.html" />
    <link rel="up" title="Matrix Documents" href="index.html" />
    <link rel="next" title="Utils Documents" href="../utils/index.html" />
    <link rel="prev" title="Matrix Documents" href="index.html" /> 
35 36 37 38 39 40 41 42 43 44
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "//hm.baidu.com/hm.js?b9a314ab40d04d805655aab1deee08ba";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>

Y
Yu Yang 已提交
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
  </head>
  <body role="document">
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="../utils/index.html" title="Utils Documents"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="index.html" title="Matrix Documents"
             accesskey="P">previous</a> |</li>
62 63 64
        <li class="nav-item nav-item-0"><a href="../../../index.html">PaddlePaddle  documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../../index.html" >Source Code Documents</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="index.html" accesskey="U">Matrix Documents</a> &#187;</li> 
Y
Yu Yang 已提交
65 66 67 68 69 70 71 72 73 74 75 76
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="matrix">
<h1>Matrix<a class="headerlink" href="#matrix" title="Permalink to this headline">¶</a></h1>
<div class="section" id="base">
<h2>Base<a class="headerlink" href="#base" title="Permalink to this headline">¶</a></h2>
77
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
78 79 80 81 82 83 84 85 86 87 88 89
<p class="breathe-sectiondef-title rubric">Defines</p>
<dl class="macro">
<dt id="c.CAL_MATRIX_START_ADDRESS">
<span class="target" id="paddleBaseMatrix_8h_1accfb7bc13a1efc4387db3d4c05a27a1e"></span><code class="descname">CAL_MATRIX_START_ADDRESS</code><span class="sig-paren">(</span>address, height, width, ld, col, row<span class="sig-paren">)</span><a class="headerlink" href="#c.CAL_MATRIX_START_ADDRESS" title="Permalink to this definition">¶</a></dt>
<dd><p>Calculate matrix element address. </p>
<p>For instance, address of A[i][j] = i * ld + j. </p>
</dd></dl>

</div>
<dl class="type">
<dt id="_CPPv26paddle">
<span id="paddle"></span><span class="target" id="paddlenamespacepaddle"></span><em class="property">namespace </em><code class="descname">paddle</code><a class="headerlink" href="#_CPPv26paddle" title="Permalink to this definition">¶</a></dt>
90
<dd><div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
<p class="breathe-sectiondef-title rubric">Typedefs</p>
<dl class="type">
<dt id="_CPPv2N6paddle10false_typeE">
<span id="paddle::false_type"></span><span class="target" id="paddlenamespacepaddle_1af65e09664858aee3227d7bc076446e51"></span><em class="property">typedef </em><a class="reference internal" href="#_CPPv2N6paddle13bool_constantE" title="paddle::bool_constant">bool_constant</a>&lt;bool, false&gt; <code class="descname">false_type</code><a class="headerlink" href="#_CPPv2N6paddle10false_typeE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="type">
<dt id="_CPPv2N6paddle9true_typeE">
<span id="paddle::true_type"></span><span class="target" id="paddlenamespacepaddle_1ad857eeccb7f4d57b1c8e12e6033a3f4a"></span><em class="property">typedef </em><a class="reference internal" href="#_CPPv2N6paddle13bool_constantE" title="paddle::bool_constant">bool_constant</a>&lt;bool, true&gt; <code class="descname">true_type</code><a class="headerlink" href="#_CPPv2N6paddle9true_typeE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="type">
<dt id="_CPPv2N6paddle10BaseMatrixE">
<span id="paddle::BaseMatrix"></span><span class="target" id="paddlenamespacepaddle_1a2d06a465b3843dd62d31bec6120ae640"></span><em class="property">typedef </em><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a>&lt;real&gt; <code class="descname">BaseMatrix</code><a class="headerlink" href="#_CPPv2N6paddle10BaseMatrixE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="type">
<dt id="_CPPv2N6paddle11IBaseMatrixE">
<span id="paddle::IBaseMatrix"></span><span class="target" id="paddlenamespacepaddle_1ae051f927386e239bf881a1fb45322d41"></span><em class="property">typedef </em><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a>&lt;int&gt; <code class="descname">IBaseMatrix</code><a class="headerlink" href="#_CPPv2N6paddle11IBaseMatrixE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
113 114 115 116 117
<dl class="class">
<dt>
<span class="target" id="paddlestructpaddle_1_1bool__constant"></span><em class="property">template </em>&lt;<em class="property">class</em> T, T <em>v</em>&gt;</dt>
<dt id="_CPPv2N6paddle13bool_constantE">
<span id="paddle::bool_constant"></span><em class="property">struct </em><code class="descname">bool_constant</code><a class="headerlink" href="#_CPPv2N6paddle13bool_constantE" title="Permalink to this definition">¶</a></dt>
118
<dd><div class="breathe-sectiondef docutils container">
119 120 121 122 123 124 125 126 127 128 129 130
<p class="breathe-sectiondef-title rubric">Public Static Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle13bool_constant5valueE">
<span id="paddle::bool_constant::value__TC"></span><span class="target" id="paddlestructpaddle_1_1bool__constant_1af2cab48c52aedfca2a3f53a4989b4566"></span><em class="property">const</em> T <code class="descname">value</code><a class="headerlink" href="#_CPPv2N6paddle13bool_constant5valueE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

<dl class="class">
<dt id="_CPPv2N6paddle12MatrixOffsetE">
<span id="paddle::MatrixOffset"></span><span class="target" id="paddleclasspaddle_1_1MatrixOffset"></span><em class="property">class </em><code class="descname">MatrixOffset</code><a class="headerlink" href="#_CPPv2N6paddle12MatrixOffsetE" title="Permalink to this definition">¶</a></dt>
131
<dd><div class="breathe-sectiondef docutils container">
132 133 134 135 136 137 138
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle12MatrixOffset12MatrixOffsetE6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t">
<span id="paddle::MatrixOffset::MatrixOffset__s.s.s.s.s.s.s.s"></span><span class="target" id="paddleclasspaddle_1_1MatrixOffset_1a606b25e4f35ed16fa3d86de555634fbf"></span><code class="descname">MatrixOffset</code><span class="sig-paren">(</span>size_t <em>aCol</em> = 0, size_t <em>aRow</em> = 0, size_t <em>bCol</em> = 0, size_t <em>bRow</em> = 0, size_t <em>cCol</em> = 0, size_t <em>cRow</em> = 0, size_t <em>dCol</em> = 0, size_t <em>dRow</em> = 0<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle12MatrixOffset12MatrixOffsetE6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
139
<div class="breathe-sectiondef docutils container">
140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183
<p class="breathe-sectiondef-title rubric">Public Members</p>
<dl class="member">
<dt id="_CPPv2N6paddle12MatrixOffset5aCol_E">
<span id="paddle::MatrixOffset::aCol___s"></span><span class="target" id="paddleclasspaddle_1_1MatrixOffset_1ab8d1e104632f9333d6499fd02d3ad487"></span>size_t <code class="descname">aCol_</code><a class="headerlink" href="#_CPPv2N6paddle12MatrixOffset5aCol_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle12MatrixOffset5aRow_E">
<span id="paddle::MatrixOffset::aRow___s"></span><span class="target" id="paddleclasspaddle_1_1MatrixOffset_1ad8bc2fc073258aea7588591341251865"></span>size_t <code class="descname">aRow_</code><a class="headerlink" href="#_CPPv2N6paddle12MatrixOffset5aRow_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle12MatrixOffset5bCol_E">
<span id="paddle::MatrixOffset::bCol___s"></span><span class="target" id="paddleclasspaddle_1_1MatrixOffset_1a6c88eb92f839be5e880c215e92b75b68"></span>size_t <code class="descname">bCol_</code><a class="headerlink" href="#_CPPv2N6paddle12MatrixOffset5bCol_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle12MatrixOffset5bRow_E">
<span id="paddle::MatrixOffset::bRow___s"></span><span class="target" id="paddleclasspaddle_1_1MatrixOffset_1aebf971ada6f29bb53ff9f21c46bdcb9c"></span>size_t <code class="descname">bRow_</code><a class="headerlink" href="#_CPPv2N6paddle12MatrixOffset5bRow_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle12MatrixOffset5cCol_E">
<span id="paddle::MatrixOffset::cCol___s"></span><span class="target" id="paddleclasspaddle_1_1MatrixOffset_1a86cdda4fabd9d5621bdff2921c9f794a"></span>size_t <code class="descname">cCol_</code><a class="headerlink" href="#_CPPv2N6paddle12MatrixOffset5cCol_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle12MatrixOffset5cRow_E">
<span id="paddle::MatrixOffset::cRow___s"></span><span class="target" id="paddleclasspaddle_1_1MatrixOffset_1acfaf728d48fd07b388771bac7efdfa14"></span>size_t <code class="descname">cRow_</code><a class="headerlink" href="#_CPPv2N6paddle12MatrixOffset5cRow_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle12MatrixOffset5dCol_E">
<span id="paddle::MatrixOffset::dCol___s"></span><span class="target" id="paddleclasspaddle_1_1MatrixOffset_1ad48c79822a5299e1abc66814baf5556b"></span>size_t <code class="descname">dCol_</code><a class="headerlink" href="#_CPPv2N6paddle12MatrixOffset5dCol_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle12MatrixOffset5dRow_E">
<span id="paddle::MatrixOffset::dRow___s"></span><span class="target" id="paddleclasspaddle_1_1MatrixOffset_1a061631ae912a55c4a570843bef20d4eb"></span>size_t <code class="descname">dRow_</code><a class="headerlink" href="#_CPPv2N6paddle12MatrixOffset5dRow_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

Y
Yu Yang 已提交
184 185 186 187 188
<dl class="class">
<dt>
<span class="target" id="paddleclasspaddle_1_1BaseMatrixT"></span><em class="property">template </em>&lt;<em class="property">class</em> T&gt;</dt>
<dt id="_CPPv2N6paddle11BaseMatrixTE">
<span id="paddle::BaseMatrixT"></span><em class="property">class </em><code class="descname">BaseMatrixT</code><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixTE" title="Permalink to this definition">¶</a></dt>
189
<dd><p>Subclassed by <a class="reference internal" href="#paddleclasspaddle_1_1BaseVector"><span class="std std-ref">paddle::BaseVector&lt; T &gt;</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1Matrix"><span class="std std-ref">paddle::Matrix</span></a></p>
190
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
191 192 193
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixTD0Ev">
194
<span id="paddle::BaseMatrixT::~BaseMatrixT"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a9b163bb6d40396e08e09227a5c05803c"></span><em class="property">virtual</em> <code class="descname">~BaseMatrixT</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixTD0Ev" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT11BaseMatrixTE6size_t6size_tP1Tbb">
<span id="paddle::BaseMatrixT::BaseMatrixT__s.s.TP.b.b"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a77f1b3751f8c50577a30d116e19b1faf"></span><code class="descname">BaseMatrixT</code><span class="sig-paren">(</span>size_t <em>height</em>, size_t <em>width</em>, T *<em>data</em>, bool <em>trans</em>, bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT11BaseMatrixTE6size_t6size_tP1Tbb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT11BaseMatrixTER11BaseMatrixTb">
<span id="paddle::BaseMatrixT::BaseMatrixT__BaseMatrixTR.b"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a80598441346afae6f54658ce9d8b2fbb"></span><code class="descname">BaseMatrixT</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixT11BaseMatrixTE6size_t6size_tP1Tbb" title="paddle::BaseMatrixT::BaseMatrixT">BaseMatrixT</a> &amp;<em>mat</em>, bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT11BaseMatrixTER11BaseMatrixTb" title="Permalink to this definition">¶</a></dt>
<dd><p><dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>This constructor is for temporarily making a matrix with different useGpu flag as the original matrix so that mixed gpu/cpu operations can be performed successfully. </dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT11BaseMatrixTE6size_t6size_t6size_tP1Tbb">
<span id="paddle::BaseMatrixT::BaseMatrixT__s.s.s.TP.b.b"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1ad38c125158b26a2cd7c1ef5289a8b646"></span><code class="descname">BaseMatrixT</code><span class="sig-paren">(</span>size_t <em>height</em>, size_t <em>width</em>, size_t <em>stride</em>, T *<em>data</em>, bool <em>trans</em>, bool <em>use_gpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT11BaseMatrixTE6size_t6size_t6size_tP1Tbb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT7setDataEP1T">
<span id="paddle::BaseMatrixT::setData__TP"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a6c81450fb9e7eb25860df3f1a1f2e828"></span>void <code class="descname">setData</code><span class="sig-paren">(</span>T *<em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT7setDataEP1T" title="Permalink to this definition">¶</a></dt>
<dd><p>caller should make sure that the size of data is at least height*width </p>
</dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> Op&gt;</dt>
<dt id="_CPPv2N6paddle11BaseMatrixT10applyUnaryE2Op">
<span id="paddle::BaseMatrixT::applyUnary__Op"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1ab18e50a6b2034fd9b97b871a47a5286a"></span>int <code class="descname">applyUnary</code><span class="sig-paren">(</span>Op <em>op</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT10applyUnaryE2Op" title="Permalink to this definition">¶</a></dt>
<dd><p>unary operator: element wise op(a).</p>
229
<p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="k">for</span> <span class="mi">0</span> <span class="o">&lt;=</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">this</span><span class="o">-&gt;</span><span class="n">height_</span> <span class="o">&amp;</span> <span class="k">for</span> <span class="mi">0</span> <span class="o">&lt;=</span> <span class="n">j</span> <span class="o">&lt;</span> <span class="n">this</span><span class="o">-&gt;</span><span class="n">width_</span><span class="o">.</span>
Y
Yu Yang 已提交
230 231
</pre></div>
</div>
232
 </p>
Y
Yu Yang 已提交
233 234 235 236 237 238 239 240
</dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> Op&gt;</dt>
<dt id="_CPPv2N6paddle11BaseMatrixT10applyUnaryE2OpiiR12MatrixOffset">
<span id="paddle::BaseMatrixT::applyUnary__Op.i.i.MatrixOffsetR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a8da124da9134900f91b1f1675518ea6a"></span>int <code class="descname">applyUnary</code><span class="sig-paren">(</span>Op <em>op</em>, int <em>numRows</em>, int <em>numCols</em>, <a class="reference internal" href="#_CPPv2N6paddle12MatrixOffsetE" title="paddle::MatrixOffset">MatrixOffset</a> &amp;<em>offset</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT10applyUnaryE2OpiiR12MatrixOffset" title="Permalink to this definition">¶</a></dt>
<dd><p>unary operator: element wise op(a).</p>
241
<p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="k">for</span> <span class="mi">0</span> <span class="o">&lt;=</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">numRows</span> <span class="o">&amp;</span> <span class="k">for</span> <span class="mi">0</span> <span class="o">&lt;=</span> <span class="n">j</span> <span class="o">&lt;</span> <span class="n">numCols</span><span class="o">.</span>
242 243
<span class="n">While</span> <span class="n">matrix</span> <span class="n">start</span> <span class="n">address</span> <span class="ow">is</span><span class="p">:</span>
 <span class="n">A</span> <span class="o">=</span> <span class="n">this</span><span class="o">-&gt;</span><span class="n">data_</span> <span class="o">+</span> <span class="n">offset</span><span class="o">.</span><span class="n">aRow_</span><span class="o">*</span><span class="n">ld</span> <span class="o">+</span> <span class="n">offset</span><span class="o">.</span><span class="n">aCol_</span><span class="p">;</span>
Y
Yu Yang 已提交
244 245
</pre></div>
</div>
246
 </p>
Y
Yu Yang 已提交
247 248 249 250 251 252
</dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> Op&gt;</dt>
<dt id="_CPPv2N6paddle11BaseMatrixT11applyBinaryE2OpR11BaseMatrixT">
253
<span id="paddle::BaseMatrixT::applyBinary__Op.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a2c6a2132a25dc80f8931fbc462832afa"></span>int <code class="descname">applyBinary</code><span class="sig-paren">(</span>Op <em>op</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT11applyBinaryE2OpR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
254
<dd><p>binary operator: element wise op(a, b).</p>
255
<p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="k">for</span> <span class="mi">0</span> <span class="o">&lt;=</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">this</span><span class="o">-&gt;</span><span class="n">height_</span> <span class="o">&amp;</span> <span class="k">for</span> <span class="mi">0</span> <span class="o">&lt;=</span> <span class="n">j</span> <span class="o">&lt;</span> <span class="n">this</span><span class="o">-&gt;</span><span class="n">width_</span><span class="o">.</span>
256
<span class="n">While</span> <span class="n">this</span><span class="o">-&gt;</span><span class="n">height_</span> <span class="o">==</span> <span class="n">b</span><span class="o">.</span><span class="n">height_</span> <span class="o">&amp;&amp;</span> <span class="n">this</span><span class="o">-&gt;</span><span class="n">width_</span> <span class="o">==</span> <span class="n">b</span><span class="o">.</span><span class="n">width_</span><span class="o">.</span>
Y
Yu Yang 已提交
257 258
</pre></div>
</div>
259
 </p>
Y
Yu Yang 已提交
260 261 262 263 264 265
</dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> Op, <em class="property">class</em> bAsRowVector, <em class="property">class</em> bAsColVector&gt;</dt>
<dt id="_CPPv2N6paddle11BaseMatrixT11applyBinaryE2OpR11BaseMatrixTiiR12MatrixOffset12bAsRowVector12bAsColVector">
266
<span id="paddle::BaseMatrixT::applyBinary__Op.BaseMatrixTR.i.i.MatrixOffsetR.bAsRowVector.bAsColVector"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a29ff20be23e018d64015559cb5b98340"></span>int <code class="descname">applyBinary</code><span class="sig-paren">(</span>Op <em>op</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, int <em>numRows</em>, int <em>numCols</em>, <a class="reference internal" href="#_CPPv2N6paddle12MatrixOffsetE" title="paddle::MatrixOffset">MatrixOffset</a> &amp;<em>offset</em>, bAsRowVector, bAsColVector<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT11applyBinaryE2OpR11BaseMatrixTiiR12MatrixOffset12bAsRowVector12bAsColVector" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
267
<dd><p>binary operator: element wise op(a, b)</p>
268
<p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="k">for</span> <span class="mi">0</span> <span class="o">&lt;=</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">numRows</span> <span class="o">&amp;</span> <span class="k">for</span> <span class="mi">0</span> <span class="o">&lt;=</span> <span class="n">j</span> <span class="o">&lt;</span> <span class="n">numCols</span><span class="o">.</span>
269 270 271
<span class="n">While</span> <span class="n">matrix</span> <span class="n">start</span> <span class="n">address</span> <span class="ow">is</span><span class="p">:</span>
  <span class="n">A</span> <span class="o">=</span> <span class="n">this</span><span class="o">-&gt;</span><span class="n">data_</span> <span class="o">+</span> <span class="n">offset</span><span class="o">.</span><span class="n">aRow_</span><span class="o">*</span><span class="n">lda</span> <span class="o">+</span> <span class="n">offset</span><span class="o">.</span><span class="n">aCol_</span><span class="p">;</span>
  <span class="n">B</span> <span class="o">=</span> <span class="n">b</span><span class="o">-&gt;</span><span class="n">data_</span> <span class="o">+</span> <span class="n">offset</span><span class="o">.</span><span class="n">bRow_</span><span class="o">*</span><span class="n">ldb</span> <span class="o">+</span> <span class="n">offset</span><span class="o">.</span><span class="n">bCol_</span><span class="p">;</span>
Y
Yu Yang 已提交
272

273 274
<span class="k">if</span> <span class="p">(</span><span class="n">bAsRowVector</span> <span class="o">==</span> <span class="n">false_type</span> <span class="o">&amp;&amp;</span> <span class="n">bAsColVector</span> <span class="o">==</span> <span class="n">false_type</span><span class="p">)</span>
  <span class="n">op</span><span class="p">(</span><span class="n">A</span><span class="p">[</span><span class="n">i</span> <span class="o">*</span> <span class="n">lda</span> <span class="o">+</span> <span class="n">j</span><span class="p">],</span> <span class="n">B</span><span class="p">[</span><span class="n">i</span> <span class="o">*</span> <span class="n">ldb</span> <span class="o">+</span> <span class="n">j</span><span class="p">])</span>
Y
Yu Yang 已提交
275

276 277
<span class="k">if</span> <span class="p">(</span><span class="n">bAsRowVector</span> <span class="o">==</span> <span class="n">true_type</span> <span class="o">&amp;&amp;</span> <span class="n">bAsColVector</span> <span class="o">==</span> <span class="n">false_type</span><span class="p">)</span>
  <span class="n">op</span><span class="p">(</span><span class="n">A</span><span class="p">[</span><span class="n">i</span> <span class="o">*</span> <span class="n">lda</span> <span class="o">+</span> <span class="n">j</span><span class="p">],</span> <span class="n">B</span><span class="p">[</span><span class="n">j</span><span class="p">])</span>
Y
Yu Yang 已提交
278

279 280
<span class="k">if</span> <span class="p">(</span><span class="n">bAsRowVector</span> <span class="o">==</span> <span class="n">false_type</span> <span class="o">&amp;&amp;</span> <span class="n">bAsColVector</span> <span class="o">==</span> <span class="n">true_type</span><span class="p">)</span>
  <span class="n">op</span><span class="p">(</span><span class="n">A</span><span class="p">[</span><span class="n">i</span> <span class="o">*</span> <span class="n">lda</span> <span class="o">+</span> <span class="n">j</span><span class="p">],</span> <span class="n">B</span><span class="p">[</span><span class="n">i</span> <span class="o">*</span> <span class="n">ldb</span><span class="p">])</span>
Y
Yu Yang 已提交
281

282 283
<span class="k">if</span> <span class="p">(</span><span class="n">bAsRowVector</span> <span class="o">==</span> <span class="n">true_type</span> <span class="o">&amp;&amp;</span> <span class="n">bAsColVector</span> <span class="o">==</span> <span class="n">true_type</span><span class="p">)</span>
  <span class="n">op</span><span class="p">(</span><span class="n">A</span><span class="p">[</span><span class="n">i</span> <span class="o">*</span> <span class="n">lda</span> <span class="o">+</span> <span class="n">j</span><span class="p">],</span> <span class="n">B</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
Y
Yu Yang 已提交
284 285
</pre></div>
</div>
286
 </p>
Y
Yu Yang 已提交
287 288 289 290 291 292
</dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> Op&gt;</dt>
<dt id="_CPPv2N6paddle11BaseMatrixT11applyBinaryE2OpR11BaseMatrixTiiR12MatrixOffset">
293
<span id="paddle::BaseMatrixT::applyBinary__Op.BaseMatrixTR.i.i.MatrixOffsetR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a7228c2ccee8ca530d8d22657bcc211b7"></span>int <code class="descname">applyBinary</code><span class="sig-paren">(</span>Op <em>op</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, int <em>numRows</em>, int <em>numCols</em>, <a class="reference internal" href="#_CPPv2N6paddle12MatrixOffsetE" title="paddle::MatrixOffset">MatrixOffset</a> &amp;<em>offset</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT11applyBinaryE2OpR11BaseMatrixTiiR12MatrixOffset" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
294 295 296 297 298 299
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> Op&gt;</dt>
<dt id="_CPPv2N6paddle11BaseMatrixT12applyTernaryE2OpR11BaseMatrixTR11BaseMatrixT">
300
<span id="paddle::BaseMatrixT::applyTernary__Op.BaseMatrixTR.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a9893200970ec3645072d68a81aa376fa"></span>int <code class="descname">applyTernary</code><span class="sig-paren">(</span>Op <em>op</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT12applyTernaryE2OpR11BaseMatrixTR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
301
<dd><p>ternary operator: element wise op(a, b, c).</p>
302
<p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="k">for</span> <span class="mi">0</span> <span class="o">&lt;=</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">this</span><span class="o">-&gt;</span><span class="n">height_</span> <span class="o">&amp;</span> <span class="k">for</span> <span class="mi">0</span> <span class="o">&lt;=</span> <span class="n">j</span> <span class="o">&lt;</span> <span class="n">this</span><span class="o">-&gt;</span><span class="n">width_</span><span class="o">.</span>
Y
Yu Yang 已提交
303

304 305
<span class="n">While</span> <span class="n">this</span><span class="o">-&gt;</span><span class="n">height_</span> <span class="o">==</span> <span class="n">b</span><span class="o">.</span><span class="n">height_</span> <span class="o">&amp;&amp;</span> <span class="n">this</span><span class="o">-&gt;</span><span class="n">width_</span> <span class="o">==</span> <span class="n">b</span><span class="o">.</span><span class="n">width_</span>
   <span class="o">&amp;&amp;</span> <span class="n">this</span><span class="o">-&gt;</span><span class="n">height_</span> <span class="o">==</span> <span class="n">c</span><span class="o">.</span><span class="n">height_</span> <span class="o">&amp;&amp;</span> <span class="n">this</span><span class="o">-&gt;</span><span class="n">width_</span> <span class="o">==</span> <span class="n">c</span><span class="o">.</span><span class="n">width_</span>
Y
Yu Yang 已提交
306 307
</pre></div>
</div>
308
 </p>
Y
Yu Yang 已提交
309 310 311 312 313 314
</dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> Op, <em class="property">class</em> cAsRowVector, <em class="property">class</em> cAsColVector&gt;</dt>
<dt id="_CPPv2N6paddle11BaseMatrixT12applyTernaryE2OpR11BaseMatrixTR11BaseMatrixTiiR12MatrixOffset12cAsRowVector12cAsColVector">
315
<span id="paddle::BaseMatrixT::applyTernary__Op.BaseMatrixTR.BaseMatrixTR.i.i.MatrixOffsetR.cAsRowVector.cAsColVector"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a657a449ffc6bd59f5522dabdc07597d5"></span>int <code class="descname">applyTernary</code><span class="sig-paren">(</span>Op <em>op</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em>, int <em>numRows</em>, int <em>numCols</em>, <a class="reference internal" href="#_CPPv2N6paddle12MatrixOffsetE" title="paddle::MatrixOffset">MatrixOffset</a> &amp;<em>offset</em>, cAsRowVector, cAsColVector<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT12applyTernaryE2OpR11BaseMatrixTR11BaseMatrixTiiR12MatrixOffset12cAsRowVector12cAsColVector" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
316
<dd><p>ternary operator: element wise op(a, b, c).</p>
317
<p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="k">for</span> <span class="mi">0</span> <span class="o">&lt;=</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">numRows</span> <span class="o">&amp;</span> <span class="k">for</span> <span class="mi">0</span> <span class="o">&lt;=</span> <span class="n">j</span> <span class="o">&lt;</span> <span class="n">numCols</span><span class="o">.</span>
318
<span class="n">While</span> <span class="n">matrix</span> <span class="n">start</span> <span class="n">address</span> <span class="ow">is</span><span class="p">:</span>
Y
Yu Yang 已提交
319

320 321 322
  <span class="n">A</span> <span class="o">=</span> <span class="n">this</span><span class="o">-&gt;</span><span class="n">data_</span> <span class="o">+</span> <span class="n">offset</span><span class="o">.</span><span class="n">aRow_</span><span class="o">*</span><span class="n">lda</span> <span class="o">+</span> <span class="n">offset</span><span class="o">.</span><span class="n">aCol_</span><span class="p">;</span>
  <span class="n">B</span> <span class="o">=</span> <span class="n">b</span><span class="o">-&gt;</span><span class="n">data_</span> <span class="o">+</span> <span class="n">offset</span><span class="o">.</span><span class="n">bRow_</span><span class="o">*</span><span class="n">ldb</span> <span class="o">+</span> <span class="n">offset</span><span class="o">.</span><span class="n">bCol_</span><span class="p">;</span>
  <span class="n">C</span> <span class="o">=</span> <span class="n">c</span><span class="o">-&gt;</span><span class="n">data_</span> <span class="o">+</span> <span class="n">offset</span><span class="o">.</span><span class="n">cRow_</span><span class="o">*</span><span class="n">ldc</span> <span class="o">+</span> <span class="n">offset</span><span class="o">.</span><span class="n">cCol_</span><span class="p">;</span>
Y
Yu Yang 已提交
323

324 325
  <span class="k">if</span> <span class="p">(</span><span class="n">cAsRowVector</span> <span class="o">==</span> <span class="n">false_type</span> <span class="o">&amp;&amp;</span> <span class="n">cAsColVector</span> <span class="o">==</span> <span class="n">false_type</span><span class="p">)</span>
    <span class="n">op</span><span class="p">(</span><span class="n">A</span><span class="p">[</span><span class="n">i</span><span class="o">*</span><span class="n">lda</span> <span class="o">+</span> <span class="n">j</span><span class="p">],</span> <span class="n">B</span><span class="p">[</span><span class="n">i</span><span class="o">*</span><span class="n">ldb</span> <span class="o">+</span> <span class="n">j</span><span class="p">],</span> <span class="n">C</span><span class="p">[</span><span class="n">i</span><span class="o">*</span><span class="n">ldc</span> <span class="o">+</span> <span class="n">j</span><span class="p">])</span>
Y
Yu Yang 已提交
326

327 328
  <span class="k">if</span> <span class="p">(</span><span class="n">cAsRowVector</span> <span class="o">==</span> <span class="n">true_type</span> <span class="o">&amp;&amp;</span> <span class="n">cAsColVector</span> <span class="o">==</span> <span class="n">false_type</span><span class="p">)</span>
    <span class="n">op</span><span class="p">(</span><span class="n">A</span><span class="p">[</span><span class="n">i</span><span class="o">*</span><span class="n">lda</span> <span class="o">+</span> <span class="n">j</span><span class="p">],</span> <span class="n">B</span><span class="p">[</span><span class="n">i</span><span class="o">*</span><span class="n">ldb</span> <span class="o">+</span> <span class="n">j</span><span class="p">],</span> <span class="n">C</span><span class="p">[</span><span class="n">j</span><span class="p">])</span>
Y
Yu Yang 已提交
329

330 331
  <span class="k">if</span> <span class="p">(</span><span class="n">cAsRowVector</span> <span class="o">==</span> <span class="n">false_type</span> <span class="o">&amp;&amp;</span> <span class="n">cAsColVector</span> <span class="o">==</span> <span class="n">true_type</span><span class="p">)</span>
    <span class="n">op</span><span class="p">(</span><span class="n">A</span><span class="p">[</span><span class="n">i</span><span class="o">*</span><span class="n">lda</span> <span class="o">+</span> <span class="n">j</span><span class="p">],</span> <span class="n">B</span><span class="p">[</span><span class="n">i</span><span class="o">*</span><span class="n">ldb</span> <span class="o">+</span> <span class="n">j</span><span class="p">],</span> <span class="n">C</span><span class="p">[</span><span class="n">i</span><span class="o">*</span><span class="n">ldc</span><span class="p">])</span>
Y
Yu Yang 已提交
332

333 334
  <span class="k">if</span> <span class="p">(</span><span class="n">cAsRowVector</span> <span class="o">==</span> <span class="mi">1</span> <span class="o">&amp;&amp;</span> <span class="n">cAsColVector</span> <span class="o">==</span> <span class="mi">1</span><span class="p">)</span>
    <span class="n">op</span><span class="p">(</span><span class="n">A</span><span class="p">[</span><span class="n">i</span><span class="o">*</span><span class="n">lda</span> <span class="o">+</span> <span class="n">j</span><span class="p">],</span> <span class="n">B</span><span class="p">[</span><span class="n">i</span><span class="o">*</span><span class="n">ldb</span> <span class="o">+</span> <span class="n">j</span><span class="p">],</span> <span class="n">C</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
Y
Yu Yang 已提交
335 336
</pre></div>
</div>
337
 </p>
Y
Yu Yang 已提交
338 339 340 341 342 343
</dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> Op&gt;</dt>
<dt id="_CPPv2N6paddle11BaseMatrixT12applyTernaryE2OpR11BaseMatrixTR11BaseMatrixTiiR12MatrixOffset">
344
<span id="paddle::BaseMatrixT::applyTernary__Op.BaseMatrixTR.BaseMatrixTR.i.i.MatrixOffsetR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1aed01609bd50a35e98d9dc0d2ef337f5e"></span>int <code class="descname">applyTernary</code><span class="sig-paren">(</span>Op <em>op</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em>, int <em>numRows</em>, int <em>numCols</em>, <a class="reference internal" href="#_CPPv2N6paddle12MatrixOffsetE" title="paddle::MatrixOffset">MatrixOffset</a> &amp;<em>offset</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT12applyTernaryE2OpR11BaseMatrixTR11BaseMatrixTiiR12MatrixOffset" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
345 346 347 348 349 350
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> Op&gt;</dt>
<dt id="_CPPv2N6paddle11BaseMatrixT15applyQuaternaryE2OpR11BaseMatrixTR11BaseMatrixTR11BaseMatrixT">
351
<span id="paddle::BaseMatrixT::applyQuaternary__Op.BaseMatrixTR.BaseMatrixTR.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1afbb29405dd9f19142cc3ad5459696233"></span>int <code class="descname">applyQuaternary</code><span class="sig-paren">(</span>Op <em>op</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>d</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT15applyQuaternaryE2OpR11BaseMatrixTR11BaseMatrixTR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
352
<dd><p>quaternary operator: element wise op(a, b, c, d).</p>
353
<p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="k">for</span> <span class="mi">0</span> <span class="o">&lt;=</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">this</span><span class="o">-&gt;</span><span class="n">height_</span> <span class="o">&amp;</span> <span class="k">for</span> <span class="mi">0</span> <span class="o">&lt;=</span> <span class="n">j</span> <span class="o">&lt;</span> <span class="n">this</span><span class="o">-&gt;</span><span class="n">width_</span><span class="o">.</span>
Y
Yu Yang 已提交
354

355 356 357
<span class="n">While</span> <span class="n">this</span><span class="o">-&gt;</span><span class="n">height_</span> <span class="o">==</span> <span class="n">b</span><span class="o">.</span><span class="n">height_</span> <span class="o">&amp;&amp;</span> <span class="n">this</span><span class="o">-&gt;</span><span class="n">width_</span> <span class="o">==</span> <span class="n">b</span><span class="o">.</span><span class="n">width_</span>
   <span class="o">&amp;&amp;</span> <span class="n">this</span><span class="o">-&gt;</span><span class="n">height_</span> <span class="o">==</span> <span class="n">c</span><span class="o">.</span><span class="n">height_</span> <span class="o">&amp;&amp;</span> <span class="n">this</span><span class="o">-&gt;</span><span class="n">width_</span> <span class="o">==</span> <span class="n">c</span><span class="o">.</span><span class="n">width_</span>
   <span class="o">&amp;&amp;</span> <span class="n">this</span><span class="o">-&gt;</span><span class="n">height_</span> <span class="o">==</span> <span class="n">d</span><span class="o">.</span><span class="n">height_</span> <span class="o">&amp;&amp;</span> <span class="n">this</span><span class="o">-&gt;</span><span class="n">width_</span> <span class="o">==</span> <span class="n">d</span><span class="o">.</span><span class="n">width_</span>
Y
Yu Yang 已提交
358 359
</pre></div>
</div>
360
 </p>
Y
Yu Yang 已提交
361 362 363 364 365 366
</dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> Op&gt;</dt>
<dt id="_CPPv2N6paddle11BaseMatrixT15applyQuaternaryE2OpR11BaseMatrixTR11BaseMatrixTR11BaseMatrixTiiR12MatrixOffset">
367
<span id="paddle::BaseMatrixT::applyQuaternary__Op.BaseMatrixTR.BaseMatrixTR.BaseMatrixTR.i.i.MatrixOffsetR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a2726a3b92469b4cabec39a7a8222a9c3"></span>int <code class="descname">applyQuaternary</code><span class="sig-paren">(</span>Op <em>op</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>d</em>, int <em>numRows</em>, int <em>numCols</em>, <a class="reference internal" href="#_CPPv2N6paddle12MatrixOffsetE" title="paddle::MatrixOffset">MatrixOffset</a> &amp;<em>offset</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT15applyQuaternaryE2OpR11BaseMatrixTR11BaseMatrixTR11BaseMatrixTiiR12MatrixOffset" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
368
<dd><p>quaternary operator: element wise op(a, b, c, d).</p>
369
<p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="k">for</span> <span class="mi">0</span> <span class="o">&lt;=</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">numRows</span> <span class="o">&amp;</span> <span class="k">for</span> <span class="mi">0</span> <span class="o">&lt;=</span> <span class="n">j</span> <span class="o">&lt;</span> <span class="n">numCols</span><span class="o">.</span>
370 371 372 373 374
<span class="n">While</span> <span class="n">matrix</span> <span class="n">start</span> <span class="n">address</span> <span class="ow">is</span><span class="p">:</span>
   <span class="n">A</span> <span class="o">=</span> <span class="n">this</span><span class="o">-&gt;</span><span class="n">data_</span> <span class="o">+</span> <span class="n">offset</span><span class="o">.</span><span class="n">aRow_</span><span class="o">*</span><span class="n">lda</span> <span class="o">+</span> <span class="n">offset</span><span class="o">.</span><span class="n">aCol_</span><span class="p">;</span>
   <span class="n">B</span> <span class="o">=</span> <span class="n">b</span><span class="o">-&gt;</span><span class="n">data_</span> <span class="o">+</span> <span class="n">offset</span><span class="o">.</span><span class="n">bRow_</span><span class="o">*</span><span class="n">ldb</span> <span class="o">+</span> <span class="n">offset</span><span class="o">.</span><span class="n">bCol_</span><span class="p">;</span>
   <span class="n">C</span> <span class="o">=</span> <span class="n">c</span><span class="o">-&gt;</span><span class="n">data_</span> <span class="o">+</span> <span class="n">offset</span><span class="o">.</span><span class="n">cRow_</span><span class="o">*</span><span class="n">ldc</span> <span class="o">+</span> <span class="n">offset</span><span class="o">.</span><span class="n">cCol_</span><span class="p">;</span>
   <span class="n">D</span> <span class="o">=</span> <span class="n">d</span><span class="o">-&gt;</span><span class="n">data_</span> <span class="o">+</span> <span class="n">offset</span><span class="o">.</span><span class="n">dRow_</span><span class="o">*</span><span class="n">ldd</span> <span class="o">+</span> <span class="n">offset</span><span class="o">.</span><span class="n">dCol_</span><span class="p">;</span>
Y
Yu Yang 已提交
375 376
</pre></div>
</div>
377
 </p>
Y
Yu Yang 已提交
378 379 380 381 382 383
</dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> Agg, <em class="property">class</em> Op, <em class="property">class</em> Saver, <em class="property">class</em> aAsRowVector, <em class="property">class</em> aAsColVector&gt;</dt>
<dt id="_CPPv2N6paddle11BaseMatrixT9aggregateE3Agg2Op5SaverR11BaseMatrixTiiR12MatrixOffset12aAsRowVector12aAsColVector">
384
<span id="paddle::BaseMatrixT::aggregate__Agg.Op.Saver.BaseMatrixTR.i.i.MatrixOffsetR.aAsRowVector.aAsColVector"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1ac356558eaaeb5aae26ed031f112d0384"></span>int <code class="descname">aggregate</code><span class="sig-paren">(</span>Agg <em>agg</em>, Op <em>op</em>, Saver <em>sv</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, int <em>numRows</em>, int <em>numCols</em>, <a class="reference internal" href="#_CPPv2N6paddle12MatrixOffsetE" title="paddle::MatrixOffset">MatrixOffset</a> &amp;<em>offset</em>, aAsRowVector, aAsColVector<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT9aggregateE3Agg2Op5SaverR11BaseMatrixTiiR12MatrixOffset12aAsRowVector12aAsColVector" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
385
<dd><p>a aggregate expression that apply each row(or column) of matrix b. op and sv is element wise operator.</p>
386
<p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="p">(</span><span class="n">aAsRowVector</span> <span class="o">==</span> <span class="n">true_type</span> <span class="o">&amp;&amp;</span> <span class="n">aAsColVector</span> <span class="o">==</span> <span class="n">false_type</span><span class="p">)</span>
387 388 389
 <span class="k">for</span> <span class="n">each</span> <span class="n">column</span> <span class="n">j</span> <span class="o">&amp;</span> <span class="mi">0</span> <span class="o">&lt;=</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">numRows</span><span class="p">,</span> <span class="n">do</span><span class="p">:</span>
   <span class="n">dst</span> <span class="o">=</span> <span class="n">agg</span><span class="p">(</span><span class="n">op</span><span class="p">(</span><span class="n">b</span><span class="p">[</span><span class="n">i</span><span class="o">*</span><span class="n">ldb</span> <span class="o">+</span> <span class="n">j</span><span class="p">]))</span>
   <span class="n">a</span><span class="p">[</span><span class="n">j</span><span class="p">]</span> <span class="o">=</span> <span class="n">sv</span><span class="p">(</span><span class="n">a</span><span class="p">[</span><span class="n">j</span><span class="p">],</span> <span class="n">dst</span><span class="p">)</span>
Y
Yu Yang 已提交
390

391 392 393 394
<span class="k">if</span> <span class="p">(</span><span class="n">aAsRowVector</span> <span class="o">==</span> <span class="n">false_type</span> <span class="o">&amp;&amp;</span> <span class="n">aAsColVector</span> <span class="o">==</span> <span class="n">true_type</span><span class="p">)</span>
 <span class="k">for</span> <span class="n">each</span> <span class="n">row</span> <span class="n">i</span> <span class="o">&amp;</span> <span class="mi">0</span> <span class="o">&lt;=</span> <span class="n">j</span> <span class="o">&lt;</span> <span class="n">numCols</span><span class="p">,</span> <span class="n">do</span><span class="p">:</span>
   <span class="n">dst</span> <span class="o">=</span> <span class="n">agg</span><span class="p">(</span><span class="n">op</span><span class="p">(</span><span class="n">b</span><span class="p">[</span><span class="n">i</span><span class="o">*</span><span class="n">ldb</span> <span class="o">+</span> <span class="n">j</span><span class="p">]))</span>
   <span class="n">a</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="n">sv</span><span class="p">(</span><span class="n">a</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> <span class="n">dst</span><span class="p">)</span>
Y
Yu Yang 已提交
395 396
</pre></div>
</div>
397
 </p>
Y
Yu Yang 已提交
398 399 400 401 402 403
</dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> Agg, <em class="property">class</em> Op, <em class="property">class</em> Saver, <em class="property">class</em> aAsRowVector, <em class="property">class</em> aAsColVector&gt;</dt>
<dt id="_CPPv2N6paddle11BaseMatrixT9aggregateE3Agg2Op5SaverR11BaseMatrixTR11BaseMatrixTiiR12MatrixOffset12aAsRowVector12aAsColVector">
404
<span id="paddle::BaseMatrixT::aggregate__Agg.Op.Saver.BaseMatrixTR.BaseMatrixTR.i.i.MatrixOffsetR.aAsRowVector.aAsColVector"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a890171afa570429c444228974231e74b"></span>int <code class="descname">aggregate</code><span class="sig-paren">(</span>Agg <em>agg</em>, Op <em>op</em>, Saver <em>sv</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em>, int <em>numRows</em>, int <em>numCols</em>, <a class="reference internal" href="#_CPPv2N6paddle12MatrixOffsetE" title="paddle::MatrixOffset">MatrixOffset</a> &amp;<em>offset</em>, aAsRowVector, aAsColVector<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT9aggregateE3Agg2Op5SaverR11BaseMatrixTR11BaseMatrixTiiR12MatrixOffset12aAsRowVector12aAsColVector" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
405 406
<dd><p>a aggregate expression that apply each row(or column) of matrix b and c.</p>
<p>op and sv is element wise operator.</p>
407
<p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="k">if</span> <span class="p">(</span><span class="n">aAsRowVector</span> <span class="o">==</span> <span class="n">true_type</span> <span class="o">&amp;&amp;</span> <span class="n">aAsColVector</span> <span class="o">==</span> <span class="n">false_type</span><span class="p">)</span>
408 409 410
  <span class="k">for</span> <span class="n">each</span> <span class="n">column</span> <span class="n">j</span> <span class="o">&amp;</span> <span class="mi">0</span> <span class="o">&lt;=</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">numRows</span><span class="p">,</span> <span class="n">do</span><span class="p">:</span>
    <span class="n">dst</span> <span class="o">=</span> <span class="n">agg</span><span class="p">(</span><span class="n">op</span><span class="p">(</span><span class="n">b</span><span class="p">[</span><span class="n">i</span><span class="o">*</span><span class="n">ldb</span> <span class="o">+</span> <span class="n">j</span><span class="p">],</span> <span class="n">c</span><span class="p">[</span><span class="n">i</span><span class="o">*</span><span class="n">ldc</span> <span class="o">+</span> <span class="n">j</span><span class="p">]))</span>
    <span class="n">a</span><span class="p">[</span><span class="n">j</span><span class="p">]</span> <span class="o">=</span> <span class="n">sv</span><span class="p">(</span><span class="n">a</span><span class="p">[</span><span class="n">j</span><span class="p">],</span> <span class="n">dst</span><span class="p">)</span>
Y
Yu Yang 已提交
411

412 413 414 415
<span class="k">if</span> <span class="p">(</span><span class="n">aAsRowVector</span> <span class="o">==</span> <span class="n">false_type</span> <span class="o">&amp;&amp;</span> <span class="n">aAsColVector</span> <span class="o">==</span> <span class="n">true_type</span><span class="p">)</span>
  <span class="k">for</span> <span class="n">each</span> <span class="n">row</span> <span class="n">i</span> <span class="o">&amp;</span> <span class="mi">0</span> <span class="o">&lt;=</span> <span class="n">j</span> <span class="o">&lt;</span> <span class="n">numCols</span><span class="p">,</span> <span class="n">do</span><span class="p">:</span>
    <span class="n">dst</span> <span class="o">=</span> <span class="n">agg</span><span class="p">(</span><span class="n">op</span><span class="p">(</span><span class="n">b</span><span class="p">[</span><span class="n">i</span><span class="o">*</span><span class="n">ldb</span> <span class="o">+</span> <span class="n">j</span><span class="p">],</span> <span class="n">c</span><span class="p">[</span><span class="n">i</span><span class="o">*</span><span class="n">ldc</span> <span class="o">+</span> <span class="n">j</span><span class="p">]))</span>
    <span class="n">a</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="n">sv</span><span class="p">(</span><span class="n">a</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> <span class="n">dst</span><span class="p">)</span>
Y
Yu Yang 已提交
416 417
</pre></div>
</div>
418
 </p>
Y
Yu Yang 已提交
419 420 421 422 423 424
</dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> Agg&gt;</dt>
<dt id="_CPPv2N6paddle11BaseMatrixT8applyRowE3AggR11BaseMatrixT">
425
<span id="paddle::BaseMatrixT::applyRow__Agg.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1affbac666eafb6eff925d72ceb66bb41f"></span>int <code class="descname">applyRow</code><span class="sig-paren">(</span>Agg <em>agg</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT8applyRowE3AggR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
426
<dd><p>a aggregate expression that apply each row of matrix b.</p>
427
<p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="k">for</span> <span class="n">each</span> <span class="n">row</span> <span class="n">i</span> <span class="o">&amp;</span> <span class="mi">0</span> <span class="o">&lt;=</span> <span class="n">j</span> <span class="o">&lt;</span> <span class="n">b</span><span class="o">.</span><span class="n">width_</span><span class="p">,</span> <span class="n">do</span><span class="p">:</span>
428
  <span class="n">this</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="n">agg</span><span class="p">(</span><span class="n">b</span><span class="p">[</span><span class="n">i</span><span class="o">*</span><span class="n">ldb</span> <span class="o">+</span> <span class="n">j</span><span class="p">])</span>
Y
Yu Yang 已提交
429 430
</pre></div>
</div>
431 432 433 434 435 436 437 438 439 440 441 442 443 444 445
 </p>
</dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> Agg, <em class="property">class</em> Op, <em class="property">class</em> Saver&gt;</dt>
<dt id="_CPPv2N6paddle11BaseMatrixT8applyRowE3Agg2Op5SaverR11BaseMatrixTR11BaseMatrixT">
<span id="paddle::BaseMatrixT::applyRow__Agg.Op.Saver.BaseMatrixTR.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a8b2be80f881bd2b884ff29727da50681"></span>int <code class="descname">applyRow</code><span class="sig-paren">(</span>Agg <em>agg</em>, Op <em>op</em>, Saver <em>sv</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT8applyRowE3Agg2Op5SaverR11BaseMatrixTR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
<dd><p>a aggregate expression that apply each row of matrix b.</p>
<p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="k">for</span> <span class="n">each</span> <span class="n">row</span> <span class="n">i</span> <span class="o">&amp;</span> <span class="mi">0</span> <span class="o">&lt;=</span> <span class="n">j</span> <span class="o">&lt;</span> <span class="n">b</span><span class="o">.</span><span class="n">width_</span><span class="p">,</span> <span class="n">do</span><span class="p">:</span>
  <span class="n">dst</span> <span class="o">=</span> <span class="n">agg</span><span class="p">(</span><span class="n">op</span><span class="p">(</span><span class="n">b</span><span class="p">[</span><span class="n">i</span><span class="o">*</span><span class="n">ldb</span> <span class="o">+</span> <span class="n">j</span><span class="p">],</span> <span class="n">c</span><span class="p">[</span><span class="n">i</span><span class="o">*</span><span class="n">ldc</span> <span class="o">+</span> <span class="n">j</span><span class="p">])</span>
  <span class="n">this</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="n">sv</span><span class="p">(</span><span class="n">this</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> <span class="n">dst</span><span class="p">)</span>
</pre></div>
</div>
 </p>
Y
Yu Yang 已提交
446 447
</dd></dl>

448 449 450 451 452 453 454
<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> Agg, <em class="property">class</em> Op&gt;</dt>
<dt id="_CPPv2N6paddle11BaseMatrixT8applyRowE3Agg2Op4real4realR11BaseMatrixTR11BaseMatrixT">
<span id="paddle::BaseMatrixT::applyRow__Agg.Op.real.real.BaseMatrixTR.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a873854915cd82ab86a35bcab49c520cb"></span>int <code class="descname">applyRow</code><span class="sig-paren">(</span>Agg <em>agg</em>, Op <em>op</em>, real <em>scaleDest</em>, real <em>scaleAgg</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT8applyRowE3Agg2Op4real4realR11BaseMatrixTR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

Y
Yu Yang 已提交
455 456 457 458
<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> Agg, <em class="property">class</em> Saver&gt;</dt>
<dt id="_CPPv2N6paddle11BaseMatrixT8applyRowE3Agg5SaverR11BaseMatrixT">
459
<span id="paddle::BaseMatrixT::applyRow__Agg.Saver.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a17f991e7162b13ccca0a379ce8b9f765"></span>int <code class="descname">applyRow</code><span class="sig-paren">(</span>Agg <em>agg</em>, Saver <em>sv</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT8applyRowE3Agg5SaverR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
460
<dd><p>a aggregate expression that apply each row of matrix b.</p>
461
<p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="k">for</span> <span class="n">each</span> <span class="n">row</span> <span class="n">i</span> <span class="o">&amp;</span> <span class="mi">0</span> <span class="o">&lt;=</span> <span class="n">j</span> <span class="o">&lt;</span> <span class="n">b</span><span class="o">.</span><span class="n">width_</span><span class="p">,</span> <span class="n">do</span><span class="p">:</span>
462 463
  <span class="n">dst</span> <span class="o">=</span> <span class="n">agg</span><span class="p">(</span><span class="n">b</span><span class="p">[</span><span class="n">i</span><span class="o">*</span><span class="n">ldb</span> <span class="o">+</span> <span class="n">j</span><span class="p">])</span>
  <span class="n">this</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="n">sv</span><span class="p">(</span><span class="n">this</span><span class="p">[</span><span class="n">i</span><span class="p">],</span> <span class="n">dst</span><span class="p">)</span>
Y
Yu Yang 已提交
464 465
</pre></div>
</div>
466
 </p>
Y
Yu Yang 已提交
467 468
</dd></dl>

469 470 471 472 473 474 475
<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> Agg&gt;</dt>
<dt id="_CPPv2N6paddle11BaseMatrixT8applyRowE3Agg4real4realR11BaseMatrixT">
<span id="paddle::BaseMatrixT::applyRow__Agg.real.real.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a67934f3d4deaaece99e5a632568bb106"></span>int <code class="descname">applyRow</code><span class="sig-paren">(</span>Agg <em>agg</em>, real <em>scaleDest</em>, real <em>scaleAgg</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT8applyRowE3Agg4real4realR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

Y
Yu Yang 已提交
476 477 478 479
<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> Agg&gt;</dt>
<dt id="_CPPv2N6paddle11BaseMatrixT8applyColE3AggR11BaseMatrixT">
480
<span id="paddle::BaseMatrixT::applyCol__Agg.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a839c05ea4f6929c9596f57a69668c36a"></span>int <code class="descname">applyCol</code><span class="sig-paren">(</span>Agg <em>agg</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT8applyColE3AggR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
481
<dd><p>a aggregate expression that apply each column of matrix b.</p>
482
<p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="k">for</span> <span class="n">each</span> <span class="n">column</span> <span class="n">j</span> <span class="o">&amp;</span> <span class="mi">0</span> <span class="o">&lt;=</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">b</span><span class="o">.</span><span class="n">height_</span><span class="p">,</span> <span class="n">do</span><span class="p">:</span>
483
  <span class="n">this</span><span class="p">[</span><span class="n">j</span><span class="p">]</span> <span class="o">=</span> <span class="n">agg</span><span class="p">(</span><span class="n">b</span><span class="p">[</span><span class="n">i</span><span class="o">*</span><span class="n">ldb</span> <span class="o">+</span> <span class="n">j</span><span class="p">])</span>
Y
Yu Yang 已提交
484 485
</pre></div>
</div>
486
 </p>
Y
Yu Yang 已提交
487 488 489 490 491 492
</dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> Agg, <em class="property">class</em> Saver&gt;</dt>
<dt id="_CPPv2N6paddle11BaseMatrixT8applyColE3Agg5SaverR11BaseMatrixT">
493
<span id="paddle::BaseMatrixT::applyCol__Agg.Saver.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1abf499e9ec8701fdd58114c084b2e1715"></span>int <code class="descname">applyCol</code><span class="sig-paren">(</span>Agg <em>agg</em>, Saver <em>sv</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT8applyColE3Agg5SaverR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
494
<dd><p>a aggregate expression that apply each column of matrix b.</p>
495
<p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="k">for</span> <span class="n">each</span> <span class="n">column</span> <span class="n">j</span> <span class="o">&amp;</span> <span class="mi">0</span> <span class="o">&lt;=</span> <span class="n">i</span> <span class="o">&lt;</span> <span class="n">b</span><span class="o">.</span><span class="n">height_</span><span class="p">,</span> <span class="n">do</span><span class="p">:</span>
496 497
  <span class="n">dst</span> <span class="o">=</span> <span class="n">agg</span><span class="p">(</span><span class="n">b</span><span class="p">[</span><span class="n">i</span><span class="o">*</span><span class="n">ldb</span> <span class="o">+</span> <span class="n">j</span><span class="p">])</span>
  <span class="n">this</span><span class="p">[</span><span class="n">j</span><span class="p">]</span> <span class="o">=</span> <span class="n">sv</span><span class="p">(</span><span class="n">this</span><span class="p">[</span><span class="n">j</span><span class="p">],</span> <span class="n">dst</span><span class="p">)</span>
Y
Yu Yang 已提交
498 499
</pre></div>
</div>
500
 </p>
Y
Yu Yang 已提交
501 502 503
</dd></dl>

<dl class="function">
504 505 506 507
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> Agg&gt;</dt>
<dt id="_CPPv2N6paddle11BaseMatrixT8applyColE3Agg4real4realR11BaseMatrixT">
<span id="paddle::BaseMatrixT::applyCol__Agg.real.real.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1af453fcc0be44cb857abde314dcb5c707"></span>int <code class="descname">applyCol</code><span class="sig-paren">(</span>Agg <em>agg</em>, real <em>scaleDest</em>, real <em>scaleAgg</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT8applyColE3Agg4real4realR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
508 509 510
<dd></dd></dl>

<dl class="function">
511 512 513 514 515 516 517
<dt id="_CPPv2NK6paddle11BaseMatrixT6useGpuEv">
<span id="paddle::BaseMatrixT::useGpuC"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a8c4952d03bf54c65ff1e5bb8486a8b5d"></span>bool <code class="descname">useGpu</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle11BaseMatrixT6useGpuEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2NK6paddle11BaseMatrixT6rowBufE6size_t">
<span id="paddle::BaseMatrixT::rowBuf__sC"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a2e251e02d95b84e617f8f70104f50c51"></span><em class="property">const</em> T *<code class="descname">rowBuf</code><span class="sig-paren">(</span>size_t <em>row</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle11BaseMatrixT6rowBufE6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
518 519 520 521
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT6rowBufE6size_t">
522
<span id="paddle::BaseMatrixT::rowBuf__s"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1ab6b1ca18dc77bc6143122cb1ed18868a"></span>T *<code class="descname">rowBuf</code><span class="sig-paren">(</span>size_t <em>row</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT6rowBufE6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT3negEv">
<span id="paddle::BaseMatrixT::neg"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1ac719b9566f0b4e12d05d8ece9a5f9f88"></span>void <code class="descname">neg</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT3negEv" title="Permalink to this definition">¶</a></dt>
<dd><p>unary operator. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT3expEv">
<span id="paddle::BaseMatrixT::exp"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1afde1ce02104174a53a8c23a3f6f07371"></span>void <code class="descname">exp</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT3expEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT3powE1T">
<span id="paddle::BaseMatrixT::pow__T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a9e1df0aac9cff3e7fc799716e2b47159"></span>void <code class="descname">pow</code><span class="sig-paren">(</span>T <em>p</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT3powE1T" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT3logEv">
<span id="paddle::BaseMatrixT::log"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a112383f62faa0f03bb5f3249a1466e6d"></span>void <code class="descname">log</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT3logEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT4sqrtEv">
<span id="paddle::BaseMatrixT::sqrt"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a44de043328bae48f5504fce0591d2b3a"></span>void <code class="descname">sqrt</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT4sqrtEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT6squareEv">
<span id="paddle::BaseMatrixT::square"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a890f8164b960bbf62c08b4f4bfe843b0"></span>void <code class="descname">square</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT6squareEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT10reciprocalEv">
<span id="paddle::BaseMatrixT::reciprocal"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a96bfcaa3571163256af64aa3e43d895a"></span>void <code class="descname">reciprocal</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT10reciprocalEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT3absEv">
<span id="paddle::BaseMatrixT::abs"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1abe64f54df95a572f948df88c87e6b5ab"></span>void <code class="descname">abs</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT3absEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT4signEv">
<span id="paddle::BaseMatrixT::sign"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1af976e0d1a4d2e9aef27566297335ac81"></span>void <code class="descname">sign</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT4signEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT4zeroEv">
<span id="paddle::BaseMatrixT::zero"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1aaad5a06f8392a3ad6f56157844a8cc3b"></span>void <code class="descname">zero</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT4zeroEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT12zeroAtOffsetE7int64_t7int64_t">
<span id="paddle::BaseMatrixT::zeroAtOffset__int64_t.int64_t"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a6adf76893fba2804b1781b8ecab52a35"></span>void <code class="descname">zeroAtOffset</code><span class="sig-paren">(</span>int64_t <em>columnOffset</em>, int64_t <em>numColumns</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT12zeroAtOffsetE7int64_t7int64_t" title="Permalink to this definition">¶</a></dt>
579
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span><span class="p">(</span><span class="n">row</span><span class="p">,</span> <span class="n">col</span> <span class="o">+</span> <span class="n">columnOffset</span><span class="p">)</span> <span class="o">=</span> <span class="mi">0</span> <span class="k">for</span> <span class="mi">0</span> <span class="o">&lt;=</span> <span class="n">col</span> <span class="o">&lt;</span> <span class="n">numColumns</span>
Y
Yu Yang 已提交
580 581
</pre></div>
</div>
582
 </p>
Y
Yu Yang 已提交
583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT3oneEv">
<span id="paddle::BaseMatrixT::one"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1aab89f76c9e3a464da99488cc56416ae1"></span>void <code class="descname">one</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT3oneEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT9subScalarE1T">
<span id="paddle::BaseMatrixT::subScalar__T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1ace390dff04e3fdb871239cb8f358d15a"></span>void <code class="descname">subScalar</code><span class="sig-paren">(</span>T <em>p</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT9subScalarE1T" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT9mulScalarE1T">
<span id="paddle::BaseMatrixT::mulScalar__T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1af7d265a7c6e0505bc7e82d887ae39c77"></span>void <code class="descname">mulScalar</code><span class="sig-paren">(</span>T <em>p</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT9mulScalarE1T" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT9divScalarE1T">
<span id="paddle::BaseMatrixT::divScalar__T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a5a3df446da1129970bdc1b9e29ea6e17"></span>void <code class="descname">divScalar</code><span class="sig-paren">(</span>T <em>p</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT9divScalarE1T" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT6assignE1T">
<span id="paddle::BaseMatrixT::assign__T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1aba847dc997b8ca3b81e47c4ad71688ef"></span>void <code class="descname">assign</code><span class="sig-paren">(</span>T <em>p</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT6assignE1T" title="Permalink to this definition">¶</a></dt>
608
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">p</span>
Y
Yu Yang 已提交
609 610
</pre></div>
</div>
611
 </p>
Y
Yu Yang 已提交
612 613 614 615 616
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT3addE1T">
<span id="paddle::BaseMatrixT::add__T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1acab4b4df9e6ef43a1bf63fc165258775"></span>void <code class="descname">add</code><span class="sig-paren">(</span>T <em>p</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT3addE1T" title="Permalink to this definition">¶</a></dt>
617
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">this</span> <span class="o">+</span> <span class="n">p</span>
Y
Yu Yang 已提交
618 619
</pre></div>
</div>
620
 </p>
Y
Yu Yang 已提交
621 622 623 624 625
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT3addE1T1T">
<span id="paddle::BaseMatrixT::add__T.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1ac42cebd922af22b3ba4a5d49d8db6af2"></span>void <code class="descname">add</code><span class="sig-paren">(</span>T <em>p1</em>, T <em>p2</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT3addE1T1T" title="Permalink to this definition">¶</a></dt>
626
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">this</span><span class="o">*</span><span class="n">p1</span> <span class="o">+</span> <span class="n">p2</span>
Y
Yu Yang 已提交
627 628
</pre></div>
</div>
629
 </p>
Y
Yu Yang 已提交
630 631 632 633 634 635 636 637 638 639 640 641
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT4clipE1T1T">
<span id="paddle::BaseMatrixT::clip__T.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a654df095f9c1e6b5da30529a7a72dc25"></span>void <code class="descname">clip</code><span class="sig-paren">(</span>T <em>p1</em>, T <em>p2</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT4clipE1T1T" title="Permalink to this definition">¶</a></dt>
<dd><p>this = this &lt; low ? low : this</p>
<p>this = this &gt; high ? high : this </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT16biggerThanScalarE1T">
<span id="paddle::BaseMatrixT::biggerThanScalar__T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1ab1b56d2c0f63a6c343ee87c42750c5c8"></span>void <code class="descname">biggerThanScalar</code><span class="sig-paren">(</span>T <em>p</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT16biggerThanScalarE1T" title="Permalink to this definition">¶</a></dt>
642
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span>a = a &gt; p ? 1.0f : 0.0f
Y
Yu Yang 已提交
643 644
</pre></div>
</div>
645
 </p>
Y
Yu Yang 已提交
646 647 648 649 650
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT8downClipE1T">
<span id="paddle::BaseMatrixT::downClip__T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1ab71607b795ccbb9ec4a383d3187f9492"></span>void <code class="descname">downClip</code><span class="sig-paren">(</span>T <em>p</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT8downClipE1T" title="Permalink to this definition">¶</a></dt>
651
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span>a = a &gt; p ? a : p
Y
Yu Yang 已提交
652 653
</pre></div>
</div>
654
 </p>
Y
Yu Yang 已提交
655 656 657 658
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT6assignER11BaseMatrixT">
659
<span id="paddle::BaseMatrixT::assign__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1aa1add71caf4f32d361584a05dbe8711c"></span>void <code class="descname">assign</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT6assignER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
660
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">b</span>
Y
Yu Yang 已提交
661 662
</pre></div>
</div>
663
 </p>
Y
Yu Yang 已提交
664 665 666 667
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT14assignAtOffsetER11BaseMatrixT7int64_t">
668
<span id="paddle::BaseMatrixT::assignAtOffset__BaseMatrixTR.int64_t"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a6d2c077718939e0dd612b532971cc738"></span>void <code class="descname">assignAtOffset</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, int64_t <em>columnOffset</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT14assignAtOffsetER11BaseMatrixT7int64_t" title="Permalink to this definition">¶</a></dt>
669
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">If</span> <span class="n">b</span><span class="o">.</span><span class="n">width</span> <span class="o">+</span> <span class="n">columOffset</span> <span class="o">&lt;=</span> <span class="n">this</span><span class="o">.</span><span class="n">width</span>
670
 <span class="n">this</span><span class="p">(</span><span class="n">row</span><span class="p">,</span> <span class="n">col</span> <span class="o">+</span> <span class="n">columnOffset</span><span class="p">)</span> <span class="o">=</span> <span class="n">b</span><span class="p">(</span><span class="n">row</span><span class="p">,</span> <span class="n">col</span><span class="p">)</span> <span class="k">for</span> <span class="mi">0</span> <span class="o">&lt;=</span> <span class="n">col</span> <span class="o">&lt;</span> <span class="n">b</span><span class="o">.</span><span class="n">width</span>
Y
Yu Yang 已提交
671

672 673
<span class="n">If</span> <span class="n">this</span><span class="o">.</span><span class="n">width</span> <span class="o">+</span> <span class="n">columnOffset</span> <span class="o">&lt;=</span> <span class="n">b</span><span class="o">.</span><span class="n">width</span>
 <span class="n">this</span><span class="p">(</span><span class="n">row</span><span class="p">,</span> <span class="n">col</span><span class="p">)</span> <span class="o">=</span> <span class="n">b</span><span class="p">(</span><span class="n">row</span><span class="p">,</span> <span class="n">col</span> <span class="o">+</span> <span class="n">columnOffset</span><span class="p">)</span> <span class="k">for</span> <span class="mi">0</span> <span class="o">&lt;=</span> <span class="n">col</span> <span class="o">&lt;</span> <span class="n">this</span><span class="o">.</span><span class="n">width</span>
Y
Yu Yang 已提交
674

675
<span class="n">Otherwise</span><span class="p">,</span> <span class="n">FATAL</span>
Y
Yu Yang 已提交
676 677
</pre></div>
</div>
678
 </p>
Y
Yu Yang 已提交
679 680 681 682
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT3addER11BaseMatrixT">
683
<span id="paddle::BaseMatrixT::add__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1ac215d408cdc20bcaae8da5f5e59eb117"></span>void <code class="descname">add</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT3addER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
684 685 686 687 688
<dd><p>this = this + b </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT11addAtOffsetER11BaseMatrixT7int64_t">
689
<span id="paddle::BaseMatrixT::addAtOffset__BaseMatrixTR.int64_t"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a3078383e74e1d753ed58711b3b9dc850"></span>void <code class="descname">addAtOffset</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, int64_t <em>columnOffset</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT11addAtOffsetER11BaseMatrixT7int64_t" title="Permalink to this definition">¶</a></dt>
690
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">If</span> <span class="n">b</span><span class="o">.</span><span class="n">width</span> <span class="o">+</span> <span class="n">columOffset</span> <span class="o">&lt;=</span> <span class="n">this</span><span class="o">.</span><span class="n">width</span>
691
 <span class="n">this</span><span class="p">(</span><span class="n">row</span><span class="p">,</span> <span class="n">col</span> <span class="o">+</span> <span class="n">columnOffset</span><span class="p">)</span> <span class="o">+=</span> <span class="n">b</span><span class="p">(</span><span class="n">row</span><span class="p">,</span> <span class="n">col</span><span class="p">)</span> <span class="k">for</span> <span class="mi">0</span> <span class="o">&lt;=</span> <span class="n">col</span> <span class="o">&lt;</span> <span class="n">b</span><span class="o">.</span><span class="n">width</span>
Y
Yu Yang 已提交
692

693 694
<span class="n">If</span> <span class="n">this</span><span class="o">.</span><span class="n">width</span> <span class="o">+</span> <span class="n">columnOffset</span> <span class="o">&lt;=</span> <span class="n">b</span><span class="o">.</span><span class="n">width</span>
 <span class="n">this</span><span class="p">(</span><span class="n">row</span><span class="p">,</span> <span class="n">col</span><span class="p">)</span> <span class="o">+=</span> <span class="n">b</span><span class="p">(</span><span class="n">row</span><span class="p">,</span> <span class="n">col</span> <span class="o">+</span> <span class="n">columnOffset</span><span class="p">)</span> <span class="k">for</span> <span class="mi">0</span> <span class="o">&lt;=</span> <span class="n">col</span> <span class="o">&lt;</span> <span class="n">this</span><span class="o">.</span><span class="n">width</span>
Y
Yu Yang 已提交
695

696
<span class="n">Otherwise</span><span class="p">,</span> <span class="n">FATAL</span>
Y
Yu Yang 已提交
697 698
</pre></div>
</div>
699
 </p>
Y
Yu Yang 已提交
700 701 702 703
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT12addColVectorER11BaseMatrixT">
704
<span id="paddle::BaseMatrixT::addColVector__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1af86af50342d8fddb2ac3f77787de792f"></span>void <code class="descname">addColVector</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT12addColVectorER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
705 706 707 708
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT12addRowVectorER11BaseMatrixT">
709
<span id="paddle::BaseMatrixT::addRowVector__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a61cd12726dcd95920e83979588e4dd90"></span>void <code class="descname">addRowVector</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT12addRowVectorER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
710 711 712 713
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT7addBiasER11BaseMatrixT1T">
714
<span id="paddle::BaseMatrixT::addBias__BaseMatrixTR.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a26a8a5a18429e480fe5ac39f7566051e"></span>void <code class="descname">addBias</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, T <em>scale</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT7addBiasER11BaseMatrixT1T" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
715 716 717 718
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT12mulRowVectorER11BaseMatrixT">
719
<span id="paddle::BaseMatrixT::mulRowVector__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a2026cac861bc8254b34dc285e2006eb5"></span>void <code class="descname">mulRowVector</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT12mulRowVectorER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
720 721 722 723
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT12divRowVectorER11BaseMatrixT">
724
<span id="paddle::BaseMatrixT::divRowVector__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a1b815a56146640db266b747ef1326118"></span>void <code class="descname">divRowVector</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT12divRowVectorER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
725 726 727 728
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT6addP2PER11BaseMatrixT">
729
<span id="paddle::BaseMatrixT::addP2P__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1aa431934891c1a4623f940b0a206c2a09"></span>void <code class="descname">addP2P</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT6addP2PER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
730 731 732 733
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT3addER11BaseMatrixT1T">
734
<span id="paddle::BaseMatrixT::add__BaseMatrixTR.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1ae2afdfa3b660a60bd523b009c0300b9e"></span>void <code class="descname">add</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, T <em>p</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT3addER11BaseMatrixT1T" title="Permalink to this definition">¶</a></dt>
735
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">this</span> <span class="o">+</span> <span class="n">b</span><span class="o">*</span><span class="n">p</span>
Y
Yu Yang 已提交
736 737
</pre></div>
</div>
738
 </p>
Y
Yu Yang 已提交
739 740 741 742
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT3addER11BaseMatrixT1T1T">
743
<span id="paddle::BaseMatrixT::add__BaseMatrixTR.T.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a4328f48f10214ed64b45147f4912ec16"></span>void <code class="descname">add</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, T <em>p1</em>, T <em>p2</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT3addER11BaseMatrixT1T1T" title="Permalink to this definition">¶</a></dt>
744
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">p1</span><span class="o">*</span><span class="n">this</span> <span class="o">+</span> <span class="n">p2</span><span class="o">*</span><span class="n">b</span>
Y
Yu Yang 已提交
745 746
</pre></div>
</div>
747
 </p>
Y
Yu Yang 已提交
748 749 750 751
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT3subER11BaseMatrixT">
752
<span id="paddle::BaseMatrixT::sub__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a54894b4ede473e2a56287a92ae1be306"></span>void <code class="descname">sub</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT3subER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
753
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">this</span> <span class="o">-</span> <span class="n">b</span>
Y
Yu Yang 已提交
754 755
</pre></div>
</div>
756
 </p>
Y
Yu Yang 已提交
757 758 759 760
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT3subER11BaseMatrixT1T">
761
<span id="paddle::BaseMatrixT::sub__BaseMatrixTR.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1aa169ea41097ece1c8a40a8c0948ad4d2"></span>void <code class="descname">sub</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, T <em>p</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT3subER11BaseMatrixT1T" title="Permalink to this definition">¶</a></dt>
762
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">this</span> <span class="o">-</span> <span class="n">b</span><span class="o">*</span><span class="n">p</span>
Y
Yu Yang 已提交
763 764
</pre></div>
</div>
765
 </p>
Y
Yu Yang 已提交
766 767 768 769
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT4reluER11BaseMatrixT">
770
<span id="paddle::BaseMatrixT::relu__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a07fd1923d6b782d7cd9bac2fcc4d7196"></span>void <code class="descname">relu</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT4reluER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
771
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">b</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">this</span><span class="p">)</span>
Y
Yu Yang 已提交
772 773
</pre></div>
</div>
774
 </p>
Y
Yu Yang 已提交
775 776 777 778
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT14reluDerivativeER11BaseMatrixT">
779
<span id="paddle::BaseMatrixT::reluDerivative__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a3a00f5044a3d682155b2625b48f0c7e3"></span>void <code class="descname">reluDerivative</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT14reluDerivativeER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
780 781 782 783
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT8softreluER11BaseMatrixT">
784
<span id="paddle::BaseMatrixT::softrelu__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a480ee6ecf599145b0651393e31002dcd"></span>void <code class="descname">softrelu</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT8softreluER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
785
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">b</span> <span class="o">=</span> <span class="n">log</span><span class="p">(</span><span class="mf">1.0</span> <span class="o">+</span> <span class="n">exp</span><span class="p">(</span><span class="n">this</span><span class="p">))</span>
Y
Yu Yang 已提交
786 787
</pre></div>
</div>
788
 </p>
Y
Yu Yang 已提交
789 790 791 792
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT18softreluDerivativeER11BaseMatrixT">
793
<span id="paddle::BaseMatrixT::softreluDerivative__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1af175eb54a668f00100810365108486b7"></span>void <code class="descname">softreluDerivative</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT18softreluDerivativeER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
794 795 796 797
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT5breluER11BaseMatrixT">
798
<span id="paddle::BaseMatrixT::brelu__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1afe5e54e1d07946434a0c14532ce77f45"></span>void <code class="descname">brelu</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT5breluER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
799
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">b</span> <span class="o">=</span> <span class="nb">min</span><span class="p">(</span><span class="nb">max</span><span class="p">(</span><span class="n">this</span><span class="p">,</span> <span class="n">p1</span><span class="p">),</span> <span class="n">p2</span><span class="p">)</span>
Y
Yu Yang 已提交
800 801
</pre></div>
</div>
802
 </p>
Y
Yu Yang 已提交
803 804 805 806
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT15breluDerivativeER11BaseMatrixT">
807
<span id="paddle::BaseMatrixT::breluDerivative__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a0a76ae7bf8d81510611e811eebe31b2d"></span>void <code class="descname">breluDerivative</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT15breluDerivativeER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
808 809 810 811
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT6squareER11BaseMatrixT">
812
<span id="paddle::BaseMatrixT::square__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a8b95e13fefa7c88a827ac83dd5d634f0"></span>void <code class="descname">square</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT6squareER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
813
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">b</span> <span class="o">=</span> <span class="n">this</span> <span class="o">*</span> <span class="n">this</span>
Y
Yu Yang 已提交
814 815
</pre></div>
</div>
816
 </p>
Y
Yu Yang 已提交
817 818 819 820
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT16squareDerivativeER11BaseMatrixT">
821
<span id="paddle::BaseMatrixT::squareDerivative__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a4341c22b31536821e549fcd33e917028"></span>void <code class="descname">squareDerivative</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT16squareDerivativeER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
822 823 824 825
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT4tanhER11BaseMatrixT">
826
<span id="paddle::BaseMatrixT::tanh__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a3e6b8f86510546269df3180914648729"></span>void <code class="descname">tanh</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT4tanhER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
827
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">b</span> <span class="o">=</span> <span class="n">tanh</span><span class="p">(</span><span class="n">this</span><span class="p">)</span>
Y
Yu Yang 已提交
828 829
</pre></div>
</div>
830
 </p>
Y
Yu Yang 已提交
831 832 833 834
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT14tanhDerivativeER11BaseMatrixT">
835
<span id="paddle::BaseMatrixT::tanhDerivative__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a7c010ca4f043b1fa55d13503f1bbb851"></span>void <code class="descname">tanhDerivative</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT14tanhDerivativeER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
836 837 838 839
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT10scaledTanhER11BaseMatrixT1T1T">
840
<span id="paddle::BaseMatrixT::scaledTanh__BaseMatrixTR.T.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a93d7a38ac574c18c4496453a4f6d6f7c"></span>void <code class="descname">scaledTanh</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, T <em>p1</em>, T <em>p2</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT10scaledTanhER11BaseMatrixT1T1T" title="Permalink to this definition">¶</a></dt>
841
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">b</span> <span class="o">=</span> <span class="n">p1</span> <span class="o">*</span> <span class="n">tanh</span><span class="p">(</span><span class="n">p2</span> <span class="o">*</span> <span class="n">this</span><span class="p">)</span>
Y
Yu Yang 已提交
842 843
</pre></div>
</div>
844
 </p>
Y
Yu Yang 已提交
845 846 847 848
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT20scaledTanhDerivativeER11BaseMatrixT1T1T">
849
<span id="paddle::BaseMatrixT::scaledTanhDerivative__BaseMatrixTR.T.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a497abacec484f311988d8ff7423d842b"></span>void <code class="descname">scaledTanhDerivative</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, T <em>p1</em>, T <em>p2</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT20scaledTanhDerivativeER11BaseMatrixT1T1T" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
850 851 852 853
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT10reciprocalER11BaseMatrixT">
854
<span id="paddle::BaseMatrixT::reciprocal__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a635b4d39b41ade4ab4766e8b39df6951"></span>void <code class="descname">reciprocal</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT10reciprocalER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
855
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">b</span> <span class="o">=</span> <span class="mf">1.0</span><span class="n">f</span> <span class="o">/</span> <span class="n">this</span>
Y
Yu Yang 已提交
856 857
</pre></div>
</div>
858
 </p>
Y
Yu Yang 已提交
859 860 861 862
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT20reciprocalDerivativeER11BaseMatrixT">
863
<span id="paddle::BaseMatrixT::reciprocalDerivative__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a951e401d59aeaa2ecf4212c8943ed510"></span>void <code class="descname">reciprocalDerivative</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT20reciprocalDerivativeER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
864 865 866 867
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT3absER11BaseMatrixT">
868
<span id="paddle::BaseMatrixT::abs__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1ac0ca7b101b08f68c4d09c59ec0df14b5"></span>void <code class="descname">abs</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT3absER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
869
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span>b = this &gt; 0.0f ? this : -this
Y
Yu Yang 已提交
870 871
</pre></div>
</div>
872
 </p>
Y
Yu Yang 已提交
873 874 875 876
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT13absDerivativeER11BaseMatrixT">
877
<span id="paddle::BaseMatrixT::absDerivative__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1aa989d38732ee2836b4d30fa8ebee7df0"></span>void <code class="descname">absDerivative</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT13absDerivativeER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
878 879 880 881
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT7sigmoidER11BaseMatrixT">
882
<span id="paddle::BaseMatrixT::sigmoid__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a5ab0e9c8c5359bc4c4579d8134a695c9"></span>void <code class="descname">sigmoid</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT7sigmoidER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
883
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">b</span> <span class="o">=</span> <span class="mf">1.0</span><span class="n">f</span> <span class="o">/</span> <span class="p">(</span><span class="mf">1.0</span><span class="n">f</span> <span class="o">+</span> <span class="n">exp</span><span class="p">(</span><span class="o">-</span><span class="n">this</span><span class="p">))</span>
Y
Yu Yang 已提交
884 885
</pre></div>
</div>
886
 </p>
Y
Yu Yang 已提交
887 888 889 890
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT17sigmoidDerivativeER11BaseMatrixT">
891
<span id="paddle::BaseMatrixT::sigmoidDerivative__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1adc5db5cefd6eb97a40792aefed7fca7b"></span>void <code class="descname">sigmoidDerivative</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT17sigmoidDerivativeER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
892 893 894 895
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT13expDerivativeER11BaseMatrixT">
896
<span id="paddle::BaseMatrixT::expDerivative__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a73d0d8a7e5289bde82379ba950ba4569"></span>void <code class="descname">expDerivative</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT13expDerivativeER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
897
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">b</span> <span class="o">=</span> <span class="n">a</span>
Y
Yu Yang 已提交
898 899
</pre></div>
</div>
900
 </p>
Y
Yu Yang 已提交
901 902 903 904
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT4signER11BaseMatrixT">
905
<span id="paddle::BaseMatrixT::sign__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1ac9024b8e4e0175fd683a9b4a665a7e5d"></span>void <code class="descname">sign</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT4signER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
906 907 908 909
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT3expER11BaseMatrixT">
910
<span id="paddle::BaseMatrixT::exp__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a4f602cb8a37307f7feb72065f0c8dc85"></span>void <code class="descname">exp</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT3expER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
911 912 913 914
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT3powER11BaseMatrixT1T">
915
<span id="paddle::BaseMatrixT::pow__BaseMatrixTR.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a244500a2abbaae80f80e0f79b3fd27d7"></span>void <code class="descname">pow</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, T <em>p</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT3powER11BaseMatrixT1T" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
916 917 918 919
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT3logER11BaseMatrixT">
920
<span id="paddle::BaseMatrixT::log__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a9b52c92ab14ab017500b2fb5a7f93177"></span>void <code class="descname">log</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT3logER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
921 922 923 924
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT4sqrtER11BaseMatrixT">
925
<span id="paddle::BaseMatrixT::sqrt__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1aab5a25f0306a72baecacc4ef254e8d94"></span>void <code class="descname">sqrt</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT4sqrtER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
926 927 928 929
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT9addScalarER11BaseMatrixT1T">
930
<span id="paddle::BaseMatrixT::addScalar__BaseMatrixTR.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1ab62a100b277f4e8eb781936ef1c5c1dd"></span>void <code class="descname">addScalar</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, T <em>p</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT9addScalarER11BaseMatrixT1T" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
931 932 933 934
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT9subScalarER11BaseMatrixT1T">
935
<span id="paddle::BaseMatrixT::subScalar__BaseMatrixTR.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a33c454b630de676f0991af50478c7b5a"></span>void <code class="descname">subScalar</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, T <em>p</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT9subScalarER11BaseMatrixT1T" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
936 937 938 939
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT9mulScalarER11BaseMatrixT1T">
940
<span id="paddle::BaseMatrixT::mulScalar__BaseMatrixTR.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1ac29ac1d272166b3de87cc8a39905a502"></span>void <code class="descname">mulScalar</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, T <em>p</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT9mulScalarER11BaseMatrixT1T" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
941 942 943 944
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT9divScalarER11BaseMatrixT1T">
945
<span id="paddle::BaseMatrixT::divScalar__BaseMatrixTR.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a049c61e4ec32293442f16322f6c25fdd"></span>void <code class="descname">divScalar</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, T <em>p</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT9divScalarER11BaseMatrixT1T" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
946 947 948 949
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT9scalarDivER11BaseMatrixT1T">
950
<span id="paddle::BaseMatrixT::scalarDiv__BaseMatrixTR.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a5df4d0d98bf8babcbf340d82bf599c3b"></span>void <code class="descname">scalarDiv</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, T <em>p</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT9scalarDivER11BaseMatrixT1T" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
951 952 953 954
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT7invSqrtER11BaseMatrixT">
955
<span id="paddle::BaseMatrixT::invSqrt__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1abd3b33bdbb66a31b892c7b13dfac6a84"></span>void <code class="descname">invSqrt</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT7invSqrtER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
956
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="mf">1.0</span><span class="n">f</span> <span class="o">/</span> <span class="n">sqrt</span><span class="p">(</span><span class="n">b</span><span class="p">)</span>
Y
Yu Yang 已提交
957 958
</pre></div>
</div>
959
 </p>
Y
Yu Yang 已提交
960 961 962 963
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT9isEqualToER11BaseMatrixT1T">
964
<span id="paddle::BaseMatrixT::isEqualTo__BaseMatrixTR.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a6e55135c3c2fbdfa028958e5fbd62850"></span>void <code class="descname">isEqualTo</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, T <em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT9isEqualToER11BaseMatrixT1T" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
965 966 967 968 969
<dd><p>this = (b == value) </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT16softCrossEntropyER11BaseMatrixTR11BaseMatrixT">
970
<span id="paddle::BaseMatrixT::softCrossEntropy__BaseMatrixTR.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1aaa21e135ac53e45c86ada90e14fa8715"></span>void <code class="descname">softCrossEntropy</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT16softCrossEntropyER11BaseMatrixTR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
971 972 973 974 975
<dd><p>ternary operator. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT18softCrossEntropyBpER11BaseMatrixTR11BaseMatrixT">
976
<span id="paddle::BaseMatrixT::softCrossEntropyBp__BaseMatrixTR.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1ae50ff4e7ae670e1270ee81694b744381"></span>void <code class="descname">softCrossEntropyBp</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT18softCrossEntropyBpER11BaseMatrixTR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
977 978 979 980
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT23binaryLabelCrossEntropyER11BaseMatrixTR11BaseMatrixT">
981
<span id="paddle::BaseMatrixT::binaryLabelCrossEntropy__BaseMatrixTR.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1aff68edb19f62071a294c35bbc4aafd25"></span>void <code class="descname">binaryLabelCrossEntropy</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT23binaryLabelCrossEntropyER11BaseMatrixTR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
982 983 984 985
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT25binaryLabelCrossEntropyBpER11BaseMatrixTR11BaseMatrixT">
986
<span id="paddle::BaseMatrixT::binaryLabelCrossEntropyBp__BaseMatrixTR.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1aea188e5cd12251b75877c54bddf4d9bd"></span>void <code class="descname">binaryLabelCrossEntropyBp</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT25binaryLabelCrossEntropyBpER11BaseMatrixTR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
987 988 989 990
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT3addER11BaseMatrixTR11BaseMatrixT">
991
<span id="paddle::BaseMatrixT::add__BaseMatrixTR.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a644268cdac374f4fedfbe45792a3b86f"></span>void <code class="descname">add</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT3addER11BaseMatrixTR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
992
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">b</span> <span class="o">+</span> <span class="n">c</span>
Y
Yu Yang 已提交
993 994
</pre></div>
</div>
995
 </p>
Y
Yu Yang 已提交
996 997 998 999
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT3addER11BaseMatrixT1TR11BaseMatrixT1T">
1000
<span id="paddle::BaseMatrixT::add__BaseMatrixTR.T.BaseMatrixTR.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a410ab3adf2c5326c3863631930de125e"></span>void <code class="descname">add</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, T <em>p1</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em>, T <em>p2</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT3addER11BaseMatrixT1TR11BaseMatrixT1T" title="Permalink to this definition">¶</a></dt>
1001
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">b</span><span class="o">*</span><span class="n">p1</span> <span class="o">+</span> <span class="n">c</span><span class="o">*</span><span class="n">p2</span>
Y
Yu Yang 已提交
1002 1003
</pre></div>
</div>
1004
 </p>
Y
Yu Yang 已提交
1005 1006 1007 1008
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT3subER11BaseMatrixTR11BaseMatrixT">
1009
<span id="paddle::BaseMatrixT::sub__BaseMatrixTR.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a74d4896c57fd84d2d7b66067042bcb9d"></span>void <code class="descname">sub</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT3subER11BaseMatrixTR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
1010
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">b</span> <span class="o">-</span> <span class="n">c</span>
Y
Yu Yang 已提交
1011 1012
</pre></div>
</div>
1013
 </p>
Y
Yu Yang 已提交
1014 1015 1016 1017
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT3subER11BaseMatrixT1TR11BaseMatrixT1T">
1018
<span id="paddle::BaseMatrixT::sub__BaseMatrixTR.T.BaseMatrixTR.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1ae66d8a874afdec296e9a15c34d9cb9af"></span>void <code class="descname">sub</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, T <em>p1</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em>, T <em>p2</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT3subER11BaseMatrixT1TR11BaseMatrixT1T" title="Permalink to this definition">¶</a></dt>
1019
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">b</span><span class="o">*</span><span class="n">p1</span> <span class="o">-</span> <span class="n">c</span><span class="o">*</span><span class="n">p2</span>
Y
Yu Yang 已提交
1020 1021
</pre></div>
</div>
1022
 </p>
Y
Yu Yang 已提交
1023 1024 1025 1026
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT4add2ER11BaseMatrixTR11BaseMatrixT">
1027
<span id="paddle::BaseMatrixT::add2__BaseMatrixTR.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a134eed740643c6450b0daad58392bab9"></span>void <code class="descname">add2</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT4add2ER11BaseMatrixTR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
1028
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">this</span> <span class="o">+</span> <span class="n">b</span> <span class="o">+</span> <span class="n">c</span>
Y
Yu Yang 已提交
1029 1030
</pre></div>
</div>
1031
 </p>
Y
Yu Yang 已提交
1032 1033 1034 1035
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT4add2ER11BaseMatrixTR11BaseMatrixT1T1T1T">
1036
<span id="paddle::BaseMatrixT::add2__BaseMatrixTR.BaseMatrixTR.T.T.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a4f1f675262ca15bbb4c4e623034b565a"></span>void <code class="descname">add2</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em>, T <em>p1</em>, T <em>p2</em>, T <em>p3</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT4add2ER11BaseMatrixTR11BaseMatrixT1T1T1T" title="Permalink to this definition">¶</a></dt>
1037
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">this</span><span class="o">*</span><span class="n">p1</span> <span class="o">+</span> <span class="n">b</span><span class="o">*</span><span class="n">p2</span> <span class="o">+</span> <span class="n">c</span><span class="o">*</span><span class="n">p3</span>
Y
Yu Yang 已提交
1038 1039
</pre></div>
</div>
1040
 </p>
Y
Yu Yang 已提交
1041 1042 1043 1044
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT4add3ER11BaseMatrixTR11BaseMatrixTR11BaseMatrixT1T1T1T">
1045
<span id="paddle::BaseMatrixT::add3__BaseMatrixTR.BaseMatrixTR.BaseMatrixTR.T.T.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a6e278d0f9a343da5bae6428f6ebe5805"></span>void <code class="descname">add3</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>d</em>, T <em>p1</em>, T <em>p2</em>, T <em>p3</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT4add3ER11BaseMatrixTR11BaseMatrixTR11BaseMatrixT1T1T1T" title="Permalink to this definition">¶</a></dt>
1046
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">a</span><span class="o">*</span><span class="n">p1</span> <span class="o">+</span> <span class="n">b</span><span class="o">*</span><span class="n">p2</span> <span class="o">+</span> <span class="n">c</span><span class="o">*</span><span class="n">p3</span>
Y
Yu Yang 已提交
1047 1048
</pre></div>
</div>
1049
 </p>
Y
Yu Yang 已提交
1050 1051 1052 1053
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT9sgdUpdateER11BaseMatrixTR11BaseMatrixT1T1T1T">
1054
<span id="paddle::BaseMatrixT::sgdUpdate__BaseMatrixTR.BaseMatrixTR.T.T.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a5be31b43206f19bbd3207b5d396c895c"></span>void <code class="descname">sgdUpdate</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em>, T <em>p1</em>, T <em>p2</em>, T <em>p3</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT9sgdUpdateER11BaseMatrixTR11BaseMatrixT1T1T1T" title="Permalink to this definition">¶</a></dt>
1055
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">c</span> <span class="o">=</span> <span class="n">p2</span> <span class="o">*</span> <span class="n">c</span> <span class="o">-</span> <span class="n">p1</span> <span class="o">*</span>  <span class="p">(</span><span class="n">b</span> <span class="o">+</span> <span class="n">p3</span> <span class="o">*</span> <span class="n">this</span><span class="p">)</span>
Y
Yu Yang 已提交
1056 1057 1058
<span class="n">this</span> <span class="o">+=</span> <span class="n">mom</span>
</pre></div>
</div>
1059
 </p>
Y
Yu Yang 已提交
1060 1061 1062 1063
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT9sgdUpdateER11BaseMatrixTR11BaseMatrixTR11BaseMatrixT1T1T1T">
1064
<span id="paddle::BaseMatrixT::sgdUpdate__BaseMatrixTR.BaseMatrixTR.BaseMatrixTR.T.T.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a986ac98afe227e863f63ef1630de3146"></span>void <code class="descname">sgdUpdate</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>d</em>, T <em>p1</em>, T <em>p2</em>, T <em>p3</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT9sgdUpdateER11BaseMatrixTR11BaseMatrixTR11BaseMatrixT1T1T1T" title="Permalink to this definition">¶</a></dt>
1065
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">c</span> <span class="o">=</span> <span class="n">p2</span> <span class="o">*</span> <span class="n">c</span> <span class="o">-</span> <span class="n">p1</span> <span class="o">*</span> <span class="n">d</span> <span class="o">*</span> <span class="p">(</span><span class="n">b</span> <span class="o">+</span> <span class="n">p3</span> <span class="o">*</span> <span class="n">this</span><span class="p">)</span>
Y
Yu Yang 已提交
1066 1067 1068
<span class="n">this</span> <span class="o">+=</span> <span class="n">mom</span>
</pre></div>
</div>
1069
 </p>
Y
Yu Yang 已提交
1070 1071 1072 1073 1074 1075 1076 1077 1078 1079
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT7applyL1E1T1T">
<span id="paddle::BaseMatrixT::applyL1__T.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1af75219cbeb989fd4284a1dd34ff1e121"></span>void <code class="descname">applyL1</code><span class="sig-paren">(</span>T <em>learningRate</em>, T <em>decayRate</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT7applyL1E1T1T" title="Permalink to this definition">¶</a></dt>
<dd><p>apply L1/L2 to <em>this</em> </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT7applyL1ER11BaseMatrixT1T1T">
1080
<span id="paddle::BaseMatrixT::applyL1__BaseMatrixTR.T.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1ade677ffd9bcb58851a6cc008d67c8b1d"></span>void <code class="descname">applyL1</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>lr</em>, T <em>learningRate</em>, T <em>decayRate</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT7applyL1ER11BaseMatrixT1T1T" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1081 1082 1083 1084 1085 1086 1087 1088 1089
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT7applyL2E1T1T">
<span id="paddle::BaseMatrixT::applyL2__T.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1aae38b3a4495b646c5bb24123ae1250ad"></span>void <code class="descname">applyL2</code><span class="sig-paren">(</span>T <em>learningRate</em>, T <em>decayRate</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT7applyL2E1T1T" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT7applyL2ER11BaseMatrixT1T1T">
1090
<span id="paddle::BaseMatrixT::applyL2__BaseMatrixTR.T.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a4ac2cc89265edd83eab50b3f0fc589e8"></span>void <code class="descname">applyL2</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>lr</em>, T <em>learningRate</em>, T <em>decayRate</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT7applyL2ER11BaseMatrixT1T1T" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1091 1092 1093 1094
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT6dotMulER11BaseMatrixT">
1095
<span id="paddle::BaseMatrixT::dotMul__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a836e3917ac62e58af21aede85818dfbb"></span>void <code class="descname">dotMul</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT6dotMulER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
1096
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">*=</span> <span class="n">b</span>
Y
Yu Yang 已提交
1097 1098
</pre></div>
</div>
1099
 </p>
Y
Yu Yang 已提交
1100 1101 1102 1103
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT6dotMulER11BaseMatrixTR11BaseMatrixT">
1104
<span id="paddle::BaseMatrixT::dotMul__BaseMatrixTR.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a85301ce27514ede0b32733e82449c322"></span>void <code class="descname">dotMul</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT6dotMulER11BaseMatrixTR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
1105
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">b</span> <span class="o">*</span> <span class="n">c</span>
Y
Yu Yang 已提交
1106 1107
</pre></div>
</div>
1108
 </p>
Y
Yu Yang 已提交
1109 1110 1111 1112
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT6dotDivER11BaseMatrixTR11BaseMatrixT">
1113
<span id="paddle::BaseMatrixT::dotDiv__BaseMatrixTR.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1af55b24da179a0993cdc8b4b4f279cacd"></span>void <code class="descname">dotDiv</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT6dotDivER11BaseMatrixTR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
1114
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">b</span> <span class="o">/</span> <span class="n">c</span>
Y
Yu Yang 已提交
1115 1116
</pre></div>
</div>
1117
 </p>
Y
Yu Yang 已提交
1118 1119 1120 1121
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT6dotDivER11BaseMatrixTR11BaseMatrixT1T1T">
1122
<span id="paddle::BaseMatrixT::dotDiv__BaseMatrixTR.BaseMatrixTR.T.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a5e746423bc6cd302f111cd563e5a0ccb"></span>void <code class="descname">dotDiv</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em>, T <em>p1</em>, T <em>p2</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT6dotDivER11BaseMatrixTR11BaseMatrixT1T1T" title="Permalink to this definition">¶</a></dt>
1123
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="p">(</span><span class="n">b</span> <span class="o">+</span> <span class="n">p1</span><span class="p">)</span> <span class="o">/</span> <span class="p">(</span><span class="n">c</span> <span class="o">+</span> <span class="n">p2</span><span class="p">)</span>
Y
Yu Yang 已提交
1124 1125
</pre></div>
</div>
1126
 </p>
Y
Yu Yang 已提交
1127 1128 1129 1130
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT8rankLossER11BaseMatrixTR11BaseMatrixTR11BaseMatrixT">
1131
<span id="paddle::BaseMatrixT::rankLoss__BaseMatrixTR.BaseMatrixTR.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a7bdc9c4d502a24b34fef726105767b4f"></span>void <code class="descname">rankLoss</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>d</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT8rankLossER11BaseMatrixTR11BaseMatrixTR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
1132
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">log</span><span class="p">(</span><span class="mi">1</span> <span class="o">+</span> <span class="n">exp</span><span class="p">(</span><span class="n">b</span> <span class="o">-</span> <span class="n">c</span><span class="p">))</span> <span class="o">-</span> <span class="n">d</span> <span class="o">*</span> <span class="p">(</span><span class="n">b</span> <span class="o">-</span> <span class="n">c</span><span class="p">)</span>
Y
Yu Yang 已提交
1133 1134
</pre></div>
</div>
1135
 </p>
Y
Yu Yang 已提交
1136 1137 1138 1139
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT10rankLossBpER11BaseMatrixTR11BaseMatrixTR11BaseMatrixT">
1140
<span id="paddle::BaseMatrixT::rankLossBp__BaseMatrixTR.BaseMatrixTR.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a92915aaa1c66614773cf74ae00d3bc0c"></span>void <code class="descname">rankLossBp</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>d</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT10rankLossBpER11BaseMatrixTR11BaseMatrixTR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1141 1142 1143 1144
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT22logisticRegressionLossER11BaseMatrixTR11BaseMatrixT">
1145
<span id="paddle::BaseMatrixT::logisticRegressionLoss__BaseMatrixTR.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a262056d9e0d9613e6a2bfd4d1a827ebe"></span>void <code class="descname">logisticRegressionLoss</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT22logisticRegressionLossER11BaseMatrixTR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
1146
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">log</span><span class="p">(</span><span class="mi">1</span> <span class="o">+</span> <span class="n">exp</span><span class="p">(</span><span class="n">b</span><span class="p">))</span> <span class="o">-</span> <span class="n">c</span> <span class="o">*</span> <span class="n">b</span>
Y
Yu Yang 已提交
1147 1148
</pre></div>
</div>
1149
 </p>
Y
Yu Yang 已提交
1150 1151 1152 1153
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT24logisticRegressionLossBpER11BaseMatrixTR11BaseMatrixT">
1154
<span id="paddle::BaseMatrixT::logisticRegressionLossBp__BaseMatrixTR.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a926ac6eaeeb6d1c5e5f8ef3005a343ad"></span>void <code class="descname">logisticRegressionLossBp</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT24logisticRegressionLossBpER11BaseMatrixTR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
1155
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">+=</span> <span class="n">exp</span><span class="p">(</span><span class="n">b</span><span class="p">)</span><span class="o">/</span><span class="p">(</span><span class="mi">1</span><span class="o">+</span><span class="n">exp</span><span class="p">(</span><span class="n">b</span><span class="p">))</span> <span class="o">-</span> <span class="n">c</span>
Y
Yu Yang 已提交
1156 1157
</pre></div>
</div>
1158
 </p>
Y
Yu Yang 已提交
1159 1160 1161 1162
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT10biggerThanER11BaseMatrixTR11BaseMatrixT">
1163
<span id="paddle::BaseMatrixT::biggerThan__BaseMatrixTR.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a907dcb40aab58bfbeb448ae01e294477"></span>void <code class="descname">biggerThan</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT10biggerThanER11BaseMatrixTR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
1164
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span>this = b &gt; c ? 1.0 : 0.0
Y
Yu Yang 已提交
1165 1166
</pre></div>
</div>
1167
 </p>
Y
Yu Yang 已提交
1168 1169 1170 1171
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT10biggerThanER11BaseMatrixTR11BaseMatrixTR11BaseMatrixT">
1172
<span id="paddle::BaseMatrixT::biggerThan__BaseMatrixTR.BaseMatrixTR.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a4287b786a15db5b4332f2bb7b605d617"></span>void <code class="descname">biggerThan</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>d</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT10biggerThanER11BaseMatrixTR11BaseMatrixTR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
1173
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span>this = ((b&gt;c &amp;&amp; d&gt;0.5) || (b&lt;c &amp;&amp; d&lt;0.5)) ? 1 : 0)
Y
Yu Yang 已提交
1174 1175
</pre></div>
</div>
1176
 </p>
Y
Yu Yang 已提交
1177 1178 1179 1180
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT3maxER11BaseMatrixTR11BaseMatrixT">
1181
<span id="paddle::BaseMatrixT::max__BaseMatrixTR.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a2a647a08163ca100a12ab4478ab116f3"></span>void <code class="descname">max</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT3maxER11BaseMatrixTR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
1182
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span>this = b&gt;c ? b : c
Y
Yu Yang 已提交
1183 1184
</pre></div>
</div>
1185
 </p>
Y
Yu Yang 已提交
1186 1187 1188 1189
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT25binaryClassificationErrorE6size_tR11BaseMatrixTR11BaseMatrixT1T">
1190
<span id="paddle::BaseMatrixT::binaryClassificationError__s.BaseMatrixTR.BaseMatrixTR.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a7fea698e53dfd94b0971a316191e0bf0"></span>void <code class="descname">binaryClassificationError</code><span class="sig-paren">(</span>size_t <em>destCol</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em>, T <em>p</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT25binaryClassificationErrorE6size_tR11BaseMatrixTR11BaseMatrixT1T" title="Permalink to this definition">¶</a></dt>
1191
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span>this[destCol] += (b&gt;p1 == c&gt;p1) ? 0 : 1)
Y
Yu Yang 已提交
1192 1193
</pre></div>
</div>
1194
 </p>
Y
Yu Yang 已提交
1195 1196 1197 1198
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT26binaryClassificationError2E6size_tR11BaseMatrixTR11BaseMatrixT1T">
1199
<span id="paddle::BaseMatrixT::binaryClassificationError2__s.BaseMatrixTR.BaseMatrixTR.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a9c5870e2fb81588351267d0a7cff92ff"></span>void <code class="descname">binaryClassificationError2</code><span class="sig-paren">(</span>size_t <em>destCol</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em>, T <em>p</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT26binaryClassificationError2E6size_tR11BaseMatrixTR11BaseMatrixT1T" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1200 1201 1202 1203
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT12dotMulSquareER11BaseMatrixT">
1204
<span id="paddle::BaseMatrixT::dotMulSquare__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1ae0def96f3b630c916c931bb65a6989c6"></span>void <code class="descname">dotMulSquare</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT12dotMulSquareER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
1205
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">this</span> <span class="o">*</span> <span class="n">b</span> <span class="o">*</span> <span class="n">b</span>
Y
Yu Yang 已提交
1206 1207
</pre></div>
</div>
1208
 </p>
Y
Yu Yang 已提交
1209 1210 1211 1212
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT12dotSquareMulER11BaseMatrixT">
1213
<span id="paddle::BaseMatrixT::dotSquareMul__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1aa16a4eb73cc8964ee71a24528fc1a7d3"></span>void <code class="descname">dotSquareMul</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT12dotSquareMulER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
1214
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">this</span> <span class="o">*</span> <span class="n">this</span> <span class="o">*</span> <span class="n">b</span>
Y
Yu Yang 已提交
1215 1216
</pre></div>
</div>
1217
 </p>
Y
Yu Yang 已提交
1218 1219 1220 1221
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT12dotMulSquareER11BaseMatrixTR11BaseMatrixT">
1222
<span id="paddle::BaseMatrixT::dotMulSquare__BaseMatrixTR.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a0d0b4c9feb1363713d70b8bdb23d2bbb"></span>void <code class="descname">dotMulSquare</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT12dotMulSquareER11BaseMatrixTR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
1223
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">b</span> <span class="o">*</span> <span class="n">c</span> <span class="o">*</span> <span class="n">c</span>
Y
Yu Yang 已提交
1224 1225
</pre></div>
</div>
1226
 </p>
Y
Yu Yang 已提交
1227 1228 1229 1230
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT15dotSquareSquareER11BaseMatrixTR11BaseMatrixT">
1231
<span id="paddle::BaseMatrixT::dotSquareSquare__BaseMatrixTR.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a1b810a14bbcdb55ef8af8e465a00c7f1"></span>void <code class="descname">dotSquareSquare</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT15dotSquareSquareER11BaseMatrixTR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
1232
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">b</span> <span class="o">*</span> <span class="n">b</span> <span class="o">*</span> <span class="n">c</span> <span class="o">*</span> <span class="n">c</span>
Y
Yu Yang 已提交
1233 1234
</pre></div>
</div>
1235
 </p>
Y
Yu Yang 已提交
1236 1237 1238 1239
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT15dotMulSquareSumER11BaseMatrixTR11BaseMatrixT1T1T">
1240
<span id="paddle::BaseMatrixT::dotMulSquareSum__BaseMatrixTR.BaseMatrixTR.T.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a7f3b0023e3572aa4d2585e1eb66eb0ce"></span>void <code class="descname">dotMulSquareSum</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em>, T <em>p1</em>, T <em>p2</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT15dotMulSquareSumER11BaseMatrixTR11BaseMatrixT1T1T" title="Permalink to this definition">¶</a></dt>
1241
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">this</span> <span class="o">*</span> <span class="p">(</span><span class="n">p1</span><span class="o">*</span><span class="n">b</span> <span class="o">+</span> <span class="n">p2</span><span class="o">*</span><span class="n">c</span><span class="p">)</span><span class="o">^</span><span class="mi">2</span>
Y
Yu Yang 已提交
1242 1243
</pre></div>
</div>
1244
 </p>
Y
Yu Yang 已提交
1245 1246 1247 1248
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT12dotSquareSumER11BaseMatrixTR11BaseMatrixT1T1T">
1249
<span id="paddle::BaseMatrixT::dotSquareSum__BaseMatrixTR.BaseMatrixTR.T.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1acc0a849b5bd3abbd140379590b04fdb4"></span>void <code class="descname">dotSquareSum</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em>, T <em>p1</em>, T <em>p2</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT12dotSquareSumER11BaseMatrixTR11BaseMatrixT1T1T" title="Permalink to this definition">¶</a></dt>
1250
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="p">(</span><span class="n">p1</span><span class="o">*</span><span class="n">b</span> <span class="o">+</span> <span class="n">p2</span><span class="o">*</span><span class="n">c</span><span class="p">)</span><span class="o">^</span><span class="mi">2</span>
Y
Yu Yang 已提交
1251 1252
</pre></div>
</div>
1253
 </p>
Y
Yu Yang 已提交
1254 1255 1256 1257
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT9dotMulSumER11BaseMatrixTR11BaseMatrixT1T1T">
1258
<span id="paddle::BaseMatrixT::dotMulSum__BaseMatrixTR.BaseMatrixTR.T.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a9b8005ab4e0dbafe1686c0dfe0a968aa"></span>void <code class="descname">dotMulSum</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em>, T <em>p1</em>, T <em>p2</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT9dotMulSumER11BaseMatrixTR11BaseMatrixT1T1T" title="Permalink to this definition">¶</a></dt>
1259
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span><span class="o">=</span>  <span class="n">this</span> <span class="o">*</span> <span class="p">(</span><span class="n">p1</span><span class="o">*</span><span class="n">b</span> <span class="o">+</span> <span class="n">p2</span><span class="o">*</span><span class="n">c</span><span class="p">)</span>
Y
Yu Yang 已提交
1260 1261
</pre></div>
</div>
1262
 </p>
Y
Yu Yang 已提交
1263 1264 1265 1266
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT12addSquareSumER11BaseMatrixTR11BaseMatrixT11BaseMatrixT1T1T1T">
1267
<span id="paddle::BaseMatrixT::addSquareSum__BaseMatrixTR.BaseMatrixTR.BaseMatrixT.T.T.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1aab2c4199d536059735c2839fcfba4f30"></span>void <code class="descname">addSquareSum</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> <em>d</em>, T <em>p1</em>, T <em>p2</em>, T <em>p3</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT12addSquareSumER11BaseMatrixTR11BaseMatrixT11BaseMatrixT1T1T1T" title="Permalink to this definition">¶</a></dt>
1268
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">+=</span> <span class="n">sqr</span><span class="p">(</span><span class="n">p1</span><span class="o">*</span><span class="n">b</span> <span class="o">+</span> <span class="n">p2</span><span class="o">*</span><span class="n">c</span> <span class="o">+</span> <span class="n">p3</span><span class="o">*</span><span class="n">d</span><span class="p">)</span>
Y
Yu Yang 已提交
1269 1270
</pre></div>
</div>
1271
 </p>
Y
Yu Yang 已提交
1272 1273 1274 1275
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT9addSquareER11BaseMatrixT1T">
1276
<span id="paddle::BaseMatrixT::addSquare__BaseMatrixTR.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a1e4fca6e537b89c9f9c5c6e51a40a804"></span>void <code class="descname">addSquare</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, T <em>p</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT9addSquareER11BaseMatrixT1T" title="Permalink to this definition">¶</a></dt>
1277
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">+=</span> <span class="n">p</span> <span class="o">*</span> <span class="n">sqr</span><span class="p">(</span><span class="n">b</span><span class="p">)</span>
Y
Yu Yang 已提交
1278 1279
</pre></div>
</div>
1280
 </p>
Y
Yu Yang 已提交
1281 1282 1283 1284
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT14decayAddSquareER11BaseMatrixT1T1T">
1285
<span id="paddle::BaseMatrixT::decayAddSquare__BaseMatrixTR.T.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a2a29750f2c9bca78dd3828c6b7602256"></span>void <code class="descname">decayAddSquare</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, T <em>p1</em>, T <em>p2</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT14decayAddSquareER11BaseMatrixT1T1T" title="Permalink to this definition">¶</a></dt>
1286
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">p1</span> <span class="o">*</span> <span class="n">this</span> <span class="o">+</span> <span class="n">p2</span> <span class="o">*</span> <span class="n">sqr</span><span class="p">(</span><span class="n">b</span><span class="p">)</span>
Y
Yu Yang 已提交
1287 1288
</pre></div>
</div>
1289
 </p>
Y
Yu Yang 已提交
1290 1291 1292 1293
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT17decayAddSquareMulER11BaseMatrixTR11BaseMatrixT1T1T">
1294
<span id="paddle::BaseMatrixT::decayAddSquareMul__BaseMatrixTR.BaseMatrixTR.T.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1af3ba7532359c4e7e72c72e76aeb6afe3"></span>void <code class="descname">decayAddSquareMul</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em>, T <em>p1</em>, T <em>p2</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT17decayAddSquareMulER11BaseMatrixTR11BaseMatrixT1T1T" title="Permalink to this definition">¶</a></dt>
1295
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">p1</span> <span class="o">*</span> <span class="n">this</span> <span class="o">+</span> <span class="n">p2</span> <span class="o">*</span> <span class="n">sqr</span><span class="p">(</span><span class="n">b</span> <span class="o">*</span> <span class="n">c</span><span class="p">)</span>
Y
Yu Yang 已提交
1296 1297
</pre></div>
</div>
1298
 </p>
Y
Yu Yang 已提交
1299 1300 1301 1302
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT10reciprocalER11BaseMatrixT1T1T">
1303
<span id="paddle::BaseMatrixT::reciprocal__BaseMatrixTR.T.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1ab11aa12de3a968b11c0e25b148d47890"></span>void <code class="descname">reciprocal</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, T <em>p1</em>, T <em>p2</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT10reciprocalER11BaseMatrixT1T1T" title="Permalink to this definition">¶</a></dt>
1304
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="mi">1</span> <span class="o">/</span> <span class="p">(</span><span class="n">p1</span> <span class="o">*</span> <span class="n">b</span> <span class="o">+</span> <span class="n">p2</span><span class="p">)</span>
Y
Yu Yang 已提交
1305 1306
</pre></div>
</div>
1307
 </p>
Y
Yu Yang 已提交
1308 1309 1310 1311
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT13reciprocalSumER11BaseMatrixTR11BaseMatrixT1T1T1T">
1312
<span id="paddle::BaseMatrixT::reciprocalSum__BaseMatrixTR.BaseMatrixTR.T.T.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a19e6ba40ce33f7061c0c256bc64ed305"></span>void <code class="descname">reciprocalSum</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em>, T <em>p1</em>, T <em>p2</em>, T <em>p3</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT13reciprocalSumER11BaseMatrixTR11BaseMatrixT1T1T1T" title="Permalink to this definition">¶</a></dt>
1313
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="mi">1</span> <span class="o">/</span> <span class="p">(</span><span class="n">p1</span> <span class="o">*</span> <span class="n">b</span> <span class="o">+</span> <span class="n">p2</span> <span class="o">*</span> <span class="n">c</span> <span class="o">+</span> <span class="n">p3</span><span class="p">)</span>
Y
Yu Yang 已提交
1314 1315
</pre></div>
</div>
1316
 </p>
Y
Yu Yang 已提交
1317 1318 1319 1320
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT12copyAndClearER11BaseMatrixT">
1321
<span id="paddle::BaseMatrixT::copyAndClear__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a755672dc5dc9dffcfd4c51a5ac1acd42"></span>void <code class="descname">copyAndClear</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT12copyAndClearER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
1322
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">b</span> <span class="o">=</span> <span class="n">this</span><span class="p">;</span> <span class="n">this</span> <span class="o">=</span> <span class="mi">0</span>
Y
Yu Yang 已提交
1323 1324
</pre></div>
</div>
1325
 </p>
Y
Yu Yang 已提交
1326 1327 1328 1329
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT9rowDotMulE6size_tR11BaseMatrixTR11BaseMatrixT">
1330
<span id="paddle::BaseMatrixT::rowDotMul__s.BaseMatrixTR.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a45980716c85535dce24fe950d6600d49"></span>void <code class="descname">rowDotMul</code><span class="sig-paren">(</span>size_t <em>destCol</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT9rowDotMulE6size_tR11BaseMatrixTR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
1331
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this_row</span><span class="p">[</span><span class="n">destCol</span><span class="p">]</span> <span class="o">+=</span> <span class="n">dotprod</span><span class="p">(</span><span class="n">b_row</span><span class="p">,</span> <span class="n">c_row</span><span class="p">)</span>
Y
Yu Yang 已提交
1332 1333
</pre></div>
</div>
1334
 </p>
Y
Yu Yang 已提交
1335 1336 1337 1338
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT10rowDotMul2E6size_tR11BaseMatrixTR11BaseMatrixT">
1339
<span id="paddle::BaseMatrixT::rowDotMul2__s.BaseMatrixTR.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a0ff23a2d8c86d8125fa9f0905bc36f0f"></span>void <code class="descname">rowDotMul2</code><span class="sig-paren">(</span>size_t <em>destCol</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT10rowDotMul2E6size_tR11BaseMatrixTR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1340 1341 1342 1343
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT12addDotMulVMMER11BaseMatrixTR11BaseMatrixT">
1344
<span id="paddle::BaseMatrixT::addDotMulVMM__BaseMatrixTR.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1aed0d984b437539977f6330ce6c150d33"></span>void <code class="descname">addDotMulVMM</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT12addDotMulVMMER11BaseMatrixTR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1345
<dd><p>this is vector (one row matrix)</p>
1346
<p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="k">for</span> <span class="n">each</span> <span class="n">row</span> <span class="n">i</span><span class="p">,</span> <span class="n">do</span><span class="p">:</span>
1347
   <span class="n">this_row</span> <span class="o">+=</span> <span class="n">dotmul</span><span class="p">(</span><span class="n">b_row_i</span><span class="p">,</span> <span class="n">c_row_i</span><span class="p">)</span>
Y
Yu Yang 已提交
1348 1349
</pre></div>
</div>
1350
 </p>
Y
Yu Yang 已提交
1351 1352 1353 1354
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT13addDotMulVMM2ER11BaseMatrixTR11BaseMatrixT">
1355
<span id="paddle::BaseMatrixT::addDotMulVMM2__BaseMatrixTR.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a5d81e6574ae550b2db2b633a5d1f6bd7"></span>void <code class="descname">addDotMulVMM2</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT13addDotMulVMM2ER11BaseMatrixTR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1356 1357 1358 1359
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT12addDotMulMMVER11BaseMatrixTR11BaseMatrixT">
1360
<span id="paddle::BaseMatrixT::addDotMulMMV__BaseMatrixTR.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a543dab3a7d984a9f089dda6507de2f24"></span>void <code class="descname">addDotMulMMV</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT12addDotMulMMVER11BaseMatrixTR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1361
<dd><p>c is vector (one row matrix)</p>
1362
<p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="k">for</span> <span class="n">each</span> <span class="n">row</span> <span class="n">i</span><span class="p">,</span> <span class="n">do</span><span class="p">:</span>
1363
   <span class="n">this_row_i</span> <span class="o">+=</span> <span class="n">dotmul</span><span class="p">(</span><span class="n">b_row_i</span><span class="p">,</span> <span class="n">c_row</span><span class="p">)</span>
Y
Yu Yang 已提交
1364 1365
</pre></div>
</div>
1366
 </p>
Y
Yu Yang 已提交
1367 1368 1369 1370
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT13addDotMulMMV2ER11BaseMatrixTR11BaseMatrixT">
1371
<span id="paddle::BaseMatrixT::addDotMulMMV2__BaseMatrixTR.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a71ed97f349d52118d34a3ced0e502713"></span>void <code class="descname">addDotMulMMV2</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT13addDotMulMMV2ER11BaseMatrixTR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1372 1373 1374 1375
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT9addDotMulER11BaseMatrixTR11BaseMatrixT1T1T">
1376
<span id="paddle::BaseMatrixT::addDotMul__BaseMatrixTR.BaseMatrixTR.T.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a21edf0a664d6e9a2531f847804251ccf"></span>void <code class="descname">addDotMul</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em>, T <em>p1</em>, T <em>p2</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT9addDotMulER11BaseMatrixTR11BaseMatrixT1T1T" title="Permalink to this definition">¶</a></dt>
1377
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">p1</span> <span class="o">*</span> <span class="n">this</span> <span class="o">+</span> <span class="n">p2</span> <span class="o">*</span> <span class="n">b</span> <span class="o">*</span> <span class="n">c</span>
Y
Yu Yang 已提交
1378 1379
</pre></div>
</div>
1380
 </p>
Y
Yu Yang 已提交
1381 1382 1383 1384
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT8rowScaleE6size_tR11BaseMatrixTR11BaseMatrixT">
1385
<span id="paddle::BaseMatrixT::rowScale__s.BaseMatrixTR.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1ab9f171dfdd1e711493d2f6f2edd31c78"></span>void <code class="descname">rowScale</code><span class="sig-paren">(</span>size_t <em>cCol</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT8rowScaleE6size_tR11BaseMatrixTR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
1386
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this_row</span> <span class="o">=</span> <span class="n">b_row</span> <span class="o">*</span> <span class="n">c_row</span><span class="p">[</span><span class="n">cCol</span><span class="p">]</span>
Y
Yu Yang 已提交
1387 1388
</pre></div>
</div>
1389
 </p>
Y
Yu Yang 已提交
1390 1391 1392 1393
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT9rowScale2E6size_tR11BaseMatrixTR11BaseMatrixT">
1394
<span id="paddle::BaseMatrixT::rowScale2__s.BaseMatrixTR.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a2404ece97019a41d1d73d71de155d651"></span>void <code class="descname">rowScale2</code><span class="sig-paren">(</span>size_t <em>cCol</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT9rowScale2E6size_tR11BaseMatrixTR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1395 1396 1397 1398
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT8colScaleE6size_tR11BaseMatrixTR11BaseMatrixT">
1399
<span id="paddle::BaseMatrixT::colScale__s.BaseMatrixTR.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a19147144ceee22787d29b81c9674376a"></span>void <code class="descname">colScale</code><span class="sig-paren">(</span>size_t <em>cRow</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT8colScaleE6size_tR11BaseMatrixTR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
1400
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this_col</span> <span class="o">=</span> <span class="n">b_col</span> <span class="o">*</span> <span class="n">c_col</span><span class="p">[</span><span class="n">cRow</span><span class="p">]</span>
Y
Yu Yang 已提交
1401 1402
</pre></div>
</div>
1403
 </p>
Y
Yu Yang 已提交
1404 1405 1406 1407
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT11addColScaleE6size_tR11BaseMatrixTR11BaseMatrixT">
1408
<span id="paddle::BaseMatrixT::addColScale__s.BaseMatrixTR.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1acca5ba26ae000c3466ba39c4e20535f9"></span>void <code class="descname">addColScale</code><span class="sig-paren">(</span>size_t <em>cRow</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT11addColScaleE6size_tR11BaseMatrixTR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
1409
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this_col</span> <span class="o">+=</span> <span class="n">b_col</span> <span class="o">*</span> <span class="n">c_col</span><span class="p">[</span><span class="n">cRow</span><span class="p">]</span>
Y
Yu Yang 已提交
1410 1411
</pre></div>
</div>
1412
 </p>
Y
Yu Yang 已提交
1413 1414 1415 1416
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT11addRowScaleE6size_tR11BaseMatrixTR11BaseMatrixT">
1417
<span id="paddle::BaseMatrixT::addRowScale__s.BaseMatrixTR.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a6cf25ec3602c56f93fce7bdd51c95391"></span>void <code class="descname">addRowScale</code><span class="sig-paren">(</span>size_t <em>cCol</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT11addRowScaleE6size_tR11BaseMatrixTR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
1418
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this_row</span> <span class="o">+=</span> <span class="n">b_row</span> <span class="o">*</span> <span class="n">c_row</span><span class="p">[</span><span class="n">cCol</span><span class="p">]</span>
Y
Yu Yang 已提交
1419 1420
</pre></div>
</div>
1421
 </p>
Y
Yu Yang 已提交
1422 1423 1424
</dd></dl>

<dl class="function">
1425 1426 1427
<dt id="_CPPv2N6paddle11BaseMatrixT7sumRowsER11BaseMatrixT1T1T">
<span id="paddle::BaseMatrixT::sumRows__BaseMatrixTR.T.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a4da1cb05ad6fe21721c1be4a67c11338"></span>void <code class="descname">sumRows</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, T <em>scaleSum</em>, T <em>scaleDest</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT7sumRowsER11BaseMatrixT1T1T" title="Permalink to this definition">¶</a></dt>
<dd><p>calculate the sum of each row of the matrix b. this_i = scaleDest * this_i + scaleSum *  b_{ij} </p>
Y
Yu Yang 已提交
1428 1429 1430 1431
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT7maxRowsER11BaseMatrixT">
1432
<span id="paddle::BaseMatrixT::maxRows__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a53ddea5ca4c9c6eab39ff9bda957548a"></span>void <code class="descname">maxRows</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT7maxRowsER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1433 1434 1435 1436 1437
<dd><p>calculate the maximum value of each row of the matrix b. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT7minRowsER11BaseMatrixT">
1438
<span id="paddle::BaseMatrixT::minRows__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1ab244015cf9d4b31d876e1bf03421272b"></span>void <code class="descname">minRows</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT7minRowsER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1439 1440 1441 1442 1443
<dd><p>calculate the minimum value of each row of the matrix b. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT7sumColsER11BaseMatrixT">
1444
<span id="paddle::BaseMatrixT::sumCols__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1ac71816a964e7ff6c374569942c4d4155"></span>void <code class="descname">sumCols</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT7sumColsER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1445 1446 1447 1448 1449
<dd><p>calculate the sum of each column of the matrix b. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT7maxColsER11BaseMatrixT">
1450
<span id="paddle::BaseMatrixT::maxCols__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1aab1a634e30791763439a3b3bafe9a199"></span>void <code class="descname">maxCols</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT7maxColsER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1451 1452 1453 1454 1455
<dd><p>calculate the maximum value of each column of the matrix b. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT7minColsER11BaseMatrixT">
1456
<span id="paddle::BaseMatrixT::minCols__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1ac47b73c6517cc50795781da5f8b57ce7"></span>void <code class="descname">minCols</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT7minColsER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1457 1458 1459 1460
<dd><p>calculate the minimum value of each column of the matrix b. </p>
</dd></dl>

<dl class="function">
1461 1462 1463 1464
<dt id="_CPPv2N6paddle11BaseMatrixT7sumColsER11BaseMatrixT1T1T">
<span id="paddle::BaseMatrixT::sumCols__BaseMatrixTR.T.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a5a7b2678cfe7339eb6092f4f60c3f2c3"></span>void <code class="descname">sumCols</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, T <em>scaleSum</em>, T <em>scaleDest</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT7sumColsER11BaseMatrixT1T1T" title="Permalink to this definition">¶</a></dt>
<dd><p>calculate the sum of each column of the matrix b. this_i = scaleDest * this_i + scaleSum *  b_{ji} </p>
</dd></dl>
Y
Yu Yang 已提交
1465 1466

<dl class="function">
1467 1468 1469 1470 1471 1472 1473 1474 1475
<dt id="_CPPv2N6paddle11BaseMatrixT17sumOfSquaredDiffsER11BaseMatrixTR11BaseMatrixT1T1T">
<span id="paddle::BaseMatrixT::sumOfSquaredDiffs__BaseMatrixTR.BaseMatrixTR.T.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a76f00ec4a20261bad0447a7ec24f9513"></span>void <code class="descname">sumOfSquaredDiffs</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em>, T <em>scaleSum</em>, T <em>scaleDest</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT17sumOfSquaredDiffsER11BaseMatrixTR11BaseMatrixT1T1T" title="Permalink to this definition">¶</a></dt>
<dd><p>this_i = scaleDest * this_i + scaleSum *  (b_{ij} - c_{ij})^2 </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT13sumOfProductsER11BaseMatrixTR11BaseMatrixT1T1T">
<span id="paddle::BaseMatrixT::sumOfProducts__BaseMatrixTR.BaseMatrixTR.T.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a3893ef2ccf7f45af4259f5334b52f665"></span>void <code class="descname">sumOfProducts</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em>, T <em>scaleSum</em>, T <em>scaleDest</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT13sumOfProductsER11BaseMatrixTR11BaseMatrixT1T1T" title="Permalink to this definition">¶</a></dt>
<dd><p>this_i = scaleDest * this_i + scaleSum *  b_{ij} * c_{ij} </p>
Y
Yu Yang 已提交
1476 1477 1478 1479
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT6rowAddE6size_tR11BaseMatrixTR11BaseMatrixT1T">
1480
<span id="paddle::BaseMatrixT::rowAdd__s.BaseMatrixTR.BaseMatrixTR.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1ac85750fd4d02d360c6054ec6723a72e4"></span>void <code class="descname">rowAdd</code><span class="sig-paren">(</span>size_t <em>cCol</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em>, T <em>p</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT6rowAddE6size_tR11BaseMatrixTR11BaseMatrixT1T" title="Permalink to this definition">¶</a></dt>
1481
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this_row</span> <span class="o">=</span> <span class="n">b_row</span> <span class="o">+</span> <span class="n">p</span> <span class="o">*</span> <span class="n">ones</span> <span class="o">*</span> <span class="n">c_row</span><span class="p">[</span><span class="n">cCol</span><span class="p">]</span>
Y
Yu Yang 已提交
1482 1483
</pre></div>
</div>
1484
 </p>
Y
Yu Yang 已提交
1485 1486 1487 1488
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT6rowPowE6size_tR11BaseMatrixTR11BaseMatrixT">
1489
<span id="paddle::BaseMatrixT::rowPow__s.BaseMatrixTR.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a6b01b6ddff485d158982d2fc13299073"></span>void <code class="descname">rowPow</code><span class="sig-paren">(</span>size_t <em>cCol</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle11BaseMatrixTE" title="paddle::BaseMatrixT">BaseMatrixT</a> &amp;<em>c</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT6rowPowE6size_tR11BaseMatrixTR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
1490
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this_row</span> <span class="o">=</span> <span class="nb">pow</span><span class="p">(</span><span class="n">b_row</span><span class="p">,</span> <span class="n">c_row</span><span class="p">[</span><span class="n">cCol</span><span class="p">])</span>
Y
Yu Yang 已提交
1491 1492
</pre></div>
</div>
1493
 </p>
Y
Yu Yang 已提交
1494 1495 1496
</dd></dl>

<dl class="function">
1497 1498
<dt id="_CPPv2NK6paddle11BaseMatrixT8isSparseEv">
<span id="paddle::BaseMatrixT::isSparseC"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a1f6af0331a1c6981522ff2b2f9f62520"></span><em class="property">virtual</em> bool <code class="descname">isSparse</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle11BaseMatrixT8isSparseEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1499 1500 1501
<dd></dd></dl>

</div>
1502
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
1503 1504 1505 1506 1507 1508 1509 1510 1511 1512 1513 1514 1515 1516 1517 1518 1519 1520 1521 1522 1523 1524 1525 1526 1527 1528 1529 1530 1531 1532 1533 1534 1535 1536 1537 1538 1539 1540 1541 1542 1543
<p class="breathe-sectiondef-title rubric">Public Members</p>
<dl class="member">
<dt id="_CPPv2N6paddle11BaseMatrixT7height_E">
<span id="paddle::BaseMatrixT::height___s"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1abbe42ec682e16948d34dc6ad6211c0e2"></span>size_t <code class="descname">height_</code><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT7height_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle11BaseMatrixT6width_E">
<span id="paddle::BaseMatrixT::width___s"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a1716143fd0374b418eb965d01177c2eb"></span>size_t <code class="descname">width_</code><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT6width_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle11BaseMatrixT7stride_E">
<span id="paddle::BaseMatrixT::stride___s"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a8caa847ea7d1ce5c4123162f2bdae3c6"></span>size_t <code class="descname">stride_</code><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT7stride_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle11BaseMatrixT5data_E">
<span id="paddle::BaseMatrixT::data___TP"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a6779fdab6346bc643007b660fb4ceae4"></span>T *<code class="descname">data_</code><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT5data_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle11BaseMatrixT6trans_E">
<span id="paddle::BaseMatrixT::trans___b"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a6e84dab1715e7b215a93a705df5d81c7"></span>bool <code class="descname">trans_</code><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT6trans_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle11BaseMatrixT7useGpu_E">
<span id="paddle::BaseMatrixT::useGpu___b"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a9828f07f3efa8d8bf4efd22bae44746f"></span>bool <code class="descname">useGpu_</code><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT7useGpu_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="sparse-matrix">
<h2>Sparse Matrix<a class="headerlink" href="#sparse-matrix" title="Permalink to this headline">¶</a></h2>
<dl class="type">
<dt id="_CPPv26paddle">
1544
<span class="target" id="paddlenamespacepaddle"></span><em class="property">namespace </em><code class="descname">paddle</code><a class="headerlink" href="#_CPPv26paddle" title="Permalink to this definition">¶</a></dt>
1545
<dd><div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
1546 1547 1548 1549 1550 1551 1552 1553 1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564 1565 1566 1567 1568 1569 1570 1571 1572
<p class="breathe-sectiondef-title rubric">Typedefs</p>
<dl class="type">
<dt id="_CPPv2N6paddle9MatrixPtrE">
<span id="paddle::MatrixPtr"></span><span class="target" id="paddlenamespacepaddle_1aa2adc58bcd2d6141ce3ad3d9dacc4d9c"></span><em class="property">typedef </em>std::shared_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a>&gt; <code class="descname">MatrixPtr</code><a class="headerlink" href="#_CPPv2N6paddle9MatrixPtrE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="type">
<dt id="_CPPv2N6paddle12GpuMatrixPtrE">
<span id="paddle::GpuMatrixPtr"></span><span class="target" id="paddlenamespacepaddle_1ac031db7a995ff451ce632f9de4cb8a66"></span><em class="property">typedef </em>std::shared_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle9GpuMatrixE" title="paddle::GpuMatrix">GpuMatrix</a>&gt; <code class="descname">GpuMatrixPtr</code><a class="headerlink" href="#_CPPv2N6paddle12GpuMatrixPtrE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="type">
<dt id="_CPPv2N6paddle12CpuMatrixPtrE">
<span id="paddle::CpuMatrixPtr"></span><span class="target" id="paddlenamespacepaddle_1a6738185382a137a500588ac716bfd30f"></span><em class="property">typedef </em>std::shared_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle9CpuMatrixE" title="paddle::CpuMatrix">CpuMatrix</a>&gt; <code class="descname">CpuMatrixPtr</code><a class="headerlink" href="#_CPPv2N6paddle12CpuMatrixPtrE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="type">
<dt id="_CPPv2N6paddle18GpuSparseMatrixPtrE">
<span id="paddle::GpuSparseMatrixPtr"></span><span class="target" id="paddlenamespacepaddle_1a64b13343c1deb887d63f6da4dfc3fc81"></span><em class="property">typedef </em>std::shared_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle15GpuSparseMatrixE" title="paddle::GpuSparseMatrix">GpuSparseMatrix</a>&gt; <code class="descname">GpuSparseMatrixPtr</code><a class="headerlink" href="#_CPPv2N6paddle18GpuSparseMatrixPtrE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="type">
<dt id="_CPPv2N6paddle18CpuSparseMatrixPtrE">
<span id="paddle::CpuSparseMatrixPtr"></span><span class="target" id="paddlenamespacepaddle_1abc085dd6cc4b12621bb22cef148cc81f"></span><em class="property">typedef </em>std::shared_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle15CpuSparseMatrixE" title="paddle::CpuSparseMatrix">CpuSparseMatrix</a>&gt; <code class="descname">CpuSparseMatrixPtr</code><a class="headerlink" href="#_CPPv2N6paddle18CpuSparseMatrixPtrE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
1573
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590 1591 1592 1593 1594 1595
<p class="breathe-sectiondef-title rubric">Enums</p>
<dl class="type">
<dt id="_CPPv2N6paddle15SparseValueTypeE">
<span id="paddle::SparseValueType"></span><span class="target" id="paddlenamespacepaddle_1a282f6a03801d9e41e6b80a86c783ea99"></span><em class="property">enum </em><code class="descname">SparseValueType</code><a class="headerlink" href="#_CPPv2N6paddle15SparseValueTypeE" title="Permalink to this definition">¶</a></dt>
<dd><p><em>Values:</em></p>
<dl class="member">
<dt id="_CPPv2N6paddle8NO_VALUEE">
<span id="paddle::NO_VALUE"></span><span class="target" id="paddlenamespacepaddle_1a282f6a03801d9e41e6b80a86c783ea99afc1f5738f7adf93af4d6f7c4cd7097cf"></span><code class="descname">NO_VALUE</code> = 0<a class="headerlink" href="#_CPPv2N6paddle8NO_VALUEE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle11FLOAT_VALUEE">
<span id="paddle::FLOAT_VALUE"></span><span class="target" id="paddlenamespacepaddle_1a282f6a03801d9e41e6b80a86c783ea99ad2277835229eeafb9af95bbde84498e1"></span><code class="descname">FLOAT_VALUE</code> = 1<a class="headerlink" href="#_CPPv2N6paddle11FLOAT_VALUEE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="type">
<dt id="_CPPv2N6paddle12SparseFormatE">
<span id="paddle::SparseFormat"></span><span class="target" id="paddlenamespacepaddle_1a88d8f5c50ae80ecf7ee7f91fc39bbfe2"></span><em class="property">enum </em><code class="descname">SparseFormat</code><a class="headerlink" href="#_CPPv2N6paddle12SparseFormatE" title="Permalink to this definition">¶</a></dt>
<dd><p>matrix sparse_format . </p>
<p>nnz represents nonzero number in sparse matrix.</p>
1596 1597
<p>SPARSE_CSR: row major matrix. length of row is height_ + 1, each element represents row start index in <a class="reference internal" href="#paddleclasspaddle_1_1Matrix"><span class="std std-ref">Matrix</span></a>. length of col and value are nnz.</p>
<p>SPARSE_CSC: col major matrix. length of col is width_ + 1, each element represents col start index in <a class="reference internal" href="#paddleclasspaddle_1_1Matrix"><span class="std std-ref">Matrix</span></a>. length of col and value are nnz.</p>
1598
<p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="k">for</span> <span class="n">example</span><span class="p">:</span> <span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">0</span><span class="p">;</span>
1599 1600 1601 1602 1603 1604 1605 1606
              <span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">;</span>
              <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">5</span><span class="p">];</span>
<span class="n">SPARSE_CSR</span> <span class="n">row</span>   <span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">5</span><span class="p">];</span>
           <span class="n">col</span>   <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">3</span><span class="p">,</span> <span class="mi">4</span><span class="p">];</span>
           <span class="n">value</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">5</span><span class="p">]</span>
<span class="n">SPARSE_CSC</span> <span class="n">col</span>   <span class="p">[</span><span class="mi">0</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">4</span><span class="p">,</span> <span class="mi">5</span><span class="p">];</span>
           <span class="n">row</span>   <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">];</span>
           <span class="n">value</span> <span class="p">[</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">2</span><span class="p">,</span> <span class="mi">5</span><span class="p">]</span>
Y
Yu Yang 已提交
1607 1608
</pre></div>
</div>
1609
 </p>
Y
Yu Yang 已提交
1610 1611 1612 1613 1614 1615 1616 1617 1618 1619 1620 1621 1622 1623
<p><em>Values:</em></p>
<dl class="member">
<dt id="_CPPv2N6paddle10SPARSE_CSRE">
<span id="paddle::SPARSE_CSR"></span><span class="target" id="paddlenamespacepaddle_1a88d8f5c50ae80ecf7ee7f91fc39bbfe2aa4b5b80d7c7a6a3b88ed1297f0155a99"></span><code class="descname">SPARSE_CSR</code> = 0<a class="headerlink" href="#_CPPv2N6paddle10SPARSE_CSRE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle10SPARSE_CSCE">
<span id="paddle::SPARSE_CSC"></span><span class="target" id="paddlenamespacepaddle_1a88d8f5c50ae80ecf7ee7f91fc39bbfe2ad5e72ef23fdf0be7304033650e77f622"></span><code class="descname">SPARSE_CSC</code> = 1<a class="headerlink" href="#_CPPv2N6paddle10SPARSE_CSCE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</div>
1624
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
1625 1626 1627 1628 1629 1630 1631 1632
<p class="breathe-sectiondef-title rubric">Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddlelsERNSt7ostreamERK6Matrix">
<span id="paddle::lshift-operator__osR.MatrixCR"></span><span class="target" id="paddlenamespacepaddle_1af3f6d96db138a48badb3e3d89e344087"></span>std::ostream &amp;<code class="descname">operator&lt;&lt;</code><span class="sig-paren">(</span>std::ostream &amp;<em>os</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>mat</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddlelsERNSt7ostreamERK6Matrix" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<dl class="class">
1633 1634 1635 1636 1637
<dt id="_CPPv2N6paddle6MatrixE">
<span id="paddle::Matrix"></span><span class="target" id="paddleclasspaddle_1_1Matrix"></span><em class="property">class </em><code class="descname">Matrix</code><a class="headerlink" href="#_CPPv2N6paddle6MatrixE" title="Permalink to this definition">¶</a></dt>
<dd><em>#include &lt;Matrix.h&gt;</em><p>Copy or assignemnt constructor will share the data as opposed to making a copy of the original data. To make a copy of the orinal data, use copyFrom() instead. </p>
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1BaseMatrixT"><span class="std std-ref">paddle::BaseMatrixT&lt; real &gt;</span></a></p>
<p>Subclassed by <a class="reference internal" href="#paddleclasspaddle_1_1CpuMatrix"><span class="std std-ref">paddle::CpuMatrix</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1CpuSparseMatrix"><span class="std std-ref">paddle::CpuSparseMatrix</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1GpuMatrix"><span class="std std-ref">paddle::GpuMatrix</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1GpuSparseMatrix"><span class="std std-ref">paddle::GpuSparseMatrix</span></a></p>
1638
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
1639 1640
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
1641
<dt id="_CPPv2N6paddle6MatrixD0Ev">
1642
<span id="paddle::Matrix::~Matrix"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a9eb0570627d3b1fa1a7023bf23dbd9c4"></span><em class="property">virtual</em> <code class="descname">~Matrix</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6MatrixD0Ev" title="Permalink to this definition">¶</a></dt>
1643
<dd></dd></dl>
Y
Yu Yang 已提交
1644 1645

<dl class="function">
1646 1647 1648 1649 1650
<dt id="_CPPv2N6paddle6Matrix7setDataEP4real">
<span id="paddle::Matrix::setData__realP"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a322488598a20d63183793b4f29e645db"></span>void <code class="descname">setData</code><span class="sig-paren">(</span>real *<em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix7setDataEP4real" title="Permalink to this definition">¶</a></dt>
<dd><p>set the data buffer used to hold the matrix data. </p>
<p>caller should make sure that the size of data is at least sizeof(real)*height*width. </p>
</dd></dl>
Y
Yu Yang 已提交
1651 1652

<dl class="function">
1653 1654 1655 1656
<dt id="_CPPv2N6paddle6Matrix7setDataEP4real6size_t6size_t">
<span id="paddle::Matrix::setData__realP.s.s"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a56740f6b028b0fb3d5fb16fee6994f67"></span>void <code class="descname">setData</code><span class="sig-paren">(</span>real *<em>data</em>, size_t <em>newHeight</em>, size_t <em>newWidth</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix7setDataEP4real6size_t6size_t" title="Permalink to this definition">¶</a></dt>
<dd><p>the data should be contiguous </p>
</dd></dl>
Y
Yu Yang 已提交
1657 1658

<dl class="function">
1659 1660
<dt id="_CPPv2NK6paddle6Matrix8getWidthEv">
<span id="paddle::Matrix::getWidthC"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a641671a85f2ebae68c0e24fcd4449f05"></span>size_t <code class="descname">getWidth</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle6Matrix8getWidthEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1661 1662 1663
<dd></dd></dl>

<dl class="function">
1664 1665
<dt id="_CPPv2NK6paddle6Matrix9getHeightEv">
<span id="paddle::Matrix::getHeightC"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a1e4b8d8a075d27ada903eb33a58ae7d4"></span>size_t <code class="descname">getHeight</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle6Matrix9getHeightEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1666 1667 1668
<dd></dd></dl>

<dl class="function">
1669 1670
<dt id="_CPPv2NK6paddle6Matrix9getStrideEv">
<span id="paddle::Matrix::getStrideC"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a857192182b09dacbf5274ea7e59a3c00"></span>size_t <code class="descname">getStride</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle6Matrix9getStrideEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1671 1672 1673
<dd></dd></dl>

<dl class="function">
1674 1675
<dt id="_CPPv2NK6paddle6Matrix13getElementCntEv">
<span id="paddle::Matrix::getElementCntC"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1ae06d50ba151d880f22e03e0cbed95bfb"></span>size_t <code class="descname">getElementCnt</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle6Matrix13getElementCntEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1676 1677 1678
<dd></dd></dl>

<dl class="function">
1679
<dt id="_CPPv2N6paddle6Matrix7getDataEv">
1680
<span id="paddle::Matrix::getData"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a122a426cf48abdbba3eae689d655c4ab"></span><em class="property">virtual</em> real *<code class="descname">getData</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix7getDataEv" title="Permalink to this definition">¶</a></dt>
1681
<dd></dd></dl>
Y
Yu Yang 已提交
1682 1683

<dl class="function">
1684 1685
<dt id="_CPPv2NK6paddle6Matrix7getDataEv">
<span id="paddle::Matrix::getDataC"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1aa8a2ffb8e06ea97ce3442fa0ffe9f45f"></span><em class="property">virtual</em> <em class="property">const</em> real *<code class="descname">getData</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle6Matrix7getDataEv" title="Permalink to this definition">¶</a></dt>
1686
<dd></dd></dl>
Y
Yu Yang 已提交
1687 1688

<dl class="function">
1689 1690
<dt id="_CPPv2NK6paddle6Matrix12isTransposedEv">
<span id="paddle::Matrix::isTransposedC"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a6842f17c7eba328930a8c7f3687e0120"></span>bool <code class="descname">isTransposed</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle6Matrix12isTransposedEv" title="Permalink to this definition">¶</a></dt>
1691
<dd></dd></dl>
Y
Yu Yang 已提交
1692 1693

<dl class="function">
1694 1695
<dt id="_CPPv2NK6paddle6Matrix12isContiguousEv">
<span id="paddle::Matrix::isContiguousC"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a26d3b58f4ae2afeccc963fb7c106bacc"></span>bool <code class="descname">isContiguous</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle6Matrix12isContiguousEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1696 1697 1698
<dd></dd></dl>

<dl class="function">
1699 1700
<dt id="_CPPv2NK6paddle6Matrix7getRowsEv">
<span id="paddle::Matrix::getRowsC"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1ad3e509174de91ab16afd614734c4fdb4"></span><em class="property">virtual</em> int *<code class="descname">getRows</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle6Matrix7getRowsEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1701 1702 1703
<dd></dd></dl>

<dl class="function">
1704 1705
<dt id="_CPPv2NK6paddle6Matrix7getColsEv">
<span id="paddle::Matrix::getColsC"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1ac6d2e9788d593a26d7c83cf2b011427b"></span><em class="property">virtual</em> int *<code class="descname">getCols</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle6Matrix7getColsEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1706 1707 1708
<dd></dd></dl>

<dl class="function">
1709 1710
<dt id="_CPPv2NK6paddle6Matrix9getFormatEv">
<span id="paddle::Matrix::getFormatC"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1ab37794b499e5c469f38add2d85c422b2"></span><em class="property">virtual</em> <a class="reference internal" href="#_CPPv2N6paddle12SparseFormatE" title="paddle::SparseFormat">SparseFormat</a> <code class="descname">getFormat</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle6Matrix9getFormatEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1711 1712 1713
<dd></dd></dl>

<dl class="function">
1714 1715
<dt id="_CPPv2NK6paddle6Matrix12getValueTypeEv">
<span id="paddle::Matrix::getValueTypeC"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1ac8d19b93ddd2b78babe36ecd3f3a43b2"></span><em class="property">virtual</em> <a class="reference internal" href="#_CPPv2N6paddle15SparseValueTypeE" title="paddle::SparseValueType">SparseValueType</a> <code class="descname">getValueType</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle6Matrix12getValueTypeEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1716 1717 1718
<dd></dd></dl>

<dl class="function">
1719
<dt id="_CPPv2N6paddle6Matrix4add3E9MatrixPtr">
1720
<span id="paddle::Matrix::add3__MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1aff61ccdd23b83e18fb5cbd404d4fa7ff"></span><em class="property">virtual</em> void <code class="descname">add3</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix4add3E9MatrixPtr" title="Permalink to this definition">¶</a></dt>
1721 1722
<dd><p>matrix elment-wise add </p>
<p>Named add3 just because add/add2 has been used in BaseMatrix.cu and they are not virtual function. </p>
Y
Yu Yang 已提交
1723 1724 1725
</dd></dl>

<dl class="function">
1726 1727
<dt id="_CPPv2NK6paddle6Matrix15getMemoryHandleEv">
<span id="paddle::Matrix::getMemoryHandleC"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a2f13376a6fdae88637163d16f7c1fff3"></span><a class="reference internal" href="../utils/utils.html#_CPPv2N6paddle15MemoryHandlePtrE" title="paddle::MemoryHandlePtr">MemoryHandlePtr</a> <code class="descname">getMemoryHandle</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle6Matrix15getMemoryHandleEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1728 1729 1730
<dd></dd></dl>

<dl class="function">
1731
<dt id="_CPPv2N6paddle6Matrix7zeroMemEv">
1732
<span id="paddle::Matrix::zeroMem"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a75a12ea41f84bd4a1a96b10e5fca62e7"></span><em class="property">virtual</em> void <code class="descname">zeroMem</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix7zeroMemEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1733 1734 1735
<dd></dd></dl>

<dl class="function">
1736
<dt id="_CPPv2N6paddle6Matrix8resetOneEv">
1737 1738 1739 1740 1741 1742
<span id="paddle::Matrix::resetOne"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a3183c4917b89abbe8798006f54306821"></span><em class="property">virtual</em> void <code class="descname">resetOne</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix8resetOneEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6Matrix7setDiagE4real">
<span id="Matrix::setDiag__real"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a4fda095bdb995c6a98ce6d48047fc345"></span>void <code class="descname">setDiag</code><span class="sig-paren">(</span>real <em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6Matrix7setDiagE4real" title="Permalink to this definition">¶</a></dt>
1743
<dd></dd></dl>
Y
Yu Yang 已提交
1744 1745

<dl class="function">
1746
<dt id="_CPPv2N6paddle6Matrix8copyFromERK6Matrix">
1747
<span id="paddle::Matrix::copyFrom__MatrixCR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a3eb60a6b368fcf4aac25d7248147ba10"></span><em class="property">virtual</em> void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>src</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix8copyFromERK6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1748 1749 1750
<dd></dd></dl>

<dl class="function">
1751
<dt id="_CPPv2N6paddle6Matrix8trimFromERK15CpuSparseMatrix">
1752
<span id="paddle::Matrix::trimFrom__CpuSparseMatrixCR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a88666babcb5beec1a83beaede78b26cf"></span><em class="property">virtual</em> void <code class="descname">trimFrom</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle15CpuSparseMatrixE" title="paddle::CpuSparseMatrix">CpuSparseMatrix</a> &amp;<em>src</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix8trimFromERK15CpuSparseMatrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1753 1754 1755
<dd></dd></dl>

<dl class="function">
1756
<dt id="_CPPv2N6paddle6Matrix8copyFromERK6Matrix11hl_stream_t">
1757
<span id="paddle::Matrix::copyFrom__MatrixCR.hl_stream_t"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a4229b26af746a50fd6b9e96dba602402"></span><em class="property">virtual</em> void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>src</em>, <a class="reference internal" href="../../cuda/utils/utils.html#_CPPv211hl_stream_t" title="hl_stream_t">hl_stream_t</a> <em>stream</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix8copyFromERK6Matrix11hl_stream_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1758 1759 1760
<dd></dd></dl>

<dl class="function">
1761 1762 1763
<dt id="_CPPv2N6Matrix9subMatrixE6size_t6size_t6size_t6size_t">
<span id="Matrix::subMatrix__s.s.s.s"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a660f0bb88c1b14a7f056ba68a2adcdf9"></span>MatrixPtr <code class="descname">subMatrix</code><span class="sig-paren">(</span>size_t <em>startRow</em>, size_t <em>endRow</em>, size_t <em>startCol</em>, size_t <em>endCol</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6Matrix9subMatrixE6size_t6size_t6size_t6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
Y
Yu Yang 已提交
1764 1765

<dl class="function">
1766 1767 1768
<dt id="_CPPv2N6paddle6Matrix12subRowMatrixE6size_t6size_t">
<span id="paddle::Matrix::subRowMatrix__s.s"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1ac6b02510212299b4dfa9b881012bec2f"></span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">subRowMatrix</code><span class="sig-paren">(</span>size_t <em>startRow</em>, size_t <em>endRow</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix12subRowMatrixE6size_t6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
Y
Yu Yang 已提交
1769 1770

<dl class="function">
1771 1772 1773
<dt id="_CPPv2N6paddle6Matrix12subColMatrixE6size_t6size_t">
<span id="paddle::Matrix::subColMatrix__s.s"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a45c4cdaaceecf35356df7c0d692dd598"></span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">subColMatrix</code><span class="sig-paren">(</span>size_t <em>startCol</em>, size_t <em>endCol</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix12subColMatrixE6size_t6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
Y
Yu Yang 已提交
1774 1775

<dl class="function">
1776
<dt id="_CPPv2N6paddle6Matrix9subMatrixE6size_t6size_t">
1777
<span id="paddle::Matrix::subMatrix__s.s"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1aceaeeccc687dd995147e7728823b7fe0"></span><em class="property">virtual</em> <a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">subMatrix</code><span class="sig-paren">(</span>size_t <em>startRow</em>, size_t <em>numRows</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix9subMatrixE6size_t6size_t" title="Permalink to this definition">¶</a></dt>
1778
<dd></dd></dl>
Y
Yu Yang 已提交
1779 1780

<dl class="function">
1781
<dt id="_CPPv2N6paddle6Matrix9subMatrixE6size_t6size_t9MatrixPtr">
1782
<span id="paddle::Matrix::subMatrix__s.s.MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a5531a209ed774f7a5a8ea9102e5b0878"></span><em class="property">virtual</em> <a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">subMatrix</code><span class="sig-paren">(</span>size_t <em>startRow</em>, size_t <em>numRows</em>, <a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>dest</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix9subMatrixE6size_t6size_t9MatrixPtr" title="Permalink to this definition">¶</a></dt>
1783
<dd></dd></dl>
Y
Yu Yang 已提交
1784 1785

<dl class="function">
1786
<dt id="_CPPv2N6paddle6Matrix8copyFromEPK4real6size_t">
1787
<span id="paddle::Matrix::copyFrom__realCP.s"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a9f28b1ba8eef75c83e414445eb0a166f"></span><em class="property">virtual</em> void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> real *<em>src</em>, size_t <em>size</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix8copyFromEPK4real6size_t" title="Permalink to this definition">¶</a></dt>
1788 1789
<dd><p>If this is <a class="reference internal" href="#paddleclasspaddle_1_1GpuMatrix"><span class="std std-ref">GpuMatrix</span></a>, src is assumed to be CPU memory</p>
<p>If this is <a class="reference internal" href="#paddleclasspaddle_1_1CpuMatrix"><span class="std std-ref">CpuMatrix</span></a>, src is assumed to be CPU memory </p>
Y
Yu Yang 已提交
1790 1791 1792
</dd></dl>

<dl class="function">
1793
<dt id="_CPPv2N6paddle6Matrix8copyFromEPK4realPK7int64_t">
1794
<span id="paddle::Matrix::copyFrom__realCP.int64_tCP"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1abad40f3937321a255ab240bc4ffe65ca"></span><em class="property">virtual</em> void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> real *<em>src</em>, <em class="property">const</em> int64_t *<em>seq</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix8copyFromEPK4realPK7int64_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1795 1796 1797
<dd></dd></dl>

<dl class="function">
1798
<dt id="_CPPv2N6paddle6Matrix8copyFromERK7IVector">
1799
<span id="paddle::Matrix::copyFrom__IVectorCR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a159966437890625711f3317dacb326ba"></span><em class="property">virtual</em> void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>src</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix8copyFromERK7IVector" title="Permalink to this definition">¶</a></dt>
1800 1801 1802
<dd><p>convert a int vector to a real matrix. </p>
<p>(1) source and dest are both in CPU.</p>
<p>(2) sizes are exactly match. </p>
Y
Yu Yang 已提交
1803 1804 1805
</dd></dl>

<dl class="function">
1806 1807
<dt id="_CPPv2N6paddle6Matrix14copyByRowIndexER6MatrixRK7IVector">
<span id="paddle::Matrix::copyByRowIndex__MatrixR.IVectorCR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1ae0eb1e4febf16bff85f1119ba18dedb0"></span><em class="property">virtual</em> void <code class="descname">copyByRowIndex</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>b</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>rowIndex</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix14copyByRowIndexER6MatrixRK7IVector" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1808 1809 1810
<dd></dd></dl>

<dl class="function">
1811
<dt id="_CPPv2N6paddle6Matrix5cloneE6size_t6size_tb">
1812
<span id="paddle::Matrix::clone__s.s.b"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a816f16646009185165ea31b469b48c29"></span><em class="property">virtual</em> <a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">clone</code><span class="sig-paren">(</span>size_t <em>height</em> = 0, size_t <em>width</em> = 0, bool <em>useGpu</em> = false<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix5cloneE6size_t6size_tb" title="Permalink to this definition">¶</a></dt>
1813 1814
<dd><p>Create a matrix with the same type (<a class="reference internal" href="#paddleclasspaddle_1_1GpuMatrix"><span class="std std-ref">GpuMatrix</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1CpuMatrix"><span class="std std-ref">CpuMatrix</span></a>, NonValueSparseMatrix, etc.) as this. </p>
<p>If height and width is zero, the new matrix will have the same size as this, otherwise the new matrix will have the specified size. </p>
Y
Yu Yang 已提交
1815 1816 1817
</dd></dl>

<dl class="function">
1818
<dt id="_CPPv2N6paddle6Matrix9getRowBufE6size_t">
1819
<span id="paddle::Matrix::getRowBuf__s"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a386a807da0977a14484ed7f55a2ab74d"></span><em class="property">virtual</em> real *<code class="descname">getRowBuf</code><span class="sig-paren">(</span>size_t <em>row</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix9getRowBufE6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1820 1821 1822
<dd></dd></dl>

<dl class="function">
1823 1824
<dt id="_CPPv2NK6paddle6Matrix10getElementE6size_t6size_t">
<span id="paddle::Matrix::getElement__s.sC"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a4eb5224fc979b75adf343562cb2874e4"></span><em class="property">virtual</em> real <code class="descname">getElement</code><span class="sig-paren">(</span>size_t <em>x</em>, size_t <em>y</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle6Matrix10getElementE6size_t6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1825 1826 1827
<dd></dd></dl>

<dl class="function">
1828
<dt id="_CPPv2N6paddle6Matrix6getSumEv">
1829
<span id="paddle::Matrix::getSum"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a4fa992891924f6a21bcf0a20ac7c849b"></span><em class="property">virtual</em> real <code class="descname">getSum</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix6getSumEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1830 1831 1832
<dd></dd></dl>

<dl class="function">
1833
<dt id="_CPPv2N6paddle6Matrix16accumulateColSumER6Matrix">
1834
<span id="paddle::Matrix::accumulateColSum__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1abaa5845c6e3d882bfbe699b2073e3e7f"></span><em class="property">virtual</em> void <code class="descname">accumulateColSum</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>src</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix16accumulateColSumER6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1835 1836 1837
<dd></dd></dl>

<dl class="function">
1838
<dt id="_CPPv2N6paddle6Matrix9getAbsSumEv">
1839
<span id="paddle::Matrix::getAbsSum"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1aaccb97a47b8c16a83866d7a39272c148"></span><em class="property">virtual</em> real <code class="descname">getAbsSum</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix9getAbsSumEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1840 1841 1842
<dd></dd></dl>

<dl class="function">
1843
<dt id="_CPPv2N6paddle6Matrix6resizeE6size_t6size_t">
1844
<span id="paddle::Matrix::resize__s.s"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a6d71f7f4f1bdc9e2f35fff1a8a337d42"></span><em class="property">virtual</em> void <code class="descname">resize</code><span class="sig-paren">(</span>size_t <em>newHeight</em>, size_t <em>newWidth</em><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle6Matrix6resizeE6size_t6size_t" title="Permalink to this definition">¶</a></dt>
1845 1846 1847 1848 1849
<dd><p><dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>Original data may not be preserved after <a class="reference internal" href="#paddleclasspaddle_1_1Matrix_1a6d71f7f4f1bdc9e2f35fff1a8a337d42"><span class="std std-ref">resize()</span></a>. </dd>
</dl>
</p>
Y
Yu Yang 已提交
1850 1851 1852
</dd></dl>

<dl class="function">
1853
<dt id="_CPPv2N6paddle6Matrix6resizeE6size_t6size_t6size_t15SparseValueType12SparseFormat">
1854
<span id="paddle::Matrix::resize__s.s.s.SparseValueType.SparseFormat"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a0e93c008467c9e7b94226bb9dae4c6ba"></span><em class="property">virtual</em> void <code class="descname">resize</code><span class="sig-paren">(</span>size_t <em>newHeight</em>, size_t <em>newWidth</em>, size_t <em>newNnz</em>, <a class="reference internal" href="#_CPPv2N6paddle15SparseValueTypeE" title="paddle::SparseValueType">SparseValueType</a> <em>valueType</em>, <a class="reference internal" href="#_CPPv2N6paddle12SparseFormatE" title="paddle::SparseFormat">SparseFormat</a> <em>format</em><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle6Matrix6resizeE6size_t6size_t6size_t15SparseValueType12SparseFormat" title="Permalink to this definition">¶</a></dt>
1855 1856 1857 1858 1859
<dd><p><dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>This should only be used for sparse matrix. </dd>
</dl>
</p>
Y
Yu Yang 已提交
1860 1861 1862
</dd></dl>

<dl class="function">
1863
<dt id="_CPPv2N6paddle6Matrix6setRowE6size_t6size_tPKjPK4real">
1864
<span id="paddle::Matrix::setRow__s.s.unsigned-iCP.realCP"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a9800da2b4a8ce1c01057dd4e2c3970b8"></span><em class="property">virtual</em> void <code class="descname">setRow</code><span class="sig-paren">(</span>size_t <em>row</em>, size_t <em>colNum</em>, <em class="property">const</em> unsigned int *<em>cols</em>, <em class="property">const</em> real *<em>values</em><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle6Matrix6setRowE6size_t6size_tPKjPK4real" title="Permalink to this definition">¶</a></dt>
1865 1866 1867 1868 1869 1870
<dd><p>This should only be used for sparse matrix. </p>
<p>Currently must be called for each row in order. The matrix is not valid until setRow is called for the last row. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix12getTransposeEv">
1871
<span id="paddle::Matrix::getTranspose"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1ad522b2d78bde26cae9c0f33ea76eee0c"></span><em class="property">virtual</em> <a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">getTranspose</code><span class="sig-paren">(</span><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle6Matrix12getTransposeEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1872 1873 1874
<dd></dd></dl>

<dl class="function">
1875
<dt id="_CPPv2N6paddle6Matrix9transposeE9MatrixPtrb">
1876
<span id="paddle::Matrix::transpose__MatrixPtr.b"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a25cab2491db8897ae00f024719f2a96c"></span><em class="property">virtual</em> void <code class="descname">transpose</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>matTrans</em>, bool <em>memAlloc</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix9transposeE9MatrixPtrb" title="Permalink to this definition">¶</a></dt>
1877 1878
<dd><p>hard transpose. </p>
<p>allocate matTrans&#8217; memory outside, then set memAlloc as false; else set as true. </p>
Y
Yu Yang 已提交
1879 1880
</dd></dl>

1881 1882 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892
<dl class="function">
<dt id="_CPPv2N6paddle6Matrix10getInverseEv">
<span id="paddle::Matrix::getInverse"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1af4f0fad1c1c4ad5020fe249e2d5b43a4"></span><em class="property">virtual</em> <a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">getInverse</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix10getInverseEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix7inverseE9MatrixPtrb">
<span id="paddle::Matrix::inverse__MatrixPtr.b"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a3679b35dd454bfb85714ac065c70c53b"></span><em class="property">virtual</em> void <code class="descname">inverse</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>matInv</em>, bool <em>memAlloc</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix7inverseE9MatrixPtrb" title="Permalink to this definition">¶</a></dt>
<dd><p>inverse. </p>
<p>if allocate matInv&#8217;s memory outside, then set memAlloc as false; else set as true. </p>
</dd></dl>

Y
Yu Yang 已提交
1893
<dl class="function">
1894
<dt id="_CPPv2N6paddle6Matrix5clearEv">
1895
<span id="paddle::Matrix::clear"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1aca8c0331ecfa2b5ad252a55d938a670f"></span><em class="property">virtual</em> void <code class="descname">clear</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix5clearEv" title="Permalink to this definition">¶</a></dt>
1896
<dd><p>Only set all variables to 0 or NULL but not free them. </p>
Y
Yu Yang 已提交
1897 1898 1899
</dd></dl>

<dl class="function">
1900 1901 1902
<dt id="_CPPv2N6Matrix7reshapeE6size_t6size_t">
<span id="Matrix::reshape__s.s"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1abc8dfa6a32628dde7add993e69af225b"></span>void <code class="descname">reshape</code><span class="sig-paren">(</span>size_t <em>height</em>, size_t <em>width</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6Matrix7reshapeE6size_t6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
Y
Yu Yang 已提交
1903 1904

<dl class="function">
1905
<dt id="_CPPv2N6paddle6Matrix7addBiasER6Matrix4real">
1906
<span id="paddle::Matrix::addBias__MatrixR.real"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1af7482755326cd9026bb6a17207a4ee22"></span><em class="property">virtual</em> void <code class="descname">addBias</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>b</em>, real <em>scale</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix7addBiasER6Matrix4real" title="Permalink to this definition">¶</a></dt>
1907
<dd><p>add b to each sample of this. </p>
Y
Yu Yang 已提交
1908 1909
</dd></dl>

1910 1911 1912 1913 1914 1915 1916 1917 1918 1919
<dl class="function">
<dt id="_CPPv2N6paddle6Matrix13addSharedBiasER6Matrix4real">
<span id="paddle::Matrix::addSharedBias__MatrixR.real"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a0badff126bc14f380b856e118f5bf038"></span><em class="property">virtual</em> void <code class="descname">addSharedBias</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>b</em>, real <em>scale</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix13addSharedBiasER6Matrix4real" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix7addBiasER6Matrix4realb">
<span id="paddle::Matrix::addBias__MatrixR.real.b"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1ab76fdd9fd57f31b90ac2cb05ff2e080f"></span><em class="property">virtual</em> void <code class="descname">addBias</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>b</em>, real <em>scale</em>, bool <em>sharedBias</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix7addBiasER6Matrix4realb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

Y
Yu Yang 已提交
1920
<dl class="function">
1921
<dt id="_CPPv2N6paddle6Matrix11collectBiasER6Matrix4real">
1922
<span id="paddle::Matrix::collectBias__MatrixR.real"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a5948cac5ff5715652491b1c729b580aa"></span><em class="property">virtual</em> void <code class="descname">collectBias</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>a</em>, real <em>scale</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix11collectBiasER6Matrix4real" title="Permalink to this definition">¶</a></dt>
1923
<dd><p>add each sample from a to this. </p>
Y
Yu Yang 已提交
1924 1925
</dd></dl>

1926 1927 1928 1929 1930 1931 1932 1933 1934 1935
<dl class="function">
<dt id="_CPPv2N6paddle6Matrix17collectSharedBiasER6Matrix4real">
<span id="paddle::Matrix::collectSharedBias__MatrixR.real"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a4259888943eb938f50364e354593ca69"></span><em class="property">virtual</em> void <code class="descname">collectSharedBias</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>a</em>, real <em>scale</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix17collectSharedBiasER6Matrix4real" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix11collectBiasER6Matrix4realb">
<span id="paddle::Matrix::collectBias__MatrixR.real.b"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a5aac6948a60273ae801baed7b15de882"></span><em class="property">virtual</em> void <code class="descname">collectBias</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>a</em>, real <em>scale</em>, bool <em>sharedBias</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix11collectBiasER6Matrix4realb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

Y
Yu Yang 已提交
1936
<dl class="function">
1937
<dt id="_CPPv2N6paddle6Matrix18sequenceAvgForwardER6MatrixRK7IVectori">
1938
<span id="paddle::Matrix::sequenceAvgForward__MatrixR.IVectorCR.i"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a9972fecfa489042ad8124ff291d03035"></span><em class="property">virtual</em> void <code class="descname">sequenceAvgForward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>a</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>startsPos</em>, int <em>mode</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix18sequenceAvgForwardER6MatrixRK7IVectori" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1939 1940 1941
<dd></dd></dl>

<dl class="function">
1942
<dt id="_CPPv2N6paddle6Matrix3mulEK9MatrixPtrK9MatrixPtr4real4real">
1943 1944
<span id="paddle::Matrix::mul__MatrixPtrC.MatrixPtrC.real.real"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a7e478eb594c0efbca130dd8ffee21ab6"></span><em class="property">virtual</em> void <code class="descname">mul</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>a</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>b</em>, real <em>scaleAB</em>, real <em>scaleT</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix3mulEK9MatrixPtrK9MatrixPtr4real4real" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">scaleAB</span><span class="o">*</span><span class="p">(</span><span class="n">a</span><span class="o">*</span><span class="n">b</span><span class="p">)</span> <span class="o">+</span> <span class="n">scaleT</span><span class="o">*</span><span class="n">this</span>
Y
Yu Yang 已提交
1945 1946
</pre></div>
</div>
1947
 </p>
Y
Yu Yang 已提交
1948 1949 1950
</dd></dl>

<dl class="function">
1951
<dt id="_CPPv2N6paddle6Matrix15addColumnVectorERK6Matrix">
1952
<span id="paddle::Matrix::addColumnVector__MatrixCR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a8017cf90c7bdcd5eb947283ee617ff40"></span><em class="property">virtual</em> void <code class="descname">addColumnVector</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix15addColumnVectorERK6Matrix" title="Permalink to this definition">¶</a></dt>
1953 1954
<dd><p>Add a vector (column) b to matrix a, column by column. </p>
</dd></dl>
Y
Yu Yang 已提交
1955 1956

<dl class="function">
1957
<dt id="_CPPv2N6paddle6Matrix12addByBitCodeE6size_tRK7IVectorRK6Matrix">
1958 1959
<span id="paddle::Matrix::addByBitCode__s.IVectorCR.MatrixCR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1af5db28eff7769d32914da55766e5f879"></span><em class="property">virtual</em> void <code class="descname">addByBitCode</code><span class="sig-paren">(</span>size_t <em>numClasses</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>codes</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>vec</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix12addByBitCodeE6size_tRK7IVectorRK6Matrix" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">For</span> <span class="n">j</span> <span class="o">&lt;</span> <span class="n">codeLength</span><span class="p">:</span>
1960 1961 1962 1963
  <span class="n">this</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">)</span> <span class="o">+=</span> <span class="n">vec</span><span class="p">(</span><span class="n">index</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">),</span> <span class="mi">0</span><span class="p">)</span>
<span class="n">where</span> <span class="n">index</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">)</span> <span class="o">=</span> <span class="p">((</span><span class="n">codes</span><span class="p">(</span><span class="n">i</span><span class="p">)</span> <span class="o">+</span> <span class="n">numClasses</span><span class="p">)</span> <span class="o">&gt;&gt;</span> <span class="p">(</span><span class="n">j</span> <span class="o">+</span> <span class="mi">1</span><span class="p">))</span> <span class="o">-</span> <span class="mi">1</span>
</pre></div>
</div>
1964
 </p>
1965
</dd></dl>
Y
Yu Yang 已提交
1966 1967

<dl class="function">
1968
<dt id="_CPPv2N6paddle6Matrix20addByBitCodeBackwardE6size_tRK7IVectorR6Matrix">
1969 1970
<span id="paddle::Matrix::addByBitCodeBackward__s.IVectorCR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a3ef12b0995a131f40058a59dce7b9b11"></span><em class="property">virtual</em> void <code class="descname">addByBitCodeBackward</code><span class="sig-paren">(</span>size_t <em>numClasses</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>codes</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>vec</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix20addByBitCodeBackwardE6size_tRK7IVectorR6Matrix" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">For</span> <span class="n">j</span> <span class="o">&lt;</span> <span class="n">codeLength</span><span class="p">:</span>
1971 1972 1973 1974
  <span class="n">vec</span><span class="p">(</span><span class="n">index</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">),</span> <span class="mi">0</span><span class="p">)</span> <span class="o">+=</span> <span class="n">this</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">)</span>
<span class="n">where</span> <span class="n">index</span> <span class="ow">is</span> <span class="n">same</span> <span class="k">as</span> <span class="n">the</span> <span class="n">index</span> <span class="k">for</span> <span class="n">addByBitCode</span>
</pre></div>
</div>
1975
 </p>
1976
</dd></dl>
Y
Yu Yang 已提交
1977 1978

<dl class="function">
1979
<dt id="_CPPv2N6paddle6Matrix12mulByBitCodeE6size_tRK7IVectorRK6MatrixRK6Matrix">
1980 1981
<span id="paddle::Matrix::mulByBitCode__s.IVectorCR.MatrixCR.MatrixCR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a48a2577bfdb79fdd67644d0123fd10df"></span><em class="property">virtual</em> void <code class="descname">mulByBitCode</code><span class="sig-paren">(</span>size_t <em>numClasses</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>codes</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>mat</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>input</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix12mulByBitCodeE6size_tRK7IVectorRK6MatrixRK6Matrix" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">For</span> <span class="n">j</span> <span class="o">&lt;</span> <span class="n">codeLength</span><span class="p">:</span>
1982 1983
  <span class="n">this</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">)</span> <span class="o">+=</span> <span class="o">&lt;</span><span class="n">mat</span><span class="o">.</span><span class="n">row</span><span class="p">(</span><span class="n">index</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">)),</span> <span class="nb">input</span><span class="o">.</span><span class="n">row</span><span class="p">(</span><span class="n">i</span><span class="p">)</span><span class="o">&gt;</span>
<span class="n">where</span> <span class="n">index</span> <span class="ow">is</span> <span class="n">same</span> <span class="k">as</span> <span class="n">the</span> <span class="n">index</span> <span class="k">for</span> <span class="n">addByBitCode</span>
Y
Yu Yang 已提交
1984 1985
</pre></div>
</div>
1986
 </p>
Y
Yu Yang 已提交
1987 1988 1989
</dd></dl>

<dl class="function">
1990
<dt id="_CPPv2N6paddle6Matrix26mulByBitCodeBackwardWeightE6size_tRK7IVectorR6MatrixRK6Matrix">
1991 1992
<span id="paddle::Matrix::mulByBitCodeBackwardWeight__s.IVectorCR.MatrixR.MatrixCR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a7ac04f922418cb9e3bd683133a3188be"></span><em class="property">virtual</em> void <code class="descname">mulByBitCodeBackwardWeight</code><span class="sig-paren">(</span>size_t <em>numClasses</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>codes</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>mat</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>input</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix26mulByBitCodeBackwardWeightE6size_tRK7IVectorR6MatrixRK6Matrix" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">For</span> <span class="n">j</span> <span class="o">&lt;</span> <span class="n">codeLength</span><span class="p">:</span>
1993 1994
  <span class="n">mat</span><span class="o">.</span><span class="n">row</span><span class="p">(</span><span class="n">index</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">))</span> <span class="o">+=</span> <span class="n">this</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">)</span> <span class="o">*</span> <span class="nb">input</span><span class="o">.</span><span class="n">row</span><span class="p">(</span><span class="n">i</span><span class="p">)</span>
<span class="n">where</span> <span class="n">index</span> <span class="ow">is</span> <span class="n">same</span> <span class="k">as</span> <span class="n">the</span> <span class="n">index</span> <span class="k">for</span> <span class="n">addByBitCode</span>
Y
Yu Yang 已提交
1995 1996
</pre></div>
</div>
1997
 </p>
Y
Yu Yang 已提交
1998 1999 2000
</dd></dl>

<dl class="function">
2001
<dt id="_CPPv2N6paddle6Matrix25mulByBitCodeBackwardErrorE6size_tRK7IVectorRK6MatrixR6Matrix">
2002 2003
<span id="paddle::Matrix::mulByBitCodeBackwardError__s.IVectorCR.MatrixCR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a243bd2c96ef914a01a45eb5192e285f5"></span><em class="property">virtual</em> void <code class="descname">mulByBitCodeBackwardError</code><span class="sig-paren">(</span>size_t <em>numClasses</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>codes</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>mat</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>input</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix25mulByBitCodeBackwardErrorE6size_tRK7IVectorRK6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">For</span> <span class="n">j</span> <span class="o">&lt;</span> <span class="n">codeLength</span><span class="p">:</span>
2004 2005
  <span class="nb">input</span><span class="o">.</span><span class="n">row</span><span class="p">(</span><span class="n">i</span><span class="p">)</span> <span class="o">+=</span> <span class="n">this</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">)</span> <span class="o">*</span> <span class="n">mat</span><span class="o">.</span><span class="n">row</span><span class="p">(</span><span class="n">index</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">))</span>
<span class="n">where</span> <span class="n">index</span> <span class="ow">is</span> <span class="n">same</span> <span class="k">as</span> <span class="n">the</span> <span class="n">index</span> <span class="k">for</span> <span class="n">addByBitCode</span>
Y
Yu Yang 已提交
2006 2007
</pre></div>
</div>
2008
 </p>
Y
Yu Yang 已提交
2009 2010 2011
</dd></dl>

<dl class="function">
2012
<dt id="_CPPv2N6paddle6Matrix12sumByBitCodeE6size_tR7IVectorR6Matrix4real">
2013 2014
<span id="paddle::Matrix::sumByBitCode__s.IVectorR.MatrixR.real"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a392403a8498bc2e3c636e0bc72fd089c"></span><em class="property">virtual</em> void <code class="descname">sumByBitCode</code><span class="sig-paren">(</span>size_t <em>numClasses</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>codes</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>sum</em>, real <em>scaleSum</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix12sumByBitCodeE6size_tR7IVectorR6Matrix4real" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span>For j &lt; codeLength
2015 2016
  sum(i, 0) = scaleSum * \sum_j  bit(i, j) * this(i, j)
where bit(i, j) = ((codes(i) + numClasses) &amp; 2^j) ? 1 : 0
Y
Yu Yang 已提交
2017 2018
</pre></div>
</div>
2019
 </p>
Y
Yu Yang 已提交
2020 2021 2022
</dd></dl>

<dl class="function">
2023
<dt id="_CPPv2N6paddle6Matrix12subByBitCodeE6size_tR7IVector">
2024 2025
<span id="paddle::Matrix::subByBitCode__s.IVectorR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a2a3f3386f54fba1959566a046053ee9f"></span><em class="property">virtual</em> void <code class="descname">subByBitCode</code><span class="sig-paren">(</span>size_t <em>numClasses_</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>codes</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix12subByBitCodeE6size_tR7IVector" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">For</span> <span class="n">j</span> <span class="o">&lt;</span> <span class="n">codeLength</span>
2026 2027
 <span class="n">this</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">)</span> <span class="o">-=</span> <span class="n">bit</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">)</span>
<span class="n">where</span> <span class="n">bit</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">)</span> <span class="ow">is</span> <span class="n">same</span> <span class="k">as</span> <span class="n">that</span> <span class="k">for</span> <span class="n">sumByBitCode</span>
Y
Yu Yang 已提交
2028 2029
</pre></div>
</div>
2030
 </p>
Y
Yu Yang 已提交
2031 2032 2033
</dd></dl>

<dl class="function">
2034
<dt id="_CPPv2N6paddle6Matrix6rowSumER6Matrix">
2035
<span id="paddle::Matrix::rowSum__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1aac84337da8ed13474d9f8366fa8890da"></span><em class="property">virtual</em> void <code class="descname">rowSum</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>sum</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix6rowSumER6Matrix" title="Permalink to this definition">¶</a></dt>
2036
<dd><p>add the sum of each row of this to mat </p>
Y
Yu Yang 已提交
2037 2038 2039
</dd></dl>

<dl class="function">
2040
<dt id="_CPPv2N6paddle6Matrix6rowMaxER6Matrix">
2041
<span id="paddle::Matrix::rowMax__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a7bc5f6706454830f800fb91ced413eb0"></span><em class="property">virtual</em> void <code class="descname">rowMax</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>max</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix6rowMaxER6Matrix" title="Permalink to this definition">¶</a></dt>
2042
<dd><p>set the max of each row of this to mat </p>
Y
Yu Yang 已提交
2043 2044 2045
</dd></dl>

<dl class="function">
2046
<dt id="_CPPv2N6paddle6Matrix6colMaxER6Matrix">
2047 2048 2049 2050 2051 2052 2053 2054 2055 2056 2057 2058 2059 2060 2061 2062 2063 2064 2065
<span id="paddle::Matrix::colMax__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1ac89c66983c6376c64d468a2e47890a8d"></span><em class="property">virtual</em> void <code class="descname">colMax</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>max</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix6colMaxER6Matrix" title="Permalink to this definition">¶</a></dt>
<dd><p>set the max of each column of this to mat </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix6colMaxER7IVectorR6Matrix">
<span id="paddle::Matrix::colMax__IVectorR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a946a1df809f7067a468d7cd835dddc90"></span><em class="property">virtual</em> void <code class="descname">colMax</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>maxIds</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>maxVal</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix6colMaxER7IVectorR6Matrix" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the top k elements of each column of this matrix. </p>
<p>The row ids and values of these elements are stored in maxIds and max respectively. where k is the size of maxIds. And note that the top k elements are not sorted. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix13maxoutForwardER6MatrixR7IVector6size_t6size_t">
<span id="paddle::Matrix::maxoutForward__MatrixR.IVectorR.s.s"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a6ba3527c4fbea9e70b3e79cc4279d379"></span><em class="property">virtual</em> void <code class="descname">maxoutForward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>a</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>id</em>, size_t <em>channels</em>, size_t <em>groups</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix13maxoutForwardER6MatrixR7IVector6size_t6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix14maxoutBackwardER6MatrixR7IVector6size_t6size_t">
<span id="paddle::Matrix::maxoutBackward__MatrixR.IVectorR.s.s"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a7f56ce9593dba387c49c5a182b2ed750"></span><em class="property">virtual</em> void <code class="descname">maxoutBackward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>a</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>id</em>, size_t <em>channels</em>, size_t <em>groups</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix14maxoutBackwardER6MatrixR7IVector6size_t6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2066 2067 2068
<dd></dd></dl>

<dl class="function">
2069
<dt id="_CPPv2N6paddle6Matrix8rowMaxIdER7IVector">
2070
<span id="paddle::Matrix::rowMaxId__IVectorR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a735ca6afdf370bcd9ebb651c539c619a"></span><em class="property">virtual</em> void <code class="descname">rowMaxId</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>maxIds</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix8rowMaxIdER7IVector" title="Permalink to this definition">¶</a></dt>
2071
<dd></dd></dl>
Y
Yu Yang 已提交
2072 2073

<dl class="function">
2074
<dt id="_CPPv2N6paddle6Matrix6rowMaxER7IVectorR6Matrix">
2075
<span id="paddle::Matrix::rowMax__IVectorR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a6c3aca70393342be128eab1f2e6dc379"></span><em class="property">virtual</em> void <code class="descname">rowMax</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>maxIds</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>max</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix6rowMaxER7IVectorR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2076
<dd><p>Get the top k elements of each row of this matrix. </p>
2077
<p>The column ids and values of these elements are stored in maxIds and max respectively. where k is the size of maxIds. And note that the top k elements are not sorted. </p>
Y
Yu Yang 已提交
2078 2079 2080
</dd></dl>

<dl class="function">
2081
<dt id="_CPPv2N6paddle6Matrix14rowNormalizeL1ER6Matrix">
2082
<span id="paddle::Matrix::rowNormalizeL1__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a0f5c441da732275ade1b23ca1e0de497"></span><em class="property">virtual</em> void <code class="descname">rowNormalizeL1</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>out</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix14rowNormalizeL1ER6Matrix" title="Permalink to this definition">¶</a></dt>
2083 2084
<dd><p>normalize each row so that the sum of each row is 1. </p>
</dd></dl>
Y
Yu Yang 已提交
2085 2086

<dl class="function">
2087
<dt id="_CPPv2N6paddle6Matrix3mulEK9MatrixPtrK9MatrixPtr">
2088 2089
<span id="paddle::Matrix::mul__MatrixPtrC.MatrixPtrC"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1aeaabdfe815ca3ea45c0c8b4a43f034be"></span><em class="property">virtual</em> void <code class="descname">mul</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>a</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix3mulEK9MatrixPtrK9MatrixPtr" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">a</span><span class="o">*</span><span class="n">b</span>
2090 2091
</pre></div>
</div>
2092
 </p>
Y
Yu Yang 已提交
2093 2094 2095
</dd></dl>

<dl class="function">
2096
<dt id="_CPPv2N6paddle6Matrix8rightMulER6Matrix4real4real">
2097 2098
<span id="paddle::Matrix::rightMul__MatrixR.real.real"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1aa40dfdc4a16aa02fd756382f317675e8"></span><em class="property">virtual</em> void <code class="descname">rightMul</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>b</em>, real <em>scaleAB</em>, real <em>scaleT</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix8rightMulER6Matrix4real4real" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">scaleAB</span><span class="o">*</span><span class="p">(</span><span class="n">this</span><span class="o">*</span><span class="n">b</span><span class="p">)</span> <span class="o">+</span>  <span class="n">scaleT</span><span class="o">*</span><span class="n">this</span>
2099 2100
</pre></div>
</div>
2101
 </p>
2102 2103 2104 2105
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix8rightMulER6Matrix">
2106 2107
<span id="paddle::Matrix::rightMul__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1aa07beb8c8f64b502490d9f0e1210bd06"></span><em class="property">virtual</em> void <code class="descname">rightMul</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix8rightMulER6Matrix" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">this</span><span class="o">*</span> <span class="n">b</span>
2108 2109
</pre></div>
</div>
2110
 </p>
2111 2112 2113 2114
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix7leftMulER6Matrix4real4real">
2115 2116
<span id="paddle::Matrix::leftMul__MatrixR.real.real"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a02e0165c26f9401f2e674ab009f9b641"></span><em class="property">virtual</em> void <code class="descname">leftMul</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>a</em>, real <em>scaleAB</em>, real <em>scaleT</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix7leftMulER6Matrix4real4real" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">scaleAB</span><span class="o">*</span><span class="p">(</span><span class="n">a</span><span class="o">*</span><span class="n">this</span><span class="p">)</span> <span class="o">+</span>  <span class="n">scaleT</span><span class="o">*</span><span class="n">this</span>
2117 2118
</pre></div>
</div>
2119
 </p>
2120 2121 2122 2123
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix7leftMulER6Matrix">
2124 2125
<span id="paddle::Matrix::leftMul__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a12aac0ed9bde92d42e078d3514ca3651"></span><em class="property">virtual</em> void <code class="descname">leftMul</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>a</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix7leftMulER6Matrix" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">a</span><span class="o">*</span><span class="n">this</span><span class="p">)</span>
2126 2127
</pre></div>
</div>
2128
 </p>
2129 2130 2131 2132
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix8colMergeER6Matrix">
2133
<span id="paddle::Matrix::colMerge__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a033fe5634175ac6fecc55633071c0ece"></span><em class="property">virtual</em> void <code class="descname">colMerge</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>src</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix8colMergeER6Matrix" title="Permalink to this definition">¶</a></dt>
2134 2135 2136 2137 2138
<dd><p>merge the element for each col. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix18oneHotCrossEntropyER6MatrixR7IVector">
2139
<span id="paddle::Matrix::oneHotCrossEntropy__MatrixR.IVectorR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1abb4da07da47394cf3838028c55e67d43"></span><em class="property">virtual</em> void <code class="descname">oneHotCrossEntropy</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>label</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix18oneHotCrossEntropyER6MatrixR7IVector" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2140 2141 2142 2143
<dd><p>copy -log(output[label]) to this-&gt;data[i]. </p>
</dd></dl>

<dl class="function">
2144
<dt id="_CPPv2N6paddle6Matrix20oneHotCrossEntropyBpER6MatrixR7IVector">
2145
<span id="paddle::Matrix::oneHotCrossEntropyBp__MatrixR.IVectorR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a5d9ee3cd2503c63cb802c0a3b3500b93"></span><em class="property">virtual</em> void <code class="descname">oneHotCrossEntropyBp</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outputV</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>label</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix20oneHotCrossEntropyBpER6MatrixR7IVector" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2146 2147 2148 2149
<dd><p>calculate the error of outputV according to label. </p>
</dd></dl>

<dl class="function">
2150
<dt id="_CPPv2N6paddle6Matrix30oneHotCrossEntropyWithSelfNormER6MatrixR7IVector4real">
2151
<span id="paddle::Matrix::oneHotCrossEntropyWithSelfNorm__MatrixR.IVectorR.real"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1abff1991cd2e3ff1bda273e2df15c7921"></span><em class="property">virtual</em> void <code class="descname">oneHotCrossEntropyWithSelfNorm</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>label</em>, real <em>alpha</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix30oneHotCrossEntropyWithSelfNormER6MatrixR7IVector4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2152 2153 2154 2155
<dd><p>copy -log(output[label]) to this-&gt;data[i]. </p>
</dd></dl>

<dl class="function">
2156
<dt id="_CPPv2N6paddle6Matrix32oneHotCrossEntropyWithSelfNormBpER6MatrixR7IVector4real">
2157
<span id="paddle::Matrix::oneHotCrossEntropyWithSelfNormBp__MatrixR.IVectorR.real"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a7ce5dd378e7c007b80a4e6ba186dea3c"></span><em class="property">virtual</em> void <code class="descname">oneHotCrossEntropyWithSelfNormBp</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outputV</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>label</em>, real <em>alpha</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix32oneHotCrossEntropyWithSelfNormBpER6MatrixR7IVector4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2158 2159 2160 2161
<dd><p>calculate the error of outputV according to label. </p>
</dd></dl>

<dl class="function">
2162
<dt id="_CPPv2N6paddle6Matrix12circularConvER6MatrixR6Matrix">
2163
<span id="paddle::Matrix::circularConv__MatrixR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a9966cc1fe5b7097f59fc0b32f40d2923"></span><em class="property">virtual</em> void <code class="descname">circularConv</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>c</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix12circularConvER6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2164 2165 2166 2167 2168 2169 2170
<dd><p><div class="math">
\[ a[i] = \sum_{j=-(N-1)/2}^{(N-1)/2} b_{i+j} * c_{j} \]</div>
</p>
<p>b contains M elements, c contains N elements (N is odd), b&#8217;s index arithmetic is computed modulo M, c&#8217;s index arithmetic is computed modulo N. </p>
</dd></dl>

<dl class="function">
2171
<dt id="_CPPv2N6paddle6Matrix22circularConvDerivativeER6MatrixR6MatrixR6MatrixR6MatrixR6Matrix">
2172
<span id="paddle::Matrix::circularConvDerivative__MatrixR.MatrixR.MatrixR.MatrixR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1aa8379ed7d2e6dbe8789f81288c1a2044"></span><em class="property">virtual</em> void <code class="descname">circularConvDerivative</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>prevOut1</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>prevOut2</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>prevGrad1</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>prevGrad2</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix22circularConvDerivativeER6MatrixR6MatrixR6MatrixR6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2173 2174 2175
<dd></dd></dl>

<dl class="function">
2176
<dt id="_CPPv2N6paddle6Matrix7softmaxER6Matrix">
2177
<span id="paddle::Matrix::softmax__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a46e6094cb4d7572ff9cd87ca977935b1"></span><em class="property">virtual</em> void <code class="descname">softmax</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix7softmaxER6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2178 2179 2180
<dd></dd></dl>

<dl class="function">
2181
<dt id="_CPPv2N6paddle6Matrix15sequenceSoftmaxER6MatrixRK7IVector">
2182
<span id="paddle::Matrix::sequenceSoftmax__MatrixR.IVectorCR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1aec1227f84891a056845bce5886ee9ffa"></span><em class="property">virtual</em> void <code class="descname">sequenceSoftmax</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>index</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix15sequenceSoftmaxER6MatrixRK7IVector" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2183 2184 2185
<dd></dd></dl>

<dl class="function">
2186
<dt id="_CPPv2N6paddle6Matrix15softmaxBackwardER6Matrix">
2187
<span id="paddle::Matrix::softmaxBackward__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a880e9ddfb13d0e5aaf7d0cfa0d8d620e"></span><em class="property">virtual</em> void <code class="descname">softmaxBackward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outputV</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix15softmaxBackwardER6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2188 2189 2190
<dd></dd></dl>

<dl class="function">
2191
<dt id="_CPPv2N6paddle6Matrix17softmaxDerivativeER6MatrixR6Matrix">
2192
<span id="paddle::Matrix::softmaxDerivative__MatrixR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a3d6701b1ace72fb1f47ec7f3f314158c"></span><em class="property">virtual</em> void <code class="descname">softmaxDerivative</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>sftmaxSum</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix17softmaxDerivativeER6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
2193 2194 2195 2196
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix12sumOfSquaresER6MatrixR6Matrix">
2197
<span id="paddle::Matrix::sumOfSquares__MatrixR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a9615bebedd8189b4d63a963d9d4c9924"></span><em class="property">virtual</em> void <code class="descname">sumOfSquares</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>label</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix12sumOfSquaresER6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2198 2199 2200 2201
<dd><p>calculate the sum of squares diff cost. </p>
</dd></dl>

<dl class="function">
2202
<dt id="_CPPv2N6paddle6Matrix14sumOfSquaresBpER6MatrixR6Matrix">
2203
<span id="paddle::Matrix::sumOfSquaresBp__MatrixR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a3e76f6f5f8b70306b66e1e0749c28193"></span><em class="property">virtual</em> void <code class="descname">sumOfSquaresBp</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outputV</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>label</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix14sumOfSquaresBpER6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2204 2205 2206 2207
<dd><p>gradient of sumOfSquares. </p>
</dd></dl>

<dl class="function">
2208
<dt id="_CPPv2N6paddle6Matrix4tanhER6Matrix">
2209
<span id="paddle::Matrix::tanh__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1ab4f85947a86a348fa82f099360df4134"></span><em class="property">virtual</em> void <code class="descname">tanh</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix4tanhER6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2210 2211 2212
<dd></dd></dl>

<dl class="function">
2213
<dt id="_CPPv2N6paddle6Matrix14tanhDerivativeER6Matrix">
2214
<span id="paddle::Matrix::tanhDerivative__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a1c292dcf153564e9fc01c79afbc7caf7"></span><em class="property">virtual</em> void <code class="descname">tanhDerivative</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix14tanhDerivativeER6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2215 2216 2217
<dd></dd></dl>

<dl class="function">
2218
<dt id="_CPPv2N6paddle6Matrix8softreluER6Matrix">
2219
<span id="paddle::Matrix::softrelu__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a4f93fd82494a81f0e3473044c96229bf"></span><em class="property">virtual</em> void <code class="descname">softrelu</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix8softreluER6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2220 2221 2222
<dd></dd></dl>

<dl class="function">
2223
<dt id="_CPPv2N6paddle6Matrix18softreluDerivativeER6Matrix">
2224
<span id="paddle::Matrix::softreluDerivative__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1aecfae4c512544f35970be91c84e9cc04"></span><em class="property">virtual</em> void <code class="descname">softreluDerivative</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix18softreluDerivativeER6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2225 2226 2227
<dd></dd></dl>

<dl class="function">
2228
<dt id="_CPPv2N6paddle6Matrix10scaledTanhER6Matrix4real4real">
2229
<span id="paddle::Matrix::scaledTanh__MatrixR.real.real"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1aa4cb8e38ef9a14a7252baca5985c949e"></span><em class="property">virtual</em> void <code class="descname">scaledTanh</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, real <em>p1</em>, real <em>p2</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix10scaledTanhER6Matrix4real4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2230 2231 2232
<dd></dd></dl>

<dl class="function">
2233
<dt id="_CPPv2N6paddle6Matrix6cosSimER6MatrixR6Matrix4real">
2234
<span id="paddle::Matrix::cosSim__MatrixR.MatrixR.real"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1adb09b0d6750e56844a30eed2fd0f9252"></span><em class="property">virtual</em> void <code class="descname">cosSim</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output1</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output2</em>, real <em>scale</em> = 1.0f<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix6cosSimER6MatrixR6Matrix4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2235 2236 2237 2238 2239
<dd><p>cosine similarity, for each row i, this[i] = cos(output1[i], output2[i])</p>
<p>output2 can only have one row, then for each row i, this[i] = cos(output1[i], output2[0]) </p>
</dd></dl>

<dl class="function">
2240
<dt id="_CPPv2N6paddle6Matrix16cosSimDerivativeER6MatrixR6MatrixR6MatrixR6MatrixR6Matrix4real">
2241
<span id="paddle::Matrix::cosSimDerivative__MatrixR.MatrixR.MatrixR.MatrixR.MatrixR.real"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a0518c3f43aa8df86657b587b892e236b"></span><em class="property">virtual</em> void <code class="descname">cosSimDerivative</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>prevOut1</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>prevOut2</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>prevGrad1</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>prevGrad2</em>, real <em>scale</em> = 1.0f<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix16cosSimDerivativeER6MatrixR6MatrixR6MatrixR6MatrixR6Matrix4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2242 2243 2244
<dd></dd></dl>

<dl class="function">
2245 2246
<dt id="_CPPv2NK6paddle6Matrix5printERNSt7ostreamE">
<span id="paddle::Matrix::print__osRC"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1aa6ae154763c7a08df663e42b62bd1315"></span><em class="property">virtual</em> void <code class="descname">print</code><span class="sig-paren">(</span>std::ostream &amp;<em>os</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle6Matrix5printERNSt7ostreamE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2247 2248 2249 2250
<dd><p>print out the values of elements to os </p>
</dd></dl>

<dl class="function">
2251 2252
<dt id="_CPPv2NK6paddle6Matrix5printERNSt7ostreamE6size_t6size_t">
<span id="paddle::Matrix::print__osR.s.sC"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a62d3d13fe13596f7711e09790df637c8"></span><em class="property">virtual</em> void <code class="descname">print</code><span class="sig-paren">(</span>std::ostream &amp;<em>os</em>, size_t <em>height</em>, size_t <em>width</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle6Matrix5printERNSt7ostreamE6size_t6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2253 2254 2255 2256
<dd><p>print a part of the matrix from the (top,left) value to the (height, width) value (not included) </p>
</dd></dl>

<dl class="function">
2257 2258
<dt id="_CPPv2NK6paddle6Matrix11printOneRowERNSt7ostreamE6size_t">
<span id="paddle::Matrix::printOneRow__osR.sC"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a9b6d9d095ec62d82dc146bcd9b3686de"></span><em class="property">virtual</em> void <code class="descname">printOneRow</code><span class="sig-paren">(</span>std::ostream &amp;<em>os</em>, size_t <em>idx</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle6Matrix11printOneRowERNSt7ostreamE6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2259 2260 2261 2262
<dd><p>print one row to os </p>
</dd></dl>

<dl class="function">
2263
<dt id="_CPPv2N6paddle6Matrix5checkERNSt7ostreamER6Matrixb">
2264
<span id="paddle::Matrix::check__osR.MatrixR.b"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1aaf09e3126318e7102743d53030f0a0da"></span><em class="property">virtual</em> void <code class="descname">check</code><span class="sig-paren">(</span>std::ostream &amp;<em>os</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>refMat</em>, bool <em>printDiff</em> = true<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix5checkERNSt7ostreamER6Matrixb" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2265 2266 2267
<dd></dd></dl>

<dl class="function">
2268
<dt id="_CPPv2N6paddle6Matrix6getMinEv">
2269
<span id="paddle::Matrix::getMin"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a4de1b6d95d798b723b894347920dbcaa"></span><em class="property">virtual</em> real <code class="descname">getMin</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix6getMinEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2270 2271 2272
<dd></dd></dl>

<dl class="function">
2273
<dt id="_CPPv2N6paddle6Matrix6getMaxEv">
2274
<span id="paddle::Matrix::getMax"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a61e9189a777c55dd5f3740ebe99d9b71"></span><em class="property">virtual</em> real <code class="descname">getMax</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix6getMaxEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2275 2276 2277
<dd></dd></dl>

<dl class="function">
2278
<dt id="_CPPv2N6paddle6Matrix16randomizeUniformEv">
2279
<span id="paddle::Matrix::randomizeUniform"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1ab5f9f4e639704eb3b45893753fc6f7ca"></span><em class="property">virtual</em> void <code class="descname">randomizeUniform</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix16randomizeUniformEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2280 2281 2282
<dd></dd></dl>

<dl class="function">
2283
<dt id="_CPPv2N6paddle6Matrix19classificationErrorE9MatrixPtr10IVectorPtr">
2284
<span id="paddle::Matrix::classificationError__MatrixPtr.IVectorPtr"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a140b3882d42203bf343118d10cd4d76c"></span><em class="property">virtual</em> void <code class="descname">classificationError</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>output</em>, <a class="reference internal" href="#_CPPv2N6paddle10IVectorPtrE" title="paddle::IVectorPtr">IVectorPtr</a> <em>label</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix19classificationErrorE9MatrixPtr10IVectorPtr" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2285 2286 2287 2288 2289 2290
<dd><p>calulate the error of classification </p>
<p>output[i] = 1 if row i is an error.</p>
<p>output[i] = 0 if row i is correct. </p>
</dd></dl>

<dl class="function">
2291
<dt id="_CPPv2N6paddle6Matrix10convExpandER6Matrixiiiiiiiiiii">
2292
<span id="paddle::Matrix::convExpand__MatrixR.i.i.i.i.i.i.i.i.i.i.i"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1afcd4bb1a5e85eb771855f76d39c53935"></span><em class="property">virtual</em> void <code class="descname">convExpand</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>feature</em>, int <em>feaImgHeight</em>, int <em>feaImgWidth</em>, int <em>channels</em>, int <em>blockH</em>, int <em>blockW</em>, int <em>strideH</em>, int <em>strideW</em>, int <em>paddingH</em>, int <em>paddingW</em>, int <em>outputH</em>, int <em>outputW</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix10convExpandER6Matrixiiiiiiiiiii" title="Permalink to this definition">¶</a></dt>
2293 2294
<dd><p>This function is used to calculate the convolution:</p>
<p>It will expand a feature matrix according to the convolution filters </p>
Y
Yu Yang 已提交
2295 2296 2297
</dd></dl>

<dl class="function">
2298
<dt id="_CPPv2N6paddle6Matrix10convShrinkER6Matrixiiiiiiiiiii4real4real">
2299
<span id="paddle::Matrix::convShrink__MatrixR.i.i.i.i.i.i.i.i.i.i.i.real.real"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1ad17a7829868f628d625d5cd5ae0ed6fd"></span><em class="property">virtual</em> void <code class="descname">convShrink</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>expandColMat</em>, int <em>thisImgHeight</em>, int <em>thisImgWidth</em>, int <em>channels</em>, int <em>blockH</em>, int <em>blockW</em>, int <em>strideH</em>, int <em>strideW</em>, int <em>paddingH</em>, int <em>paddingW</em>, int <em>outputH</em>, int <em>outputW</em>, real <em>alpha</em> = 1.0f, real <em>beta</em> = 0.0f<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix10convShrinkER6Matrixiiiiiiiiiii4real4real" title="Permalink to this definition">¶</a></dt>
2300 2301
<dd><p>This function is the reverse implementation of convExpand:</p>
<p>Its function is to restore a expanded-matrix into a feature matrix </p>
Y
Yu Yang 已提交
2302 2303 2304
</dd></dl>

<dl class="function">
2305 2306
<dt id="_CPPv2N6paddle6Matrix14maxPoolForwardER6Matrix6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t">
<span id="paddle::Matrix::maxPoolForward__MatrixR.s.s.s.s.s.s.s.s.s.s.s"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1afb881a111e85c482e5542c5f04cfe353"></span><em class="property">virtual</em> void <code class="descname">maxPoolForward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>inputMat</em>, size_t <em>imgSizeH</em>, size_t <em>imgSizeW</em>, size_t <em>channels</em>, size_t <em>sizeX</em>, size_t <em>sizeY</em>, size_t <em>strideH</em>, size_t <em>strideW</em>, size_t <em>outputH</em>, size_t <em>outputW</em>, size_t <em>paddingH</em>, size_t <em>paddingW</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix14maxPoolForwardER6Matrix6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t" title="Permalink to this definition">¶</a></dt>
2307
<dd><p>Pooling forward operation, pick out the largest element in the sizeX of value </p>
Y
Yu Yang 已提交
2308 2309 2310
</dd></dl>

<dl class="function">
2311 2312
<dt id="_CPPv2N6paddle6Matrix15maxPoolBackwardER6Matrix6size_t6size_tR6MatrixR6Matrix6size_t6size_t6size_t6size_t6size_t6size_t4real4real6size_t6size_t">
<span id="paddle::Matrix::maxPoolBackward__MatrixR.s.s.MatrixR.MatrixR.s.s.s.s.s.s.real.real.s.s"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a401f06ce97e359b8f1c0e4a4f0d24b14"></span><em class="property">virtual</em> void <code class="descname">maxPoolBackward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>image</em>, size_t <em>imgSizeH</em>, size_t <em>imgSizeW</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outGrad</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outV</em>, size_t <em>sizeX</em>, size_t <em>sizeY</em>, size_t <em>strideH</em>, size_t <em>strideW</em>, size_t <em>outputH</em>, size_t <em>outputW</em>, real <em>scaleTargets</em>, real <em>scaleOutput</em>, size_t <em>paddingH</em>, size_t <em>paddingW</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix15maxPoolBackwardER6Matrix6size_t6size_tR6MatrixR6Matrix6size_t6size_t6size_t6size_t6size_t6size_t4real4real6size_t6size_t" title="Permalink to this definition">¶</a></dt>
2313
<dd><p>Pooling backward operation. </p>
Y
Yu Yang 已提交
2314 2315 2316
</dd></dl>

<dl class="function">
2317 2318
<dt id="_CPPv2N6paddle6Matrix14avgPoolForwardER6Matrix6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t">
<span id="paddle::Matrix::avgPoolForward__MatrixR.s.s.s.s.s.s.s.s.s.s.s"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a438160b40b392a0ada4c26f1e41fb2a4"></span><em class="property">virtual</em> void <code class="descname">avgPoolForward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>input</em>, size_t <em>imgSizeH</em>, size_t <em>imgSizeW</em>, size_t <em>channels</em>, size_t <em>sizeX</em>, size_t <em>sizeY</em>, size_t <em>strideH</em>, size_t <em>strideW</em>, size_t <em>outputH</em>, size_t <em>outputW</em>, size_t <em>paddingH</em>, size_t <em>paddingW</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix14avgPoolForwardER6Matrix6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t" title="Permalink to this definition">¶</a></dt>
2319
<dd><p>Pooling forward operation, caculate the average of sizeX elements. </p>
Y
Yu Yang 已提交
2320 2321 2322
</dd></dl>

<dl class="function">
2323 2324
<dt id="_CPPv2N6paddle6Matrix15avgPoolBackwardER6Matrix6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t4real4real6size_t6size_t">
<span id="paddle::Matrix::avgPoolBackward__MatrixR.s.s.s.s.s.s.s.s.real.real.s.s"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1ad0d7b0142b5ff6cdba5850c44adebcf6"></span><em class="property">virtual</em> void <code class="descname">avgPoolBackward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>input</em>, size_t <em>imgSizeH</em>, size_t <em>imgSizeW</em>, size_t <em>sizeX</em>, size_t <em>sizeY</em>, size_t <em>strideH</em>, size_t <em>strideW</em>, size_t <em>outputH</em>, size_t <em>outputW</em>, real <em>scaleTargets</em>, real <em>scaleOutput</em>, size_t <em>paddingH</em>, size_t <em>paddingW</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix15avgPoolBackwardER6Matrix6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t4real4real6size_t6size_t" title="Permalink to this definition">¶</a></dt>
2325
<dd></dd></dl>
Y
Yu Yang 已提交
2326 2327

<dl class="function">
2328
<dt id="_CPPv2N6paddle6Matrix17crossMapNormalFwdER6Matrix6size_t6size_tR6Matrix6size_t6size_tff">
2329
<span id="paddle::Matrix::crossMapNormalFwd__MatrixR.s.s.MatrixR.s.s.float.float"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a0d474f8284d8973bd37eb3a70abe31b5"></span><em class="property">virtual</em> void <code class="descname">crossMapNormalFwd</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>input</em>, size_t <em>imgSizeH</em>, size_t <em>imgSizeW</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>denoms</em>, size_t <em>channels</em>, size_t <em>sizeX</em>, float <em>scale</em>, float <em>pow</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix17crossMapNormalFwdER6Matrix6size_t6size_tR6Matrix6size_t6size_tff" title="Permalink to this definition">¶</a></dt>
2330
<dd><p>normalize-operation. </p>
Y
Yu Yang 已提交
2331 2332 2333
</dd></dl>

<dl class="function">
2334
<dt id="_CPPv2N6paddle6Matrix17crossMapNormalBwdER6MatrixR6MatrixR6MatrixR6Matrix6size_t6size_t6size_t6size_tff">
2335
<span id="paddle::Matrix::crossMapNormalBwd__MatrixR.MatrixR.MatrixR.MatrixR.s.s.s.s.float.float"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a04e9a8320a4e36ff2f3949a3015427c3"></span><em class="property">virtual</em> void <code class="descname">crossMapNormalBwd</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>localGrad</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>denoms</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>preOutV</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>localOutV</em>, size_t <em>channels</em>, size_t <em>imgSizeH</em>, size_t <em>imgSizeW</em>, size_t <em>size</em>, float <em>scale</em>, float <em>pow</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix17crossMapNormalBwdER6MatrixR6MatrixR6MatrixR6Matrix6size_t6size_t6size_t6size_tff" title="Permalink to this definition">¶</a></dt>
2336 2337 2338 2339
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix18maxSequenceForwardER6MatrixRK7IVectorR7IVector">
2340
<span id="paddle::Matrix::maxSequenceForward__MatrixR.IVectorCR.IVectorR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a06bb9c7e4d1512b44e9e14687e91cef2"></span><em class="property">virtual</em> void <code class="descname">maxSequenceForward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>input</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>sequence</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>index</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix18maxSequenceForwardER6MatrixRK7IVectorR7IVector" title="Permalink to this definition">¶</a></dt>
2341 2342 2343
<dd><p>Input: one or more sequences. Each sequence contains some instances.</p>
<p>Output: output size is the number of input sequences (NOT input instances).</p>
<p>output[i] is set to max_input[i]. </p>
Y
Yu Yang 已提交
2344 2345 2346
</dd></dl>

<dl class="function">
2347
<dt id="_CPPv2N6paddle6Matrix19maxSequenceBackwardER6MatrixRK7IVectorR7IVector">
2348
<span id="paddle::Matrix::maxSequenceBackward__MatrixR.IVectorCR.IVectorR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a93c2dd752b6628796a83c5aeaf8a5bf4"></span><em class="property">virtual</em> void <code class="descname">maxSequenceBackward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outputGrad</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>sequence</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>index</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix19maxSequenceBackwardER6MatrixRK7IVectorR7IVector" title="Permalink to this definition">¶</a></dt>
2349 2350 2351 2352
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix24contextProjectionForwardE9MatrixPtr9MatrixPtrRK7IVectorii6size_tb">
2353
<span id="paddle::Matrix::contextProjectionForward__MatrixPtr.MatrixPtr.IVectorCR.i.i.s.b"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a9b52b8eaca408d54fcc76d53e0d936b5"></span><em class="property">virtual</em> void <code class="descname">contextProjectionForward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>input</em>, <a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>weight</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>sequence</em>, int <em>contextLength</em>, int <em>contextStart</em>, size_t <em>beginPad</em>, bool <em>isPadding</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix24contextProjectionForwardE9MatrixPtr9MatrixPtrRK7IVectorii6size_tb" title="Permalink to this definition">¶</a></dt>
2354 2355 2356 2357
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix25contextProjectionBackwardE9MatrixPtr9MatrixPtrRK7IVectorii6size_tb">
2358
<span id="paddle::Matrix::contextProjectionBackward__MatrixPtr.MatrixPtr.IVectorCR.i.i.s.b"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a0a364ab1d7d16ef5ec53cb8fc65e0f72"></span><em class="property">virtual</em> void <code class="descname">contextProjectionBackward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>inputGrad</em>, <a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>weightGrad</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>sequence</em>, int <em>contextLength</em>, int <em>contextStart</em>, size_t <em>beginPad</em>, bool <em>isPadding</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix25contextProjectionBackwardE9MatrixPtr9MatrixPtrRK7IVectorii6size_tb" title="Permalink to this definition">¶</a></dt>
2359 2360 2361 2362
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix29contextProjectionBackwardDataE9MatrixPtrRK7IVectorii">
2363
<span id="paddle::Matrix::contextProjectionBackwardData__MatrixPtr.IVectorCR.i.i"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1af19f55ae625e870de28257bf30646751"></span><em class="property">virtual</em> void <code class="descname">contextProjectionBackwardData</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>inputGrad</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>sequence</em>, int <em>contextLength</em>, int <em>contextStart</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix29contextProjectionBackwardDataE9MatrixPtrRK7IVectorii" title="Permalink to this definition">¶</a></dt>
2364 2365 2366 2367
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix31contextProjectionBackwardWeightE9MatrixPtrRK7IVectoriii6size_t">
2368
<span id="paddle::Matrix::contextProjectionBackwardWeight__MatrixPtr.IVectorCR.i.i.i.s"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1adad15b5f753ccebd780dcf5a57400c58"></span><em class="property">virtual</em> void <code class="descname">contextProjectionBackwardWeight</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>weightGrad</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>sequence</em>, int <em>contextLength</em>, int <em>contextStart</em>, int <em>totalPad</em>, size_t <em>beginPad</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix31contextProjectionBackwardWeightE9MatrixPtrRK7IVectoriii6size_t" title="Permalink to this definition">¶</a></dt>
2369 2370 2371 2372
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix10selectRowsER6MatrixR7IVector">
2373 2374
<span id="paddle::Matrix::selectRows__MatrixR.IVectorR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a7ee4671196c2c002ec889dc85b197db2"></span><em class="property">virtual</em> void <code class="descname">selectRows</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>table</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>ids</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix10selectRowsER6MatrixR7IVector" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span><span class="o">.</span><span class="n">row</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">+=</span> <span class="n">table</span><span class="o">.</span><span class="n">row</span><span class="p">[</span><span class="n">ids</span><span class="p">[</span><span class="n">i</span><span class="p">]]</span>
2375 2376 2377
<span class="k">if</span> <span class="n">ids</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">it</span> <span class="n">will</span> <span class="n">be</span> <span class="n">ignored</span>
</pre></div>
</div>
2378
 </p>
2379 2380 2381 2382
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix14selectElementsER6MatrixR7IVector">
2383 2384
<span id="paddle::Matrix::selectElements__MatrixR.IVectorR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a5770811cb7df65c27017a1ce41fa7b5f"></span><em class="property">virtual</em> void <code class="descname">selectElements</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>table</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>ids</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix14selectElementsER6MatrixR7IVector" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="n">table</span><span class="p">[</span><span class="n">i</span><span class="p">,</span> <span class="nb">id</span><span class="p">[</span><span class="n">i</span><span class="p">]]</span>
2385 2386
</pre></div>
</div>
2387
 </p>
2388 2389 2390 2391
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix9addToRowsER6MatrixR7IVector">
2392 2393
<span id="paddle::Matrix::addToRows__MatrixR.IVectorR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a698467386b439424193460ba36a02da2"></span><em class="property">virtual</em> void <code class="descname">addToRows</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>table</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>ids</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix9addToRowsER6MatrixR7IVector" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">table</span><span class="o">.</span><span class="n">row</span><span class="p">[</span><span class="n">ids</span><span class="p">[</span><span class="n">i</span><span class="p">]]</span> <span class="o">+=</span> <span class="n">this</span><span class="o">.</span><span class="n">row</span><span class="p">[</span><span class="n">i</span><span class="p">]</span>
2394 2395 2396
<span class="k">if</span> <span class="n">ids</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span><span class="p">,</span> <span class="n">it</span> <span class="n">will</span> <span class="n">be</span> <span class="n">ignored</span>
</pre></div>
</div>
2397
 </p>
2398 2399 2400 2401
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix11addElementsER6MatrixR7IVector">
2402 2403
<span id="paddle::Matrix::addElements__MatrixR.IVectorR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a08ab40bed79df5e2e46e97fe6f3c5874"></span><em class="property">virtual</em> void <code class="descname">addElements</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>table</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>ids</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix11addElementsER6MatrixR7IVector" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">table</span><span class="p">[</span><span class="n">i</span><span class="p">,</span> <span class="nb">id</span><span class="p">[</span><span class="n">i</span><span class="p">]]</span> <span class="o">+=</span> <span class="n">this</span><span class="p">[</span><span class="n">i</span><span class="p">]</span>
2404 2405
</pre></div>
</div>
2406
 </p>
2407 2408 2409 2410
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix28multiBinaryLabelCrossEntropyER6MatrixR6Matrix">
2411
<span id="paddle::Matrix::multiBinaryLabelCrossEntropy__MatrixR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a787925e54669bf8b8a207a7f9a6d8028"></span><em class="property">virtual</em> void <code class="descname">multiBinaryLabelCrossEntropy</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>label</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix28multiBinaryLabelCrossEntropyER6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
2412
<dd><p>cross entropy for multi binary labels </p>
2413
<p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="o">-</span><span class="nb">sum</span><span class="p">(</span><span class="n">label</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">]</span><span class="o">*</span><span class="n">log</span><span class="p">(</span><span class="n">output</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">])</span>
2414 2415 2416
          <span class="o">+</span> <span class="p">(</span><span class="mi">1</span><span class="o">-</span><span class="n">label</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">])</span><span class="o">*</span><span class="n">log</span><span class="p">(</span><span class="mi">1</span><span class="o">-</span><span class="n">output</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">]))</span>
</pre></div>
</div>
2417
 </p>
2418 2419 2420 2421
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix30multiBinaryLabelCrossEntropyBpER6MatrixR6Matrix">
2422
<span id="paddle::Matrix::multiBinaryLabelCrossEntropyBp__MatrixR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1af03de87cdf65385eb8edf58f0ec2d45a"></span><em class="property">virtual</em> void <code class="descname">multiBinaryLabelCrossEntropyBp</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>label</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix30multiBinaryLabelCrossEntropyBpER6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2423
<dd><p>The gradient of cross entropy for multi binary labels on output. </p>
2424
<p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">]</span> <span class="o">=</span> <span class="o">-</span><span class="n">label</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">]</span><span class="o">/</span><span class="n">output</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">]</span>
2425
             <span class="o">+</span> <span class="p">(</span><span class="mi">1</span><span class="o">-</span><span class="n">label</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">])</span><span class="o">/</span><span class="p">(</span><span class="mi">1</span><span class="o">-</span><span class="n">output</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">])</span>
Y
Yu Yang 已提交
2426 2427
</pre></div>
</div>
2428
 </p>
Y
Yu Yang 已提交
2429 2430 2431
</dd></dl>

<dl class="function">
2432
<dt id="_CPPv2N6paddle6Matrix24classificationErrorMultiER6MatrixR6Matrix4real">
2433
<span id="paddle::Matrix::classificationErrorMulti__MatrixR.MatrixR.real"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1af24da39d66fb9276807fead356750adb"></span><em class="property">virtual</em> void <code class="descname">classificationErrorMulti</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>label</em>, real <em>threshold</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix24classificationErrorMultiER6MatrixR6Matrix4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2434
<dd><p>Calculate the classification error for multi binary labels. </p>
2435
<p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="nb">sum</span><span class="p">((</span><span class="n">output</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">]</span> <span class="o">&gt;=</span> <span class="n">threshold</span> <span class="o">&amp;&amp;</span> <span class="n">label</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">]</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span>
2436 2437
           <span class="o">||</span> <span class="p">(</span><span class="n">output</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">]</span> <span class="o">&lt;</span> <span class="n">threshold</span> <span class="o">&amp;&amp;</span> <span class="n">label</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">]</span> <span class="o">==</span> <span class="mi">1</span><span class="p">))</span>
           <span class="o">/</span> <span class="n">output</span><span class="o">-&gt;</span><span class="n">getWidth</span><span class="p">()</span>
Y
Yu Yang 已提交
2438 2439
</pre></div>
</div>
2440
 </p>
Y
Yu Yang 已提交
2441 2442
</dd></dl>

2443 2444
<dl class="function">
<dt id="_CPPv2N6paddle6Matrix16paramReluForwardER6MatrixR6Matrix">
2445
<span id="paddle::Matrix::paramReluForward__MatrixR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a382f5dd92b7e8d4fa5539f7dffd624b8"></span><em class="property">virtual</em> void <code class="descname">paramReluForward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>data</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>W</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix16paramReluForwardER6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
2446 2447 2448 2449
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix18paramReluBackwardWER6MatrixR6Matrix">
2450
<span id="paddle::Matrix::paramReluBackwardW__MatrixR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1ae4795969f4a0a36caeceaf0f9c757bee"></span><em class="property">virtual</em> void <code class="descname">paramReluBackwardW</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>oGrad</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix18paramReluBackwardWER6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
2451 2452 2453 2454
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix21paramReluBackwardDiffER6MatrixR6MatrixR6Matrix">
2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465
<span id="paddle::Matrix::paramReluBackwardDiff__MatrixR.MatrixR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1aeefdd34125baa6bc870e306adc1b5673"></span><em class="property">virtual</em> void <code class="descname">paramReluBackwardDiff</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>oGrad</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>data</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>W</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix21paramReluBackwardDiffER6MatrixR6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix15bilinearForwardERK6MatrixK6size_tK6size_tK6size_tK6size_tK6size_tK4realK4real">
<span id="paddle::Matrix::bilinearForward__MatrixCR.sC.sC.sC.sC.sC.realC.realC"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a60eb506f44a1305492c1f8e1487299be"></span><em class="property">virtual</em> void <code class="descname">bilinearForward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>in</em>, <em class="property">const</em> size_t <em>inImgH</em>, <em class="property">const</em> size_t <em>inImgW</em>, <em class="property">const</em> size_t <em>outImgH</em>, <em class="property">const</em> size_t <em>outImgW</em>, <em class="property">const</em> size_t <em>numChannels</em>, <em class="property">const</em> real <em>ratioH</em>, <em class="property">const</em> real <em>ratioW</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix15bilinearForwardERK6MatrixK6size_tK6size_tK6size_tK6size_tK6size_tK4realK4real" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix16bilinearBackwardERK6MatrixK6size_tK6size_tK6size_tK6size_tK6size_tK4realK4real">
<span id="paddle::Matrix::bilinearBackward__MatrixCR.sC.sC.sC.sC.sC.realC.realC"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a5a3a976fb42a26826e626bbd32ca330f"></span><em class="property">virtual</em> void <code class="descname">bilinearBackward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>out</em>, <em class="property">const</em> size_t <em>outImgH</em>, <em class="property">const</em> size_t <em>outImgW</em>, <em class="property">const</em> size_t <em>inImgH</em>, <em class="property">const</em> size_t <em>inImgW</em>, <em class="property">const</em> size_t <em>numChannels</em>, <em class="property">const</em> real <em>ratioH</em>, <em class="property">const</em> real <em>ratioW</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix16bilinearBackwardERK6MatrixK6size_tK6size_tK6size_tK6size_tK6size_tK4realK4real" title="Permalink to this definition">¶</a></dt>
2466 2467 2468
<dd></dd></dl>

</div>
2469
<div class="breathe-sectiondef docutils container">
2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480
<p class="breathe-sectiondef-title rubric">Public Members</p>
<dl class="member">
<dt id="_CPPv2N6paddle6Matrix11elementCnt_E">
<span id="paddle::Matrix::elementCnt___s"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a58e782d3e4f64008220b3493874d4bf6"></span>size_t <code class="descname">elementCnt_</code><a class="headerlink" href="#_CPPv2N6paddle6Matrix11elementCnt_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle6Matrix13memoryHandle_E">
<span id="paddle::Matrix::memoryHandle___MemoryHandlePtr"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a4d66a4e9783636ae684a16cf90afa335"></span><a class="reference internal" href="../utils/utils.html#_CPPv2N6paddle15MemoryHandlePtrE" title="paddle::MemoryHandlePtr">MemoryHandlePtr</a> <code class="descname">memoryHandle_</code><a class="headerlink" href="#_CPPv2N6paddle6Matrix13memoryHandle_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

Y
Yu Yang 已提交
2481
</div>
2482
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
2483 2484
<p class="breathe-sectiondef-title rubric">Public Static Functions</p>
<dl class="function">
2485 2486
<dt id="_CPPv2N6Matrix6createE15MemoryHandlePtr6size_t6size_tb">
<span id="Matrix::create__MemoryHandlePtr.s.s.b"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a4d33969b7d252a9093daaa74fb4b52fb"></span>MatrixPtr <code class="descname">create</code><span class="sig-paren">(</span>MemoryHandlePtr <em>memHandle</em>, size_t <em>height</em>, size_t <em>width</em>, bool <em>trans</em> = false<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6Matrix6createE15MemoryHandlePtr6size_t6size_tb" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2487 2488 2489
<dd></dd></dl>

<dl class="function">
2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501 2502 2503 2504 2505 2506 2507 2508 2509 2510 2511 2512 2513 2514 2515 2516 2517 2518 2519 2520 2521 2522 2523 2524 2525 2526 2527 2528 2529
<dt id="_CPPv2N6Matrix6createE6size_t6size_tbb">
<span id="Matrix::create__s.s.b.b"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1aa0f83407e7b94755e647e0fbd6fab3ff"></span>MatrixPtr <code class="descname">create</code><span class="sig-paren">(</span>size_t <em>height</em>, size_t <em>width</em>, bool <em>trans</em> = false, bool <em>useGpu</em> = false<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6Matrix6createE6size_t6size_tbb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6Matrix6createEP4real6size_t6size_tbb">
<span id="Matrix::create__realP.s.s.b.b"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1aea35d5c56821078f558ceaa6dccb47eb"></span>MatrixPtr <code class="descname">create</code><span class="sig-paren">(</span>real *<em>data</em>, size_t <em>height</em>, size_t <em>width</em>, bool <em>trans</em> = false, bool <em>useGpu</em> = false<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6Matrix6createEP4real6size_t6size_tbb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6Matrix6createEP4real6size_t6size_t6size_tbb">
<span id="Matrix::create__realP.s.s.s.b.b"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a1e1a2581dd662f52fa8f031e0b610816"></span>MatrixPtr <code class="descname">create</code><span class="sig-paren">(</span>real *<em>data</em>, size_t <em>height</em>, size_t <em>width</em>, size_t <em>stride</em>, bool <em>trans</em> = false, bool <em>useGpu</em> = false<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6Matrix6createEP4real6size_t6size_t6size_tbb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6Matrix18createSparseMatrixE6size_t6size_t6size_t15SparseValueTypebb">
<span id="Matrix::createSparseMatrix__s.s.s.SparseValueType.b.b"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a7dba3623f4ab99d13af9eb76c81a3b73"></span>MatrixPtr <code class="descname">createSparseMatrix</code><span class="sig-paren">(</span>size_t <em>height</em>, size_t <em>width</em>, size_t <em>nnz</em>, <a class="reference internal" href="../../api/api.html#_CPPv215SparseValueType" title="SparseValueType">SparseValueType</a> <em>valueType</em> = FLOAT_VALUE, bool <em>trans</em> = false, bool <em>useGpu</em> = false<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6Matrix18createSparseMatrixE6size_t6size_t6size_t15SparseValueTypebb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6Matrix18createSparseMatrixE6size_t6size_t6size_t15SparseValueType12SparseFormatbb">
<span id="Matrix::createSparseMatrix__s.s.s.SparseValueType.SparseFormat.b.b"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a54685a8e62f6f92f9b6106d6c7fd2465"></span>MatrixPtr <code class="descname">createSparseMatrix</code><span class="sig-paren">(</span>size_t <em>height</em>, size_t <em>width</em>, size_t <em>nnz</em>, <a class="reference internal" href="../../api/api.html#_CPPv215SparseValueType" title="SparseValueType">SparseValueType</a> <em>valueType</em> = FLOAT_VALUE, SparseFormat <em>foramt</em> = SPARSE_CSR, bool <em>trans</em> = false, bool <em>useGpu</em> = false<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6Matrix18createSparseMatrixE6size_t6size_t6size_t15SparseValueType12SparseFormatbb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6Matrix18createSparseMatrixEP4realPiPi6size_t6size_t6size_t15SparseValueType12SparseFormatbb">
<span id="Matrix::createSparseMatrix__realP.iP.iP.s.s.s.SparseValueType.SparseFormat.b.b"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a91402bd04327794482e9b062da3a50d0"></span>MatrixPtr <code class="descname">createSparseMatrix</code><span class="sig-paren">(</span>real *<em>data</em>, int *<em>row</em>, int *<em>col</em>, size_t <em>height</em>, size_t <em>width</em>, size_t <em>nnz</em>, <a class="reference internal" href="../../api/api.html#_CPPv215SparseValueType" title="SparseValueType">SparseValueType</a> <em>valueType</em>, SparseFormat <em>format</em>, bool <em>trans</em>, bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6Matrix18createSparseMatrixEP4realPiPi6size_t6size_t6size_t15SparseValueType12SparseFormatbb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6Matrix26resizeOrCreateSparseMatrixER9MatrixPtr6size_t6size_t6size_t15SparseValueType12SparseFormatbb">
<span id="Matrix::resizeOrCreateSparseMatrix__MatrixPtrR.s.s.s.SparseValueType.SparseFormat.b.b"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a9409cc05c5ecff573817f64e40c88406"></span>void <code class="descname">resizeOrCreateSparseMatrix</code><span class="sig-paren">(</span>MatrixPtr &amp;<em>matrix</em>, size_t <em>height</em>, size_t <em>width</em>, size_t <em>nnz</em>, <a class="reference internal" href="../../api/api.html#_CPPv215SparseValueType" title="SparseValueType">SparseValueType</a> <em>valueType</em> = FLOAT_VALUE, SparseFormat <em>foramt</em> = SPARSE_CSR, bool <em>trans</em> = false, bool <em>useGpu</em> = false<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6Matrix26resizeOrCreateSparseMatrixER9MatrixPtr6size_t6size_t6size_t15SparseValueType12SparseFormatbb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6Matrix14resizeOrCreateER9MatrixPtr6size_t6size_tbb">
<span id="Matrix::resizeOrCreate__MatrixPtrR.s.s.b.b"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a5b37120b7dda96454dcfc3f312972a0c"></span>void <code class="descname">resizeOrCreate</code><span class="sig-paren">(</span>MatrixPtr &amp;<em>a</em>, size_t <em>height</em>, size_t <em>width</em>, bool <em>trans</em> = false, bool <em>useGpu</em> = false<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6Matrix14resizeOrCreateER9MatrixPtr6size_t6size_tbb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
2530
<div class="breathe-sectiondef docutils container">
2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547
<p class="breathe-sectiondef-title rubric">Protected Functions</p>
<dl class="function">
<dt id="_CPPv2N6Matrix6MatrixE15MemoryHandlePtr6size_t6size_tbb">
<span id="Matrix::Matrix__MemoryHandlePtr.s.s.b.b"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1afdec603234189c9554c34683f7a4387b"></span><code class="descname">Matrix</code><span class="sig-paren">(</span>MemoryHandlePtr <em>memHandle</em>, size_t <em>height</em>, size_t <em>width</em>, bool <em>trans</em>, bool <em>use_gpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6Matrix6MatrixE15MemoryHandlePtr6size_t6size_tbb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6Matrix6MatrixEP4real6size_t6size_tbb">
<span id="Matrix::Matrix__realP.s.s.b.b"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1aae2f3f5d085d72310e7a4cb7323f2f82"></span><code class="descname">Matrix</code><span class="sig-paren">(</span>real *<em>data</em>, size_t <em>height</em>, size_t <em>width</em>, bool <em>trans</em>, bool <em>use_gpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6Matrix6MatrixEP4real6size_t6size_tbb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6Matrix6MatrixEP4real6size_t6size_t6size_tbb">
<span id="Matrix::Matrix__realP.s.s.s.b.b"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a1ea1784018da61711c7139faaef99710"></span><code class="descname">Matrix</code><span class="sig-paren">(</span>real *<em>data</em>, size_t <em>height</em>, size_t <em>width</em>, size_t <em>stride</em>, bool <em>trans</em>, bool <em>use_gpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6Matrix6MatrixEP4real6size_t6size_t6size_tbb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
2548
<div class="breathe-sectiondef docutils container">
2549 2550 2551 2552 2553
<p class="breathe-sectiondef-title rubric">Protected Static Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle6Matrix7tmpMat_E">
<span id="paddle::Matrix::tmpMat___ThreadLocal:MatrixPtr:"></span><span class="target" id="paddleclasspaddle_1_1Matrix_1a26849e1433d828892bc832608abdd22e"></span>ThreadLocal&lt;<a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a>&gt; <code class="descname">tmpMat_</code><a class="headerlink" href="#_CPPv2N6paddle6Matrix7tmpMat_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
Y
Yu Yang 已提交
2554 2555 2556 2557 2558 2559 2560

</div>
</dd></dl>

<dl class="class">
<dt id="_CPPv2N6paddle9GpuMatrixE">
<span id="paddle::GpuMatrix"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix"></span><em class="property">class </em><code class="descname">GpuMatrix</code><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrixE" title="Permalink to this definition">¶</a></dt>
2561
<dd><p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Matrix"><span class="std std-ref">paddle::Matrix</span></a></p>
2562
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
2563 2564 2565 2566 2567 2568 2569 2570 2571 2572 2573 2574 2575 2576 2577 2578 2579 2580 2581 2582 2583 2584 2585 2586 2587 2588 2589 2590 2591 2592 2593 2594 2595
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix9GpuMatrixEv">
<span id="paddle::GpuMatrix::GpuMatrix"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1ae56e96d86aa8a3b7e83f45efd202610b"></span><code class="descname">GpuMatrix</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix9GpuMatrixEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix9GpuMatrixE6size_t6size_tb">
<span id="paddle::GpuMatrix::GpuMatrix__s.s.b"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1acd99c2965e91c019edcb732cf00b75dd"></span><code class="descname">GpuMatrix</code><span class="sig-paren">(</span>size_t <em>height</em>, size_t <em>width</em>, bool <em>trans</em> = false<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix9GpuMatrixE6size_t6size_tb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix9GpuMatrixEP4real6size_t6size_tb">
<span id="paddle::GpuMatrix::GpuMatrix__realP.s.s.b"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a6fefcce088792d5859f4b43d9c514c38"></span><code class="descname">GpuMatrix</code><span class="sig-paren">(</span>real *<em>data</em>, size_t <em>height</em>, size_t <em>width</em>, bool <em>trans</em> = false<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix9GpuMatrixEP4real6size_t6size_tb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix9GpuMatrixEP4real6size_t6size_t6size_tb">
<span id="paddle::GpuMatrix::GpuMatrix__realP.s.s.s.b"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a424880ed3e2d2caae7860e7df15d22b1"></span><code class="descname">GpuMatrix</code><span class="sig-paren">(</span>real *<em>data</em>, size_t <em>height</em>, size_t <em>width</em>, size_t <em>stride</em>, bool <em>trans</em> = false<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix9GpuMatrixEP4real6size_t6size_t6size_tb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix9GpuMatrixE15GpuMemHandlePtr6size_t6size_tb">
<span id="paddle::GpuMatrix::GpuMatrix__GpuMemHandlePtr.s.s.b"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1acb43da56e54ceb9e889cd4432bbb160f"></span><code class="descname">GpuMatrix</code><span class="sig-paren">(</span><a class="reference internal" href="../utils/utils.html#_CPPv2N6paddle15GpuMemHandlePtrE" title="paddle::GpuMemHandlePtr">GpuMemHandlePtr</a> <em>dataHandle</em>, size_t <em>height</em>, size_t <em>width</em>, bool <em>trans</em> = false<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix9GpuMatrixE15GpuMemHandlePtr6size_t6size_tb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrixD0Ev">
<span id="paddle::GpuMatrix::~GpuMatrix"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a15153f8a7db9e5ddb6c6854699333cea"></span><code class="descname">~GpuMatrix</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrixD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix7zeroMemEv">
2596
<span id="paddle::GpuMatrix::zeroMem"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1ac7e5e95576f72bbd645c74dc13ce4b50"></span>void <code class="descname">zeroMem</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix7zeroMemEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2597 2598 2599 2600
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix8resetOneEv">
2601 2602 2603 2604 2605 2606
<span id="paddle::GpuMatrix::resetOne"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1aec0893ab182e391fd378091725cd81b7"></span>void <code class="descname">resetOne</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix8resetOneEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix7setDiagE4real">
<span id="paddle::GpuMatrix::setDiag__real"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1aa67805e0154613a5875c100475b96191"></span>void <code class="descname">setDiag</code><span class="sig-paren">(</span>real <em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix7setDiagE4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2607 2608 2609 2610
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix6resizeE6size_t6size_t">
2611
<span id="paddle::GpuMatrix::resize__s.s"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a9264b682f2091315976890281d369d3d"></span>void <code class="descname">resize</code><span class="sig-paren">(</span>size_t <em>newHeight</em>, size_t <em>newWidth</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix6resizeE6size_t6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2612 2613
<dd><p><dl class="docutils">
<dt><strong>Note</strong></dt>
2614
<dd>Original data may not be preserved after <a class="reference internal" href="#paddleclasspaddle_1_1GpuMatrix_1a9264b682f2091315976890281d369d3d"><span class="std std-ref">resize()</span></a>. </dd>
Y
Yu Yang 已提交
2615 2616 2617 2618 2619 2620
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix6resizeE6size_t6size_t6size_t15SparseValueType12SparseFormat">
2621
<span id="paddle::GpuMatrix::resize__s.s.s.SparseValueType.SparseFormat"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a3e95de7399e8febe51f9ce308617e14d"></span>void <code class="descname">resize</code><span class="sig-paren">(</span>size_t <em>newHeight</em>, size_t <em>newWidth</em>, size_t <em>newNnz</em>, <a class="reference internal" href="#_CPPv2N6paddle15SparseValueTypeE" title="paddle::SparseValueType">SparseValueType</a> <em>valueType</em>, <a class="reference internal" href="#_CPPv2N6paddle12SparseFormatE" title="paddle::SparseFormat">SparseFormat</a> <em>format</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix6resizeE6size_t6size_t6size_t15SparseValueType12SparseFormat" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2622 2623 2624 2625 2626 2627 2628 2629 2630
<dd><p><dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>This should only be used for sparse matrix. </dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix6setRowE6size_t6size_tPKjPK4real">
2631
<span id="paddle::GpuMatrix::setRow__s.s.unsigned-iCP.realCP"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a049e8b03b1605c1372249572a7371fc5"></span>void <code class="descname">setRow</code><span class="sig-paren">(</span>size_t <em>row</em>, size_t <em>colNum</em>, <em class="property">const</em> unsigned int *<em>cols</em>, <em class="property">const</em> real *<em>values</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix6setRowE6size_t6size_tPKjPK4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2632 2633 2634 2635 2636 2637
<dd><p>This should only be used for sparse matrix. </p>
<p>Currently must be called for each row in order. The matrix is not valid until setRow is called for the last row. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix8copyFromEPK4real6size_t">
2638
<span id="paddle::GpuMatrix::copyFrom__realCP.s"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1ac42f9766746b5b9837198109cfb89147"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> real *<em>hostSrc</em>, size_t <em>size</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix8copyFromEPK4real6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2639 2640 2641 2642 2643
<dd><p>Copy the data from cpu_memory buffer </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix8copyFromEPK4realPK7int64_t">
2644
<span id="paddle::GpuMatrix::copyFrom__realCP.int64_tCP"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a73eb31e2253c2cec453a685300816a39"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> real *<em>hostSrc</em>, <em class="property">const</em> int64_t *<em>seq</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix8copyFromEPK4realPK7int64_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2645 2646 2647 2648
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix8copyFromERK6Matrix11hl_stream_t">
2649
<span id="paddle::GpuMatrix::copyFrom__MatrixCR.hl_stream_t"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a41d9725a1b04ad059da26439e5c318e7"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>src</em>, <a class="reference internal" href="../../cuda/utils/utils.html#_CPPv211hl_stream_t" title="hl_stream_t">hl_stream_t</a> <em>stream</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix8copyFromERK6Matrix11hl_stream_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2650 2651 2652 2653
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix8copyFromERK6Matrix">
2654
<span id="paddle::GpuMatrix::copyFrom__MatrixCR"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1ad430654561f3715b5dbd81ce1924d77e"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>src</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix8copyFromERK6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2655 2656 2657 2658
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix8copyFromERK7IVector">
2659
<span id="paddle::GpuMatrix::copyFrom__IVectorCR"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1abc9dc300f2d2cfe018fe5c343ec030db"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>src</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix8copyFromERK7IVector" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2660 2661 2662 2663 2664 2665
<dd><p>convert a int vector to a real matrix. </p>
<p>(1) source and dest are both in CPU.</p>
<p>(2) sizes are exactly match. </p>
</dd></dl>

<dl class="function">
2666 2667
<dt id="_CPPv2N6paddle9GpuMatrix14copyByRowIndexER6MatrixRK7IVector">
<span id="paddle::GpuMatrix::copyByRowIndex__MatrixR.IVectorCR"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a7d757b48a3fcfcd594818c48a88b357c"></span>void <code class="descname">copyByRowIndex</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>b</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>rowIndex</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix14copyByRowIndexER6MatrixRK7IVector" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2668 2669 2670 2671
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix5cloneE6size_t6size_tb">
2672
<span id="paddle::GpuMatrix::clone__s.s.b"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a350558303d4fc4025373e10c1f55e557"></span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">clone</code><span class="sig-paren">(</span>size_t <em>height</em>, size_t <em>width</em>, bool <em>useGpu</em> = false<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix5cloneE6size_t6size_tb" title="Permalink to this definition">¶</a></dt>
2673
<dd><p>Create a matrix with the same type (<a class="reference internal" href="#paddleclasspaddle_1_1GpuMatrix"><span class="std std-ref">GpuMatrix</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1CpuMatrix"><span class="std std-ref">CpuMatrix</span></a>, NonValueSparseMatrix, etc.) as this. </p>
Y
Yu Yang 已提交
2674 2675 2676 2677
<p>If height and width is zero, the new matrix will have the same size as this, otherwise the new matrix will have the specified size. </p>
</dd></dl>

<dl class="function">
2678 2679
<dt id="_CPPv2NK6paddle9GpuMatrix10getElementE6size_t6size_t">
<span id="paddle::GpuMatrix::getElement__s.sC"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1af9969903be12d8b2722bf1e0cbc8ea74"></span>real <code class="descname">getElement</code><span class="sig-paren">(</span>size_t <em>x</em>, size_t <em>y</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle9GpuMatrix10getElementE6size_t6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2680 2681 2682 2683 2684 2685 2686 2687 2688
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix6getRowE6size_t">
<span id="paddle::GpuMatrix::getRow__s"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a974ad51855ae53ec3a3c3d46f823b57e"></span>real *<code class="descname">getRow</code><span class="sig-paren">(</span>size_t <em>row</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix6getRowE6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix9getRowBufE6size_t">
2689
<span id="paddle::GpuMatrix::getRowBuf__s"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1aafc0f3e898ad3370c491ba7b45d31177"></span><em class="property">virtual</em> real *<code class="descname">getRowBuf</code><span class="sig-paren">(</span>size_t <em>row</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix9getRowBufE6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2690 2691 2692 2693
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix6getSumEv">
2694
<span id="paddle::GpuMatrix::getSum"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1afdf1237a360267545ac80afb231f5a0e"></span>real <code class="descname">getSum</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix6getSumEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2695 2696 2697 2698
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix16accumulateColSumER6Matrix">
2699
<span id="paddle::GpuMatrix::accumulateColSum__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a2e93082e5f6b13f4dbbe88e3997c4291"></span>void <code class="descname">accumulateColSum</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>src</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix16accumulateColSumER6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2700 2701 2702 2703
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix9getAbsSumEv">
2704
<span id="paddle::GpuMatrix::getAbsSum"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a95b41df28dc6f3ad835af635e0f020fd"></span>real <code class="descname">getAbsSum</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix9getAbsSumEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2705 2706 2707 2708
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix12getTransposeEv">
2709
<span id="paddle::GpuMatrix::getTranspose"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a4bfe07a8b6ce015b1759a5dcba0440e6"></span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">getTranspose</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix12getTransposeEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2710 2711 2712 2713
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix9transposeE9MatrixPtrb">
2714
<span id="paddle::GpuMatrix::transpose__MatrixPtr.b"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a6cf0704200457e138b310bdb1b702381"></span>void <code class="descname">transpose</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>matTrans</em>, bool <em>memAlloc</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix9transposeE9MatrixPtrb" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2715 2716 2717 2718
<dd><p>hard transpose. </p>
<p>allocate matTrans&#8217; memory outside, then set memAlloc as false; else set as true. </p>
</dd></dl>

2719 2720 2721 2722 2723 2724 2725 2726 2727 2728 2729 2730
<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix10getInverseEv">
<span id="paddle::GpuMatrix::getInverse"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1adf0ff07ee68a637b5f274deaa0c73736"></span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">getInverse</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix10getInverseEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix7inverseE9MatrixPtrb">
<span id="paddle::GpuMatrix::inverse__MatrixPtr.b"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1aefc7ac7176b61a8f468d05578a494795"></span>void <code class="descname">inverse</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>matInv</em>, bool <em>memAlloc</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix7inverseE9MatrixPtrb" title="Permalink to this definition">¶</a></dt>
<dd><p>inverse. </p>
<p>if allocate matInv&#8217;s memory outside, then set memAlloc as false; else set as true. </p>
</dd></dl>

Y
Yu Yang 已提交
2731 2732
<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix7addBiasER6Matrix4real">
2733
<span id="paddle::GpuMatrix::addBias__MatrixR.real"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1aac00dd3b0417e1d60577fa2885cd0fb2"></span>void <code class="descname">addBias</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>b</em>, real <em>scale</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix7addBiasER6Matrix4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2734 2735 2736
<dd><p>add b to each sample of this. </p>
</dd></dl>

2737 2738 2739 2740 2741
<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix13addSharedBiasER6Matrix4real">
<span id="paddle::GpuMatrix::addSharedBias__MatrixR.real"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a45388272c73926e128d951e0bb9ee63c"></span>void <code class="descname">addSharedBias</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>b</em>, real <em>scale</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix13addSharedBiasER6Matrix4real" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

Y
Yu Yang 已提交
2742 2743
<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix11collectBiasER6Matrix4real">
2744 2745
<span id="paddle::GpuMatrix::collectBias__MatrixR.real"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1aeaca3b37fbafd8379a9d7debdf889467"></span>void <code class="descname">collectBias</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>a</em>, real <em>scale</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix11collectBiasER6Matrix4real" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">add</span> <span class="n">each</span> <span class="n">sample</span> <span class="kn">from</span> <span class="nn">a</span> <span class="n">to</span> <span class="n">this</span><span class="o">.</span>
Y
Yu Yang 已提交
2746 2747
</pre></div>
</div>
2748
 </p>
Y
Yu Yang 已提交
2749 2750
</dd></dl>

2751 2752 2753 2754 2755
<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix17collectSharedBiasER6Matrix4real">
<span id="paddle::GpuMatrix::collectSharedBias__MatrixR.real"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1aa53eb73dd36a9522588cd4ed6bb1bd5d"></span>void <code class="descname">collectSharedBias</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>a</em>, real <em>scale</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix17collectSharedBiasER6Matrix4real" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

Y
Yu Yang 已提交
2756 2757
<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix18sequenceAvgForwardER6MatrixRK7IVectori">
2758
<span id="paddle::GpuMatrix::sequenceAvgForward__MatrixR.IVectorCR.i"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a4000851cfb9ca1c313b6a4b5f3627f02"></span>void <code class="descname">sequenceAvgForward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>a</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>startsPos</em>, int <em>mode</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix18sequenceAvgForwardER6MatrixRK7IVectori" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2759 2760 2761 2762
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix10selectRowsER6MatrixR7IVector">
2763 2764
<span id="paddle::GpuMatrix::selectRows__MatrixR.IVectorR"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a92efa942fe6d35f0766434f417555a30"></span>void <code class="descname">selectRows</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>table</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>ids</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix10selectRowsER6MatrixR7IVector" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span><span class="o">.</span><span class="n">row</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">+=</span> <span class="n">table</span><span class="o">.</span><span class="n">row</span><span class="p">[</span><span class="n">ids</span><span class="p">[</span><span class="n">i</span><span class="p">]]</span>
Y
Yu Yang 已提交
2765 2766
</pre></div>
</div>
2767
 </p>
Y
Yu Yang 已提交
2768 2769 2770 2771
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix14selectElementsER6MatrixR7IVector">
2772 2773
<span id="paddle::GpuMatrix::selectElements__MatrixR.IVectorR"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1acc8deff09d299770504674d7ec0099c6"></span>void <code class="descname">selectElements</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>table</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>ids</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix14selectElementsER6MatrixR7IVector" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="n">table</span><span class="p">[</span><span class="n">i</span><span class="p">,</span> <span class="nb">id</span><span class="p">[</span><span class="n">i</span><span class="p">]]</span>
Y
Yu Yang 已提交
2774 2775
</pre></div>
</div>
2776
 </p>
Y
Yu Yang 已提交
2777 2778 2779 2780
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix9addToRowsER6MatrixR7IVector">
2781 2782
<span id="paddle::GpuMatrix::addToRows__MatrixR.IVectorR"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a0670b9f5863a8d3a4383edcf4abe81aa"></span>void <code class="descname">addToRows</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>table</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>ids</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix9addToRowsER6MatrixR7IVector" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">table</span><span class="o">.</span><span class="n">row</span><span class="p">[</span><span class="n">ids</span><span class="p">[</span><span class="n">i</span><span class="p">]]</span> <span class="o">+=</span> <span class="n">this</span><span class="o">.</span><span class="n">row</span><span class="p">[</span><span class="n">i</span><span class="p">]</span>
Y
Yu Yang 已提交
2783 2784
</pre></div>
</div>
2785
 </p>
Y
Yu Yang 已提交
2786 2787 2788 2789
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix15addColumnVectorERK6Matrix">
2790
<span id="paddle::GpuMatrix::addColumnVector__MatrixCR"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1af932f50f5eb2882237d7ae06798adbc8"></span>void <code class="descname">addColumnVector</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix15addColumnVectorERK6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2791 2792 2793 2794 2795
<dd><p>Add a vector (column) b to matrix a, column by column. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix3mulEK9MatrixPtrK9MatrixPtr4real4real">
2796 2797
<span id="paddle::GpuMatrix::mul__MatrixPtrC.MatrixPtrC.real.real"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a363a07bdd63fa38ec75468b3ade653ae"></span>void <code class="descname">mul</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>a</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>b</em>, real <em>scaleAB</em>, real <em>scaleT</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix3mulEK9MatrixPtrK9MatrixPtr4real4real" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">scaleAB</span><span class="o">*</span><span class="p">(</span><span class="n">a</span><span class="o">*</span><span class="n">b</span><span class="p">)</span> <span class="o">+</span> <span class="n">scaleT</span><span class="o">*</span><span class="n">this</span>
Y
Yu Yang 已提交
2798 2799
</pre></div>
</div>
2800
 </p>
Y
Yu Yang 已提交
2801 2802 2803 2804
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix3mulEK9MatrixPtrK9MatrixPtr">
2805 2806
<span id="paddle::GpuMatrix::mul__MatrixPtrC.MatrixPtrC"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a0b58b869e844807dbcc2318bcbf75334"></span>void <code class="descname">mul</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>a</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix3mulEK9MatrixPtrK9MatrixPtr" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">a</span><span class="o">*</span><span class="n">b</span>
Y
Yu Yang 已提交
2807 2808
</pre></div>
</div>
2809
 </p>
Y
Yu Yang 已提交
2810 2811 2812 2813
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix3mulERK9GpuMatrixRK9GpuMatrix4real4real">
2814
<span id="paddle::GpuMatrix::mul__GpuMatrixCR.GpuMatrixCR.real.real"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a02cb98ecf2bd576d3d11066d5f5ac7df"></span>void <code class="descname">mul</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle9GpuMatrixE" title="paddle::GpuMatrix">GpuMatrix</a> &amp;<em>a</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle9GpuMatrixE" title="paddle::GpuMatrix">GpuMatrix</a> &amp;<em>b</em>, real <em>scaleAB</em>, real <em>scaleT</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix3mulERK9GpuMatrixRK9GpuMatrix4real4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2815 2816 2817 2818
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix3mulERK15GpuSparseMatrixRK9GpuMatrix4real4real">
2819
<span id="paddle::GpuMatrix::mul__GpuSparseMatrixCR.GpuMatrixCR.real.real"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a0312ec400644bdd80fe380cc81e6370d"></span>void <code class="descname">mul</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle15GpuSparseMatrixE" title="paddle::GpuSparseMatrix">GpuSparseMatrix</a> &amp;<em>a</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle9GpuMatrixE" title="paddle::GpuMatrix">GpuMatrix</a> &amp;<em>b</em>, real <em>scaleAB</em>, real <em>scaleT</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix3mulERK15GpuSparseMatrixRK9GpuMatrix4real4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2820 2821 2822 2823
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix3mulERK9GpuMatrixRK15GpuSparseMatrix4real4real">
2824
<span id="paddle::GpuMatrix::mul__GpuMatrixCR.GpuSparseMatrixCR.real.real"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a6d8a7e8e67779836a3aa24bdb90b4b6e"></span>void <code class="descname">mul</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle9GpuMatrixE" title="paddle::GpuMatrix">GpuMatrix</a> &amp;<em>a</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle15GpuSparseMatrixE" title="paddle::GpuSparseMatrix">GpuSparseMatrix</a> &amp;<em>b</em>, real <em>scaleAB</em>, real <em>scaleT</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix3mulERK9GpuMatrixRK15GpuSparseMatrix4real4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2825 2826 2827 2828
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix8rightMulER6Matrix4real4real">
2829 2830
<span id="paddle::GpuMatrix::rightMul__MatrixR.real.real"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a1318085153e7860932d80ec7b2cb12ff"></span>void <code class="descname">rightMul</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>b</em>, real <em>scaleAB</em>, real <em>scaleT</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix8rightMulER6Matrix4real4real" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">scaleAB</span><span class="o">*</span><span class="p">(</span><span class="n">this</span><span class="o">*</span><span class="n">b</span><span class="p">)</span> <span class="o">+</span>  <span class="n">scaleT</span><span class="o">*</span><span class="n">this</span>
Y
Yu Yang 已提交
2831 2832
</pre></div>
</div>
2833
 </p>
Y
Yu Yang 已提交
2834 2835 2836 2837
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix8rightMulER6Matrix">
2838 2839
<span id="paddle::GpuMatrix::rightMul__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1ac1321ff747437d8298778b92180eb9cd"></span>void <code class="descname">rightMul</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix8rightMulER6Matrix" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">this</span><span class="o">*</span> <span class="n">b</span>
Y
Yu Yang 已提交
2840 2841
</pre></div>
</div>
2842
 </p>
Y
Yu Yang 已提交
2843 2844 2845 2846
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix7leftMulER6Matrix4real4real">
2847 2848
<span id="paddle::GpuMatrix::leftMul__MatrixR.real.real"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1aadb62ccee3ffe8e94156c47c0da40d4d"></span>void <code class="descname">leftMul</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>a</em>, real <em>scaleAB</em>, real <em>scaleT</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix7leftMulER6Matrix4real4real" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">scaleAB</span><span class="o">*</span><span class="p">(</span><span class="n">a</span><span class="o">*</span><span class="n">this</span><span class="p">)</span> <span class="o">+</span>  <span class="n">scaleT</span><span class="o">*</span><span class="n">this</span>
Y
Yu Yang 已提交
2849 2850
</pre></div>
</div>
2851
 </p>
Y
Yu Yang 已提交
2852 2853 2854 2855
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix7leftMulER6Matrix">
2856 2857
<span id="paddle::GpuMatrix::leftMul__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a6ff5aeb630ed859388448efa4f687f59"></span>void <code class="descname">leftMul</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>a</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix7leftMulER6Matrix" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">a</span><span class="o">*</span><span class="n">this</span>
Y
Yu Yang 已提交
2858 2859
</pre></div>
</div>
2860
 </p>
Y
Yu Yang 已提交
2861 2862 2863 2864
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix8colMergeER6Matrix">
2865
<span id="paddle::GpuMatrix::colMerge__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1abe96bd238500735b6a67c2977b020ab1"></span>void <code class="descname">colMerge</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>src</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix8colMergeER6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2866 2867 2868 2869 2870
<dd><p>merge the element for each col. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix6rowSumER6Matrix">
2871
<span id="paddle::GpuMatrix::rowSum__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1afd105d6d58e440f655ef68975a4bd318"></span>void <code class="descname">rowSum</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>sum</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix6rowSumER6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2872 2873 2874 2875 2876
<dd><p>add the sum of each row of this to mat </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix6rowMaxER6Matrix">
2877
<span id="paddle::GpuMatrix::rowMax__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1ac5c17fd472225c5be952a7aeedfe3b80"></span>void <code class="descname">rowMax</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>max</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix6rowMaxER6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2878 2879 2880 2881 2882
<dd><p>set the max of each row of this to mat </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix6rowMaxER7IVectorR6Matrix">
2883
<span id="paddle::GpuMatrix::rowMax__IVectorR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a1bf5a4d0d31aa3cd92e495c4b4fc3e29"></span>void <code class="descname">rowMax</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>maxIds</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>max</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix6rowMaxER7IVectorR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2884
<dd><p>Get the top k elements of each row of this matrix. </p>
2885
<p>The column ids and values of these elements are stored in maxIds and max respectively. where k is the size of maxIds. And note that the top k elements are not sorted. </p>
Y
Yu Yang 已提交
2886 2887 2888 2889
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix6colMaxER6Matrix">
2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908
<span id="paddle::GpuMatrix::colMax__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a34e4d0e75833ffa50d8aee72bbe592da"></span>void <code class="descname">colMax</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>max</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix6colMaxER6Matrix" title="Permalink to this definition">¶</a></dt>
<dd><p>set the max of each column of this to mat </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix6colMaxER7IVectorR6Matrix">
<span id="paddle::GpuMatrix::colMax__IVectorR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a50899afbb71c85e2a55487131fe7672d"></span>void <code class="descname">colMax</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>maxIds</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>maxVal</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix6colMaxER7IVectorR6Matrix" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the top k elements of each column of this matrix. </p>
<p>The row ids and values of these elements are stored in maxIds and max respectively. where k is the size of maxIds. And note that the top k elements are not sorted. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix13maxoutForwardER6MatrixR7IVector6size_t6size_t">
<span id="paddle::GpuMatrix::maxoutForward__MatrixR.IVectorR.s.s"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a7442fb9f327c87cdbcda52b4a00e6d72"></span>void <code class="descname">maxoutForward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>a</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>id</em>, size_t <em>channels</em>, size_t <em>groups</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix13maxoutForwardER6MatrixR7IVector6size_t6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix14maxoutBackwardER6MatrixR7IVector6size_t6size_t">
<span id="paddle::GpuMatrix::maxoutBackward__MatrixR.IVectorR.s.s"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a4a921cc1adb4953e2a406c8ca4f59410"></span>void <code class="descname">maxoutBackward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>a</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>id</em>, size_t <em>channels</em>, size_t <em>groups</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix14maxoutBackwardER6MatrixR7IVector6size_t6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2909 2910 2911 2912
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix18oneHotCrossEntropyER6MatrixR7IVector">
2913
<span id="paddle::GpuMatrix::oneHotCrossEntropy__MatrixR.IVectorR"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a7acc226929c5572e83c614bfb4b186d0"></span>void <code class="descname">oneHotCrossEntropy</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>label</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix18oneHotCrossEntropyER6MatrixR7IVector" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2914 2915 2916 2917 2918
<dd><p>copy -log(output[label]) to this-&gt;data[i]. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix20oneHotCrossEntropyBpER6MatrixR7IVector">
2919
<span id="paddle::GpuMatrix::oneHotCrossEntropyBp__MatrixR.IVectorR"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a0b9097b9c7e4c34a052f0194aabfb356"></span>void <code class="descname">oneHotCrossEntropyBp</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outputV</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>label</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix20oneHotCrossEntropyBpER6MatrixR7IVector" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2920 2921 2922 2923 2924
<dd><p>calculate the error of outputV according to label. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix30oneHotCrossEntropyWithSelfNormER6MatrixR7IVector4real">
2925
<span id="paddle::GpuMatrix::oneHotCrossEntropyWithSelfNorm__MatrixR.IVectorR.real"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1af16dba4c56db9ca917a9b79c1baed05a"></span>void <code class="descname">oneHotCrossEntropyWithSelfNorm</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>label</em>, real <em>alpha</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix30oneHotCrossEntropyWithSelfNormER6MatrixR7IVector4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2926 2927 2928 2929 2930
<dd><p>copy -log(output[label]) to this-&gt;data[i]. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix32oneHotCrossEntropyWithSelfNormBpER6MatrixR7IVector4real">
2931
<span id="paddle::GpuMatrix::oneHotCrossEntropyWithSelfNormBp__MatrixR.IVectorR.real"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a3301474124d18f56d4f650406ab28d71"></span>void <code class="descname">oneHotCrossEntropyWithSelfNormBp</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outputV</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>label</em>, real <em>alpha</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix32oneHotCrossEntropyWithSelfNormBpER6MatrixR7IVector4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2932 2933 2934 2935 2936
<dd><p>calculate the error of outputV according to label. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix7softmaxER6Matrix">
2937
<span id="paddle::GpuMatrix::softmax__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1ad28fa1246acf2be7bb2a630637fe4a16"></span>void <code class="descname">softmax</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix7softmaxER6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2938 2939 2940 2941
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix15sequenceSoftmaxER6MatrixRK7IVector">
2942
<span id="paddle::GpuMatrix::sequenceSoftmax__MatrixR.IVectorCR"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1aba934ed3291ce74c2a2fe83872caa468"></span>void <code class="descname">sequenceSoftmax</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>index</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix15sequenceSoftmaxER6MatrixRK7IVector" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2943 2944 2945 2946
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix15softmaxBackwardER6Matrix">
2947
<span id="paddle::GpuMatrix::softmaxBackward__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a879110c4e0a64c7a69b006fd75b84c51"></span>void <code class="descname">softmaxBackward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outputV</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix15softmaxBackwardER6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2948 2949 2950 2951
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix17softmaxDerivativeER6MatrixR6Matrix">
2952
<span id="paddle::GpuMatrix::softmaxDerivative__MatrixR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1ad8e2cb3a0595a6865e022189d9dc9897"></span>void <code class="descname">softmaxDerivative</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>sftmaxSum</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix17softmaxDerivativeER6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2953 2954 2955 2956
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix12sumOfSquaresER6MatrixR6Matrix">
2957
<span id="paddle::GpuMatrix::sumOfSquares__MatrixR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a5a0c21218ad80dfa754207a38761ac1a"></span>void <code class="descname">sumOfSquares</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>label</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix12sumOfSquaresER6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2958 2959 2960 2961 2962
<dd><p>calculate the sum of squares diff cost. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix14sumOfSquaresBpER6MatrixR6Matrix">
2963
<span id="paddle::GpuMatrix::sumOfSquaresBp__MatrixR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1ab2f98eee298f1e4e8f20f81fdf12dd1d"></span>void <code class="descname">sumOfSquaresBp</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outputV</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>label</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix14sumOfSquaresBpER6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2964 2965 2966 2967 2968
<dd><p>gradient of sumOfSquares. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix4tanhER6Matrix">
2969
<span id="paddle::GpuMatrix::tanh__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1add3106678b5609a8dc21c427bd0391b5"></span>void <code class="descname">tanh</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix4tanhER6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2970 2971 2972 2973
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix14tanhDerivativeER6Matrix">
2974
<span id="paddle::GpuMatrix::tanhDerivative__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a6ea6a3432222692996627158b1222736"></span>void <code class="descname">tanhDerivative</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix14tanhDerivativeER6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2975 2976 2977 2978
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix8softreluER6Matrix">
2979
<span id="paddle::GpuMatrix::softrelu__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a3698744b3e1a9b645d66e10a9ef99d12"></span>void <code class="descname">softrelu</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix8softreluER6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2980 2981 2982 2983
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix18softreluDerivativeER6Matrix">
2984
<span id="paddle::GpuMatrix::softreluDerivative__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a2864315f133eb14ec3d9c5a6ee19bb0a"></span>void <code class="descname">softreluDerivative</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix18softreluDerivativeER6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2985 2986 2987 2988
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix10scaledTanhER6Matrix4real4real">
2989
<span id="paddle::GpuMatrix::scaledTanh__MatrixR.real.real"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a866e29680e4a1ca62442d6fbbea44121"></span>void <code class="descname">scaledTanh</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, real <em>p1</em>, real <em>p2</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix10scaledTanhER6Matrix4real4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2990 2991 2992 2993
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix6cosSimER6MatrixR6Matrix4real">
2994
<span id="paddle::GpuMatrix::cosSim__MatrixR.MatrixR.real"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1af3c0a9d67536aa61fa1895e806a144fe"></span>void <code class="descname">cosSim</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output1</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output2</em>, real <em>scale</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix6cosSimER6MatrixR6Matrix4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2995 2996 2997 2998 2999 3000
<dd><p>cosine similarity, for each row i, this[i] = cos(output1[i], output2[i])</p>
<p>output2 can only have one row, then for each row i, this[i] = cos(output1[i], output2[0]) </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix16cosSimDerivativeER6MatrixR6MatrixR6MatrixR6MatrixR6Matrix4real">
3001
<span id="paddle::GpuMatrix::cosSimDerivative__MatrixR.MatrixR.MatrixR.MatrixR.MatrixR.real"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a68b1428328bc7cca4d6284e7b0f3e99f"></span>void <code class="descname">cosSimDerivative</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>prevOut1</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>prevOut2</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>prevGrad1</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>prevGrad2</em>, real <em>scale</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix16cosSimDerivativeER6MatrixR6MatrixR6MatrixR6MatrixR6Matrix4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3002 3003 3004
<dd></dd></dl>

<dl class="function">
3005 3006
<dt id="_CPPv2NK6paddle9GpuMatrix5printERNSt7ostreamE">
<span id="paddle::GpuMatrix::print__osRC"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a053f063435f912f974eb61c601213f7f"></span>void <code class="descname">print</code><span class="sig-paren">(</span>std::ostream &amp;<em>os</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle9GpuMatrix5printERNSt7ostreamE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3007 3008 3009 3010
<dd><p>print out the values of elements to os </p>
</dd></dl>

<dl class="function">
3011 3012
<dt id="_CPPv2NK6paddle9GpuMatrix5printERNSt7ostreamE6size_t6size_t">
<span id="paddle::GpuMatrix::print__osR.s.sC"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1ac23c0ed1894db5e6423cc2692abb8608"></span>void <code class="descname">print</code><span class="sig-paren">(</span>std::ostream &amp;<em>os</em>, size_t <em>height</em>, size_t <em>width</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle9GpuMatrix5printERNSt7ostreamE6size_t6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3013 3014 3015 3016 3017
<dd><p>print a part of the matrix from the (top,left) value to the (height, width) value (not included) </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix16paramReluForwardER6MatrixR6Matrix">
3018
<span id="paddle::GpuMatrix::paramReluForward__MatrixR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a83d750742602eecdaaf9f683aa96d4a0"></span>void <code class="descname">paramReluForward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>data</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>W</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix16paramReluForwardER6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3019 3020 3021 3022
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix18paramReluBackwardWER6MatrixR6Matrix">
3023
<span id="paddle::GpuMatrix::paramReluBackwardW__MatrixR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1aec239b2ee928aba1b00535585d3b723a"></span>void <code class="descname">paramReluBackwardW</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>oGrad</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix18paramReluBackwardWER6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3024 3025 3026 3027
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix21paramReluBackwardDiffER6MatrixR6MatrixR6Matrix">
3028
<span id="paddle::GpuMatrix::paramReluBackwardDiff__MatrixR.MatrixR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1aa76d8256c8e40929dc7ff88c8e3ee6a5"></span>void <code class="descname">paramReluBackwardDiff</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>oGrad</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>data</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>W</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix21paramReluBackwardDiffER6MatrixR6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3029 3030 3031 3032
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix5checkERNSt7ostreamER6Matrixb">
3033
<span id="paddle::GpuMatrix::check__osR.MatrixR.b"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a4caca6618169292e3a8d29773aa8fffb"></span>void <code class="descname">check</code><span class="sig-paren">(</span>std::ostream &amp;<em>os</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>refMat</em>, bool <em>printDiff</em> = true<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix5checkERNSt7ostreamER6Matrixb" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3034 3035 3036 3037
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix16randomizeUniformEv">
3038
<span id="paddle::GpuMatrix::randomizeUniform"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a65e4126295cbd0415cc4344bff7bc174"></span>void <code class="descname">randomizeUniform</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix16randomizeUniformEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3039 3040 3041 3042
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix19classificationErrorE9MatrixPtr10IVectorPtr">
3043
<span id="paddle::GpuMatrix::classificationError__MatrixPtr.IVectorPtr"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1aa1b8d97a77bc55cee3d204bcc071e03a"></span>void <code class="descname">classificationError</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>output</em>, <a class="reference internal" href="#_CPPv2N6paddle10IVectorPtrE" title="paddle::IVectorPtr">IVectorPtr</a> <em>label</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix19classificationErrorE9MatrixPtr10IVectorPtr" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3044 3045 3046 3047 3048 3049 3050
<dd><p>calulate the error of classification </p>
<p>output[i] = 1 if row i is an error.</p>
<p>output[i] = 0 if row i is correct. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix10convExpandER6Matrixiiiiiiiiiii">
3051
<span id="paddle::GpuMatrix::convExpand__MatrixR.i.i.i.i.i.i.i.i.i.i.i"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a0e8d1b0e1b0b235e04056d4467cf18a3"></span>void <code class="descname">convExpand</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>feature</em>, int <em>feaImgHeight</em>, int <em>feaImgWidth</em>, int <em>channels</em>, int <em>blockH</em>, int <em>blockW</em>, int <em>strideH</em>, int <em>strideW</em>, int <em>paddingH</em>, int <em>paddingW</em>, int <em>outputH</em>, int <em>outputW</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix10convExpandER6Matrixiiiiiiiiiii" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3052 3053 3054 3055 3056 3057
<dd><p>This function is used to calculate the convolution:</p>
<p>It will expand a feature matrix according to the convolution filters </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix10convShrinkER6Matrixiiiiiiiiiii4real4real">
3058
<span id="paddle::GpuMatrix::convShrink__MatrixR.i.i.i.i.i.i.i.i.i.i.i.real.real"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a51d7f282b7117a3686ea4b4fd2179d03"></span>void <code class="descname">convShrink</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>expandColMat</em>, int <em>thisImgHeight</em>, int <em>thisImgWidth</em>, int <em>channels</em>, int <em>blockH</em>, int <em>blockW</em>, int <em>strideH</em>, int <em>strideW</em>, int <em>paddingH</em>, int <em>paddingW</em>, int <em>outputH</em>, int <em>outputW</em>, real <em>alpha</em> = 1.0f, real <em>beta</em> = 0.0f<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix10convShrinkER6Matrixiiiiiiiiiii4real4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3059 3060 3061 3062 3063
<dd><p>This function is the reverse implementation of convExpand:</p>
<p>Its function is to restore a expanded-matrix into a feature matrix </p>
</dd></dl>

<dl class="function">
3064 3065
<dt id="_CPPv2N6paddle9GpuMatrix14maxPoolForwardER6Matrix6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t">
<span id="paddle::GpuMatrix::maxPoolForward__MatrixR.s.s.s.s.s.s.s.s.s.s.s"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a7a39bfd0f4265a864f8601b40d80418e"></span>void <code class="descname">maxPoolForward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>inputMat</em>, size_t <em>imgSizeH</em>, size_t <em>imgSizeW</em>, size_t <em>channels</em>, size_t <em>sizeX</em>, size_t <em>sizeY</em>, size_t <em>strideH</em>, size_t <em>strideW</em>, size_t <em>outputH</em>, size_t <em>outputW</em>, size_t <em>paddingH</em>, size_t <em>paddingW</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix14maxPoolForwardER6Matrix6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3066 3067 3068 3069
<dd><p>Pooling forward operation, pick out the largest element in the sizeX of value </p>
</dd></dl>

<dl class="function">
3070 3071
<dt id="_CPPv2N6paddle9GpuMatrix15maxPoolBackwardER6Matrix6size_t6size_tR6MatrixR6Matrix6size_t6size_t6size_t6size_t6size_t6size_t4real4real6size_t6size_t">
<span id="paddle::GpuMatrix::maxPoolBackward__MatrixR.s.s.MatrixR.MatrixR.s.s.s.s.s.s.real.real.s.s"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a92794a172807e1c2e6988203d3ff9208"></span>void <code class="descname">maxPoolBackward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>image</em>, size_t <em>imgSizeH</em>, size_t <em>imgSizeW</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outGrad</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outV</em>, size_t <em>sizeX</em>, size_t <em>sizeY</em>, size_t <em>strideH</em>, size_t <em>strideW</em>, size_t <em>outputH</em>, size_t <em>outputW</em>, real <em>scaleTargets</em>, real <em>scaleOutput</em>, size_t <em>paddingH</em>, size_t <em>paddingW</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix15maxPoolBackwardER6Matrix6size_t6size_tR6MatrixR6Matrix6size_t6size_t6size_t6size_t6size_t6size_t4real4real6size_t6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3072 3073 3074 3075
<dd><p>Pooling backward operation. </p>
</dd></dl>

<dl class="function">
3076 3077
<dt id="_CPPv2N6paddle9GpuMatrix14avgPoolForwardER6Matrix6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t">
<span id="paddle::GpuMatrix::avgPoolForward__MatrixR.s.s.s.s.s.s.s.s.s.s.s"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1ab09ce823c7287dee4c41a4a5bbee089d"></span>void <code class="descname">avgPoolForward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>input</em>, size_t <em>imgSizeH</em>, size_t <em>imgSizeW</em>, size_t <em>channels</em>, size_t <em>sizeX</em>, size_t <em>sizeY</em>, size_t <em>strideH</em>, size_t <em>strideW</em>, size_t <em>outputH</em>, size_t <em>outputW</em>, size_t <em>paddingH</em>, size_t <em>paddingW</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix14avgPoolForwardER6Matrix6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3078 3079 3080 3081
<dd><p>Pooling forward operation, caculate the average of sizeX elements. </p>
</dd></dl>

<dl class="function">
3082 3083
<dt id="_CPPv2N6paddle9GpuMatrix15avgPoolBackwardER6Matrix6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t4real4real6size_t6size_t">
<span id="paddle::GpuMatrix::avgPoolBackward__MatrixR.s.s.s.s.s.s.s.s.real.real.s.s"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a5e740986dcd3d3645c3c7c2f931c5f4f"></span>void <code class="descname">avgPoolBackward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>input</em>, size_t <em>imgSizeH</em>, size_t <em>imgSizeW</em>, size_t <em>sizeX</em>, size_t <em>sizeY</em>, size_t <em>strideH</em>, size_t <em>strideW</em>, size_t <em>outputH</em>, size_t <em>outputW</em>, real <em>scaleTargets</em>, real <em>scaleOutput</em>, size_t <em>paddingH</em>, size_t <em>paddingW</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix15avgPoolBackwardER6Matrix6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t4real4real6size_t6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3084 3085 3086
<dd></dd></dl>

<dl class="function">
3087
<dt id="_CPPv2N6paddle9GpuMatrix17crossMapNormalFwdER6Matrix6size_t6size_tR6Matrix6size_t6size_tff">
3088
<span id="paddle::GpuMatrix::crossMapNormalFwd__MatrixR.s.s.MatrixR.s.s.float.float"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a2e65451dd1f5b45c43d4451723d18162"></span>void <code class="descname">crossMapNormalFwd</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>input</em>, size_t <em>imgSizeH</em>, size_t <em>imgSizeW</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>denoms</em>, size_t <em>channels</em>, size_t <em>sizeX</em>, float <em>scale</em>, float <em>pow</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix17crossMapNormalFwdER6Matrix6size_t6size_tR6Matrix6size_t6size_tff" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3089 3090 3091 3092
<dd><p>normalize-operation. </p>
</dd></dl>

<dl class="function">
3093
<dt id="_CPPv2N6paddle9GpuMatrix17crossMapNormalBwdER6MatrixR6MatrixR6MatrixR6Matrix6size_t6size_t6size_t6size_tff">
3094
<span id="paddle::GpuMatrix::crossMapNormalBwd__MatrixR.MatrixR.MatrixR.MatrixR.s.s.s.s.float.float"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a0c357d4be65f82fdc869eb10102f80f3"></span>void <code class="descname">crossMapNormalBwd</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>localGrad</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>denoms</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>preOutV</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>localOutV</em>, size_t <em>channels</em>, size_t <em>imgSizeH</em>, size_t <em>imgSizeW</em>, size_t <em>sizeX</em>, float <em>scale</em>, float <em>pow</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix17crossMapNormalBwdER6MatrixR6MatrixR6MatrixR6Matrix6size_t6size_t6size_t6size_tff" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3095 3096 3097 3098
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix18maxSequenceForwardER6MatrixRK7IVectorR7IVector">
3099
<span id="paddle::GpuMatrix::maxSequenceForward__MatrixR.IVectorCR.IVectorR"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1ad9171d08337e4d25cf29b60dea6420fa"></span>void <code class="descname">maxSequenceForward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>input</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>sequence</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>index</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix18maxSequenceForwardER6MatrixRK7IVectorR7IVector" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3100 3101 3102 3103 3104 3105 3106
<dd><p>Input: one or more sequences. Each sequence contains some instances.</p>
<p>Output: output size is the number of input sequences (NOT input instances).</p>
<p>output[i] is set to max_input[i]. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix19maxSequenceBackwardER6MatrixRK7IVectorR7IVector">
3107
<span id="paddle::GpuMatrix::maxSequenceBackward__MatrixR.IVectorCR.IVectorR"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a2f12ba456a19d8fa84359eb52c8fd537"></span>void <code class="descname">maxSequenceBackward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outputGrad</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>sequence</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>index</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix19maxSequenceBackwardER6MatrixRK7IVectorR7IVector" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3108 3109 3110 3111
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix24contextProjectionForwardE9MatrixPtr9MatrixPtrRK7IVectorii6size_tb">
3112
<span id="paddle::GpuMatrix::contextProjectionForward__MatrixPtr.MatrixPtr.IVectorCR.i.i.s.b"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a557dbe9726bdfe5fd9c2355cf52d3038"></span>void <code class="descname">contextProjectionForward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>input</em>, <a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>weight</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>sequence</em>, int <em>contextLength</em>, int <em>contextStart</em>, size_t <em>beginPad</em>, bool <em>isPadding</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix24contextProjectionForwardE9MatrixPtr9MatrixPtrRK7IVectorii6size_tb" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3113 3114 3115 3116
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix29contextProjectionBackwardDataE9MatrixPtrRK7IVectorii">
3117
<span id="paddle::GpuMatrix::contextProjectionBackwardData__MatrixPtr.IVectorCR.i.i"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1ac6b4413a278aa2be7e64b6558938e9fb"></span>void <code class="descname">contextProjectionBackwardData</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>inputGrad</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>sequence</em>, int <em>contextLength</em>, int <em>contextStart</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix29contextProjectionBackwardDataE9MatrixPtrRK7IVectorii" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3118 3119 3120 3121
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix31contextProjectionBackwardWeightE9MatrixPtrRK7IVectoriii6size_t">
3122 3123 3124 3125 3126 3127
<span id="paddle::GpuMatrix::contextProjectionBackwardWeight__MatrixPtr.IVectorCR.i.i.i.s"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a911f790d2178077116eb157f5095dbac"></span>void <code class="descname">contextProjectionBackwardWeight</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>weightGrad</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>sequence</em>, int <em>contextLength</em>, int <em>contextStart</em>, int <em>totalPad</em>, size_t <em>beginPad</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix31contextProjectionBackwardWeightE9MatrixPtrRK7IVectoriii6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix15bilinearForwardERK6MatrixK6size_tK6size_tK6size_tK6size_tK6size_tK4realK4real">
<span id="paddle::GpuMatrix::bilinearForward__MatrixCR.sC.sC.sC.sC.sC.realC.realC"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1abf393d86bd0f8713713d970fb11b8e75"></span>void <code class="descname">bilinearForward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>in</em>, <em class="property">const</em> size_t <em>inImgH</em>, <em class="property">const</em> size_t <em>inImgW</em>, <em class="property">const</em> size_t <em>outImgH</em>, <em class="property">const</em> size_t <em>outImgW</em>, <em class="property">const</em> size_t <em>numChannels</em>, <em class="property">const</em> real <em>ratioH</em>, <em class="property">const</em> real <em>ratioW</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix15bilinearForwardERK6MatrixK6size_tK6size_tK6size_tK6size_tK6size_tK4realK4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3128 3129
<dd></dd></dl>

3130 3131 3132 3133 3134 3135 3136 3137 3138 3139 3140 3141 3142 3143 3144 3145 3146 3147 3148 3149 3150 3151 3152 3153 3154 3155 3156
<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix16bilinearBackwardERK6MatrixK6size_tK6size_tK6size_tK6size_tK6size_tK4realK4real">
<span id="paddle::GpuMatrix::bilinearBackward__MatrixCR.sC.sC.sC.sC.sC.realC.realC"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1aef5db74ffa3d20da9391f50586e9d652"></span>void <code class="descname">bilinearBackward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>out</em>, <em class="property">const</em> size_t <em>outImgH</em>, <em class="property">const</em> size_t <em>outImgW</em>, <em class="property">const</em> size_t <em>inImgH</em>, <em class="property">const</em> size_t <em>inImgW</em>, <em class="property">const</em> size_t <em>numChannels</em>, <em class="property">const</em> real <em>ratioH</em>, <em class="property">const</em> real <em>ratioW</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix16bilinearBackwardERK6MatrixK6size_tK6size_tK6size_tK6size_tK6size_tK4realK4real" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix28multiBinaryLabelCrossEntropyER6MatrixR6Matrix">
<span id="paddle::GpuMatrix::multiBinaryLabelCrossEntropy__MatrixR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1aae70a9f25eb236f97535ce37b94c579b"></span>void <code class="descname">multiBinaryLabelCrossEntropy</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>label</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix28multiBinaryLabelCrossEntropyER6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
<dd><p>cross entropy for multi binary labels </p>
<p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="o">-</span><span class="nb">sum</span><span class="p">(</span><span class="n">label</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">]</span><span class="o">*</span><span class="n">log</span><span class="p">(</span><span class="n">output</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">])</span>
          <span class="o">+</span> <span class="p">(</span><span class="mi">1</span><span class="o">-</span><span class="n">label</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">])</span><span class="o">*</span><span class="n">log</span><span class="p">(</span><span class="mi">1</span><span class="o">-</span><span class="n">output</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">]))</span>
</pre></div>
</div>
 </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix30multiBinaryLabelCrossEntropyBpER6MatrixR6Matrix">
<span id="paddle::GpuMatrix::multiBinaryLabelCrossEntropyBp__MatrixR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a02679de8ad2c7e54eece4620d0832b5a"></span>void <code class="descname">multiBinaryLabelCrossEntropyBp</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>label</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix30multiBinaryLabelCrossEntropyBpER6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
<dd><p>The gradient of cross entropy for multi binary labels on output. </p>
<p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">]</span> <span class="o">=</span> <span class="o">-</span><span class="n">label</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">]</span><span class="o">/</span><span class="n">output</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">]</span>
             <span class="o">+</span> <span class="p">(</span><span class="mi">1</span><span class="o">-</span><span class="n">label</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">])</span><span class="o">/</span><span class="p">(</span><span class="mi">1</span><span class="o">-</span><span class="n">output</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">])</span>
</pre></div>
</div>
 </p>
</dd></dl>

Y
Yu Yang 已提交
3157 3158 3159 3160
</div>
</dd></dl>

<dl class="class">
3161 3162 3163 3164
<dt id="_CPPv2N6paddle9CpuMatrixE">
<span id="paddle::CpuMatrix"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix"></span><em class="property">class </em><code class="descname">CpuMatrix</code><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrixE" title="Permalink to this definition">¶</a></dt>
<dd><p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Matrix"><span class="std std-ref">paddle::Matrix</span></a></p>
<p>Subclassed by <a class="reference internal" href="#paddleclasspaddle_1_1SharedCpuMatrix"><span class="std std-ref">paddle::SharedCpuMatrix</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1SparseRowCpuMatrix"><span class="std std-ref">paddle::SparseRowCpuMatrix</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1SparseRowIdsCpuMatrix"><span class="std std-ref">paddle::SparseRowIdsCpuMatrix</span></a></p>
3165
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
3166 3167
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
3168 3169 3170
<dt id="_CPPv2N6paddle9CpuMatrix9CpuMatrixE6size_t6size_tb">
<span id="paddle::CpuMatrix::CpuMatrix__s.s.b"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1adfca558c20ac1f828d54118f31f61d20"></span><code class="descname">CpuMatrix</code><span class="sig-paren">(</span>size_t <em>height</em>, size_t <em>width</em>, bool <em>trans</em> = false<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix9CpuMatrixE6size_t6size_tb" title="Permalink to this definition">¶</a></dt>
<dd><p><a class="reference internal" href="#paddleclasspaddle_1_1CpuMatrix"><span class="std std-ref">CpuMatrix</span></a> </p>
Y
Yu Yang 已提交
3171 3172 3173
</dd></dl>

<dl class="function">
3174 3175 3176
<dt id="_CPPv2N6paddle9CpuMatrix9CpuMatrixEP4real6size_t6size_tb">
<span id="paddle::CpuMatrix::CpuMatrix__realP.s.s.b"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1acf183dc85fd9e94fa436e05e1ac52b18"></span><code class="descname">CpuMatrix</code><span class="sig-paren">(</span>real *<em>data</em>, size_t <em>height</em>, size_t <em>width</em>, bool <em>trans</em> = false<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix9CpuMatrixEP4real6size_t6size_tb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
Y
Yu Yang 已提交
3177 3178

<dl class="function">
3179 3180
<dt id="_CPPv2N6paddle9CpuMatrix9CpuMatrixEP4real6size_t6size_t6size_tb">
<span id="paddle::CpuMatrix::CpuMatrix__realP.s.s.s.b"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a06cdf0a3ac0cf37c7d09a8ebe1469909"></span><code class="descname">CpuMatrix</code><span class="sig-paren">(</span>real *<em>data</em>, size_t <em>height</em>, size_t <em>width</em>, size_t <em>stride</em>, bool <em>trans</em> = false<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix9CpuMatrixEP4real6size_t6size_t6size_tb" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3181 3182 3183
<dd></dd></dl>

<dl class="function">
3184 3185
<dt id="_CPPv2N6paddle9CpuMatrix9CpuMatrixE15CpuMemHandlePtr6size_t6size_tb">
<span id="paddle::CpuMatrix::CpuMatrix__CpuMemHandlePtr.s.s.b"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a25284592c9fc27de797d8b9e4b2ade61"></span><code class="descname">CpuMatrix</code><span class="sig-paren">(</span><a class="reference internal" href="../utils/utils.html#_CPPv2N6paddle15CpuMemHandlePtrE" title="paddle::CpuMemHandlePtr">CpuMemHandlePtr</a> <em>dataHandle</em>, size_t <em>height</em>, size_t <em>width</em>, bool <em>trans</em> = false<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix9CpuMatrixE15CpuMemHandlePtr6size_t6size_tb" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3186 3187 3188
<dd></dd></dl>

<dl class="function">
3189 3190
<dt id="_CPPv2N6paddle9CpuMatrixD0Ev">
<span id="paddle::CpuMatrix::~CpuMatrix"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a044500bdd9c50b0fe9fd07a32cf90677"></span><code class="descname">~CpuMatrix</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrixD0Ev" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3191 3192 3193
<dd></dd></dl>

<dl class="function">
3194
<dt id="_CPPv2N6paddle9CpuMatrix7zeroMemEv">
3195
<span id="paddle::CpuMatrix::zeroMem"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a5cf9e363edf0ec7a5d52dfb132cf5da5"></span>void <code class="descname">zeroMem</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix7zeroMemEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3196 3197 3198
<dd></dd></dl>

<dl class="function">
3199
<dt id="_CPPv2N6paddle9CpuMatrix8resetOneEv">
3200 3201 3202 3203 3204 3205
<span id="paddle::CpuMatrix::resetOne"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a1dc25aef14a5824518bd4c3a7e1ddce2"></span>void <code class="descname">resetOne</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix8resetOneEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9CpuMatrix7setDiagE4real">
<span id="paddle::CpuMatrix::setDiag__real"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a76648184a52c3cfead8fc28ce257f3a3"></span>void <code class="descname">setDiag</code><span class="sig-paren">(</span>real <em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix7setDiagE4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3206 3207 3208
<dd></dd></dl>

<dl class="function">
3209
<dt id="_CPPv2N6paddle9CpuMatrix6resizeE6size_t6size_t">
3210
<span id="paddle::CpuMatrix::resize__s.s"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1ad2bec703a9265c5b541132b910b820f0"></span>void <code class="descname">resize</code><span class="sig-paren">(</span>size_t <em>newHeight</em>, size_t <em>newWidth</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix6resizeE6size_t6size_t" title="Permalink to this definition">¶</a></dt>
3211 3212 3213 3214 3215 3216
<dd><p><dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>Original data may not be preserved after <a class="reference internal" href="#paddleclasspaddle_1_1CpuMatrix_1ad2bec703a9265c5b541132b910b820f0"><span class="std std-ref">resize()</span></a>. </dd>
</dl>
</p>
</dd></dl>
Y
Yu Yang 已提交
3217 3218

<dl class="function">
3219
<dt id="_CPPv2N6paddle9CpuMatrix6resizeE6size_t6size_t6size_t15SparseValueType12SparseFormat">
3220
<span id="paddle::CpuMatrix::resize__s.s.s.SparseValueType.SparseFormat"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1aaf054249688c24bd859bf589638f757c"></span>void <code class="descname">resize</code><span class="sig-paren">(</span>size_t <em>newHeight</em>, size_t <em>newWidth</em>, size_t <em>newNnz</em>, <a class="reference internal" href="#_CPPv2N6paddle15SparseValueTypeE" title="paddle::SparseValueType">SparseValueType</a> <em>valueType</em>, <a class="reference internal" href="#_CPPv2N6paddle12SparseFormatE" title="paddle::SparseFormat">SparseFormat</a> <em>format</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix6resizeE6size_t6size_t6size_t15SparseValueType12SparseFormat" title="Permalink to this definition">¶</a></dt>
3221 3222 3223 3224 3225 3226
<dd><p><dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>This should only be used for sparse matrix. </dd>
</dl>
</p>
</dd></dl>
Y
Yu Yang 已提交
3227 3228

<dl class="function">
3229
<dt id="_CPPv2N6paddle9CpuMatrix6setRowE6size_t6size_tPKjPK4real">
3230
<span id="paddle::CpuMatrix::setRow__s.s.unsigned-iCP.realCP"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a17456ab806613e5cdc76c103535240e2"></span>void <code class="descname">setRow</code><span class="sig-paren">(</span>size_t <em>row</em>, size_t <em>colNum</em>, <em class="property">const</em> unsigned int *<em>cols</em>, <em class="property">const</em> real *<em>values</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix6setRowE6size_t6size_tPKjPK4real" title="Permalink to this definition">¶</a></dt>
3231 3232 3233
<dd><p>This should only be used for sparse matrix. </p>
<p>Currently must be called for each row in order. The matrix is not valid until setRow is called for the last row. </p>
</dd></dl>
Y
Yu Yang 已提交
3234 3235

<dl class="function">
3236 3237
<dt id="_CPPv2NK6paddle9CpuMatrix10getElementE6size_t6size_t">
<span id="paddle::CpuMatrix::getElement__s.sC"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1ac06aea73884d8d995dea6f52cbba0796"></span>real <code class="descname">getElement</code><span class="sig-paren">(</span>size_t <em>x</em>, size_t <em>y</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle9CpuMatrix10getElementE6size_t6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3238 3239 3240
<dd></dd></dl>

<dl class="function">
3241
<dt id="_CPPv2N6paddle9CpuMatrix6getSumEv">
3242
<span id="paddle::CpuMatrix::getSum"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a3ddef846847295568187cd7f911cbe8b"></span>real <code class="descname">getSum</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix6getSumEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3243 3244 3245
<dd></dd></dl>

<dl class="function">
3246
<dt id="_CPPv2N6paddle9CpuMatrix16accumulateColSumER6Matrix">
3247
<span id="paddle::CpuMatrix::accumulateColSum__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a53f3a958a29f5a2c6712043e66c65302"></span>void <code class="descname">accumulateColSum</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>src</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix16accumulateColSumER6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3248 3249 3250
<dd></dd></dl>

<dl class="function">
3251
<dt id="_CPPv2N6paddle9CpuMatrix9getAbsSumEv">
3252
<span id="paddle::CpuMatrix::getAbsSum"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1ac02f6dfb909059d9f86cd354173be4d9"></span>real <code class="descname">getAbsSum</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix9getAbsSumEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3253 3254 3255
<dd></dd></dl>

<dl class="function">
3256
<dt id="_CPPv2N6paddle9CpuMatrix12getTransposeEv">
3257
<span id="paddle::CpuMatrix::getTranspose"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a05696fc9dd9ecff6c8de49ac3a8fd638"></span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">getTranspose</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix12getTransposeEv" title="Permalink to this definition">¶</a></dt>
3258
<dd></dd></dl>
Y
Yu Yang 已提交
3259 3260

<dl class="function">
3261
<dt id="_CPPv2N6paddle9CpuMatrix9transposeE9MatrixPtrb">
3262
<span id="paddle::CpuMatrix::transpose__MatrixPtr.b"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a429ccbb076d2187c6984287827c5c397"></span>void <code class="descname">transpose</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>matTrans</em>, bool <em>memAlloc</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix9transposeE9MatrixPtrb" title="Permalink to this definition">¶</a></dt>
3263 3264 3265
<dd><p>hard transpose. </p>
<p>allocate matTrans&#8217; memory outside, then set memAlloc as false; else set as true. </p>
</dd></dl>
Y
Yu Yang 已提交
3266

3267 3268 3269 3270 3271 3272 3273 3274 3275 3276 3277 3278
<dl class="function">
<dt id="_CPPv2N6paddle9CpuMatrix10getInverseEv">
<span id="paddle::CpuMatrix::getInverse"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a8ea9af1a39b04e968cef22d25a2471b2"></span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">getInverse</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix10getInverseEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9CpuMatrix7inverseE9MatrixPtrb">
<span id="paddle::CpuMatrix::inverse__MatrixPtr.b"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1aaab7554e0f84489c4a7c954645927000"></span>void <code class="descname">inverse</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>matInv</em>, bool <em>memAlloc</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix7inverseE9MatrixPtrb" title="Permalink to this definition">¶</a></dt>
<dd><p>inverse. </p>
<p>if allocate matInv&#8217;s memory outside, then set memAlloc as false; else set as true. </p>
</dd></dl>

Y
Yu Yang 已提交
3279
<dl class="function">
3280
<dt id="_CPPv2N6paddle9CpuMatrix8copyFromERK6Matrix">
3281
<span id="paddle::CpuMatrix::copyFrom__MatrixCR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1ae74583a71aae6ebb68ca31f491af265f"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>src</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix8copyFromERK6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3282 3283 3284
<dd></dd></dl>

<dl class="function">
3285
<dt id="_CPPv2N6paddle9CpuMatrix8copyFromERK6Matrix11hl_stream_t">
3286
<span id="paddle::CpuMatrix::copyFrom__MatrixCR.hl_stream_t"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a7279e98655aec449c5f7f8d1348f000b"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>src</em>, <a class="reference internal" href="../../cuda/utils/utils.html#_CPPv211hl_stream_t" title="hl_stream_t">hl_stream_t</a> <em>stream</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix8copyFromERK6Matrix11hl_stream_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3287 3288 3289
<dd></dd></dl>

<dl class="function">
3290
<dt id="_CPPv2N6paddle9CpuMatrix8copyFromEPK4real6size_t">
3291
<span id="paddle::CpuMatrix::copyFrom__realCP.s"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a8e8f13c560d7f91047c4e08b178826a8"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> real *<em>src</em>, size_t <em>size</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix8copyFromEPK4real6size_t" title="Permalink to this definition">¶</a></dt>
3292 3293 3294
<dd><p>If this is <a class="reference internal" href="#paddleclasspaddle_1_1GpuMatrix"><span class="std std-ref">GpuMatrix</span></a>, src is assumed to be CPU memory</p>
<p>If this is <a class="reference internal" href="#paddleclasspaddle_1_1CpuMatrix"><span class="std std-ref">CpuMatrix</span></a>, src is assumed to be CPU memory </p>
</dd></dl>
Y
Yu Yang 已提交
3295 3296

<dl class="function">
3297
<dt id="_CPPv2N6paddle9CpuMatrix8copyFromEPK4realPK7int64_t">
3298
<span id="paddle::CpuMatrix::copyFrom__realCP.int64_tCP"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1ab5a67a2704ad95af84f975ce3cbbb356"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> real *<em>cpuSrc</em>, <em class="property">const</em> int64_t *<em>seq</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix8copyFromEPK4realPK7int64_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3299 3300 3301
<dd></dd></dl>

<dl class="function">
3302
<dt id="_CPPv2N6paddle9CpuMatrix8copyFromERK7IVector">
3303
<span id="paddle::CpuMatrix::copyFrom__IVectorCR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a4a177e83e582d0090c2458ad99406026"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>src</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix8copyFromERK7IVector" title="Permalink to this definition">¶</a></dt>
3304 3305 3306 3307
<dd><p>convert a int vector to a real matrix. </p>
<p>(1) source and dest are both in CPU.</p>
<p>(2) sizes are exactly match. </p>
</dd></dl>
Y
Yu Yang 已提交
3308 3309

<dl class="function">
3310 3311
<dt id="_CPPv2N6paddle9CpuMatrix8copyFromER15CpuSparseMatrix">
<span id="paddle::CpuMatrix::copyFrom__CpuSparseMatrixR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1afbc858062ea1571f21a52675d2ace56a"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle15CpuSparseMatrixE" title="paddle::CpuSparseMatrix">CpuSparseMatrix</a> &amp;<em>src</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix8copyFromER15CpuSparseMatrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3312 3313 3314
<dd></dd></dl>

<dl class="function">
3315 3316
<dt id="_CPPv2N6paddle9CpuMatrix14copyByRowIndexER6MatrixRK7IVector">
<span id="paddle::CpuMatrix::copyByRowIndex__MatrixR.IVectorCR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a8bfc00af2e2e972193b762434e26d979"></span>void <code class="descname">copyByRowIndex</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>b</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>rowIndex</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix14copyByRowIndexER6MatrixRK7IVector" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3317 3318 3319
<dd></dd></dl>

<dl class="function">
3320
<dt id="_CPPv2N6paddle9CpuMatrix5cloneE6size_t6size_tb">
3321
<span id="paddle::CpuMatrix::clone__s.s.b"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1aed972c0fc83de8087d6d29c70dbaabd8"></span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">clone</code><span class="sig-paren">(</span>size_t <em>height</em>, size_t <em>width</em>, bool <em>useGpu</em> = false<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix5cloneE6size_t6size_tb" title="Permalink to this definition">¶</a></dt>
3322 3323 3324
<dd><p>Create a matrix with the same type (<a class="reference internal" href="#paddleclasspaddle_1_1GpuMatrix"><span class="std std-ref">GpuMatrix</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1CpuMatrix"><span class="std std-ref">CpuMatrix</span></a>, NonValueSparseMatrix, etc.) as this. </p>
<p>If height and width is zero, the new matrix will have the same size as this, otherwise the new matrix will have the specified size. </p>
</dd></dl>
Y
Yu Yang 已提交
3325 3326

<dl class="function">
3327
<dt id="_CPPv2N6paddle9CpuMatrix10convExpandER6Matrixiiiiiiiiiii">
3328
<span id="paddle::CpuMatrix::convExpand__MatrixR.i.i.i.i.i.i.i.i.i.i.i"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1afc7fdb74c2b35e98654244df8d7bec30"></span>void <code class="descname">convExpand</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>feature</em>, int <em>feaImgHeight</em>, int <em>feaImgWidth</em>, int <em>channels</em>, int <em>blockH</em>, int <em>blockW</em>, int <em>strideH</em>, int <em>strideW</em>, int <em>paddingH</em>, int <em>paddingW</em>, int <em>outputH</em>, int <em>outputW</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix10convExpandER6Matrixiiiiiiiiiii" title="Permalink to this definition">¶</a></dt>
3329 3330 3331
<dd><p>This function is used to calculate the convolution:</p>
<p>It will expand a feature matrix according to the convolution filters </p>
</dd></dl>
Y
Yu Yang 已提交
3332 3333

<dl class="function">
3334
<dt id="_CPPv2N6paddle9CpuMatrix10convShrinkER6Matrixiiiiiiiiiii4real4real">
3335
<span id="paddle::CpuMatrix::convShrink__MatrixR.i.i.i.i.i.i.i.i.i.i.i.real.real"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1aed62dc2d9b1ca52f88e0e39e219903ee"></span>void <code class="descname">convShrink</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>expandColMat</em>, int <em>thisImgHeight</em>, int <em>thisImgWidth</em>, int <em>channels</em>, int <em>blockH</em>, int <em>blockW</em>, int <em>strideH</em>, int <em>strideW</em>, int <em>paddingH</em>, int <em>paddingW</em>, int <em>outputH</em>, int <em>outputW</em>, real <em>alpha</em> = 1.0f, real <em>beta</em> = 0.0f<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix10convShrinkER6Matrixiiiiiiiiiii4real4real" title="Permalink to this definition">¶</a></dt>
3336 3337 3338
<dd><p>This function is the reverse implementation of convExpand:</p>
<p>Its function is to restore a expanded-matrix into a feature matrix </p>
</dd></dl>
Y
Yu Yang 已提交
3339 3340

<dl class="function">
3341 3342
<dt id="_CPPv2N6paddle9CpuMatrix14maxPoolForwardER6Matrix6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t">
<span id="paddle::CpuMatrix::maxPoolForward__MatrixR.s.s.s.s.s.s.s.s.s.s.s"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a2af927c8337cb6ddda40a4402d44c394"></span>void <code class="descname">maxPoolForward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>inputMat</em>, size_t <em>imgSizeH</em>, size_t <em>imgSizeW</em>, size_t <em>channels</em>, size_t <em>sizeX</em>, size_t <em>sizeY</em>, size_t <em>strideH</em>, size_t <em>strideW</em>, size_t <em>outputH</em>, size_t <em>outputW</em>, size_t <em>paddingH</em>, size_t <em>paddingW</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix14maxPoolForwardER6Matrix6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t" title="Permalink to this definition">¶</a></dt>
3343
<dd><p>Pooling forward operation, pick out the largest element in the sizeX of value </p>
Y
Yu Yang 已提交
3344 3345 3346
</dd></dl>

<dl class="function">
3347 3348
<dt id="_CPPv2N6paddle9CpuMatrix15maxPoolBackwardER6Matrix6size_t6size_tR6MatrixR6Matrix6size_t6size_t6size_t6size_t6size_t6size_t4real4real6size_t6size_t">
<span id="paddle::CpuMatrix::maxPoolBackward__MatrixR.s.s.MatrixR.MatrixR.s.s.s.s.s.s.real.real.s.s"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1aea22ae371bfe4055ffdbabcfc53e6cb3"></span>void <code class="descname">maxPoolBackward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>image</em>, size_t <em>imgSizeH</em>, size_t <em>imgSizeW</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outGrad</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outV</em>, size_t <em>sizeX</em>, size_t <em>sizeY</em>, size_t <em>strideH</em>, size_t <em>strideW</em>, size_t <em>outputH</em>, size_t <em>outputW</em>, real <em>scaleTargets</em>, real <em>scaleOutput</em>, size_t <em>paddingH</em>, size_t <em>paddingW</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix15maxPoolBackwardER6Matrix6size_t6size_tR6MatrixR6Matrix6size_t6size_t6size_t6size_t6size_t6size_t4real4real6size_t6size_t" title="Permalink to this definition">¶</a></dt>
3349 3350
<dd><p>Pooling backward operation. </p>
</dd></dl>
Y
Yu Yang 已提交
3351 3352

<dl class="function">
3353 3354
<dt id="_CPPv2N6paddle9CpuMatrix14avgPoolForwardER6Matrix6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t">
<span id="paddle::CpuMatrix::avgPoolForward__MatrixR.s.s.s.s.s.s.s.s.s.s.s"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a62dc202b6fcd472babe8c6a7abfb67c8"></span>void <code class="descname">avgPoolForward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>input</em>, size_t <em>imgSizeH</em>, size_t <em>imgSizeW</em>, size_t <em>channels</em>, size_t <em>sizeX</em>, size_t <em>sizeY</em>, size_t <em>strideH</em>, size_t <em>strideW</em>, size_t <em>outputH</em>, size_t <em>outputW</em>, size_t <em>paddingH</em>, size_t <em>paddingW</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix14avgPoolForwardER6Matrix6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t" title="Permalink to this definition">¶</a></dt>
3355
<dd><p>Pooling forward operation, caculate the average of sizeX elements. </p>
Y
Yu Yang 已提交
3356 3357 3358
</dd></dl>

<dl class="function">
3359 3360
<dt id="_CPPv2N6paddle9CpuMatrix15avgPoolBackwardER6Matrix6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t4real4real6size_t6size_t">
<span id="paddle::CpuMatrix::avgPoolBackward__MatrixR.s.s.s.s.s.s.s.s.real.real.s.s"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1ad47406cc380f6e3dc4b329924f644fa9"></span>void <code class="descname">avgPoolBackward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>input</em>, size_t <em>imgSizeH</em>, size_t <em>imgSizeW</em>, size_t <em>sizeX</em>, size_t <em>sizeY</em>, size_t <em>strideH</em>, size_t <em>strideW</em>, size_t <em>outputH</em>, size_t <em>outputW</em>, real <em>scaleTargets</em>, real <em>scaleOutput</em>, size_t <em>paddingH</em>, size_t <em>paddingW</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix15avgPoolBackwardER6Matrix6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t4real4real6size_t6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3361 3362 3363
<dd></dd></dl>

<dl class="function">
3364
<dt id="_CPPv2N6paddle9CpuMatrix17crossMapNormalFwdER6Matrix6size_t6size_tR6Matrix6size_t6size_tff">
3365
<span id="paddle::CpuMatrix::crossMapNormalFwd__MatrixR.s.s.MatrixR.s.s.float.float"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1abb804c698632298abc85fac618141159"></span>void <code class="descname">crossMapNormalFwd</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>input</em>, size_t <em>imgSizeH</em>, size_t <em>imgSizeW</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>denoms</em>, size_t <em>channels</em>, size_t <em>sizeX</em>, float <em>scale</em>, float <em>pow</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix17crossMapNormalFwdER6Matrix6size_t6size_tR6Matrix6size_t6size_tff" title="Permalink to this definition">¶</a></dt>
3366
<dd><p>normalize-operation. </p>
Y
Yu Yang 已提交
3367 3368 3369
</dd></dl>

<dl class="function">
3370
<dt id="_CPPv2N6paddle9CpuMatrix17crossMapNormalBwdER6MatrixR6MatrixR6MatrixR6Matrix6size_t6size_t6size_t6size_tff">
3371
<span id="paddle::CpuMatrix::crossMapNormalBwd__MatrixR.MatrixR.MatrixR.MatrixR.s.s.s.s.float.float"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a14d85c02e91a2f8706149b67fc148d15"></span>void <code class="descname">crossMapNormalBwd</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>localGrad</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>denoms</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>preOutV</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>localOutV</em>, size_t <em>channels</em>, size_t <em>imgSizeH</em>, size_t <em>imgSizeW</em>, size_t <em>sizeX</em>, float <em>scale</em>, float <em>pow</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix17crossMapNormalBwdER6MatrixR6MatrixR6MatrixR6Matrix6size_t6size_t6size_t6size_tff" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3372 3373 3374
<dd></dd></dl>

<dl class="function">
3375
<dt id="_CPPv2N6paddle9CpuMatrix18maxSequenceForwardER6MatrixRK7IVectorR7IVector">
3376
<span id="paddle::CpuMatrix::maxSequenceForward__MatrixR.IVectorCR.IVectorR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a5280ecf08d5b84c772f9c7618ebb6a20"></span>void <code class="descname">maxSequenceForward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>input</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>sequence</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>index</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix18maxSequenceForwardER6MatrixRK7IVectorR7IVector" title="Permalink to this definition">¶</a></dt>
3377 3378 3379 3380 3381
<dd><p>Input: one or more sequences. Each sequence contains some instances. Output: output size is the number of input sequences (NOT input instances). output[i] is set to max_{for each instance in this sequence}{input[i]} </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9CpuMatrix19maxSequenceBackwardER6MatrixRK7IVectorR7IVector">
3382
<span id="paddle::CpuMatrix::maxSequenceBackward__MatrixR.IVectorCR.IVectorR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1aef02ab20cd88232489234d9de4e7b18c"></span>void <code class="descname">maxSequenceBackward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outputGrad</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>sequence</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>index</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix19maxSequenceBackwardER6MatrixRK7IVectorR7IVector" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3383 3384 3385
<dd></dd></dl>

<dl class="function">
3386
<dt id="_CPPv2N6paddle9CpuMatrix24contextProjectionForwardE9MatrixPtr9MatrixPtrRK7IVectorii6size_tb">
3387
<span id="paddle::CpuMatrix::contextProjectionForward__MatrixPtr.MatrixPtr.IVectorCR.i.i.s.b"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1aac3bacd5e4d199066065152ac764ac01"></span>void <code class="descname">contextProjectionForward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>input</em>, <a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>weight</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>sequence</em>, int <em>contextLength</em>, int <em>contextStart</em>, size_t <em>beginPad</em>, bool <em>isPadding</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix24contextProjectionForwardE9MatrixPtr9MatrixPtrRK7IVectorii6size_tb" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3388 3389 3390
<dd></dd></dl>

<dl class="function">
3391
<dt id="_CPPv2N6paddle9CpuMatrix25contextProjectionBackwardE9MatrixPtr9MatrixPtrRK7IVectorii6size_tb">
3392
<span id="paddle::CpuMatrix::contextProjectionBackward__MatrixPtr.MatrixPtr.IVectorCR.i.i.s.b"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a325263f7191dbb91dfc57508722f7304"></span>void <code class="descname">contextProjectionBackward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>inputGrad</em>, <a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>weightGrad</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>sequence</em>, int <em>contextLength</em>, int <em>contextStart</em>, size_t <em>beginPad</em>, bool <em>isPadding</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix25contextProjectionBackwardE9MatrixPtr9MatrixPtrRK7IVectorii6size_tb" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3393 3394 3395
<dd></dd></dl>

<dl class="function">
3396 3397
<dt id="_CPPv2N6paddle9CpuMatrix6getRowE6size_t">
<span id="paddle::CpuMatrix::getRow__s"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a78709f065f7d78f0b8188162a805e2ca"></span>real *<code class="descname">getRow</code><span class="sig-paren">(</span>size_t <em>row</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix6getRowE6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3398 3399 3400
<dd></dd></dl>

<dl class="function">
3401
<dt id="_CPPv2N6paddle9CpuMatrix9getRowBufE6size_t">
3402
<span id="paddle::CpuMatrix::getRowBuf__s"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a55bfc3c285e4213510fe9b13f0acc6d2"></span><em class="property">virtual</em> real *<code class="descname">getRowBuf</code><span class="sig-paren">(</span>size_t <em>row</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix9getRowBufE6size_t" title="Permalink to this definition">¶</a></dt>
3403
<dd></dd></dl>
Y
Yu Yang 已提交
3404 3405

<dl class="function">
3406
<dt id="_CPPv2N6paddle9CpuMatrix7addBiasER6Matrix4real">
3407
<span id="paddle::CpuMatrix::addBias__MatrixR.real"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a0e1b7287c111d117c84cdceb2bf9e593"></span>void <code class="descname">addBias</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>b</em>, real <em>scale</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix7addBiasER6Matrix4real" title="Permalink to this definition">¶</a></dt>
3408
<dd><p>add b to each sample of this. </p>
Y
Yu Yang 已提交
3409 3410
</dd></dl>

3411 3412 3413 3414 3415
<dl class="function">
<dt id="_CPPv2N6paddle9CpuMatrix13addSharedBiasER6Matrix4real">
<span id="paddle::CpuMatrix::addSharedBias__MatrixR.real"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1abb8d8e5457ff57672080d3f89769ff90"></span>void <code class="descname">addSharedBias</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>b</em>, real <em>scale</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix13addSharedBiasER6Matrix4real" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

Y
Yu Yang 已提交
3416
<dl class="function">
3417
<dt id="_CPPv2N6paddle9CpuMatrix11collectBiasER6Matrix4real">
3418
<span id="paddle::CpuMatrix::collectBias__MatrixR.real"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1ad1eec532274d532e70b8af29bc437fe1"></span>void <code class="descname">collectBias</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>a</em>, real <em>scale</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix11collectBiasER6Matrix4real" title="Permalink to this definition">¶</a></dt>
3419
<dd><p>add each sample of a to this. </p>
Y
Yu Yang 已提交
3420 3421
</dd></dl>

3422 3423 3424 3425 3426
<dl class="function">
<dt id="_CPPv2N6paddle9CpuMatrix17collectSharedBiasER6Matrix4real">
<span id="paddle::CpuMatrix::collectSharedBias__MatrixR.real"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1abaeabb05da221bf4dee99418e10df9dc"></span>void <code class="descname">collectSharedBias</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>a</em>, real <em>scale</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix17collectSharedBiasER6Matrix4real" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

Y
Yu Yang 已提交
3427
<dl class="function">
3428
<dt id="_CPPv2N6paddle9CpuMatrix18sequenceAvgForwardER6MatrixRK7IVectori">
3429
<span id="paddle::CpuMatrix::sequenceAvgForward__MatrixR.IVectorCR.i"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a3b4bb3c94d76c507c8ad95892e2e688d"></span>void <code class="descname">sequenceAvgForward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>a</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>startsPos</em>, int <em>mode</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix18sequenceAvgForwardER6MatrixRK7IVectori" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3430 3431 3432
<dd></dd></dl>

<dl class="function">
3433
<dt id="_CPPv2N6paddle9CpuMatrix10selectRowsER6MatrixR7IVector">
3434 3435
<span id="paddle::CpuMatrix::selectRows__MatrixR.IVectorR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a32e5cb0d990ef682dee512f3056771f6"></span>void <code class="descname">selectRows</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>table</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>ids</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix10selectRowsER6MatrixR7IVector" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span><span class="o">.</span><span class="n">row</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">+=</span> <span class="n">table</span><span class="o">.</span><span class="n">row</span><span class="p">[</span><span class="n">ids</span><span class="p">[</span><span class="n">i</span><span class="p">]]</span>
3436 3437
</pre></div>
</div>
3438
 </p>
Y
Yu Yang 已提交
3439 3440 3441
</dd></dl>

<dl class="function">
3442
<dt id="_CPPv2N6paddle9CpuMatrix9addToRowsER6MatrixR7IVector">
3443 3444
<span id="paddle::CpuMatrix::addToRows__MatrixR.IVectorR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a28f626e8717a4a5e1c89fad904b13ae2"></span>void <code class="descname">addToRows</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>table</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>ids</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix9addToRowsER6MatrixR7IVector" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">table</span><span class="o">.</span><span class="n">row</span><span class="p">[</span><span class="n">ids</span><span class="p">[</span><span class="n">i</span><span class="p">]]</span> <span class="o">+=</span> <span class="n">this</span><span class="o">.</span><span class="n">row</span><span class="p">[</span><span class="n">i</span><span class="p">]</span>
3445 3446
</pre></div>
</div>
3447
 </p>
Y
Yu Yang 已提交
3448 3449 3450
</dd></dl>

<dl class="function">
3451
<dt id="_CPPv2N6paddle9CpuMatrix14selectElementsER6MatrixR7IVector">
3452 3453
<span id="paddle::CpuMatrix::selectElements__MatrixR.IVectorR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1aa23deb0850eeda52180bb32a81284525"></span>void <code class="descname">selectElements</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>table</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>ids</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix14selectElementsER6MatrixR7IVector" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="n">table</span><span class="p">[</span><span class="n">i</span><span class="p">,</span> <span class="nb">id</span><span class="p">[</span><span class="n">i</span><span class="p">]]</span>
3454 3455
</pre></div>
</div>
3456
 </p>
3457
</dd></dl>
Y
Yu Yang 已提交
3458 3459

<dl class="function">
3460
<dt id="_CPPv2N6paddle9CpuMatrix11addElementsER6MatrixR7IVector">
3461 3462
<span id="paddle::CpuMatrix::addElements__MatrixR.IVectorR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1acfe653d567cf81036765730330ad29d7"></span>void <code class="descname">addElements</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>table</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>ids</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix11addElementsER6MatrixR7IVector" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">table</span><span class="p">[</span><span class="n">i</span><span class="p">,</span> <span class="nb">id</span><span class="p">[</span><span class="n">i</span><span class="p">]]</span> <span class="o">+=</span> <span class="n">this</span><span class="p">[</span><span class="n">i</span><span class="p">]</span>
3463 3464
</pre></div>
</div>
3465
 </p>
Y
Yu Yang 已提交
3466 3467 3468
</dd></dl>

<dl class="function">
3469 3470 3471 3472 3473 3474
<dt>
<em class="property">template </em>&lt;<em class="property">typename</em> TableMatType&gt;</dt>
<dt id="_CPPv2N6paddle9CpuMatrix13selectRowsImpER12TableMatTypeR7IVector">
<span id="paddle::CpuMatrix::selectRowsImp__TableMatTypeR.IVectorR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a5bd6f72f56b366b3bcdf2867c0af5799"></span>void <code class="descname">selectRowsImp</code><span class="sig-paren">(</span>TableMatType &amp;<em>table</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>ids</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix13selectRowsImpER12TableMatTypeR7IVector" title="Permalink to this definition">¶</a></dt>
<dd><p>use abstract getRow() to get row from table.</p>
<p>Define table as template instead of virtual class for performance sake. internal used by above two virtual funcs. </p>
Y
Yu Yang 已提交
3475 3476 3477
</dd></dl>

<dl class="function">
3478 3479 3480 3481
<dt>
<em class="property">template </em>&lt;<em class="property">typename</em> TableMatType&gt;</dt>
<dt id="_CPPv2N6paddle9CpuMatrix12addToRowsImpER12TableMatTypeR7IVector">
<span id="paddle::CpuMatrix::addToRowsImp__TableMatTypeR.IVectorR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1aecafde5656b78628140a776e6e3f5e14"></span>void <code class="descname">addToRowsImp</code><span class="sig-paren">(</span>TableMatType &amp;<em>table</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>ids</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix12addToRowsImpER12TableMatTypeR7IVector" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3482 3483 3484
<dd></dd></dl>

<dl class="function">
3485
<dt id="_CPPv2N6paddle9CpuMatrix15addColumnVectorERK6Matrix">
3486
<span id="paddle::CpuMatrix::addColumnVector__MatrixCR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1ad411f893387937050e3f701de3a8a62d"></span>void <code class="descname">addColumnVector</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix15addColumnVectorERK6Matrix" title="Permalink to this definition">¶</a></dt>
3487 3488 3489 3490 3491
<dd><p>Add a vector (column) b to matrix a, column by column. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9CpuMatrix3mulEK9MatrixPtrK9MatrixPtr4real4real">
3492 3493
<span id="paddle::CpuMatrix::mul__MatrixPtrC.MatrixPtrC.real.real"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1adcb8d5e85a03436cb40ad29f27cf0970"></span>void <code class="descname">mul</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>a</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>b</em>, real <em>scaleAB</em>, real <em>scaleT</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix3mulEK9MatrixPtrK9MatrixPtr4real4real" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">scaleAB</span><span class="o">*</span><span class="p">(</span><span class="n">a</span><span class="o">*</span><span class="n">b</span><span class="p">)</span> <span class="o">+</span> <span class="n">scaleT</span><span class="o">*</span><span class="n">this</span>
Y
Yu Yang 已提交
3494 3495
</pre></div>
</div>
3496
 </p>
Y
Yu Yang 已提交
3497 3498 3499
</dd></dl>

<dl class="function">
3500 3501 3502
<dt id="_CPPv2N6paddle9CpuMatrix3mulEP9CpuMatrixP9CpuMatrix4real4real">
<span id="paddle::CpuMatrix::mul__CpuMatrixP.CpuMatrixP.real.real"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1ab5ec04f52303c1453e960973a2daad90"></span>void <code class="descname">mul</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle9CpuMatrixE" title="paddle::CpuMatrix">CpuMatrix</a> *<em>a</em>, <a class="reference internal" href="#_CPPv2N6paddle9CpuMatrixE" title="paddle::CpuMatrix">CpuMatrix</a> *<em>b</em>, real <em>scaleAB</em>, real <em>scaleT</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix3mulEP9CpuMatrixP9CpuMatrix4real4real" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
Y
Yu Yang 已提交
3503 3504

<dl class="function">
3505 3506 3507 3508 3509 3510
<dt id="_CPPv2N6paddle9CpuMatrix3mulEP9CpuMatrixP15CpuSparseMatrix4real4real">
<span id="paddle::CpuMatrix::mul__CpuMatrixP.CpuSparseMatrixP.real.real"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a04ef420fd15507675d5656781d9b202a"></span>void <code class="descname">mul</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle9CpuMatrixE" title="paddle::CpuMatrix">CpuMatrix</a> *<em>a</em>, <a class="reference internal" href="#_CPPv2N6paddle15CpuSparseMatrixE" title="paddle::CpuSparseMatrix">CpuSparseMatrix</a> *<em>b</em>, real <em>scaleAB</em>, real <em>scaleT</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix3mulEP9CpuMatrixP15CpuSparseMatrix4real4real" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9CpuMatrix3mulEP15CpuSparseMatrixP9CpuMatrix4real4real">
3511
<span id="paddle::CpuMatrix::mul__CpuSparseMatrixP.CpuMatrixP.real.real"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a1687635d3f45ada2f3ad737a9ff11c6f"></span>void <code class="descname">mul</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle15CpuSparseMatrixE" title="paddle::CpuSparseMatrix">CpuSparseMatrix</a> *<em>a</em>, <a class="reference internal" href="#_CPPv2N6paddle9CpuMatrixE" title="paddle::CpuMatrix">CpuMatrix</a> *<em>b</em>, real <em>scaleAB</em>, real <em>scaleT</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix3mulEP15CpuSparseMatrixP9CpuMatrix4real4real" title="Permalink to this definition">¶</a></dt>
3512 3513 3514 3515
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9CpuMatrix3mulEK9MatrixPtrK9MatrixPtr">
3516 3517
<span id="paddle::CpuMatrix::mul__MatrixPtrC.MatrixPtrC"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a851653052c2f9397519866db4f90d9bb"></span>void <code class="descname">mul</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>a</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix3mulEK9MatrixPtrK9MatrixPtr" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">a</span><span class="o">*</span><span class="n">b</span>
Y
Yu Yang 已提交
3518 3519
</pre></div>
</div>
3520
 </p>
Y
Yu Yang 已提交
3521 3522 3523
</dd></dl>

<dl class="function">
3524
<dt id="_CPPv2N6paddle9CpuMatrix8rightMulER6Matrix4real4real">
3525 3526
<span id="paddle::CpuMatrix::rightMul__MatrixR.real.real"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a998ab646464fe709d30ef3645d7fda80"></span>void <code class="descname">rightMul</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>b</em>, real <em>scaleAB</em>, real <em>scaleT</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix8rightMulER6Matrix4real4real" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">scaleAB</span><span class="o">*</span><span class="p">(</span><span class="n">this</span><span class="o">*</span><span class="n">b</span><span class="p">)</span> <span class="o">+</span>  <span class="n">scaleT</span><span class="o">*</span><span class="n">this</span>
Y
Yu Yang 已提交
3527 3528
</pre></div>
</div>
3529
 </p>
Y
Yu Yang 已提交
3530 3531 3532
</dd></dl>

<dl class="function">
3533
<dt id="_CPPv2N6paddle9CpuMatrix8rightMulER6Matrix">
3534 3535
<span id="paddle::CpuMatrix::rightMul__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1ad6392810e8f2965f1f4ac91e7757ae8d"></span>void <code class="descname">rightMul</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix8rightMulER6Matrix" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">this</span><span class="o">*</span> <span class="n">b</span>
Y
Yu Yang 已提交
3536 3537
</pre></div>
</div>
3538
 </p>
Y
Yu Yang 已提交
3539 3540 3541
</dd></dl>

<dl class="function">
3542
<dt id="_CPPv2N6paddle9CpuMatrix7leftMulER6Matrix4real4real">
3543 3544
<span id="paddle::CpuMatrix::leftMul__MatrixR.real.real"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a0ba0c1a991c8aab300d7335a5a60392d"></span>void <code class="descname">leftMul</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>a</em>, real <em>scaleAB</em>, real <em>scaleT</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix7leftMulER6Matrix4real4real" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">scaleAB</span><span class="o">*</span><span class="p">(</span><span class="n">a</span><span class="o">*</span><span class="n">this</span><span class="p">)</span> <span class="o">+</span>  <span class="n">scaleT</span><span class="o">*</span><span class="n">this</span>
Y
Yu Yang 已提交
3545 3546
</pre></div>
</div>
3547
 </p>
Y
Yu Yang 已提交
3548 3549 3550
</dd></dl>

<dl class="function">
3551
<dt id="_CPPv2N6paddle9CpuMatrix7leftMulER6Matrix">
3552 3553
<span id="paddle::CpuMatrix::leftMul__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a093e5cdcecfbfb3443ca78ea2a265d2c"></span>void <code class="descname">leftMul</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>a</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix7leftMulER6Matrix" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">a</span><span class="o">*</span><span class="n">this</span><span class="p">)</span>
Y
Yu Yang 已提交
3554 3555
</pre></div>
</div>
3556
 </p>
Y
Yu Yang 已提交
3557 3558 3559
</dd></dl>

<dl class="function">
3560
<dt id="_CPPv2N6paddle9CpuMatrix8colMergeER6Matrix">
3561
<span id="paddle::CpuMatrix::colMerge__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a3cfcde2d36ae0b96ae5ade30fa7bf5b1"></span>void <code class="descname">colMerge</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>src</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix8colMergeER6Matrix" title="Permalink to this definition">¶</a></dt>
3562
<dd><p>merge the element for each col. </p>
Y
Yu Yang 已提交
3563 3564 3565
</dd></dl>

<dl class="function">
3566
<dt id="_CPPv2N6paddle9CpuMatrix6rowSumER6Matrix">
3567
<span id="paddle::CpuMatrix::rowSum__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1ac1e492cffa4b1fed616078446c285dad"></span>void <code class="descname">rowSum</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>sum</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix6rowSumER6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3568 3569 3570 3571
<dd><p>add the sum of each row of this to mat </p>
</dd></dl>

<dl class="function">
3572
<dt id="_CPPv2N6paddle9CpuMatrix8rowMaxIdER7IVector">
3573
<span id="paddle::CpuMatrix::rowMaxId__IVectorR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a745819849c1412814cc63748395b1337"></span>void <code class="descname">rowMaxId</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>maxIds</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix8rowMaxIdER7IVector" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3574 3575 3576
<dd></dd></dl>

<dl class="function">
3577
<dt id="_CPPv2N6paddle9CpuMatrix6rowMaxER6Matrix">
3578
<span id="paddle::CpuMatrix::rowMax__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a659f96cb35de996640101b4597dc6757"></span>void <code class="descname">rowMax</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>max</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix6rowMaxER6Matrix" title="Permalink to this definition">¶</a></dt>
3579 3580
<dd><p>set the max of each row of this to mat </p>
</dd></dl>
Y
Yu Yang 已提交
3581 3582

<dl class="function">
3583
<dt id="_CPPv2N6paddle9CpuMatrix6rowMaxER7IVectorR6Matrix">
3584
<span id="paddle::CpuMatrix::rowMax__IVectorR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a8d63feac52987dddd6af7741afbf846b"></span>void <code class="descname">rowMax</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>maxIds</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>max</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix6rowMaxER7IVectorR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3585
<dd><p>Get the top k elements of each row of this matrix. </p>
3586
<p>The column ids and values of these elements are stored in maxIds and max respectively. where k is the size of maxIds. And note that the top k elements are not sorted. </p>
Y
Yu Yang 已提交
3587 3588 3589
</dd></dl>

<dl class="function">
3590
<dt id="_CPPv2N6paddle9CpuMatrix6colMaxER6Matrix">
3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609
<span id="paddle::CpuMatrix::colMax__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1aa90557207b0204490d88ef854ddd1d1a"></span>void <code class="descname">colMax</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>max</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix6colMaxER6Matrix" title="Permalink to this definition">¶</a></dt>
<dd><p>set the max of each column of this to mat </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9CpuMatrix6colMaxER7IVectorR6Matrix">
<span id="paddle::CpuMatrix::colMax__IVectorR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a126ca6b5874e7cc2b66fe2ef4446b64f"></span>void <code class="descname">colMax</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>maxIds</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>maxVal</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix6colMaxER7IVectorR6Matrix" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the top k elements of each column of this matrix. </p>
<p>The row ids and values of these elements are stored in maxIds and max respectively. where k is the size of maxIds. And note that the top k elements are not sorted. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9CpuMatrix13maxoutForwardER6MatrixR7IVector6size_t6size_t">
<span id="paddle::CpuMatrix::maxoutForward__MatrixR.IVectorR.s.s"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1ad220fe3dac59b84dadb6869f8c2e8b69"></span>void <code class="descname">maxoutForward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>a</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>id</em>, size_t <em>channels</em>, size_t <em>groups</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix13maxoutForwardER6MatrixR7IVector6size_t6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9CpuMatrix14maxoutBackwardER6MatrixR7IVector6size_t6size_t">
<span id="paddle::CpuMatrix::maxoutBackward__MatrixR.IVectorR.s.s"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a4f3d8539c81c249d82b8736b056b2dc5"></span>void <code class="descname">maxoutBackward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>a</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>id</em>, size_t <em>channels</em>, size_t <em>groups</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix14maxoutBackwardER6MatrixR7IVector6size_t6size_t" title="Permalink to this definition">¶</a></dt>
3610
<dd></dd></dl>
Y
Yu Yang 已提交
3611 3612

<dl class="function">
3613
<dt id="_CPPv2N6paddle9CpuMatrix14rowNormalizeL1ER6Matrix">
3614
<span id="paddle::CpuMatrix::rowNormalizeL1__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a05f8dbfd7854aef30822e52a52de98c7"></span>void <code class="descname">rowNormalizeL1</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>out</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix14rowNormalizeL1ER6Matrix" title="Permalink to this definition">¶</a></dt>
3615
<dd><p>normalize each row so that the sum of each row is 1. </p>
Y
Yu Yang 已提交
3616 3617 3618
</dd></dl>

<dl class="function">
3619
<dt id="_CPPv2N6paddle9CpuMatrix18oneHotCrossEntropyER6MatrixR7IVector">
3620
<span id="paddle::CpuMatrix::oneHotCrossEntropy__MatrixR.IVectorR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a2d4e5bac8d91337e406c23ec9662818a"></span>void <code class="descname">oneHotCrossEntropy</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>label</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix18oneHotCrossEntropyER6MatrixR7IVector" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3621 3622 3623 3624
<dd><p>copy -log(output[label]) to this-&gt;data[i]. </p>
</dd></dl>

<dl class="function">
3625
<dt id="_CPPv2N6paddle9CpuMatrix20oneHotCrossEntropyBpER6MatrixR7IVector">
3626
<span id="paddle::CpuMatrix::oneHotCrossEntropyBp__MatrixR.IVectorR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a4d245ee9e1ef3aeb8704e36b28cdd7ad"></span>void <code class="descname">oneHotCrossEntropyBp</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outputV</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>label</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix20oneHotCrossEntropyBpER6MatrixR7IVector" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3627 3628 3629 3630
<dd><p>calculate the error of outputV according to label. </p>
</dd></dl>

<dl class="function">
3631
<dt id="_CPPv2N6paddle9CpuMatrix30oneHotCrossEntropyWithSelfNormER6MatrixR7IVector4real">
3632
<span id="paddle::CpuMatrix::oneHotCrossEntropyWithSelfNorm__MatrixR.IVectorR.real"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a66e35e2319c7cc57b98e0e4a8187eac7"></span>void <code class="descname">oneHotCrossEntropyWithSelfNorm</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>label</em>, real <em>alpha</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix30oneHotCrossEntropyWithSelfNormER6MatrixR7IVector4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3633 3634 3635 3636
<dd><p>copy -log(output[label]) to this-&gt;data[i]. </p>
</dd></dl>

<dl class="function">
3637
<dt id="_CPPv2N6paddle9CpuMatrix32oneHotCrossEntropyWithSelfNormBpER6MatrixR7IVector4real">
3638
<span id="paddle::CpuMatrix::oneHotCrossEntropyWithSelfNormBp__MatrixR.IVectorR.real"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1aa7ccfbd52d782b29b76e7b6190c1a18f"></span>void <code class="descname">oneHotCrossEntropyWithSelfNormBp</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outputV</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>label</em>, real <em>alpha</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix32oneHotCrossEntropyWithSelfNormBpER6MatrixR7IVector4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3639 3640 3641 3642
<dd><p>calculate the error of outputV according to label. </p>
</dd></dl>

<dl class="function">
3643
<dt id="_CPPv2N6paddle9CpuMatrix12circularConvER6MatrixR6Matrix">
3644
<span id="paddle::CpuMatrix::circularConv__MatrixR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a00f3e0c893af285a2bbd0ea11444a827"></span>void <code class="descname">circularConv</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>c</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix12circularConvER6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3645 3646 3647 3648 3649 3650 3651
<dd><p><div class="math">
\[ a[i] = \sum_{j=-(N-1)/2}^{(N-1)/2} b_{i+j} * c_{j} \]</div>
</p>
<p>b contains M elements, c contains N elements (N is odd), b&#8217;s index arithmetic is computed modulo M, c&#8217;s index arithmetic is computed modulo N. </p>
</dd></dl>

<dl class="function">
3652
<dt id="_CPPv2N6paddle9CpuMatrix22circularConvDerivativeER6MatrixR6MatrixR6MatrixR6MatrixR6Matrix">
3653
<span id="paddle::CpuMatrix::circularConvDerivative__MatrixR.MatrixR.MatrixR.MatrixR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a21558366cdb3faf3a084768c5f2f7a29"></span>void <code class="descname">circularConvDerivative</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>prevOut1</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>prevOut2</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>prevGrad1</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>prevGrad2</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix22circularConvDerivativeER6MatrixR6MatrixR6MatrixR6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3654 3655 3656
<dd></dd></dl>

<dl class="function">
3657
<dt id="_CPPv2N6paddle9CpuMatrix7softmaxER6Matrix">
3658
<span id="paddle::CpuMatrix::softmax__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a8360b16ee77a2bfab1c6c1a6fdce9fdb"></span>void <code class="descname">softmax</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix7softmaxER6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3659 3660 3661
<dd></dd></dl>

<dl class="function">
3662
<dt id="_CPPv2N6paddle9CpuMatrix15sequenceSoftmaxER6MatrixRK7IVector">
3663
<span id="paddle::CpuMatrix::sequenceSoftmax__MatrixR.IVectorCR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a791e1f7e62eff9437459d9d813ae347c"></span>void <code class="descname">sequenceSoftmax</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>index</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix15sequenceSoftmaxER6MatrixRK7IVector" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3664 3665 3666
<dd></dd></dl>

<dl class="function">
3667
<dt id="_CPPv2N6paddle9CpuMatrix17softmaxDerivativeER6MatrixR6Matrix">
3668
<span id="paddle::CpuMatrix::softmaxDerivative__MatrixR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a17d01222b73d30e01dfb93f7faff2c2a"></span>void <code class="descname">softmaxDerivative</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>sftmaxSum</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix17softmaxDerivativeER6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3669 3670 3671
<dd></dd></dl>

<dl class="function">
3672
<dt id="_CPPv2N6paddle9CpuMatrix12sumOfSquaresER6MatrixR6Matrix">
3673
<span id="paddle::CpuMatrix::sumOfSquares__MatrixR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a4c3664f3a26e20cbd2a26569cb64cd43"></span>void <code class="descname">sumOfSquares</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>label</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix12sumOfSquaresER6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3674 3675 3676 3677
<dd><p>calculate the sum of squares diff cost. </p>
</dd></dl>

<dl class="function">
3678
<dt id="_CPPv2N6paddle9CpuMatrix14sumOfSquaresBpER6MatrixR6Matrix">
3679
<span id="paddle::CpuMatrix::sumOfSquaresBp__MatrixR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1aabe92738fcfe7a31a1c2714dbb8c9fbb"></span>void <code class="descname">sumOfSquaresBp</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>outputV</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>label</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix14sumOfSquaresBpER6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3680 3681 3682 3683
<dd><p>gradient of sumOfSquares. </p>
</dd></dl>

<dl class="function">
3684
<dt id="_CPPv2N6paddle9CpuMatrix4tanhER6Matrix">
3685
<span id="paddle::CpuMatrix::tanh__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a5e59954796674fcfd706a0a28705748b"></span>void <code class="descname">tanh</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix4tanhER6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3686 3687 3688
<dd></dd></dl>

<dl class="function">
3689
<dt id="_CPPv2N6paddle9CpuMatrix14tanhDerivativeER6Matrix">
3690
<span id="paddle::CpuMatrix::tanhDerivative__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1ac0173c488572518ba82284f689c10e40"></span>void <code class="descname">tanhDerivative</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix14tanhDerivativeER6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3691 3692 3693
<dd></dd></dl>

<dl class="function">
3694
<dt id="_CPPv2N6paddle9CpuMatrix8softreluER6Matrix">
3695
<span id="paddle::CpuMatrix::softrelu__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1af889ea440ca6e0f6e7935133158f1ff5"></span>void <code class="descname">softrelu</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix8softreluER6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3696 3697 3698
<dd></dd></dl>

<dl class="function">
3699
<dt id="_CPPv2N6paddle9CpuMatrix18softreluDerivativeER6Matrix">
3700
<span id="paddle::CpuMatrix::softreluDerivative__MatrixR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1acb744c584f6f5a4d87d0f9d8dafe9da8"></span>void <code class="descname">softreluDerivative</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix18softreluDerivativeER6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3701 3702 3703
<dd></dd></dl>

<dl class="function">
3704
<dt id="_CPPv2N6paddle9CpuMatrix10scaledTanhER6Matrix4real4real">
3705
<span id="paddle::CpuMatrix::scaledTanh__MatrixR.real.real"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a3da51c480b4aa3c7de7c4623b2249e68"></span>void <code class="descname">scaledTanh</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, real <em>p1</em>, real <em>p2</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix10scaledTanhER6Matrix4real4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3706 3707 3708
<dd></dd></dl>

<dl class="function">
3709
<dt id="_CPPv2N6paddle9CpuMatrix6cosSimER6MatrixR6Matrix4real">
3710
<span id="paddle::CpuMatrix::cosSim__MatrixR.MatrixR.real"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a24af62f18005cc9468d4d5832e655381"></span>void <code class="descname">cosSim</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output1</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output2</em>, real <em>scale</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix6cosSimER6MatrixR6Matrix4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3711 3712 3713 3714 3715
<dd><p>cosine similarity, for each row i, this[i] = cos(output1[i], output2[i])</p>
<p>output2 can only have one row, then for each row i, this[i] = cos(output1[i], output2[0]) </p>
</dd></dl>

<dl class="function">
3716
<dt id="_CPPv2N6paddle9CpuMatrix16cosSimDerivativeER6MatrixR6MatrixR6MatrixR6MatrixR6Matrix4real">
3717
<span id="paddle::CpuMatrix::cosSimDerivative__MatrixR.MatrixR.MatrixR.MatrixR.MatrixR.real"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1af2f2d125dbf16b47d3d1aef7e21c1f0f"></span>void <code class="descname">cosSimDerivative</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>prevOut1</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>prevOut2</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>prevGrad1</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>prevGrad2</em>, real <em>scale</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix16cosSimDerivativeER6MatrixR6MatrixR6MatrixR6MatrixR6Matrix4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3718 3719 3720
<dd></dd></dl>

<dl class="function">
3721 3722
<dt id="_CPPv2NK6paddle9CpuMatrix5printERNSt7ostreamE">
<span id="paddle::CpuMatrix::print__osRC"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a02b0d1bea517edcab935fe27177abe01"></span>void <code class="descname">print</code><span class="sig-paren">(</span>std::ostream &amp;<em>os</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle9CpuMatrix5printERNSt7ostreamE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3723 3724 3725 3726
<dd><p>print out the values of elements to os </p>
</dd></dl>

<dl class="function">
3727 3728
<dt id="_CPPv2NK6paddle9CpuMatrix5printERNSt7ostreamE6size_t6size_t">
<span id="paddle::CpuMatrix::print__osR.s.sC"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a278dcb83895f5ac1efa932b10e6937be"></span>void <code class="descname">print</code><span class="sig-paren">(</span>std::ostream &amp;<em>os</em>, size_t <em>height</em>, size_t <em>width</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle9CpuMatrix5printERNSt7ostreamE6size_t6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3729 3730 3731 3732
<dd><p>print a part of the matrix from the (top,left) value to the (height, width) value (not included) </p>
</dd></dl>

<dl class="function">
3733 3734
<dt id="_CPPv2NK6paddle9CpuMatrix11printOneRowERNSt7ostreamE6size_t">
<span id="paddle::CpuMatrix::printOneRow__osR.sC"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a85be5839482a39cd976b968b149d07ca"></span>void <code class="descname">printOneRow</code><span class="sig-paren">(</span>std::ostream &amp;<em>os</em>, size_t <em>idx</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle9CpuMatrix11printOneRowERNSt7ostreamE6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3735 3736 3737 3738
<dd><p>print one row to os </p>
</dd></dl>

<dl class="function">
3739
<dt id="_CPPv2N6paddle9CpuMatrix16paramReluForwardER6MatrixR6Matrix">
3740
<span id="paddle::CpuMatrix::paramReluForward__MatrixR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a0267e92c395d8261ed0c25964102aa0e"></span>void <code class="descname">paramReluForward</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>data</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>W</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix16paramReluForwardER6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3741 3742 3743
<dd></dd></dl>

<dl class="function">
3744
<dt id="_CPPv2N6paddle9CpuMatrix18paramReluBackwardWER6MatrixR6Matrix">
3745
<span id="paddle::CpuMatrix::paramReluBackwardW__MatrixR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1ab57b20eea638770dd09a9f283abd4e37"></span>void <code class="descname">paramReluBackwardW</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>oGrad</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix18paramReluBackwardWER6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3746 3747 3748
<dd></dd></dl>

<dl class="function">
3749
<dt id="_CPPv2N6paddle9CpuMatrix21paramReluBackwardDiffER6MatrixR6MatrixR6Matrix">
3750
<span id="paddle::CpuMatrix::paramReluBackwardDiff__MatrixR.MatrixR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a61f627a01803f324af4af1440df3ba60"></span>void <code class="descname">paramReluBackwardDiff</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>oGrad</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>data</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>W</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix21paramReluBackwardDiffER6MatrixR6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3751 3752 3753
<dd></dd></dl>

<dl class="function">
3754
<dt id="_CPPv2N6paddle9CpuMatrix5checkERNSt7ostreamER6Matrixb">
3755
<span id="paddle::CpuMatrix::check__osR.MatrixR.b"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1af3b52dad7d5ae5d9f0e11f2674aefe3e"></span>void <code class="descname">check</code><span class="sig-paren">(</span>std::ostream &amp;<em>os</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>refMat</em>, bool <em>printDiff</em> = true<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix5checkERNSt7ostreamER6Matrixb" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3756 3757 3758
<dd></dd></dl>

<dl class="function">
3759
<dt id="_CPPv2N6paddle9CpuMatrix6getMinEv">
3760
<span id="paddle::CpuMatrix::getMin"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a8aca8e0dcd0ecd7a8fce55b93e56bd7d"></span>real <code class="descname">getMin</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix6getMinEv" title="Permalink to this definition">¶</a></dt>
3761 3762 3763 3764
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9CpuMatrix6getMaxEv">
3765
<span id="paddle::CpuMatrix::getMax"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1ae38c2a0a4f91af23208419b158bfdbe6"></span>real <code class="descname">getMax</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix6getMaxEv" title="Permalink to this definition">¶</a></dt>
3766 3767 3768 3769
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9CpuMatrix16randomizeUniformEv">
3770
<span id="paddle::CpuMatrix::randomizeUniform"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a11120dee514432930a77234f3c0b8912"></span>void <code class="descname">randomizeUniform</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix16randomizeUniformEv" title="Permalink to this definition">¶</a></dt>
3771 3772 3773 3774
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9CpuMatrix19classificationErrorE9MatrixPtr10IVectorPtr">
3775
<span id="paddle::CpuMatrix::classificationError__MatrixPtr.IVectorPtr"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a41b162f0bd1fd7f0b742715f6b8e77c2"></span>void <code class="descname">classificationError</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>output</em>, <a class="reference internal" href="#_CPPv2N6paddle10IVectorPtrE" title="paddle::IVectorPtr">IVectorPtr</a> <em>label</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix19classificationErrorE9MatrixPtr10IVectorPtr" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3776 3777 3778 3779 3780 3781
<dd><p>calulate the error of classification </p>
<p>output[i] = 1 if row i is an error.</p>
<p>output[i] = 0 if row i is correct. </p>
</dd></dl>

<dl class="function">
3782
<dt id="_CPPv2N6paddle9CpuMatrix12addByBitCodeE6size_tRK7IVectorRK6Matrix">
3783 3784
<span id="paddle::CpuMatrix::addByBitCode__s.IVectorCR.MatrixCR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1ac56b093c35d7ae354cfa312c66a2ca20"></span>void <code class="descname">addByBitCode</code><span class="sig-paren">(</span>size_t <em>numClasses</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>codes</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>vec</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix12addByBitCodeE6size_tRK7IVectorRK6Matrix" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">For</span> <span class="n">j</span> <span class="o">&lt;</span> <span class="n">codeLength</span><span class="p">:</span>
3785 3786 3787 3788
  <span class="n">this</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">)</span> <span class="o">+=</span> <span class="n">vec</span><span class="p">(</span><span class="n">index</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">),</span> <span class="mi">0</span><span class="p">)</span>
<span class="n">where</span> <span class="n">index</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">)</span> <span class="o">=</span> <span class="p">((</span><span class="n">codes</span><span class="p">(</span><span class="n">i</span><span class="p">)</span> <span class="o">+</span> <span class="n">numClasses</span><span class="p">)</span> <span class="o">&gt;&gt;</span> <span class="p">(</span><span class="n">j</span> <span class="o">+</span> <span class="mi">1</span><span class="p">))</span> <span class="o">-</span> <span class="mi">1</span>
</pre></div>
</div>
3789
 </p>
Y
Yu Yang 已提交
3790 3791 3792
</dd></dl>

<dl class="function">
3793
<dt id="_CPPv2N6paddle9CpuMatrix20addByBitCodeBackwardE6size_tRK7IVectorR6Matrix">
3794 3795
<span id="paddle::CpuMatrix::addByBitCodeBackward__s.IVectorCR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a8566aeb1e186c4f4bf6c570dae63021c"></span>void <code class="descname">addByBitCodeBackward</code><span class="sig-paren">(</span>size_t <em>numClasses</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>codes</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>vec</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix20addByBitCodeBackwardE6size_tRK7IVectorR6Matrix" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">For</span> <span class="n">j</span> <span class="o">&lt;</span> <span class="n">codeLength</span><span class="p">:</span>
3796 3797 3798 3799
  <span class="n">vec</span><span class="p">(</span><span class="n">index</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">),</span> <span class="mi">0</span><span class="p">)</span> <span class="o">+=</span> <span class="n">this</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">)</span>
<span class="n">where</span> <span class="n">index</span> <span class="ow">is</span> <span class="n">same</span> <span class="k">as</span> <span class="n">the</span> <span class="n">index</span> <span class="k">for</span> <span class="n">addByBitCode</span>
</pre></div>
</div>
3800
 </p>
Y
Yu Yang 已提交
3801 3802 3803
</dd></dl>

<dl class="function">
3804
<dt id="_CPPv2N6paddle9CpuMatrix12mulByBitCodeE6size_tRK7IVectorRK6MatrixRK6Matrix">
3805 3806
<span id="paddle::CpuMatrix::mulByBitCode__s.IVectorCR.MatrixCR.MatrixCR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1af358b90cf75fbaf797db45c20bd004be"></span>void <code class="descname">mulByBitCode</code><span class="sig-paren">(</span>size_t <em>numClasses</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>codes</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>mat</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>input</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix12mulByBitCodeE6size_tRK7IVectorRK6MatrixRK6Matrix" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">For</span> <span class="n">j</span> <span class="o">&lt;</span> <span class="n">codeLength</span><span class="p">:</span>
3807 3808 3809 3810
  <span class="n">this</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">)</span> <span class="o">+=</span> <span class="o">&lt;</span><span class="n">mat</span><span class="o">.</span><span class="n">row</span><span class="p">(</span><span class="n">index</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">)),</span> <span class="nb">input</span><span class="o">.</span><span class="n">row</span><span class="p">(</span><span class="n">i</span><span class="p">)</span><span class="o">&gt;</span>
<span class="n">where</span> <span class="n">index</span> <span class="ow">is</span> <span class="n">same</span> <span class="k">as</span> <span class="n">the</span> <span class="n">index</span> <span class="k">for</span> <span class="n">addByBitCode</span>
</pre></div>
</div>
3811
 </p>
Y
Yu Yang 已提交
3812 3813 3814
</dd></dl>

<dl class="function">
3815
<dt id="_CPPv2N6paddle9CpuMatrix26mulByBitCodeBackwardWeightE6size_tRK7IVectorR6MatrixRK6Matrix">
3816 3817
<span id="paddle::CpuMatrix::mulByBitCodeBackwardWeight__s.IVectorCR.MatrixR.MatrixCR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a808d37e07e7b78fa1e1cfc541db0c3ad"></span>void <code class="descname">mulByBitCodeBackwardWeight</code><span class="sig-paren">(</span>size_t <em>numClasses</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>codes</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>mat</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>input</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix26mulByBitCodeBackwardWeightE6size_tRK7IVectorR6MatrixRK6Matrix" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">For</span> <span class="n">j</span> <span class="o">&lt;</span> <span class="n">codeLength</span><span class="p">:</span>
3818 3819 3820 3821
  <span class="n">mat</span><span class="o">.</span><span class="n">row</span><span class="p">(</span><span class="n">index</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">))</span> <span class="o">+=</span> <span class="n">this</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">)</span> <span class="o">*</span> <span class="nb">input</span><span class="o">.</span><span class="n">row</span><span class="p">(</span><span class="n">i</span><span class="p">)</span>
<span class="n">where</span> <span class="n">index</span> <span class="ow">is</span> <span class="n">same</span> <span class="k">as</span> <span class="n">the</span> <span class="n">index</span> <span class="k">for</span> <span class="n">addByBitCode</span>
</pre></div>
</div>
3822
 </p>
Y
Yu Yang 已提交
3823 3824 3825
</dd></dl>

<dl class="function">
3826
<dt id="_CPPv2N6paddle9CpuMatrix25mulByBitCodeBackwardErrorE6size_tRK7IVectorRK6MatrixR6Matrix">
3827 3828
<span id="paddle::CpuMatrix::mulByBitCodeBackwardError__s.IVectorCR.MatrixCR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a76e6aeed29a9651473a152d16205de53"></span>void <code class="descname">mulByBitCodeBackwardError</code><span class="sig-paren">(</span>size_t <em>numClasses</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>codes</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>mat</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>input</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix25mulByBitCodeBackwardErrorE6size_tRK7IVectorRK6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">For</span> <span class="n">j</span> <span class="o">&lt;</span> <span class="n">codeLength</span><span class="p">:</span>
3829 3830
  <span class="nb">input</span><span class="o">.</span><span class="n">row</span><span class="p">(</span><span class="n">i</span><span class="p">)</span> <span class="o">+=</span> <span class="n">this</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">)</span> <span class="o">*</span> <span class="n">mat</span><span class="o">.</span><span class="n">row</span><span class="p">(</span><span class="n">index</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">))</span>
<span class="n">where</span> <span class="n">index</span> <span class="ow">is</span> <span class="n">same</span> <span class="k">as</span> <span class="n">the</span> <span class="n">index</span> <span class="k">for</span> <span class="n">addByBitCode</span>
Y
Yu Yang 已提交
3831 3832
</pre></div>
</div>
3833
 </p>
Y
Yu Yang 已提交
3834 3835 3836
</dd></dl>

<dl class="function">
3837
<dt id="_CPPv2N6paddle9CpuMatrix12sumByBitCodeE6size_tR7IVectorR6Matrix4real">
3838 3839
<span id="paddle::CpuMatrix::sumByBitCode__s.IVectorR.MatrixR.real"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a90ff781ce7121465b772d815e8e5197b"></span>void <code class="descname">sumByBitCode</code><span class="sig-paren">(</span>size_t <em>numClasses</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>codes</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>sum</em>, real <em>scaleSum</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix12sumByBitCodeE6size_tR7IVectorR6Matrix4real" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span>For j &lt; codeLength
3840 3841
  sum(i, 0) = scaleSum * \sum_j  bit(i, j) * this(i, j)
where bit(i, j) = ((codes(i) + numClasses) &amp; 2^j) ? 1 : 0
Y
Yu Yang 已提交
3842 3843
</pre></div>
</div>
3844
 </p>
Y
Yu Yang 已提交
3845 3846 3847
</dd></dl>

<dl class="function">
3848
<dt id="_CPPv2N6paddle9CpuMatrix12subByBitCodeE6size_tR7IVector">
3849 3850
<span id="paddle::CpuMatrix::subByBitCode__s.IVectorR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1aa99727f63bbb2744f2b8a325c0290828"></span>void <code class="descname">subByBitCode</code><span class="sig-paren">(</span>size_t <em>numClasses_</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>codes</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix12subByBitCodeE6size_tR7IVector" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">For</span> <span class="n">j</span> <span class="o">&lt;</span> <span class="n">codeLength</span>
3851 3852
 <span class="n">this</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">)</span> <span class="o">-=</span> <span class="n">bit</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">)</span>
<span class="n">where</span> <span class="n">bit</span><span class="p">(</span><span class="n">i</span><span class="p">,</span> <span class="n">j</span><span class="p">)</span> <span class="ow">is</span> <span class="n">same</span> <span class="k">as</span> <span class="n">that</span> <span class="k">for</span> <span class="n">sumByBitCode</span>
Y
Yu Yang 已提交
3853 3854
</pre></div>
</div>
3855
 </p>
Y
Yu Yang 已提交
3856 3857 3858
</dd></dl>

<dl class="function">
3859
<dt id="_CPPv2N6paddle9CpuMatrix28multiBinaryLabelCrossEntropyER6MatrixR6Matrix">
3860
<span id="paddle::CpuMatrix::multiBinaryLabelCrossEntropy__MatrixR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a1586b8d48f745c28c5df3b7b18f39e76"></span>void <code class="descname">multiBinaryLabelCrossEntropy</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>label</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix28multiBinaryLabelCrossEntropyER6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3861
<dd><p>cross entropy for multi binary labels </p>
3862
<p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="o">-</span><span class="nb">sum</span><span class="p">(</span><span class="n">label</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">]</span><span class="o">*</span><span class="n">log</span><span class="p">(</span><span class="n">output</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">])</span>
Y
Yu Yang 已提交
3863 3864 3865
          <span class="o">+</span> <span class="p">(</span><span class="mi">1</span><span class="o">-</span><span class="n">label</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">])</span><span class="o">*</span><span class="n">log</span><span class="p">(</span><span class="mi">1</span><span class="o">-</span><span class="n">output</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">]))</span>
</pre></div>
</div>
3866
 </p>
Y
Yu Yang 已提交
3867 3868 3869
</dd></dl>

<dl class="function">
3870
<dt id="_CPPv2N6paddle9CpuMatrix30multiBinaryLabelCrossEntropyBpER6MatrixR6Matrix">
3871
<span id="paddle::CpuMatrix::multiBinaryLabelCrossEntropyBp__MatrixR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a18c2ad673d7af5e177d227426fee9f25"></span>void <code class="descname">multiBinaryLabelCrossEntropyBp</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>label</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix30multiBinaryLabelCrossEntropyBpER6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3872
<dd><p>The gradient of cross entropy for multi binary labels on output. </p>
3873
<p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">]</span> <span class="o">=</span> <span class="o">-</span><span class="n">label</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">]</span><span class="o">/</span><span class="n">output</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">]</span>
3874
             <span class="o">+</span> <span class="p">(</span><span class="mi">1</span><span class="o">-</span><span class="n">label</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">])</span><span class="o">/</span><span class="p">(</span><span class="mi">1</span><span class="o">-</span><span class="n">output</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">])</span>
Y
Yu Yang 已提交
3875 3876
</pre></div>
</div>
3877
 </p>
Y
Yu Yang 已提交
3878 3879 3880
</dd></dl>

<dl class="function">
3881
<dt id="_CPPv2N6paddle9CpuMatrix24classificationErrorMultiER6MatrixR6Matrix4real">
3882
<span id="paddle::CpuMatrix::classificationErrorMulti__MatrixR.MatrixR.real"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1ac7a0d7873126ec53a8773e9a487538be"></span>void <code class="descname">classificationErrorMulti</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>output</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>label</em>, real <em>threshold</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix24classificationErrorMultiER6MatrixR6Matrix4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3883
<dd><p>Calculate the classification error for multi binary labels. </p>
3884
<p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="o">=</span> <span class="nb">sum</span><span class="p">((</span><span class="n">output</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">]</span> <span class="o">&gt;=</span> <span class="n">threshold</span> <span class="o">&amp;&amp;</span> <span class="n">label</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">]</span> <span class="o">==</span> <span class="mi">0</span><span class="p">)</span>
3885 3886
           <span class="o">||</span> <span class="p">(</span><span class="n">output</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">]</span> <span class="o">&lt;</span> <span class="n">threshold</span> <span class="o">&amp;&amp;</span> <span class="n">label</span><span class="p">[</span><span class="n">i</span><span class="p">][</span><span class="n">j</span><span class="p">]</span> <span class="o">==</span> <span class="mi">1</span><span class="p">))</span>
           <span class="o">/</span> <span class="n">output</span><span class="o">-&gt;</span><span class="n">getWidth</span><span class="p">()</span>
Y
Yu Yang 已提交
3887 3888
</pre></div>
</div>
3889
 </p>
Y
Yu Yang 已提交
3890 3891
</dd></dl>

3892 3893 3894 3895 3896 3897 3898 3899 3900 3901
<dl class="function">
<dt id="_CPPv2N6paddle9CpuMatrix15bilinearForwardERK6MatrixK6size_tK6size_tK6size_tK6size_tK6size_tK4realK4real">
<span id="paddle::CpuMatrix::bilinearForward__MatrixCR.sC.sC.sC.sC.sC.realC.realC"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a2c42b3ea50c41325219552b26c5b231b"></span>void <code class="descname">bilinearForward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>in</em>, <em class="property">const</em> size_t <em>inImgH</em>, <em class="property">const</em> size_t <em>inImgW</em>, <em class="property">const</em> size_t <em>outImgH</em>, <em class="property">const</em> size_t <em>outImgW</em>, <em class="property">const</em> size_t <em>numChannels</em>, <em class="property">const</em> real <em>ratioH</em>, <em class="property">const</em> real <em>ratioW</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix15bilinearForwardERK6MatrixK6size_tK6size_tK6size_tK6size_tK6size_tK4realK4real" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9CpuMatrix16bilinearBackwardERK6MatrixK6size_tK6size_tK6size_tK6size_tK6size_tK4realK4real">
<span id="paddle::CpuMatrix::bilinearBackward__MatrixCR.sC.sC.sC.sC.sC.realC.realC"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1ac29f062db4aff1ca67f2ebe5f1fde1fa"></span>void <code class="descname">bilinearBackward</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>out</em>, <em class="property">const</em> size_t <em>outImgH</em>, <em class="property">const</em> size_t <em>outImgW</em>, <em class="property">const</em> size_t <em>inImgH</em>, <em class="property">const</em> size_t <em>inImgW</em>, <em class="property">const</em> size_t <em>numChannels</em>, <em class="property">const</em> real <em>ratioH</em>, <em class="property">const</em> real <em>ratioW</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix16bilinearBackwardERK6MatrixK6size_tK6size_tK6size_tK6size_tK6size_tK4realK4real" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

Y
Yu Yang 已提交
3902
</div>
3903
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
3904 3905
<p class="breathe-sectiondef-title rubric">Public Static Functions</p>
<dl class="function">
3906 3907
<dt id="_CPPv2N6paddle9CpuMatrix3mulEP9CpuMatrixP9CpuMatrixP15CpuSparseMatrix4real4real">
<span id="paddle::CpuMatrix::mul__CpuMatrixP.CpuMatrixP.CpuSparseMatrixP.real.real"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a76484a3780c3cc12227421129be4d284"></span>void <code class="descname">mul</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle9CpuMatrixE" title="paddle::CpuMatrix">CpuMatrix</a> *<em>a</em>, <a class="reference internal" href="#_CPPv2N6paddle9CpuMatrixE" title="paddle::CpuMatrix">CpuMatrix</a> *<em>b</em>, <a class="reference internal" href="#_CPPv2N6paddle15CpuSparseMatrixE" title="paddle::CpuSparseMatrix">CpuSparseMatrix</a> *<em>c</em>, real <em>scaleAB</em>, real <em>scaleT</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix3mulEP9CpuMatrixP9CpuMatrixP15CpuSparseMatrix4real4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3908 3909 3910
<dd></dd></dl>

<dl class="function">
3911 3912 3913 3914 3915 3916 3917
<dt>
<em class="property">template </em>&lt;<em class="property">typename</em> MatBType, <em class="property">typename</em> MatCType&gt;</dt>
<dt id="_CPPv2N6paddle9CpuMatrix3mulEP15CpuSparseMatrixP8MatBTypeP8MatCType4real4real">
<span id="paddle::CpuMatrix::mul__CpuSparseMatrixP.MatBTypeP.MatCTypeP.real.real"></span><span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a27a21fe7259502a4e05b01c58589a933"></span>void <code class="descname">mul</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle15CpuSparseMatrixE" title="paddle::CpuSparseMatrix">CpuSparseMatrix</a> *<em>a</em>, MatBType *<em>b</em>, MatCType *<em>c</em>, real <em>scaleAB</em>, real <em>scaleT</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix3mulEP15CpuSparseMatrixP8MatBTypeP8MatCType4real4real" title="Permalink to this definition">¶</a></dt>
<dd><p>c = a * b</p>
<p>use abstract getRow() to get row from B,C. Define B,C as template instead of virtual class for performance sake. </p>
</dd></dl>
Y
Yu Yang 已提交
3918 3919 3920 3921 3922 3923 3924

</div>
</dd></dl>

<dl class="class">
<dt id="_CPPv2N6paddle15SharedCpuMatrixE">
<span id="paddle::SharedCpuMatrix"></span><span class="target" id="paddleclasspaddle_1_1SharedCpuMatrix"></span><em class="property">class </em><code class="descname">SharedCpuMatrix</code><a class="headerlink" href="#_CPPv2N6paddle15SharedCpuMatrixE" title="Permalink to this definition">¶</a></dt>
3925
<dd><p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1CpuMatrix"><span class="std std-ref">paddle::CpuMatrix</span></a></p>
3926
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
3927 3928 3929 3930 3931 3932 3933 3934 3935 3936 3937 3938 3939 3940 3941 3942 3943 3944 3945 3946 3947 3948 3949 3950 3951 3952 3953 3954
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle15SharedCpuMatrix15SharedCpuMatrixEi6size_t6size_tb">
<span id="paddle::SharedCpuMatrix::SharedCpuMatrix__i.s.s.b"></span><span class="target" id="paddleclasspaddle_1_1SharedCpuMatrix_1a2b463d8be568f586fcce6a6c1e16a13f"></span><code class="descname">SharedCpuMatrix</code><span class="sig-paren">(</span>int <em>blockNum</em>, size_t <em>height</em>, size_t <em>width</em>, bool <em>trans</em> = false<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15SharedCpuMatrix15SharedCpuMatrixEi6size_t6size_tb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15SharedCpuMatrix15SharedCpuMatrixEiP4real6size_t6size_tb">
<span id="paddle::SharedCpuMatrix::SharedCpuMatrix__i.realP.s.s.b"></span><span class="target" id="paddleclasspaddle_1_1SharedCpuMatrix_1ae709c51b5b1fd0c60a67b1968d51356e"></span><code class="descname">SharedCpuMatrix</code><span class="sig-paren">(</span>int <em>blockNum</em>, real *<em>data</em>, size_t <em>height</em>, size_t <em>width</em>, bool <em>trans</em> = false<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15SharedCpuMatrix15SharedCpuMatrixEiP4real6size_t6size_tb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15SharedCpuMatrix15SharedCpuMatrixEi15CpuMemHandlePtr6size_t6size_tb">
<span id="paddle::SharedCpuMatrix::SharedCpuMatrix__i.CpuMemHandlePtr.s.s.b"></span><span class="target" id="paddleclasspaddle_1_1SharedCpuMatrix_1abcd2319f298674cf4278f47c38a50ad2"></span><code class="descname">SharedCpuMatrix</code><span class="sig-paren">(</span>int <em>blockNum</em>, <a class="reference internal" href="../utils/utils.html#_CPPv2N6paddle15CpuMemHandlePtrE" title="paddle::CpuMemHandlePtr">CpuMemHandlePtr</a> <em>dataHandle</em>, size_t <em>height</em>, size_t <em>width</em>, bool <em>trans</em> = false<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15SharedCpuMatrix15SharedCpuMatrixEi15CpuMemHandlePtr6size_t6size_tb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15SharedCpuMatrix15SharedCpuMatrixE15CpuMemHandlePtr6size_t6size_tb">
<span id="paddle::SharedCpuMatrix::SharedCpuMatrix__CpuMemHandlePtr.s.s.b"></span><span class="target" id="paddleclasspaddle_1_1SharedCpuMatrix_1a74032b28a05ec969f50acbb2f1c92423"></span><code class="descname">SharedCpuMatrix</code><span class="sig-paren">(</span><a class="reference internal" href="../utils/utils.html#_CPPv2N6paddle15CpuMemHandlePtrE" title="paddle::CpuMemHandlePtr">CpuMemHandlePtr</a> <em>dataHandle</em>, size_t <em>height</em>, size_t <em>width</em>, bool <em>trans</em> = false<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15SharedCpuMatrix15SharedCpuMatrixE15CpuMemHandlePtr6size_t6size_tb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15SharedCpuMatrixD0Ev">
<span id="paddle::SharedCpuMatrix::~SharedCpuMatrix"></span><span class="target" id="paddleclasspaddle_1_1SharedCpuMatrix_1afdb74c073dce2bebedb63d3e60c4a11d"></span><code class="descname">~SharedCpuMatrix</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15SharedCpuMatrixD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15SharedCpuMatrix3mulEP15CpuSparseMatrixP9CpuMatrix4real4real">
3955
<span id="paddle::SharedCpuMatrix::mul__CpuSparseMatrixP.CpuMatrixP.real.real"></span><span class="target" id="paddleclasspaddle_1_1SharedCpuMatrix_1a08ae52529db0e3944900c131ae3d574d"></span>void <code class="descname">mul</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle15CpuSparseMatrixE" title="paddle::CpuSparseMatrix">CpuSparseMatrix</a> *<em>a</em>, <a class="reference internal" href="#_CPPv2N6paddle9CpuMatrixE" title="paddle::CpuMatrix">CpuMatrix</a> *<em>b</em>, real <em>scaleAB</em>, real <em>scaleT</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15SharedCpuMatrix3mulEP15CpuSparseMatrixP9CpuMatrix4real4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3956 3957 3958 3959 3960 3961 3962 3963 3964 3965 3966 3967 3968
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15SharedCpuMatrix3addER6Matrix4real4real">
<span id="paddle::SharedCpuMatrix::add__MatrixR.real.real"></span><span class="target" id="paddleclasspaddle_1_1SharedCpuMatrix_1a7d90c8dce5ccc9649d0057e42fcf54ed"></span>void <code class="descname">add</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>b</em>, real <em>p1</em>, real <em>p2</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15SharedCpuMatrix3addER6Matrix4real4real" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15SharedCpuMatrix3addE4real4real">
<span id="paddle::SharedCpuMatrix::add__real.real"></span><span class="target" id="paddleclasspaddle_1_1SharedCpuMatrix_1a9867353df249702291178de2944ba19f"></span>void <code class="descname">add</code><span class="sig-paren">(</span>real <em>p1</em>, real <em>p2</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15SharedCpuMatrix3addE4real4real" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
3969
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981
<p class="breathe-sectiondef-title rubric">Private Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle15SharedCpuMatrix10initSharedEi">
<span id="paddle::SharedCpuMatrix::initShared__i"></span><span class="target" id="paddleclasspaddle_1_1SharedCpuMatrix_1a9d44e847811ce7f87d86b2f828d78804"></span>void <code class="descname">initShared</code><span class="sig-paren">(</span>int <em>blockNum</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15SharedCpuMatrix10initSharedEi" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15SharedCpuMatrix9initBlockEi">
<span id="paddle::SharedCpuMatrix::initBlock__i"></span><span class="target" id="paddleclasspaddle_1_1SharedCpuMatrix_1a64673232aa3f2899efa12d15ffdc3ef5"></span>void <code class="descname">initBlock</code><span class="sig-paren">(</span>int <em>blockNum</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15SharedCpuMatrix9initBlockEi" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
3982
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012
<p class="breathe-sectiondef-title rubric">Private Members</p>
<dl class="member">
<dt id="_CPPv2N6paddle15SharedCpuMatrix9blockNum_E">
<span id="paddle::SharedCpuMatrix::blockNum___i"></span><span class="target" id="paddleclasspaddle_1_1SharedCpuMatrix_1adfce8e1146fbbf5a7faac6c7a8fa74bc"></span>int <code class="descname">blockNum_</code><a class="headerlink" href="#_CPPv2N6paddle15SharedCpuMatrix9blockNum_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle15SharedCpuMatrix11blockLocks_E">
<span id="paddle::SharedCpuMatrix::blockLocks___std::vector:std::unique_ptr:std::mutex::"></span><span class="target" id="paddleclasspaddle_1_1SharedCpuMatrix_1a13c78b63fcfe1e30562cb8257d20a88a"></span>std::vector&lt;std::unique_ptr&lt;std::mutex&gt;&gt; <code class="descname">blockLocks_</code><a class="headerlink" href="#_CPPv2N6paddle15SharedCpuMatrix11blockLocks_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle15SharedCpuMatrix9localBuf_E">
<span id="paddle::SharedCpuMatrix::localBuf___ThreadLocal:CpuMatrixPtr:"></span><span class="target" id="paddleclasspaddle_1_1SharedCpuMatrix_1a6afdcda96e42e1d33ca5dfbb10dfc4e2"></span>ThreadLocal&lt;<a class="reference internal" href="#_CPPv2N6paddle12CpuMatrixPtrE" title="paddle::CpuMatrixPtr">CpuMatrixPtr</a>&gt; <code class="descname">localBuf_</code><a class="headerlink" href="#_CPPv2N6paddle15SharedCpuMatrix9localBuf_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle15SharedCpuMatrix13localBufRows_E">
<span id="paddle::SharedCpuMatrix::localBufRows___ThreadLocal:std::vector:i::"></span><span class="target" id="paddleclasspaddle_1_1SharedCpuMatrix_1ab5837a8d59522906f2664d6d3e2d5873"></span>ThreadLocal&lt;std::vector&lt;int&gt;&gt; <code class="descname">localBufRows_</code><a class="headerlink" href="#_CPPv2N6paddle15SharedCpuMatrix13localBufRows_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle15SharedCpuMatrix9blockSeq_E">
<span id="paddle::SharedCpuMatrix::blockSeq___ThreadLocal:std::vector:i::"></span><span class="target" id="paddleclasspaddle_1_1SharedCpuMatrix_1a8c438ffb5c5d673b51040d7f625fba3b"></span>ThreadLocal&lt;std::vector&lt;int&gt;&gt; <code class="descname">blockSeq_</code><a class="headerlink" href="#_CPPv2N6paddle15SharedCpuMatrix9blockSeq_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

<dl class="class">
4013 4014
<dt id="_CPPv2N6paddle18sparse_non_value_tE">
<span id="paddle::sparse_non_value_t"></span><span class="target" id="paddlestructpaddle_1_1sparse__non__value__t"></span><em class="property">struct </em><code class="descname">sparse_non_value_t</code><a class="headerlink" href="#_CPPv2N6paddle18sparse_non_value_tE" title="Permalink to this definition">¶</a></dt>
4015
<dd><div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4016 4017
<p class="breathe-sectiondef-title rubric">Public Members</p>
<dl class="member">
4018 4019
<dt id="_CPPv2N6paddle18sparse_non_value_t3colE">
<span id="paddle::sparse_non_value_t::col__unsigned-i"></span><span class="target" id="paddlestructpaddle_1_1sparse__non__value__t_1a8bbd591bdf51b16588a117409c7e130c"></span>unsigned int <code class="descname">col</code><a class="headerlink" href="#_CPPv2N6paddle18sparse_non_value_t3colE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4020 4021 4022 4023 4024 4025
<dd></dd></dl>

</div>
</dd></dl>

<dl class="class">
4026 4027
<dt id="_CPPv2N6paddle20sparse_float_value_tE">
<span id="paddle::sparse_float_value_t"></span><span class="target" id="paddlestructpaddle_1_1sparse__float__value__t"></span><em class="property">struct </em><code class="descname">sparse_float_value_t</code><a class="headerlink" href="#_CPPv2N6paddle20sparse_float_value_tE" title="Permalink to this definition">¶</a></dt>
4028
<dd><div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4029 4030
<p class="breathe-sectiondef-title rubric">Public Members</p>
<dl class="member">
4031 4032 4033 4034 4035 4036 4037
<dt id="_CPPv2N6paddle20sparse_float_value_t3colE">
<span id="paddle::sparse_float_value_t::col__unsigned-i"></span><span class="target" id="paddlestructpaddle_1_1sparse__float__value__t_1a1628eb862d55799d076f0bb88059c39c"></span>unsigned int <code class="descname">col</code><a class="headerlink" href="#_CPPv2N6paddle20sparse_float_value_t3colE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle20sparse_float_value_t5valueE">
<span id="paddle::sparse_float_value_t::value__float"></span><span class="target" id="paddlestructpaddle_1_1sparse__float__value__t_1adae20eb7fbcf2b07a534791e85d26f23"></span>float <code class="descname">value</code><a class="headerlink" href="#_CPPv2N6paddle20sparse_float_value_t5valueE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4038 4039 4040 4041 4042 4043 4044 4045
<dd></dd></dl>

</div>
</dd></dl>

</dd></dl>

<dl class="type">
4046 4047
<dt>
<span class="target" id="paddlenamespacepaddle"></span><em class="property">namespace </em><code class="descname">paddle</code></dt>
4048
<dd><div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4049 4050 4051 4052 4053 4054 4055 4056 4057 4058 4059 4060 4061 4062 4063 4064 4065 4066 4067 4068 4069 4070 4071 4072 4073 4074 4075 4076 4077 4078 4079 4080 4081 4082 4083 4084 4085 4086 4087 4088 4089 4090 4091 4092 4093 4094 4095 4096 4097 4098 4099 4100 4101 4102 4103 4104 4105 4106 4107 4108 4109 4110 4111 4112 4113 4114 4115 4116 4117 4118 4119 4120 4121 4122 4123 4124 4125 4126 4127 4128 4129 4130
<p class="breathe-sectiondef-title rubric">Typedefs</p>
<dl class="type">
<dt id="_CPPv2N6paddle6VectorE">
<span id="paddle::Vector"></span><span class="target" id="paddlenamespacepaddle_1a341b097590e70bf4d347408bd735a5b8"></span><em class="property">typedef </em><a class="reference internal" href="#_CPPv2N6paddle7VectorTE" title="paddle::VectorT">VectorT</a>&lt;real&gt; <code class="descname">Vector</code><a class="headerlink" href="#_CPPv2N6paddle6VectorE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="type">
<dt id="_CPPv2N6paddle9CpuVectorE">
<span id="paddle::CpuVector"></span><span class="target" id="paddlenamespacepaddle_1a3b8830d9d648d29ab499f9645fba7299"></span><em class="property">typedef </em><a class="reference internal" href="#_CPPv2N6paddle10CpuVectorTE" title="paddle::CpuVectorT">CpuVectorT</a>&lt;real&gt; <code class="descname">CpuVector</code><a class="headerlink" href="#_CPPv2N6paddle9CpuVectorE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="type">
<dt id="_CPPv2N6paddle9GpuVectorE">
<span id="paddle::GpuVector"></span><span class="target" id="paddlenamespacepaddle_1ae821f5d5806a77dd9139e70dcfe99e65"></span><em class="property">typedef </em><a class="reference internal" href="#_CPPv2N6paddle10GpuVectorTE" title="paddle::GpuVectorT">GpuVectorT</a>&lt;real&gt; <code class="descname">GpuVector</code><a class="headerlink" href="#_CPPv2N6paddle9GpuVectorE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="type">
<dt id="_CPPv2N6paddle7IVectorE">
<span id="paddle::IVector"></span><span class="target" id="paddlenamespacepaddle_1a5a4178694f6ce2e225a424d9482ba876"></span><em class="property">typedef </em><a class="reference internal" href="#_CPPv2N6paddle7VectorTE" title="paddle::VectorT">VectorT</a>&lt;int&gt; <code class="descname">IVector</code><a class="headerlink" href="#_CPPv2N6paddle7IVectorE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="type">
<dt id="_CPPv2N6paddle10CpuIVectorE">
<span id="paddle::CpuIVector"></span><span class="target" id="paddlenamespacepaddle_1a9472b2728992867c899a581c64aa4e9b"></span><em class="property">typedef </em><a class="reference internal" href="#_CPPv2N6paddle10CpuVectorTE" title="paddle::CpuVectorT">CpuVectorT</a>&lt;int&gt; <code class="descname">CpuIVector</code><a class="headerlink" href="#_CPPv2N6paddle10CpuIVectorE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="type">
<dt id="_CPPv2N6paddle10GpuIVectorE">
<span id="paddle::GpuIVector"></span><span class="target" id="paddlenamespacepaddle_1a8f7dab33f38eb139b8b5ff64557cd67c"></span><em class="property">typedef </em><a class="reference internal" href="#_CPPv2N6paddle10GpuVectorTE" title="paddle::GpuVectorT">GpuVectorT</a>&lt;int&gt; <code class="descname">GpuIVector</code><a class="headerlink" href="#_CPPv2N6paddle10GpuIVectorE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="type">
<dt id="_CPPv2N6paddle9VectorPtrE">
<span id="paddle::VectorPtr"></span><span class="target" id="paddlenamespacepaddle_1aed8cb0dde301a907ff641fc7798a4f6e"></span><em class="property">typedef </em>std::shared_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle6VectorE" title="paddle::Vector">Vector</a>&gt; <code class="descname">VectorPtr</code><a class="headerlink" href="#_CPPv2N6paddle9VectorPtrE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="type">
<dt id="_CPPv2N6paddle12CpuVectorPtrE">
<span id="paddle::CpuVectorPtr"></span><span class="target" id="paddlenamespacepaddle_1a7d54371b45b59a347dff377a9696b82e"></span><em class="property">typedef </em>std::shared_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle9CpuVectorE" title="paddle::CpuVector">CpuVector</a>&gt; <code class="descname">CpuVectorPtr</code><a class="headerlink" href="#_CPPv2N6paddle12CpuVectorPtrE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="type">
<dt id="_CPPv2N6paddle12GpuVectorPtrE">
<span id="paddle::GpuVectorPtr"></span><span class="target" id="paddlenamespacepaddle_1a56f3f3eee8b4563dedc9deeed2d8ae2e"></span><em class="property">typedef </em>std::shared_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle9GpuVectorE" title="paddle::GpuVector">GpuVector</a>&gt; <code class="descname">GpuVectorPtr</code><a class="headerlink" href="#_CPPv2N6paddle12GpuVectorPtrE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="type">
<dt id="_CPPv2N6paddle10IVectorPtrE">
<span id="paddle::IVectorPtr"></span><span class="target" id="paddlenamespacepaddle_1a037b7bd489359cd146ab531bc2fc9d46"></span><em class="property">typedef </em>std::shared_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a>&gt; <code class="descname">IVectorPtr</code><a class="headerlink" href="#_CPPv2N6paddle10IVectorPtrE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="type">
<dt id="_CPPv2N6paddle13CpuIVectorPtrE">
<span id="paddle::CpuIVectorPtr"></span><span class="target" id="paddlenamespacepaddle_1a37d15353ce23a21482d84157092388b9"></span><em class="property">typedef </em>std::shared_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle10CpuIVectorE" title="paddle::CpuIVector">CpuIVector</a>&gt; <code class="descname">CpuIVectorPtr</code><a class="headerlink" href="#_CPPv2N6paddle13CpuIVectorPtrE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="type">
<dt id="_CPPv2N6paddle13GpuIVectorPtrE">
<span id="paddle::GpuIVectorPtr"></span><span class="target" id="paddlenamespacepaddle_1a9d5202cf12b49f96186e7077a66f24a7"></span><em class="property">typedef </em>std::shared_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle10GpuIVectorE" title="paddle::GpuIVector">GpuIVector</a>&gt; <code class="descname">GpuIVectorPtr</code><a class="headerlink" href="#_CPPv2N6paddle13GpuIVectorPtrE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="type">
<dt id="_CPPv2N6paddle12CpuGpuVectorE">
<span id="paddle::CpuGpuVector"></span><span class="target" id="paddlenamespacepaddle_1a3a11eda9b46b6e8e79e173e1106dacd8"></span><em class="property">typedef </em><a class="reference internal" href="#_CPPv2N6paddle13CpuGpuVectorTE" title="paddle::CpuGpuVectorT">CpuGpuVectorT</a>&lt;real&gt; <code class="descname">CpuGpuVector</code><a class="headerlink" href="#_CPPv2N6paddle12CpuGpuVectorE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="type">
<dt id="_CPPv2N6paddle13ICpuGpuVectorE">
<span id="paddle::ICpuGpuVector"></span><span class="target" id="paddlenamespacepaddle_1aa0927e470a8b37cf469b7b6da9825ebb"></span><em class="property">typedef </em><a class="reference internal" href="#_CPPv2N6paddle13CpuGpuVectorTE" title="paddle::CpuGpuVectorT">CpuGpuVectorT</a>&lt;int&gt; <code class="descname">ICpuGpuVector</code><a class="headerlink" href="#_CPPv2N6paddle13ICpuGpuVectorE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="type">
<dt id="_CPPv2N6paddle15CpuGpuVectorPtrE">
<span id="paddle::CpuGpuVectorPtr"></span><span class="target" id="paddlenamespacepaddle_1a761c112d3762460b8fd792299d36aa73"></span><em class="property">typedef </em>std::shared_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle12CpuGpuVectorE" title="paddle::CpuGpuVector">CpuGpuVector</a>&gt; <code class="descname">CpuGpuVectorPtr</code><a class="headerlink" href="#_CPPv2N6paddle15CpuGpuVectorPtrE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="type">
<dt id="_CPPv2N6paddle16ICpuGpuVectorPtrE">
<span id="paddle::ICpuGpuVectorPtr"></span><span class="target" id="paddlenamespacepaddle_1ab68f1bd09fc5145d5214adad59144e33"></span><em class="property">typedef </em>std::shared_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle13ICpuGpuVectorE" title="paddle::ICpuGpuVector">ICpuGpuVector</a>&gt; <code class="descname">ICpuGpuVectorPtr</code><a class="headerlink" href="#_CPPv2N6paddle16ICpuGpuVectorPtrE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
4131
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142
<p class="breathe-sectiondef-title rubric">Functions</p>
<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> T&gt;</dt>
<dt id="_CPPv2N6paddlelsERNSt7ostreamERK7VectorTI1TE">
<span id="paddle::lshift-operator__osR.VectorT:T:CR"></span><span class="target" id="paddlenamespacepaddle_1ae29a866bd5cca861adbec0dcb3decbb7"></span>std::ostream &amp;<code class="descname">operator&lt;&lt;</code><span class="sig-paren">(</span>std::ostream &amp;<em>os</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7VectorTE" title="paddle::VectorT">VectorT</a>&lt;T&gt; &amp;<em>vec</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddlelsERNSt7ostreamERK7VectorTI1TE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<dl class="class">
<dt>
4143 4144 4145 4146
<span class="target" id="paddleclasspaddle_1_1GpuVectorT"></span><em class="property">template </em>&lt;<em class="property">class</em> T&gt;</dt>
<dt id="_CPPv2N6paddle10GpuVectorTE">
<span id="paddle::GpuVectorT"></span><em class="property">class </em><code class="descname">GpuVectorT</code><a class="headerlink" href="#_CPPv2N6paddle10GpuVectorTE" title="Permalink to this definition">¶</a></dt>
<dd><p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1VectorT"><span class="std std-ref">paddle::VectorT&lt; T &gt;</span></a></p>
4147
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4148 4149
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
4150 4151
<dt id="_CPPv2N6paddle10GpuVectorT10GpuVectorTE6size_t">
<span id="paddle::GpuVectorT::GpuVectorT__s"></span><span class="target" id="paddleclasspaddle_1_1GpuVectorT_1a81d47bbc05ced04b04a63fc7d8710f3e"></span><code class="descname">GpuVectorT</code><span class="sig-paren">(</span>size_t <em>size</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10GpuVectorT10GpuVectorTE6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4152 4153 4154
<dd></dd></dl>

<dl class="function">
4155 4156
<dt id="_CPPv2N6paddle10GpuVectorT10GpuVectorTE6size_t15GpuMemHandlePtr6size_t">
<span id="paddle::GpuVectorT::GpuVectorT__s.GpuMemHandlePtr.s"></span><span class="target" id="paddleclasspaddle_1_1GpuVectorT_1ad98321c55d7abaa0e59b1bc32d55f91e"></span><code class="descname">GpuVectorT</code><span class="sig-paren">(</span>size_t <em>size</em>, <a class="reference internal" href="../utils/utils.html#_CPPv2N6paddle15GpuMemHandlePtrE" title="paddle::GpuMemHandlePtr">GpuMemHandlePtr</a> <em>memHandle</em>, size_t <em>offset</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10GpuVectorT10GpuVectorTE6size_t15GpuMemHandlePtr6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4157 4158
<dd></dd></dl>

4159 4160 4161
<dl class="function">
<dt id="_CPPv2N6paddle10GpuVectorT10GpuVectorTE6size_tP1T">
<span id="paddle::GpuVectorT::GpuVectorT__s.TP"></span><span class="target" id="paddleclasspaddle_1_1GpuVectorT_1a4e702e49aae57a80bd4337e4ed75f8bf"></span><code class="descname">GpuVectorT</code><span class="sig-paren">(</span>size_t <em>size</em>, T *<em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10GpuVectorT10GpuVectorTE6size_tP1T" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4162 4163
<dd></dd></dl>

4164 4165
<dl class="function">
<dt id="_CPPv2N6paddle10GpuVectorT9newMemoryE6size_t">
4166
<span id="paddle::GpuVectorT::newMemory__s"></span><span class="target" id="paddleclasspaddle_1_1GpuVectorT_1adc88649a2403c47fad3bdc7dc4d36142"></span><em class="property">virtual</em> <a class="reference internal" href="../utils/utils.html#_CPPv2N6paddle15MemoryHandlePtrE" title="paddle::MemoryHandlePtr">MemoryHandlePtr</a> <code class="descname">newMemory</code><span class="sig-paren">(</span>size_t <em>size</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10GpuVectorT9newMemoryE6size_t" title="Permalink to this definition">¶</a></dt>
4167
<dd></dd></dl>
Y
Yu Yang 已提交
4168 4169

<dl class="function">
4170
<dt id="_CPPv2N6paddle10GpuVectorT7zeroMemEv">
4171
<span id="paddle::GpuVectorT::zeroMem"></span><span class="target" id="paddleclasspaddle_1_1GpuVectorT_1ad53456be47f0921ebaf06bb25ac33cae"></span>void <code class="descname">zeroMem</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10GpuVectorT7zeroMemEv" title="Permalink to this definition">¶</a></dt>
4172
<dd></dd></dl>
Y
Yu Yang 已提交
4173 4174

<dl class="function">
4175
<dt id="_CPPv2N6paddle10GpuVectorT5resetERK1T">
4176
<span id="paddle::GpuVectorT::reset__TCR"></span><span class="target" id="paddleclasspaddle_1_1GpuVectorT_1ad153210576bfb1ad668cd0882925e9a1"></span>void <code class="descname">reset</code><span class="sig-paren">(</span><em class="property">const</em> T &amp;<em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10GpuVectorT5resetERK1T" title="Permalink to this definition">¶</a></dt>
4177
<dd></dd></dl>
Y
Yu Yang 已提交
4178 4179

<dl class="function">
4180
<dt id="_CPPv2N6paddle10GpuVectorT12fillSequenceEv">
4181
<span id="paddle::GpuVectorT::fillSequence"></span><span class="target" id="paddleclasspaddle_1_1GpuVectorT_1a6e97a380d0ec7a11fd0317d1e0375e8d"></span>void <code class="descname">fillSequence</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10GpuVectorT12fillSequenceEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4182 4183 4184
<dd></dd></dl>

<dl class="function">
4185
<dt id="_CPPv2N6paddle10GpuVectorT8copyFromEPK1T6size_t">
4186
<span id="paddle::GpuVectorT::copyFrom__TCP.s"></span><span class="target" id="paddleclasspaddle_1_1GpuVectorT_1a13294d0ae830fa7226091c6b68016c05"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> T *<em>src</em>, size_t <em>size</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10GpuVectorT8copyFromEPK1T6size_t" title="Permalink to this definition">¶</a></dt>
4187 4188 4189 4190
<dd><p>copy size elements from src</p>
<p>If this is GpuVector, src can be cpu or gpu memory</p>
<p>If this is CpuVector, src is assumed to be cpu memory </p>
</dd></dl>
Y
Yu Yang 已提交
4191 4192

<dl class="function">
4193
<dt id="_CPPv2N6paddle10GpuVectorT8copyFromEPK1T6size_t11hl_stream_t">
4194
<span id="paddle::GpuVectorT::copyFrom__TCP.s.hl_stream_t"></span><span class="target" id="paddleclasspaddle_1_1GpuVectorT_1a2169dca97b86c8b5cfa29c3070bd554c"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> T *<em>src</em>, size_t <em>size</em>, <a class="reference internal" href="../../cuda/utils/utils.html#_CPPv211hl_stream_t" title="hl_stream_t">hl_stream_t</a> <em>stream</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10GpuVectorT8copyFromEPK1T6size_t11hl_stream_t" title="Permalink to this definition">¶</a></dt>
4195 4196 4197
<dd><p>copy size elements from src</p>
<p>If this is GpuVector, src can be cpu or gpu memory</p>
<p>If this is CpuVector, src is assumed to be cpu memory, </p>
Y
Yu Yang 已提交
4198 4199 4200
</dd></dl>

<dl class="function">
4201
<dt id="_CPPv2N6paddle10GpuVectorT8copyFromERK7VectorTI1TE">
4202
<span id="paddle::GpuVectorT::copyFrom__VectorT:T:CR"></span><span class="target" id="paddleclasspaddle_1_1GpuVectorT_1a3d0a5a836bff7e7f1cc5a02f9cfa61d4"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7VectorTE" title="paddle::VectorT">VectorT</a>&lt;T&gt; &amp;<em>src</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10GpuVectorT8copyFromERK7VectorTI1TE" title="Permalink to this definition">¶</a></dt>
4203
<dd><p>This function will crash if the size of src and dest is different. </p>
Y
Yu Yang 已提交
4204 4205 4206
</dd></dl>

<dl class="function">
4207
<dt id="_CPPv2N6paddle10GpuVectorT8copyFromERK7VectorTI1TE11hl_stream_t">
4208
<span id="paddle::GpuVectorT::copyFrom__VectorT:T:CR.hl_stream_t"></span><span class="target" id="paddleclasspaddle_1_1GpuVectorT_1a99a93964c65c71249225dab1f886ef3e"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7VectorTE" title="paddle::VectorT">VectorT</a>&lt;T&gt; &amp;<em>src</em>, <a class="reference internal" href="../../cuda/utils/utils.html#_CPPv211hl_stream_t" title="hl_stream_t">hl_stream_t</a> <em>stream</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10GpuVectorT8copyFromERK7VectorTI1TE11hl_stream_t" title="Permalink to this definition">¶</a></dt>
4209 4210
<dd><p>If use_gpu, this function will push the copy-task to the specifed-stream and return immediately.</p>
<p>If not use GPU, this function is same as the <a class="reference internal" href="#paddleclasspaddle_1_1GpuVectorT_1a3d0a5a836bff7e7f1cc5a02f9cfa61d4"><span class="std std-ref">copyFrom(const VectorT&lt;T&gt;&amp; src)</span></a>, which use stream HPPL_STREAM_DEFAULT. </p>
Y
Yu Yang 已提交
4211 4212 4213
</dd></dl>

<dl class="function">
4214 4215
<dt id="_CPPv2NK6paddle10GpuVectorT10getElementE6size_t">
<span id="paddle::GpuVectorT::getElement__sC"></span><span class="target" id="paddleclasspaddle_1_1GpuVectorT_1afd437d6a780e451b443c63d2745c0356"></span>T <code class="descname">getElement</code><span class="sig-paren">(</span>size_t <em>i</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle10GpuVectorT10getElementE6size_t" title="Permalink to this definition">¶</a></dt>
4216
<dd><p>Get the value for the i&#8217;th element. </p>
Y
Yu Yang 已提交
4217 4218 4219
</dd></dl>

<dl class="function">
4220
<dt id="_CPPv2N6paddle10GpuVectorT10setElementE6size_tRK1T">
4221
<span id="paddle::GpuVectorT::setElement__s.TCR"></span><span class="target" id="paddleclasspaddle_1_1GpuVectorT_1a180fb7d70dc7c026695881c23f1c346f"></span>void <code class="descname">setElement</code><span class="sig-paren">(</span>size_t <em>i</em>, <em class="property">const</em> T &amp;<em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10GpuVectorT10setElementE6size_tRK1T" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4222 4223 4224
<dd></dd></dl>

<dl class="function">
4225
<dt id="_CPPv2N6paddle10GpuVectorT8getPointEK8uint64_t">
4226
<span id="paddle::GpuVectorT::getPoint__uint64_tC"></span><span class="target" id="paddleclasspaddle_1_1GpuVectorT_1aab084f35c24bf6ca1464a2d3c8b6f886"></span>T *<code class="descname">getPoint</code><span class="sig-paren">(</span><em class="property">const</em> uint64_t <em>beginPos</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10GpuVectorT8getPointEK8uint64_t" title="Permalink to this definition">¶</a></dt>
4227
<dd><p>Get the buffer point with beginPos. </p>
Y
Yu Yang 已提交
4228 4229 4230
</dd></dl>

<dl class="function">
4231
<dt id="_CPPv2N6paddle10GpuVectorT9getAbsSumEv">
4232
<span id="paddle::GpuVectorT::getAbsSum"></span><span class="target" id="paddleclasspaddle_1_1GpuVectorT_1a07f70a7f6369f4aa3cea861f734c915f"></span><em class="property">virtual</em> T <code class="descname">getAbsSum</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10GpuVectorT9getAbsSumEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4233 4234 4235
<dd></dd></dl>

<dl class="function">
4236
<dt id="_CPPv2N6paddle10GpuVectorT6getSumEv">
4237
<span id="paddle::GpuVectorT::getSum"></span><span class="target" id="paddleclasspaddle_1_1GpuVectorT_1a12126096c2a83cacf6697638ade61851"></span><em class="property">virtual</em> T <code class="descname">getSum</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10GpuVectorT6getSumEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4238 4239 4240
<dd></dd></dl>

<dl class="function">
4241
<dt id="_CPPv2N6paddle10GpuVectorT6getMaxEv">
4242
<span id="paddle::GpuVectorT::getMax"></span><span class="target" id="paddleclasspaddle_1_1GpuVectorT_1a500da3aa099892b164c02ebf231b9f6d"></span><em class="property">virtual</em> T <code class="descname">getMax</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10GpuVectorT6getMaxEv" title="Permalink to this definition">¶</a></dt>
4243
<dd></dd></dl>
Y
Yu Yang 已提交
4244 4245

<dl class="function">
4246
<dt id="_CPPv2N6paddle10GpuVectorT9getAbsMaxEv">
4247
<span id="paddle::GpuVectorT::getAbsMax"></span><span class="target" id="paddleclasspaddle_1_1GpuVectorT_1a543043cf7fc4a2efdf69de57b8fcdbde"></span><em class="property">virtual</em> T <code class="descname">getAbsMax</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10GpuVectorT9getAbsMaxEv" title="Permalink to this definition">¶</a></dt>
4248
<dd></dd></dl>
Y
Yu Yang 已提交
4249 4250

<dl class="function">
4251
<dt id="_CPPv2N6paddle10GpuVectorT6getMinEv">
4252
<span id="paddle::GpuVectorT::getMin"></span><span class="target" id="paddleclasspaddle_1_1GpuVectorT_1ae11e9b8071ab8cf807f292bc7939b977"></span><em class="property">virtual</em> T <code class="descname">getMin</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10GpuVectorT6getMinEv" title="Permalink to this definition">¶</a></dt>
4253
<dd></dd></dl>
Y
Yu Yang 已提交
4254 4255

<dl class="function">
4256
<dt id="_CPPv2N6paddle10GpuVectorT9isEqualToERK7VectorTI1TERK1T">
4257
<span id="paddle::GpuVectorT::isEqualTo__VectorT:T:CR.TCR"></span><span class="target" id="paddleclasspaddle_1_1GpuVectorT_1a5ff671da13b1d538ca7d4b9ca6e35f84"></span>void <code class="descname">isEqualTo</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7VectorTE" title="paddle::VectorT">VectorT</a>&lt;T&gt; &amp;<em>b</em>, <em class="property">const</em> T &amp;<em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10GpuVectorT9isEqualToERK7VectorTI1TERK1T" title="Permalink to this definition">¶</a></dt>
4258
<dd><p>element-wise calc: this = (b == value) </p>
Y
Yu Yang 已提交
4259 4260 4261
</dd></dl>

<dl class="function">
4262
<dt id="_CPPv2N6paddle10GpuVectorT10selectFromERK7VectorTI1TERK7VectorTIiE">
4263
<span id="paddle::GpuVectorT::selectFrom__VectorT:T:CR.VectorT:i:CR"></span><span class="target" id="paddleclasspaddle_1_1GpuVectorT_1ac9d64af6fa29498ad462505bbd3b899f"></span>void <code class="descname">selectFrom</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7VectorTE" title="paddle::VectorT">VectorT</a>&lt;T&gt; &amp;<em>src</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7VectorTE" title="paddle::VectorT">VectorT</a>&lt;int&gt; &amp;<em>ids</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10GpuVectorT10selectFromERK7VectorTI1TERK7VectorTIiE" title="Permalink to this definition">¶</a></dt>
4264
<dd><p>select elements indexed by <em>ids</em> from vector <em>src</em> </p>
Y
Yu Yang 已提交
4265 4266 4267
</dd></dl>

<dl class="function">
4268
<dt id="_CPPv2N6paddle10GpuVectorT9histogramERNSt7ostreamEi">
4269
<span id="paddle::GpuVectorT::histogram__osR.i"></span><span class="target" id="paddleclasspaddle_1_1GpuVectorT_1afe6117077b35805268b8897bcedf89aa"></span>void <code class="descname">histogram</code><span class="sig-paren">(</span>std::ostream &amp;<em>os</em>, int <em>type</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10GpuVectorT9histogramERNSt7ostreamEi" title="Permalink to this definition">¶</a></dt>
4270
<dd><p>print histogram of vector values </p>
Y
Yu Yang 已提交
4271 4272
<p><dl class="docutils">
<dt><strong>Note</strong></dt>
4273
<dd>only exponent histogram supported currently </dd>
Y
Yu Yang 已提交
4274 4275 4276 4277 4278
</dl>
</p>
</dd></dl>

<dl class="function">
4279
<dt id="_CPPv2N6paddle10GpuVectorT4randEv">
4280
<span id="paddle::GpuVectorT::rand"></span><span class="target" id="paddleclasspaddle_1_1GpuVectorT_1a78102f4439490521a8d9e3bfe35eca33"></span><em class="property">virtual</em> void <code class="descname">rand</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10GpuVectorT4randEv" title="Permalink to this definition">¶</a></dt>
4281
<dd><p>generate uniform random value for each element </p>
Y
Yu Yang 已提交
4282 4283 4284
</dd></dl>

<dl class="function">
4285
<dt id="_CPPv2N6paddle10GpuVectorT4randE6size_t">
4286
<span id="paddle::GpuVectorT::rand__s"></span><span class="target" id="paddleclasspaddle_1_1GpuVectorT_1a38bf5008cb839c6a01c58c647a1a5da9"></span><em class="property">virtual</em> void <code class="descname">rand</code><span class="sig-paren">(</span>size_t <em>classes</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10GpuVectorT4randE6size_t" title="Permalink to this definition">¶</a></dt>
4287
<dd><p>generate uniform random value for each element, data range is from 0 to (classes - 1). </p>
Y
Yu Yang 已提交
4288 4289 4290
</dd></dl>

<dl class="function">
4291
<dt id="_CPPv2N6paddle10GpuVectorT8randnormE4real4real">
4292
<span id="paddle::GpuVectorT::randnorm__real.real"></span><span class="target" id="paddleclasspaddle_1_1GpuVectorT_1a7c2962089789d798e68d47b79a9086c0"></span>void <code class="descname">randnorm</code><span class="sig-paren">(</span>real <em>mean</em>, real <em>standardDeviation</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10GpuVectorT8randnormE4real4real" title="Permalink to this definition">¶</a></dt>
4293
<dd><p>generate univariate Gaussian distributed random numbers with given mean and standardDeviation. </p>
Y
Yu Yang 已提交
4294 4295 4296
</dd></dl>

<dl class="function">
4297
<dt id="_CPPv2N6paddle10GpuVectorT7uniformE4real4real">
4298
<span id="paddle::GpuVectorT::uniform__real.real"></span><span class="target" id="paddleclasspaddle_1_1GpuVectorT_1af0d6a2f87fcdeb6110ce36c7b2794f00"></span>void <code class="descname">uniform</code><span class="sig-paren">(</span>real <em>left</em>, real <em>right</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10GpuVectorT7uniformE4real4real" title="Permalink to this definition">¶</a></dt>
4299
<dd><p>generate uniform distributed random numbers with given range. </p>
Y
Yu Yang 已提交
4300 4301 4302
</dd></dl>

<dl class="function">
4303
<dt id="_CPPv2N6paddle10GpuVectorT3getE6size_t">
4304
<span id="paddle::GpuVectorT::get__s"></span><span class="target" id="paddleclasspaddle_1_1GpuVectorT_1a96b60315ac69fd99ee38c9fc43f8eb91"></span>T <code class="descname">get</code><span class="sig-paren">(</span>size_t <em>pos</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10GpuVectorT3getE6size_t" title="Permalink to this definition">¶</a></dt>
4305 4306
<dd><p>Debug use only. Very inefficient for GPU vector. get the value at pos. </p>
</dd></dl>
Y
Yu Yang 已提交
4307 4308

<dl class="function">
4309 4310
<dt id="_CPPv2NK6paddle10GpuVectorT5printERNSt7ostreamE6size_t">
<span id="paddle::GpuVectorT::print__osR.sC"></span><span class="target" id="paddleclasspaddle_1_1GpuVectorT_1ae215964188665591290fa455bdedb4fc"></span><em class="property">virtual</em> void <code class="descname">print</code><span class="sig-paren">(</span>std::ostream &amp;<em>os</em>, size_t <em>num</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle10GpuVectorT5printERNSt7ostreamE6size_t" title="Permalink to this definition">¶</a></dt>
4311 4312
<dd><p>print the first &#8220;num&#8221; elements of the <a class="reference internal" href="../../api/api.html#paddleclassVector"><span class="std std-ref">Vector</span></a> </p>
</dd></dl>
Y
Yu Yang 已提交
4313 4314

<dl class="function">
4315 4316
<dt id="_CPPv2NK6paddle10GpuVectorT15printOneElementERNSt7ostreamE6size_t">
<span id="paddle::GpuVectorT::printOneElement__osR.sC"></span><span class="target" id="paddleclasspaddle_1_1GpuVectorT_1a546b131f3f595424d2e8305acfc7a2e8"></span><em class="property">virtual</em> void <code class="descname">printOneElement</code><span class="sig-paren">(</span>std::ostream &amp;<em>os</em>, size_t <em>idx</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle10GpuVectorT15printOneElementERNSt7ostreamE6size_t" title="Permalink to this definition">¶</a></dt>
4317
<dd><p>print the &#8220;idx&#8221; element of the <a class="reference internal" href="../../api/api.html#paddleclassVector"><span class="std std-ref">Vector</span></a> </p>
Y
Yu Yang 已提交
4318 4319 4320
</dd></dl>

</div>
4321
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4322 4323
<p class="breathe-sectiondef-title rubric">Protected Functions</p>
<dl class="function">
4324 4325
<dt id="_CPPv2NK6paddle10GpuVectorT6copyToEP10CpuVectorTI1TE">
<span id="paddle::GpuVectorT::copyTo__CpuVectorT:T:PC"></span><span class="target" id="paddleclasspaddle_1_1GpuVectorT_1adbcd6c5e647c907088350bbb2677963c"></span>void <code class="descname">copyTo</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle10CpuVectorTE" title="paddle::CpuVectorT">CpuVectorT</a>&lt;T&gt; *<em>dest</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle10GpuVectorT6copyToEP10CpuVectorTI1TE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4326 4327 4328
<dd></dd></dl>

<dl class="function">
4329 4330
<dt id="_CPPv2NK6paddle10GpuVectorT6copyToEP10GpuVectorTI1TE">
<span id="paddle::GpuVectorT::copyTo__GpuVectorT:T:PC"></span><span class="target" id="paddleclasspaddle_1_1GpuVectorT_1abf1c55362cb081950a9769f2546ca225"></span>void <code class="descname">copyTo</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle10GpuVectorTE" title="paddle::GpuVectorT">GpuVectorT</a>&lt;T&gt; *<em>dest</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle10GpuVectorT6copyToEP10GpuVectorTI1TE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4331 4332 4333 4334 4335 4336 4337 4338 4339 4340
<dd></dd></dl>

</div>
</dd></dl>

<dl class="class">
<dt>
<span class="target" id="paddleclasspaddle_1_1CpuVectorT"></span><em class="property">template </em>&lt;<em class="property">class</em> T&gt;</dt>
<dt id="_CPPv2N6paddle10CpuVectorTE">
<span id="paddle::CpuVectorT"></span><em class="property">class </em><code class="descname">CpuVectorT</code><a class="headerlink" href="#_CPPv2N6paddle10CpuVectorTE" title="Permalink to this definition">¶</a></dt>
4341 4342
<dd><p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1VectorT"><span class="std std-ref">paddle::VectorT&lt; T &gt;</span></a></p>
<p>Subclassed by <a class="reference internal" href="#paddleclasspaddle_1_1ParallelCpuVectorT"><span class="std std-ref">paddle::ParallelCpuVectorT&lt; T &gt;</span></a></p>
4343
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4344 4345 4346 4347 4348 4349 4350 4351 4352 4353 4354 4355 4356 4357 4358 4359 4360 4361 4362 4363 4364 4365 4366 4367 4368
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT10CpuVectorTE6size_t">
<span id="paddle::CpuVectorT::CpuVectorT__s"></span><span class="target" id="paddleclasspaddle_1_1CpuVectorT_1ab6e3410588def4911312efdebda6c5e8"></span><code class="descname">CpuVectorT</code><span class="sig-paren">(</span>size_t <em>size</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10CpuVectorT10CpuVectorTE6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT10CpuVectorTE6size_t15MemoryHandlePtr6size_t">
<span id="paddle::CpuVectorT::CpuVectorT__s.MemoryHandlePtr.s"></span><span class="target" id="paddleclasspaddle_1_1CpuVectorT_1a40066fb353eb6e15933d59757c77142b"></span><code class="descname">CpuVectorT</code><span class="sig-paren">(</span>size_t <em>size</em>, <a class="reference internal" href="../utils/utils.html#_CPPv2N6paddle15MemoryHandlePtrE" title="paddle::MemoryHandlePtr">MemoryHandlePtr</a> <em>memoryHandle</em>, size_t <em>offset</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10CpuVectorT10CpuVectorTE6size_t15MemoryHandlePtr6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT10CpuVectorTE6size_tP1T">
<span id="paddle::CpuVectorT::CpuVectorT__s.TP"></span><span class="target" id="paddleclasspaddle_1_1CpuVectorT_1ad47079e69552c929275db7f6c2d91ed5"></span><code class="descname">CpuVectorT</code><span class="sig-paren">(</span>size_t <em>size</em>, T *<em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10CpuVectorT10CpuVectorTE6size_tP1T" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT10CpuVectorTERK7VectorTI1TE">
<span id="paddle::CpuVectorT::CpuVectorT__VectorT:T:CR"></span><span class="target" id="paddleclasspaddle_1_1CpuVectorT_1a7913e3e09043611be18b86a2afbe4039"></span><code class="descname">CpuVectorT</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7VectorTE" title="paddle::VectorT">VectorT</a>&lt;T&gt; &amp;<em>src</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10CpuVectorT10CpuVectorTERK7VectorTI1TE" title="Permalink to this definition">¶</a></dt>
<dd><p>If src is a CpuVector, the new CpuVector will share the data with src</p>
<p>If src is a GpuVector, the new CpuVector will copy data from src </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT9newMemoryE6size_t">
4369
<span id="paddle::CpuVectorT::newMemory__s"></span><span class="target" id="paddleclasspaddle_1_1CpuVectorT_1afdaa90c17b29d988be1fc57571cf94b4"></span><em class="property">virtual</em> <a class="reference internal" href="../utils/utils.html#_CPPv2N6paddle15MemoryHandlePtrE" title="paddle::MemoryHandlePtr">MemoryHandlePtr</a> <code class="descname">newMemory</code><span class="sig-paren">(</span>size_t <em>size</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10CpuVectorT9newMemoryE6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4370 4371 4372 4373
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT7zeroMemEv">
4374
<span id="paddle::CpuVectorT::zeroMem"></span><span class="target" id="paddleclasspaddle_1_1CpuVectorT_1a5c180ad441f0f09a2e782d741c3d189a"></span>void <code class="descname">zeroMem</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10CpuVectorT7zeroMemEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4375 4376 4377 4378
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT5resetERK1T">
4379
<span id="paddle::CpuVectorT::reset__TCR"></span><span class="target" id="paddleclasspaddle_1_1CpuVectorT_1a086c86fa5f17b78b247c0ad78988f17c"></span>void <code class="descname">reset</code><span class="sig-paren">(</span><em class="property">const</em> T &amp;<em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10CpuVectorT5resetERK1T" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4380 4381 4382 4383
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT12fillSequenceEv">
4384
<span id="paddle::CpuVectorT::fillSequence"></span><span class="target" id="paddleclasspaddle_1_1CpuVectorT_1a8304decc7e0a9c1ce4293bb187139a95"></span>void <code class="descname">fillSequence</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10CpuVectorT12fillSequenceEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4385 4386 4387 4388
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT8copyFromEPK1T6size_t">
4389
<span id="paddle::CpuVectorT::copyFrom__TCP.s"></span><span class="target" id="paddleclasspaddle_1_1CpuVectorT_1ac9ed47df56babd7d6eab6eaa0a91bbcb"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> T *<em>src</em>, size_t <em>size</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10CpuVectorT8copyFromEPK1T6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4390 4391 4392 4393 4394 4395 4396
<dd><p>copy size elements from src</p>
<p>If this is GpuVector, src can be cpu or gpu memory</p>
<p>If this is CpuVector, src is assumed to be cpu memory </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT8copyFromEPK1T6size_t11hl_stream_t">
4397
<span id="paddle::CpuVectorT::copyFrom__TCP.s.hl_stream_t"></span><span class="target" id="paddleclasspaddle_1_1CpuVectorT_1acb801d96b00f88dcbd1c4e371b2c7218"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> T *<em>src</em>, size_t <em>size</em>, <a class="reference internal" href="../../cuda/utils/utils.html#_CPPv211hl_stream_t" title="hl_stream_t">hl_stream_t</a> <em>stream</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10CpuVectorT8copyFromEPK1T6size_t11hl_stream_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4398 4399 4400 4401 4402 4403 4404
<dd><p>copy size elements from src</p>
<p>If this is GpuVector, src can be cpu or gpu memory</p>
<p>If this is CpuVector, src is assumed to be cpu memory, </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT8copyFromERK7VectorTI1TE">
4405
<span id="paddle::CpuVectorT::copyFrom__VectorT:T:CR"></span><span class="target" id="paddleclasspaddle_1_1CpuVectorT_1aaea8c3d30f15b2b40e4d6f928ba178cf"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7VectorTE" title="paddle::VectorT">VectorT</a>&lt;T&gt; &amp;<em>src</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10CpuVectorT8copyFromERK7VectorTI1TE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4406 4407 4408 4409 4410
<dd><p>This function will crash if the size of src and dest is different. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT8copyFromERK7VectorTI1TE11hl_stream_t">
4411
<span id="paddle::CpuVectorT::copyFrom__VectorT:T:CR.hl_stream_t"></span><span class="target" id="paddleclasspaddle_1_1CpuVectorT_1ae38ac2b5d3f283c52a333c0d202c24b0"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7VectorTE" title="paddle::VectorT">VectorT</a>&lt;T&gt; &amp;<em>src</em>, <a class="reference internal" href="../../cuda/utils/utils.html#_CPPv211hl_stream_t" title="hl_stream_t">hl_stream_t</a> <em>stream</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10CpuVectorT8copyFromERK7VectorTI1TE11hl_stream_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4412
<dd><p>If use_gpu, this function will push the copy-task to the specifed-stream and return immediately.</p>
4413
<p>If not use GPU, this function is same as the <a class="reference internal" href="#paddleclasspaddle_1_1CpuVectorT_1aaea8c3d30f15b2b40e4d6f928ba178cf"><span class="std std-ref">copyFrom(const VectorT&lt;T&gt;&amp; src)</span></a>, which use stream HPPL_STREAM_DEFAULT. </p>
Y
Yu Yang 已提交
4414 4415 4416
</dd></dl>

<dl class="function">
4417 4418
<dt id="_CPPv2NK6paddle10CpuVectorT6copyToEP10CpuVectorTI1TE">
<span id="paddle::CpuVectorT::copyTo__CpuVectorT:T:PC"></span><span class="target" id="paddleclasspaddle_1_1CpuVectorT_1aa8a47606a17b86a801b318aa031e7605"></span>void <code class="descname">copyTo</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle10CpuVectorTE" title="paddle::CpuVectorT">CpuVectorT</a>&lt;T&gt; *<em>dest</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle10CpuVectorT6copyToEP10CpuVectorTI1TE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4419 4420 4421
<dd></dd></dl>

<dl class="function">
4422 4423
<dt id="_CPPv2NK6paddle10CpuVectorT6copyToEP10GpuVectorTI1TE">
<span id="paddle::CpuVectorT::copyTo__GpuVectorT:T:PC"></span><span class="target" id="paddleclasspaddle_1_1CpuVectorT_1ab23bc97931df58a54b0d3bd355c02974"></span>void <code class="descname">copyTo</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle10GpuVectorTE" title="paddle::GpuVectorT">GpuVectorT</a>&lt;T&gt; *<em>dest</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle10CpuVectorT6copyToEP10GpuVectorTI1TE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4424 4425 4426 4427
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT8getPointEK8uint64_t">
4428
<span id="paddle::CpuVectorT::getPoint__uint64_tC"></span><span class="target" id="paddleclasspaddle_1_1CpuVectorT_1ab9fb3e29de5bae0d03b5ec84f57e11ed"></span><em class="property">virtual</em> T *<code class="descname">getPoint</code><span class="sig-paren">(</span><em class="property">const</em> uint64_t <em>beginPos</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10CpuVectorT8getPointEK8uint64_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4429 4430 4431 4432
<dd><p>Get the buffer point with beginPos. </p>
</dd></dl>

<dl class="function">
4433 4434
<dt id="_CPPv2NK6paddle10CpuVectorT10getElementE6size_t">
<span id="paddle::CpuVectorT::getElement__sC"></span><span class="target" id="paddleclasspaddle_1_1CpuVectorT_1a934e3da138a5ec1adf6018235490b16f"></span><em class="property">virtual</em> T <code class="descname">getElement</code><span class="sig-paren">(</span>size_t <em>i</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle10CpuVectorT10getElementE6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4435 4436 4437 4438 4439
<dd><p>Get the value for the i&#8217;th element. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT10setElementE6size_tRK1T">
4440
<span id="paddle::CpuVectorT::setElement__s.TCR"></span><span class="target" id="paddleclasspaddle_1_1CpuVectorT_1aab03abbd5a39c65cc9a143c9af480dfc"></span><em class="property">virtual</em> void <code class="descname">setElement</code><span class="sig-paren">(</span>size_t <em>i</em>, <em class="property">const</em> T &amp;<em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10CpuVectorT10setElementE6size_tRK1T" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4441 4442 4443 4444
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT9getAbsSumEv">
4445
<span id="paddle::CpuVectorT::getAbsSum"></span><span class="target" id="paddleclasspaddle_1_1CpuVectorT_1a2acf45abba73d1ad39af798c765b0f44"></span>T <code class="descname">getAbsSum</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10CpuVectorT9getAbsSumEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4446 4447 4448 4449
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT6getSumEv">
4450
<span id="paddle::CpuVectorT::getSum"></span><span class="target" id="paddleclasspaddle_1_1CpuVectorT_1aacc1de90d130c4038552cce9ef240469"></span>T <code class="descname">getSum</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10CpuVectorT6getSumEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4451 4452 4453 4454
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT6getMaxEv">
4455
<span id="paddle::CpuVectorT::getMax"></span><span class="target" id="paddleclasspaddle_1_1CpuVectorT_1ac009c0df4cfbdfb791b223add003e271"></span>T <code class="descname">getMax</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10CpuVectorT6getMaxEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4456 4457 4458 4459
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT9getAbsMaxEv">
4460
<span id="paddle::CpuVectorT::getAbsMax"></span><span class="target" id="paddleclasspaddle_1_1CpuVectorT_1a2986e403f779ef927ef955af05798cbc"></span>T <code class="descname">getAbsMax</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10CpuVectorT9getAbsMaxEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4461 4462 4463 4464
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT6getMinEv">
4465
<span id="paddle::CpuVectorT::getMin"></span><span class="target" id="paddleclasspaddle_1_1CpuVectorT_1a4666297b70eb108805c27d607e7c61c4"></span>T <code class="descname">getMin</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10CpuVectorT6getMinEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4466 4467 4468 4469
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT9isEqualToERK7VectorTI1TERK1T">
4470
<span id="paddle::CpuVectorT::isEqualTo__VectorT:T:CR.TCR"></span><span class="target" id="paddleclasspaddle_1_1CpuVectorT_1a1d7554a92e66fdb318d48f776d6d82d6"></span>void <code class="descname">isEqualTo</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7VectorTE" title="paddle::VectorT">VectorT</a>&lt;T&gt; &amp;<em>b</em>, <em class="property">const</em> T &amp;<em>value</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10CpuVectorT9isEqualToERK7VectorTI1TERK1T" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4471 4472 4473 4474 4475
<dd><p>element-wise calc: this = (b == value) </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT10selectFromERK7VectorTI1TERK7VectorTIiE">
4476
<span id="paddle::CpuVectorT::selectFrom__VectorT:T:CR.VectorT:i:CR"></span><span class="target" id="paddleclasspaddle_1_1CpuVectorT_1a3523bf4bd2756084cf04089a10144cbe"></span>void <code class="descname">selectFrom</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7VectorTE" title="paddle::VectorT">VectorT</a>&lt;T&gt; &amp;<em>src</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7VectorTE" title="paddle::VectorT">VectorT</a>&lt;int&gt; &amp;<em>ids</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10CpuVectorT10selectFromERK7VectorTI1TERK7VectorTIiE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4477 4478 4479 4480 4481
<dd><p>select elements indexed by <em>ids</em> from vector <em>src</em> </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT9histogramERNSt7ostreamEi">
4482
<span id="paddle::CpuVectorT::histogram__osR.i"></span><span class="target" id="paddleclasspaddle_1_1CpuVectorT_1adbfaa86c6e4d8e71c455a85bc3c95b50"></span>void <code class="descname">histogram</code><span class="sig-paren">(</span>std::ostream &amp;<em>os</em>, int <em>type</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10CpuVectorT9histogramERNSt7ostreamEi" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4483 4484 4485 4486 4487 4488 4489 4490 4491 4492
<dd><p>print histogram of vector values </p>
<p><dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>only exponent histogram supported currently </dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT4randEv">
4493
<span id="paddle::CpuVectorT::rand"></span><span class="target" id="paddleclasspaddle_1_1CpuVectorT_1a1aac47f1b8029ff0c04d2eca388074b4"></span><em class="property">virtual</em> void <code class="descname">rand</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10CpuVectorT4randEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4494 4495 4496 4497 4498
<dd><p>generate uniform random value for each element </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT4randE6size_t">
4499
<span id="paddle::CpuVectorT::rand__s"></span><span class="target" id="paddleclasspaddle_1_1CpuVectorT_1a470841d8510c997d9139ead503c0298b"></span><em class="property">virtual</em> void <code class="descname">rand</code><span class="sig-paren">(</span>size_t <em>classes</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10CpuVectorT4randE6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4500 4501 4502 4503 4504
<dd><p>generate uniform random value for each element, data range is from 0 to (classes - 1). </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT8randnormE4real4real">
4505
<span id="paddle::CpuVectorT::randnorm__real.real"></span><span class="target" id="paddleclasspaddle_1_1CpuVectorT_1a3e4bfe8b7934220fbdbc3fe61c0f08e9"></span>void <code class="descname">randnorm</code><span class="sig-paren">(</span>real <em>mean</em>, real <em>standardDeviation</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10CpuVectorT8randnormE4real4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4506 4507 4508 4509 4510
<dd><p>generate univariate Gaussian distributed random numbers with given mean and standardDeviation. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT7uniformE4real4real">
4511
<span id="paddle::CpuVectorT::uniform__real.real"></span><span class="target" id="paddleclasspaddle_1_1CpuVectorT_1ade54e40de04450a97eb1d014f173b149"></span>void <code class="descname">uniform</code><span class="sig-paren">(</span>real <em>left</em>, real <em>right</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10CpuVectorT7uniformE4real4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4512 4513 4514 4515 4516
<dd><p>generate uniform distributed random numbers with given range. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT3getE6size_t">
4517
<span id="paddle::CpuVectorT::get__s"></span><span class="target" id="paddleclasspaddle_1_1CpuVectorT_1ac0ae9da89d830f3c83847e2dd27f9514"></span>T <code class="descname">get</code><span class="sig-paren">(</span>size_t <em>pos</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10CpuVectorT3getE6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4518 4519 4520 4521
<dd><p>Debug use only. Very inefficient for GPU vector. get the value at pos. </p>
</dd></dl>

<dl class="function">
4522 4523
<dt id="_CPPv2NK6paddle10CpuVectorT5printERNSt7ostreamE6size_t">
<span id="paddle::CpuVectorT::print__osR.sC"></span><span class="target" id="paddleclasspaddle_1_1CpuVectorT_1a0b23837ed1420e9df14648036d00f482"></span><em class="property">virtual</em> void <code class="descname">print</code><span class="sig-paren">(</span>std::ostream &amp;<em>os</em>, size_t <em>num</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle10CpuVectorT5printERNSt7ostreamE6size_t" title="Permalink to this definition">¶</a></dt>
4524
<dd><p>print the first &#8220;num&#8221; elements of the <a class="reference internal" href="../../api/api.html#paddleclassVector"><span class="std std-ref">Vector</span></a> </p>
Y
Yu Yang 已提交
4525 4526 4527
</dd></dl>

<dl class="function">
4528 4529
<dt id="_CPPv2NK6paddle10CpuVectorT15printOneElementERNSt7ostreamE6size_t">
<span id="paddle::CpuVectorT::printOneElement__osR.sC"></span><span class="target" id="paddleclasspaddle_1_1CpuVectorT_1a392bdf95e00ab5fb761e959e2b7e9216"></span><em class="property">virtual</em> void <code class="descname">printOneElement</code><span class="sig-paren">(</span>std::ostream &amp;<em>os</em>, size_t <em>idx</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle10CpuVectorT15printOneElementERNSt7ostreamE6size_t" title="Permalink to this definition">¶</a></dt>
4530
<dd><p>print the &#8220;idx&#8221; element of the <a class="reference internal" href="../../api/api.html#paddleclassVector"><span class="std std-ref">Vector</span></a> </p>
Y
Yu Yang 已提交
4531 4532 4533 4534 4535 4536 4537
</dd></dl>

</div>
</dd></dl>

<dl class="class">
<dt>
4538 4539 4540 4541 4542
<span class="target" id="paddleclasspaddle_1_1BaseVector"></span><em class="property">template </em>&lt;<em class="property">class</em> T&gt;</dt>
<dt id="_CPPv2N6paddle10BaseVectorE">
<span id="paddle::BaseVector"></span><em class="property">class </em><code class="descname">BaseVector</code><a class="headerlink" href="#_CPPv2N6paddle10BaseVectorE" title="Permalink to this definition">¶</a></dt>
<dd><p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1BaseMatrixT"><span class="std std-ref">paddle::BaseMatrixT&lt; T &gt;</span></a></p>
<p>Subclassed by <a class="reference internal" href="#paddleclasspaddle_1_1VectorT"><span class="std std-ref">paddle::VectorT&lt; T &gt;</span></a></p>
4543
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4544 4545
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
4546 4547
<dt id="_CPPv2N6paddle10BaseVector10BaseVectorE6size_tP1Tb">
<span id="paddle::BaseVector::BaseVector__s.TP.b"></span><span class="target" id="paddleclasspaddle_1_1BaseVector_1a2d96e370ea9bbeaa479b3ed7e16355bc"></span><code class="descname">BaseVector</code><span class="sig-paren">(</span>size_t <em>size</em>, T *<em>data</em>, bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10BaseVector10BaseVectorE6size_tP1Tb" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4548 4549 4550
<dd></dd></dl>

<dl class="function">
4551 4552 4553 4554 4555
<dt id="_CPPv2N6paddle10BaseVectorD0Ev">
<span id="paddle::BaseVector::~BaseVector"></span><span class="target" id="paddleclasspaddle_1_1BaseVector_1a6fb06278d8ddc680ffcaa3b6a59aa2f0"></span><code class="descname">~BaseVector</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10BaseVectorD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
4556
<div class="breathe-sectiondef docutils container">
4557 4558 4559 4560
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle10BaseVector5size_E">
<span id="paddle::BaseVector::size___sR"></span><span class="target" id="paddleclasspaddle_1_1BaseVector_1a4097421e88f2743ada85ea794dc95365"></span>size_t &amp;<code class="descname">size_</code><a class="headerlink" href="#_CPPv2N6paddle10BaseVector5size_E" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4561 4562
<dd></dd></dl>

4563 4564 4565 4566 4567 4568 4569 4570 4571 4572 4573
</div>
</dd></dl>

<dl class="class">
<dt>
<span class="target" id="paddleclasspaddle_1_1VectorT"></span><em class="property">template </em>&lt;class <em>T</em>&gt;</dt>
<dt id="_CPPv2N6paddle7VectorTE">
<span id="paddle::VectorT"></span><em class="property">class </em><code class="descname">VectorT</code><a class="headerlink" href="#_CPPv2N6paddle7VectorTE" title="Permalink to this definition">¶</a></dt>
<dd><em>#include &lt;Vector.h&gt;</em><p>Copy or assignemnt constructor will share the data as opposed to making a copy of the original data. To make a copy of the orinal data, use <a class="reference internal" href="#paddleclasspaddle_1_1VectorT_1ad2afa0a39de13b7e43ee3f52ee96a188"><span class="std std-ref">copyFrom()</span></a> instead. </p>
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1BaseVector"><span class="std std-ref">paddle::BaseVector&lt; T &gt;</span></a></p>
<p>Subclassed by <a class="reference internal" href="#paddleclasspaddle_1_1CpuVectorT"><span class="std std-ref">paddle::CpuVectorT&lt; T &gt;</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1GpuVectorT"><span class="std std-ref">paddle::GpuVectorT&lt; T &gt;</span></a></p>
4574
<div class="breathe-sectiondef docutils container">
4575 4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587
<p class="breathe-sectiondef-title rubric">Public Types</p>
<dl class="type">
<dt id="_CPPv2N6paddle13HistogramTypeE">
<span id="paddle::HistogramType"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1a77c5cae31036972e283f98153890fd51"></span><em class="property">enum </em><code class="descname">HistogramType</code><a class="headerlink" href="#_CPPv2N6paddle13HistogramTypeE" title="Permalink to this definition">¶</a></dt>
<dd><p><em>Values:</em></p>
<dl class="member">
<dt id="_CPPv2N6paddle18HISTOGRAM_EXPONENTE">
<span id="paddle::HISTOGRAM_EXPONENT"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1a77c5cae31036972e283f98153890fd51a7175b8bb93a2fd0db020ddaca1667b44"></span><code class="descname">HISTOGRAM_EXPONENT</code> = 0<a class="headerlink" href="#_CPPv2N6paddle18HISTOGRAM_EXPONENTE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</dd></dl>

</div>
4588
<div class="breathe-sectiondef docutils container">
4589
<p class="breathe-sectiondef-title rubric">Public Functions</p>
Y
Yu Yang 已提交
4590
<dl class="function">
4591
<dt id="_CPPv2N6paddle7VectorTD0Ev">
4592
<span id="paddle::VectorT::~VectorT"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1a058f30cf858c72abf4b1d4a3d98e9f8e"></span><em class="property">virtual</em> <code class="descname">~VectorT</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle7VectorTD0Ev" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4593 4594 4595
<dd></dd></dl>

<dl class="function">
4596 4597
<dt id="_CPPv2NK6paddle7VectorT7getSizeEv">
<span id="paddle::VectorT::getSizeC"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1a86645276e7e251da730c963e16f27e95"></span>size_t <code class="descname">getSize</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle7VectorT7getSizeEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4598 4599 4600
<dd></dd></dl>

<dl class="function">
4601 4602
<dt id="_CPPv2NK6paddle7VectorT7getDataEv">
<span id="paddle::VectorT::getDataC"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1a62b30d0dfd5e3318ad778bfdad0a36f9"></span><em class="property">const</em> T *<code class="descname">getData</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle7VectorT7getDataEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4603 4604 4605
<dd></dd></dl>

<dl class="function">
4606
<dt id="_CPPv2N6paddle7VectorT7getDataEv">
4607
<span id="paddle::VectorT::getData"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1aec1b0625588cd126070c741db92a3f49"></span>T *<code class="descname">getData</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle7VectorT7getDataEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4608 4609 4610
<dd></dd></dl>

<dl class="function">
4611
<dt id="_CPPv2N6paddle7VectorT7zeroMemEv">
4612
<span id="paddle::VectorT::zeroMem"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1ae816e03dc16222e0d50173d79e00b09f"></span><em class="property">virtual</em> void <code class="descname">zeroMem</code><span class="sig-paren">(</span><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT7zeroMemEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4613 4614 4615
<dd></dd></dl>

<dl class="function">
4616
<dt id="_CPPv2N6paddle7VectorT5resetERK1T">
4617
<span id="paddle::VectorT::reset__TCR"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1a5519a2f858366edeb55b06165d5c2041"></span><em class="property">virtual</em> void <code class="descname">reset</code><span class="sig-paren">(</span><em class="property">const</em> T &amp;<em>value</em><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT5resetERK1T" title="Permalink to this definition">¶</a></dt>
4618 4619 4620 4621
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle7VectorT12fillSequenceEv">
4622
<span id="paddle::VectorT::fillSequence"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1ab3fe29977819f4a33a7ec35520d8a7ca"></span><em class="property">virtual</em> void <code class="descname">fillSequence</code><span class="sig-paren">(</span><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT12fillSequenceEv" title="Permalink to this definition">¶</a></dt>
4623 4624 4625
<dd></dd></dl>

<dl class="function">
4626 4627
<dt id="_CPPv2NK6paddle7VectorT15getMemoryHandleEv">
<span id="paddle::VectorT::getMemoryHandleC"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1a7969d0ab73b70bbe3f4e8dca271f066d"></span><a class="reference internal" href="../utils/utils.html#_CPPv2N6paddle15MemoryHandlePtrE" title="paddle::MemoryHandlePtr">MemoryHandlePtr</a> <code class="descname">getMemoryHandle</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle7VectorT15getMemoryHandleEv" title="Permalink to this definition">¶</a></dt>
4628 4629 4630 4631 4632 4633 4634 4635 4636 4637
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle7VectorT6resizeE6size_t">
<span id="paddle::VectorT::resize__s"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1a8c788934e719f448668d931304aaa619"></span>void <code class="descname">resize</code><span class="sig-paren">(</span>size_t <em>newSize</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle7VectorT6resizeE6size_t" title="Permalink to this definition">¶</a></dt>
<dd><p>resizing to a big vector will not preserve old values. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle7VectorT9newMemoryE6size_t">
4638
<span id="paddle::VectorT::newMemory__s"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1a91513b17b4d9aa8e14bac53f61135e4a"></span><em class="property">virtual</em> <a class="reference internal" href="../utils/utils.html#_CPPv2N6paddle15MemoryHandlePtrE" title="paddle::MemoryHandlePtr">MemoryHandlePtr</a> <code class="descname">newMemory</code><span class="sig-paren">(</span>size_t <em>size</em><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT9newMemoryE6size_t" title="Permalink to this definition">¶</a></dt>
4639 4640 4641 4642 4643 4644 4645 4646 4647 4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle7VectorT10subVecFromERK7VectorTI1TE6size_t6size_t">
<span id="paddle::VectorT::subVecFrom__VectorT:T:CR.s.s"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1a655353294f0dbdcabebb10d04099a4ed"></span>void <code class="descname">subVecFrom</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7VectorTE" title="paddle::VectorT">VectorT</a>&lt;T&gt; &amp;<em>src</em>, size_t <em>start</em>, size_t <em>size</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle7VectorT10subVecFromERK7VectorTI1TE6size_t6size_t" title="Permalink to this definition">¶</a></dt>
<dd><p>form sub vector from <em>src</em>, shallow copy </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle7VectorT6subVecE6size_t6size_t">
<span id="paddle::VectorT::subVec__s.s"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1aafd5f652d12316856e9d5bf807a8fc71"></span>std::shared_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle7VectorTE" title="paddle::VectorT">VectorT</a>&lt;T&gt;&gt; <code class="descname">subVec</code><span class="sig-paren">(</span>size_t <em>start</em>, size_t <em>size</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle7VectorT6subVecE6size_t6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle7VectorT10subVecFromEPK1T6size_t6size_t">
<span id="paddle::VectorT::subVecFrom__TCP.s.s"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1a1b28836593f592eae3cdff31cc949906"></span>void <code class="descname">subVecFrom</code><span class="sig-paren">(</span><em class="property">const</em> T *<em>src</em>, size_t <em>start</em>, size_t <em>size</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle7VectorT10subVecFromEPK1T6size_t6size_t" title="Permalink to this definition">¶</a></dt>
<dd><p>form sub vector from <em>src</em>, shallow copy </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle7VectorT10subVecFromERK7VectorTI1TENSt4pairI6size_t6size_tEE">
<span id="paddle::VectorT::subVecFrom__VectorT:T:CR.std::pair:s.s:"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1a024d160ac48f975d9d9ac84184b3d89a"></span>void <code class="descname">subVecFrom</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7VectorTE" title="paddle::VectorT">VectorT</a>&lt;T&gt; &amp;<em>src</em>, std::pair&lt;size_t, size_t&gt; <em>interval</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle7VectorT10subVecFromERK7VectorTI1TENSt4pairI6size_t6size_tEE" title="Permalink to this definition">¶</a></dt>
<dd><p>form sub vector from <em>src</em>, shallow copy in <em>interval</em> [interval.first, interval.second) </p>
</dd></dl>

4664 4665 4666 4667 4668 4669
<dl class="function">
<dt id="_CPPv2N6paddle7VectorT20toOneHotSparseMatrixE6size_tb">
<span id="paddle::VectorT::toOneHotSparseMatrix__s.b"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1a08e08e0a712f55cc2c7ffdb71f9e0be6"></span>std::shared_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a>&gt; <code class="descname">toOneHotSparseMatrix</code><span class="sig-paren">(</span>size_t <em>idRange</em>, bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle7VectorT20toOneHotSparseMatrixE6size_tb" title="Permalink to this definition">¶</a></dt>
<dd><p>convert the vector to a sparse one_hot matrix of width idRange only applies to <a class="reference internal" href="../../api/api.html#paddleclassIVector"><span class="std std-ref">IVector</span></a> </p>
</dd></dl>

4670 4671
<dl class="function">
<dt id="_CPPv2N6paddle7VectorT8copyFromERK7VectorTI1TE">
4672
<span id="paddle::VectorT::copyFrom__VectorT:T:CR"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1ad2afa0a39de13b7e43ee3f52ee96a188"></span><em class="property">virtual</em> void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7VectorTE" title="paddle::VectorT">VectorT</a>&lt;T&gt; &amp;<em>src</em><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT8copyFromERK7VectorTI1TE" title="Permalink to this definition">¶</a></dt>
4673 4674 4675 4676 4677
<dd><p>This function will crash if the size of src and dest is different. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle7VectorT8copyFromERK7VectorTI1TE11hl_stream_t">
4678
<span id="paddle::VectorT::copyFrom__VectorT:T:CR.hl_stream_t"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1a71ab70b536d7c06db3a3f869926172a9"></span><em class="property">virtual</em> void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7VectorTE" title="paddle::VectorT">VectorT</a>&lt;T&gt; &amp;<em>src</em>, <a class="reference internal" href="../../cuda/utils/utils.html#_CPPv211hl_stream_t" title="hl_stream_t">hl_stream_t</a> <em>stream</em><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT8copyFromERK7VectorTI1TE11hl_stream_t" title="Permalink to this definition">¶</a></dt>
4679 4680 4681 4682 4683 4684
<dd><p>If use_gpu, this function will push the copy-task to the specifed-stream and return immediately.</p>
<p>If not use GPU, this function is same as the <a class="reference internal" href="#paddleclasspaddle_1_1VectorT_1ad2afa0a39de13b7e43ee3f52ee96a188"><span class="std std-ref">copyFrom(const VectorT&lt;T&gt;&amp; src)</span></a>, which use stream HPPL_STREAM_DEFAULT. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle7VectorT8copyFromEPK1T6size_t">
4685
<span id="paddle::VectorT::copyFrom__TCP.s"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1a2b5007ca4136f363988babe40ef1ec6a"></span><em class="property">virtual</em> void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> T *<em>src</em>, size_t <em>size</em><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT8copyFromEPK1T6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4686 4687 4688 4689 4690 4691
<dd><p>copy size elements from src</p>
<p>If this is GpuVector, src can be cpu or gpu memory</p>
<p>If this is CpuVector, src is assumed to be cpu memory </p>
</dd></dl>

<dl class="function">
4692
<dt id="_CPPv2N6paddle7VectorT8copyFromEPK1T6size_t11hl_stream_t">
4693
<span id="paddle::VectorT::copyFrom__TCP.s.hl_stream_t"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1a677ffe228a21a557a6c044421a2515f5"></span><em class="property">virtual</em> void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> T *<em>src</em>, size_t <em>size</em>, <a class="reference internal" href="../../cuda/utils/utils.html#_CPPv211hl_stream_t" title="hl_stream_t">hl_stream_t</a> <em>stream</em><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT8copyFromEPK1T6size_t11hl_stream_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4694 4695 4696 4697 4698 4699
<dd><p>copy size elements from src</p>
<p>If this is GpuVector, src can be cpu or gpu memory</p>
<p>If this is CpuVector, src is assumed to be cpu memory, </p>
</dd></dl>

<dl class="function">
4700
<dt id="_CPPv2N6paddle7VectorT4execEN14SyncThreadPool7JobFuncE">
4701
<span id="paddle::VectorT::exec__SyncThreadPool::JobFunc"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1a8513e47ee7f478dac7686802dd42c067"></span><em class="property">virtual</em> void <code class="descname">exec</code><span class="sig-paren">(</span><a class="reference internal" href="../../utils/lock.html#_CPPv2N6paddle14SyncThreadPoolE" title="paddle::SyncThreadPool">SyncThreadPool</a>::<a class="reference internal" href="../../utils/lock.html#_CPPv2N6paddle14SyncThreadPool7JobFuncE" title="paddle::SyncThreadPool::JobFunc">JobFunc</a> <em>func</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle7VectorT4execEN14SyncThreadPool7JobFuncE" title="Permalink to this definition">¶</a></dt>
4702
<dd><p>exec a func in single/multi thread </p>
Y
Yu Yang 已提交
4703 4704 4705
</dd></dl>

<dl class="function">
4706
<dt id="_CPPv2N6paddle7VectorT8getPointEK8uint64_t">
4707
<span id="paddle::VectorT::getPoint__uint64_tC"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1ac2492c93d55804c084d375829c9cf51b"></span><em class="property">virtual</em> T *<code class="descname">getPoint</code><span class="sig-paren">(</span><em class="property">const</em> uint64_t <em>beginPos</em><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT8getPointEK8uint64_t" title="Permalink to this definition">¶</a></dt>
4708
<dd><p>Get the buffer point with beginPos. </p>
Y
Yu Yang 已提交
4709 4710 4711
</dd></dl>

<dl class="function">
4712 4713
<dt id="_CPPv2NK6paddle7VectorT10getElementE6size_t">
<span id="paddle::VectorT::getElement__sC"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1a8914bfb7e5955d8929a153f88b7a9bd2"></span><em class="property">virtual</em> T <code class="descname">getElement</code><span class="sig-paren">(</span>size_t <em>i</em><span class="sig-paren">)</span> <em class="property">const</em> = 0<a class="headerlink" href="#_CPPv2NK6paddle7VectorT10getElementE6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4714 4715 4716 4717
<dd><p>Get the value for the i&#8217;th element. </p>
</dd></dl>

<dl class="function">
4718
<dt id="_CPPv2N6paddle7VectorT10setElementE6size_tRK1T">
4719
<span id="paddle::VectorT::setElement__s.TCR"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1a5f4b75a7e84ca2144d257666f24771cf"></span><em class="property">virtual</em> void <code class="descname">setElement</code><span class="sig-paren">(</span>size_t <em>i</em>, <em class="property">const</em> T &amp;<em>value</em><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT10setElementE6size_tRK1T" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4720 4721 4722
<dd></dd></dl>

<dl class="function">
4723
<dt id="_CPPv2N6paddle7VectorT9getAbsSumEv">
4724
<span id="paddle::VectorT::getAbsSum"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1aacdde5cf642a32e40a4ba081c67fa7a4"></span><em class="property">virtual</em> T <code class="descname">getAbsSum</code><span class="sig-paren">(</span><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT9getAbsSumEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4725 4726 4727
<dd></dd></dl>

<dl class="function">
4728
<dt id="_CPPv2N6paddle7VectorT6getSumEv">
4729
<span id="paddle::VectorT::getSum"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1adee48c6124c12b67e19dd725bf6d7b79"></span><em class="property">virtual</em> T <code class="descname">getSum</code><span class="sig-paren">(</span><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT6getSumEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4730 4731 4732
<dd></dd></dl>

<dl class="function">
4733
<dt id="_CPPv2N6paddle7VectorT6getMaxEv">
4734
<span id="paddle::VectorT::getMax"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1aafdb8060b02175c76fc132a3624c2a1d"></span><em class="property">virtual</em> T <code class="descname">getMax</code><span class="sig-paren">(</span><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT6getMaxEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4735 4736 4737
<dd></dd></dl>

<dl class="function">
4738
<dt id="_CPPv2N6paddle7VectorT9getAbsMaxEv">
4739
<span id="paddle::VectorT::getAbsMax"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1a97ff8d81ad7b604a9372de5c796ae76c"></span><em class="property">virtual</em> T <code class="descname">getAbsMax</code><span class="sig-paren">(</span><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT9getAbsMaxEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4740 4741 4742
<dd></dd></dl>

<dl class="function">
4743
<dt id="_CPPv2N6paddle7VectorT6getMinEv">
4744
<span id="paddle::VectorT::getMin"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1ac5311edc5a94d2c993da705e81243ea9"></span><em class="property">virtual</em> T <code class="descname">getMin</code><span class="sig-paren">(</span><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT6getMinEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4745 4746 4747
<dd></dd></dl>

<dl class="function">
4748
<dt id="_CPPv2N6paddle7VectorT9isEqualToERK7VectorTI1TERK1T">
4749
<span id="paddle::VectorT::isEqualTo__VectorT:T:CR.TCR"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1a688b7c52ce826a2b74f97e899520b01b"></span><em class="property">virtual</em> void <code class="descname">isEqualTo</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7VectorTE" title="paddle::VectorT">VectorT</a>&lt;T&gt; &amp;<em>b</em>, <em class="property">const</em> T &amp;<em>value</em><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT9isEqualToERK7VectorTI1TERK1T" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4750 4751 4752 4753
<dd><p>element-wise calc: this = (b == value) </p>
</dd></dl>

<dl class="function">
4754
<dt id="_CPPv2N6paddle7VectorT10selectFromERK7VectorTI1TERK7VectorTIiE">
4755
<span id="paddle::VectorT::selectFrom__VectorT:T:CR.VectorT:i:CR"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1aa7732aea5c5649074ce4c0368a05b56f"></span><em class="property">virtual</em> void <code class="descname">selectFrom</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7VectorTE" title="paddle::VectorT">VectorT</a>&lt;T&gt; &amp;<em>src</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7VectorTE" title="paddle::VectorT">VectorT</a>&lt;int&gt; &amp;<em>ids</em><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT10selectFromERK7VectorTI1TERK7VectorTIiE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4756 4757 4758 4759
<dd><p>select elements indexed by <em>ids</em> from vector <em>src</em> </p>
</dd></dl>

<dl class="function">
4760
<dt id="_CPPv2N6paddle7VectorT9histogramERNSt7ostreamEi">
4761
<span id="paddle::VectorT::histogram__osR.i"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1a7d6a791c4ea3f9360e60edbb90e8d7fe"></span><em class="property">virtual</em> void <code class="descname">histogram</code><span class="sig-paren">(</span>std::ostream &amp;<em>os</em>, int <em>type</em> = HISTOGRAM_EXPONENT<span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT9histogramERNSt7ostreamEi" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4762 4763 4764 4765 4766 4767 4768 4769 4770
<dd><p>print histogram of vector values </p>
<p><dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>only exponent histogram supported currently </dd>
</dl>
</p>
</dd></dl>

<dl class="function">
4771
<dt id="_CPPv2N6paddle7VectorT4randEv">
4772
<span id="paddle::VectorT::rand"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1a690cf875451be316caa46f3d91059479"></span><em class="property">virtual</em> void <code class="descname">rand</code><span class="sig-paren">(</span><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT4randEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4773 4774 4775 4776
<dd><p>generate uniform random value for each element </p>
</dd></dl>

<dl class="function">
4777
<dt id="_CPPv2N6paddle7VectorT4randE6size_t">
4778
<span id="paddle::VectorT::rand__s"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1a59b498f1cbaba04f3aaf93d14a2d5d54"></span><em class="property">virtual</em> void <code class="descname">rand</code><span class="sig-paren">(</span>size_t <em>classes</em><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT4randE6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4779 4780 4781 4782
<dd><p>generate uniform random value for each element, data range is from 0 to (classes - 1). </p>
</dd></dl>

<dl class="function">
4783
<dt id="_CPPv2N6paddle7VectorT3getE6size_t">
4784
<span id="paddle::VectorT::get__s"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1a3200f155f28b7ef25ce3735bd0e68e22"></span><em class="property">virtual</em> T <code class="descname">get</code><span class="sig-paren">(</span>size_t <em>pos</em><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT3getE6size_t" title="Permalink to this definition">¶</a></dt>
4785 4786 4787 4788 4789
<dd><p>Debug use only. Very inefficient for GPU vector. get the value at pos. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle7VectorT8randnormE4real4real">
4790
<span id="paddle::VectorT::randnorm__real.real"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1a90dd9ff7e3cda8095d21c233ce9f3ef6"></span><em class="property">virtual</em> void <code class="descname">randnorm</code><span class="sig-paren">(</span>real <em>mean</em>, real <em>standardDeviation</em><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT8randnormE4real4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4791 4792 4793 4794
<dd><p>generate univariate Gaussian distributed random numbers with given mean and standardDeviation. </p>
</dd></dl>

<dl class="function">
4795
<dt id="_CPPv2N6paddle7VectorT7uniformE4real4real">
4796
<span id="paddle::VectorT::uniform__real.real"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1ab671dfaf7c16b9743088e6ee1a9381a9"></span><em class="property">virtual</em> void <code class="descname">uniform</code><span class="sig-paren">(</span>real <em>left</em>, real <em>right</em><span class="sig-paren">)</span> = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT7uniformE4real4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4797 4798 4799 4800
<dd><p>generate uniform distributed random numbers with given range. </p>
</dd></dl>

<dl class="function">
4801 4802
<dt id="_CPPv2NK6paddle7VectorT5printERNSt7ostreamE6size_t">
<span id="paddle::VectorT::print__osR.sC"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1a84826a695b03dd27ca5716472e6ccb05"></span><em class="property">virtual</em> void <code class="descname">print</code><span class="sig-paren">(</span>std::ostream &amp;<em>os</em>, size_t <em>num</em><span class="sig-paren">)</span> <em class="property">const</em> = 0<a class="headerlink" href="#_CPPv2NK6paddle7VectorT5printERNSt7ostreamE6size_t" title="Permalink to this definition">¶</a></dt>
4803
<dd><p>print the first &#8220;num&#8221; elements of the <a class="reference internal" href="../../api/api.html#paddleclassVector"><span class="std std-ref">Vector</span></a> </p>
Y
Yu Yang 已提交
4804 4805 4806
</dd></dl>

<dl class="function">
4807 4808
<dt id="_CPPv2NK6paddle7VectorT15printOneElementERNSt7ostreamE6size_t">
<span id="paddle::VectorT::printOneElement__osR.sC"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1a49d5ac85b438235085772f877b51db33"></span><em class="property">virtual</em> void <code class="descname">printOneElement</code><span class="sig-paren">(</span>std::ostream &amp;<em>os</em>, size_t <em>idx</em><span class="sig-paren">)</span> <em class="property">const</em> = 0<a class="headerlink" href="#_CPPv2NK6paddle7VectorT15printOneElementERNSt7ostreamE6size_t" title="Permalink to this definition">¶</a></dt>
4809
<dd><p>print the &#8220;idx&#8221; element of the <a class="reference internal" href="../../api/api.html#paddleclassVector"><span class="std std-ref">Vector</span></a> </p>
Y
Yu Yang 已提交
4810 4811
</dd></dl>

4812
</div>
4813
<div class="breathe-sectiondef docutils container">
4814 4815 4816 4817 4818 4819
<p class="breathe-sectiondef-title rubric">Public Static Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle7VectorT6createE6size_tb">
<span id="paddle::VectorT::create__s.b"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1a29c12d680869340f7cdc789c9e5928ed"></span>std::shared_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle7VectorTE" title="paddle::VectorT">VectorT</a>&lt;T&gt;&gt; <code class="descname">create</code><span class="sig-paren">(</span>size_t <em>size</em>, bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle7VectorT6createE6size_tb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

Y
Yu Yang 已提交
4820
<dl class="function">
4821 4822 4823 4824 4825 4826 4827 4828 4829 4830 4831 4832 4833 4834 4835 4836 4837 4838
<dt id="_CPPv2N6paddle7VectorT6createEP1T6size_tb">
<span id="paddle::VectorT::create__TP.s.b"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1a35ac82b24a7fb646977b823194e987bb"></span>std::shared_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle7VectorTE" title="paddle::VectorT">VectorT</a>&lt;T&gt;&gt; <code class="descname">create</code><span class="sig-paren">(</span>T *<em>data</em>, size_t <em>size</em>, bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle7VectorT6createEP1T6size_tb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle7VectorT6createE6size_t15MemoryHandlePtr6size_t">
<span id="paddle::VectorT::create__s.MemoryHandlePtr.s"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1a407ce9d596a14a97da26c60e39eed437"></span>std::shared_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle7VectorTE" title="paddle::VectorT">VectorT</a>&lt;T&gt;&gt; <code class="descname">create</code><span class="sig-paren">(</span>size_t <em>size</em>, <a class="reference internal" href="../utils/utils.html#_CPPv2N6paddle15MemoryHandlePtrE" title="paddle::MemoryHandlePtr">MemoryHandlePtr</a> <em>memoryHandle</em>, size_t <em>offset</em> = 0<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle7VectorT6createE6size_t15MemoryHandlePtr6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle7VectorT20createParallelVectorE6size_tbP14SyncThreadPool">
<span id="paddle::VectorT::createParallelVector__s.b.SyncThreadPoolP"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1aaa16c805ae3d4f4080ff4b8f7209017f"></span>std::shared_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle7VectorTE" title="paddle::VectorT">VectorT</a>&lt;T&gt;&gt; <code class="descname">createParallelVector</code><span class="sig-paren">(</span>size_t <em>size</em>, bool <em>useGpu</em>, <a class="reference internal" href="../../utils/lock.html#_CPPv2N6paddle14SyncThreadPoolE" title="paddle::SyncThreadPool">SyncThreadPool</a> *<em>pool</em> = nullptr<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle7VectorT20createParallelVectorE6size_tbP14SyncThreadPool" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle7VectorT14resizeOrCreateERNSt10shared_ptrI7VectorTI1TEEE6size_tb">
<span id="paddle::VectorT::resizeOrCreate__std::shared_ptr:VectorT:T::R.s.b"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1aa14f819e709847444a5f54a84f0c8611"></span><em class="property">static</em> void <code class="descname">resizeOrCreate</code><span class="sig-paren">(</span>std::shared_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle7VectorTE" title="paddle::VectorT">VectorT</a>&lt;T&gt;&gt; &amp;<em>vec</em>, size_t <em>size</em>, bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle7VectorT14resizeOrCreateERNSt10shared_ptrI7VectorTI1TEEE6size_tb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
Y
Yu Yang 已提交
4839 4840

</div>
4841
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4842 4843
<p class="breathe-sectiondef-title rubric">Protected Functions</p>
<dl class="function">
4844 4845
<dt id="_CPPv2N6paddle7VectorT7VectorTE6size_t15MemoryHandlePtr6size_tb">
<span id="paddle::VectorT::VectorT__s.MemoryHandlePtr.s.b"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1a1b678b9f77f2f444acf67f8ba0e0a2c3"></span><code class="descname">VectorT</code><span class="sig-paren">(</span>size_t <em>size</em>, <a class="reference internal" href="../utils/utils.html#_CPPv2N6paddle15MemoryHandlePtrE" title="paddle::MemoryHandlePtr">MemoryHandlePtr</a> <em>memoryHandle</em>, size_t <em>offset</em>, bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle7VectorT7VectorTE6size_t15MemoryHandlePtr6size_tb" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4846 4847 4848
<dd></dd></dl>

<dl class="function">
4849 4850 4851 4852 4853
<dt id="_CPPv2N6paddle7VectorT7VectorTE6size_tP1Tb">
<span id="paddle::VectorT::VectorT__s.TP.b"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1ad41726c049efd7f66564a3e68edf6e16"></span><code class="descname">VectorT</code><span class="sig-paren">(</span>size_t <em>size</em>, T *<em>data</em>, bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle7VectorT7VectorTE6size_tP1Tb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
4854 4855
<dt id="_CPPv2NK6paddle7VectorT6copyToEP10CpuVectorTI1TE">
<span id="paddle::VectorT::copyTo__CpuVectorT:T:PC"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1a3c2ec93ad09d0f15127160f176b1085b"></span><em class="property">virtual</em> void <code class="descname">copyTo</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle10CpuVectorTE" title="paddle::CpuVectorT">CpuVectorT</a>&lt;T&gt; *<em>dest</em><span class="sig-paren">)</span> <em class="property">const</em> = 0<a class="headerlink" href="#_CPPv2NK6paddle7VectorT6copyToEP10CpuVectorTI1TE" title="Permalink to this definition">¶</a></dt>
4856 4857 4858
<dd></dd></dl>

<dl class="function">
4859 4860
<dt id="_CPPv2NK6paddle7VectorT6copyToEP10GpuVectorTI1TE">
<span id="paddle::VectorT::copyTo__GpuVectorT:T:PC"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1aa643581395e868c32e4f2778730b21ed"></span><em class="property">virtual</em> void <code class="descname">copyTo</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle10GpuVectorTE" title="paddle::GpuVectorT">GpuVectorT</a>&lt;T&gt; *<em>dest</em><span class="sig-paren">)</span> <em class="property">const</em> = 0<a class="headerlink" href="#_CPPv2NK6paddle7VectorT6copyToEP10GpuVectorTI1TE" title="Permalink to this definition">¶</a></dt>
4861 4862 4863
<dd></dd></dl>

</div>
4864
<div class="breathe-sectiondef docutils container">
4865 4866 4867 4868 4869 4870 4871
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle7VectorT13memoryHandle_E">
<span id="paddle::VectorT::memoryHandle___MemoryHandlePtr"></span><span class="target" id="paddleclasspaddle_1_1VectorT_1af54b3e8a263dbcf1d876ea6f78ca8040"></span><a class="reference internal" href="../utils/utils.html#_CPPv2N6paddle15MemoryHandlePtrE" title="paddle::MemoryHandlePtr">MemoryHandlePtr</a> <code class="descname">memoryHandle_</code><a class="headerlink" href="#_CPPv2N6paddle7VectorT13memoryHandle_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
4872
<div class="breathe-sectiondef docutils container">
4873 4874 4875 4876 4877 4878 4879 4880 4881
<p class="breathe-sectiondef-title rubric">Friends</p>
<dl class="function">
<dt>
<span class="target" id="paddleclasspaddle_1_1VectorT_1a0df69e8a5be91b967d716b4b7f3fa7ae"></span><em class="property">friend </em><code class="descname">paddle::GpuVectorT&lt; T &gt;</code></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<span class="target" id="paddleclasspaddle_1_1VectorT_1a1548dad01a1072d026b8ebed460965e6"></span><em class="property">friend </em><code class="descname">paddle::CpuVectorT&lt; T &gt;</code></dt>
Y
Yu Yang 已提交
4882 4883 4884 4885 4886 4887 4888 4889 4890 4891
<dd></dd></dl>

</div>
</dd></dl>

<dl class="class">
<dt>
<span class="target" id="paddleclasspaddle_1_1ParallelCpuVectorT"></span><em class="property">template </em>&lt;<em class="property">class</em> T&gt;</dt>
<dt id="_CPPv2N6paddle18ParallelCpuVectorTE">
<span id="paddle::ParallelCpuVectorT"></span><em class="property">class </em><code class="descname">ParallelCpuVectorT</code><a class="headerlink" href="#_CPPv2N6paddle18ParallelCpuVectorTE" title="Permalink to this definition">¶</a></dt>
4892
<dd><p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1CpuVectorT"><span class="std std-ref">paddle::CpuVectorT&lt; T &gt;</span></a></p>
4893
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4894 4895 4896 4897 4898 4899 4900 4901
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle18ParallelCpuVectorT18ParallelCpuVectorTE6size_tP14SyncThreadPool">
<span id="paddle::ParallelCpuVectorT::ParallelCpuVectorT__s.SyncThreadPoolP"></span><span class="target" id="paddleclasspaddle_1_1ParallelCpuVectorT_1abdda021821ce79dbd3dcd899ac0ed93f"></span><code class="descname">ParallelCpuVectorT</code><span class="sig-paren">(</span>size_t <em>size</em>, <a class="reference internal" href="../../utils/lock.html#_CPPv2N6paddle14SyncThreadPoolE" title="paddle::SyncThreadPool">SyncThreadPool</a> *<em>pool</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18ParallelCpuVectorT18ParallelCpuVectorTE6size_tP14SyncThreadPool" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18ParallelCpuVectorT7zeroMemEv">
4902
<span id="paddle::ParallelCpuVectorT::zeroMem"></span><span class="target" id="paddleclasspaddle_1_1ParallelCpuVectorT_1af2dd92b0a297db292a3198b64468c585"></span><em class="property">virtual</em> void <code class="descname">zeroMem</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18ParallelCpuVectorT7zeroMemEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4903 4904 4905 4906
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18ParallelCpuVectorT8randnormE4real4real">
4907
<span id="paddle::ParallelCpuVectorT::randnorm__real.real"></span><span class="target" id="paddleclasspaddle_1_1ParallelCpuVectorT_1ac45376a3105d6e43118d2e3666cf5b38"></span><em class="property">virtual</em> void <code class="descname">randnorm</code><span class="sig-paren">(</span>real <em>mean</em>, real <em>standardDeviation</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18ParallelCpuVectorT8randnormE4real4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4908 4909 4910 4911 4912
<dd><p>generate univariate Gaussian distributed random numbers with given mean and standardDeviation. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18ParallelCpuVectorT7uniformE4real4real">
4913
<span id="paddle::ParallelCpuVectorT::uniform__real.real"></span><span class="target" id="paddleclasspaddle_1_1ParallelCpuVectorT_1ade345c9a443c1d2650ee0a301f9d4bd1"></span><em class="property">virtual</em> void <code class="descname">uniform</code><span class="sig-paren">(</span>real <em>left</em>, real <em>right</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18ParallelCpuVectorT7uniformE4real4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4914 4915 4916 4917 4918
<dd><p>generate uniform distributed random numbers with given range. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18ParallelCpuVectorT4execEN14SyncThreadPool7JobFuncE">
4919
<span id="paddle::ParallelCpuVectorT::exec__SyncThreadPool::JobFunc"></span><span class="target" id="paddleclasspaddle_1_1ParallelCpuVectorT_1a6c5cda234bfbbd5a91c8babee04a5857"></span>void <code class="descname">exec</code><span class="sig-paren">(</span><a class="reference internal" href="../../utils/lock.html#_CPPv2N6paddle14SyncThreadPoolE" title="paddle::SyncThreadPool">SyncThreadPool</a>::<a class="reference internal" href="../../utils/lock.html#_CPPv2N6paddle14SyncThreadPool7JobFuncE" title="paddle::SyncThreadPool::JobFunc">JobFunc</a> <em>func</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18ParallelCpuVectorT4execEN14SyncThreadPool7JobFuncE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4920 4921 4922 4923
<dd><p>exec a func in single/multi thread </p>
</dd></dl>

</div>
4924
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4925 4926 4927
<p class="breathe-sectiondef-title rubric">Private Types</p>
<dl class="type">
<dt id="_CPPv2N6paddle18ParallelCpuVectorT8ExecFuncE">
4928
<span id="paddle::ParallelCpuVectorT::ExecFunc"></span><span class="target" id="paddleclasspaddle_1_1ParallelCpuVectorT_1abdb397a3ea40bda28f0f796df3d3e9b6"></span><em class="property">typedef </em>std::function&lt;void<span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle10CpuVectorTE" title="paddle::CpuVectorT">CpuVectorT</a>&lt;T&gt; &amp;vec<span class="sig-paren">)</span>&gt; <code class="descname">ExecFunc</code><a class="headerlink" href="#_CPPv2N6paddle18ParallelCpuVectorT8ExecFuncE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4929 4930 4931
<dd></dd></dl>

</div>
4932
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4933 4934 4935 4936 4937 4938 4939
<p class="breathe-sectiondef-title rubric">Private Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle18ParallelCpuVectorT12parallelExecE8ExecFunc">
<span id="paddle::ParallelCpuVectorT::parallelExec__ExecFunc"></span><span class="target" id="paddleclasspaddle_1_1ParallelCpuVectorT_1a8b7437be5ebc6229a83cc37d8a52ff69"></span>void <code class="descname">parallelExec</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle18ParallelCpuVectorT8ExecFuncE" title="paddle::ParallelCpuVectorT::ExecFunc">ExecFunc</a> <em>func</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18ParallelCpuVectorT12parallelExecE8ExecFunc" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
4940
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4941 4942 4943 4944 4945 4946 4947 4948 4949 4950 4951
<p class="breathe-sectiondef-title rubric">Private Members</p>
<dl class="member">
<dt id="_CPPv2N6paddle18ParallelCpuVectorT5pool_E">
<span id="paddle::ParallelCpuVectorT::pool___SyncThreadPoolP"></span><span class="target" id="paddleclasspaddle_1_1ParallelCpuVectorT_1a339893877a79ff73a9c9a4cbf86fec40"></span><a class="reference internal" href="../../utils/lock.html#_CPPv2N6paddle14SyncThreadPoolE" title="paddle::SyncThreadPool">SyncThreadPool</a> *<code class="descname">pool_</code><a class="headerlink" href="#_CPPv2N6paddle18ParallelCpuVectorT5pool_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

<dl class="class">
<dt>
4952 4953 4954 4955
<span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT"></span><em class="property">template </em>&lt;class <em>T</em>&gt;</dt>
<dt id="_CPPv2N6paddle13CpuGpuVectorTE">
<span id="paddle::CpuGpuVectorT"></span><em class="property">class </em><code class="descname">CpuGpuVectorT</code><a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorTE" title="Permalink to this definition">¶</a></dt>
<dd><em>#include &lt;Vector.h&gt;</em><p>A class to do conversion between CpuVector and GpuVector automatically. </p>
4956
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
4957 4958
<p class="breathe-sectiondef-title rubric">Public Types</p>
<dl class="type">
4959 4960 4961 4962 4963 4964 4965
<dt id="_CPPv2N6paddle10SyncedFlagE">
<span id="paddle::SyncedFlag"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1af0e02eda06cb53cfb3c576facc550b77"></span><em class="property">enum </em><code class="descname">SyncedFlag</code><a class="headerlink" href="#_CPPv2N6paddle10SyncedFlagE" title="Permalink to this definition">¶</a></dt>
<dd><p>An enum type of SyncedFlag using to mark data memory is in CPU or GPU. </p>
<p>DATA_AT_CPU: data is located in CPU.</p>
<p>DATA_AT_GPU: data is located in GPU.</p>
<p>SYNCED: data is located in CPU and GPU simultaneously. </p>
<p><em>Values:</em></p>
Y
Yu Yang 已提交
4966
<dl class="member">
4967 4968
<dt id="_CPPv2N6paddle11DATA_AT_CPUE">
<span id="paddle::DATA_AT_CPU"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1af0e02eda06cb53cfb3c576facc550b77a0d4bfcd76f1d368980f7ef5530467fe8"></span><code class="descname">DATA_AT_CPU</code> = 0<a class="headerlink" href="#_CPPv2N6paddle11DATA_AT_CPUE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4969 4970
<dd></dd></dl>

4971 4972 4973
<dl class="member">
<dt id="_CPPv2N6paddle11DATA_AT_GPUE">
<span id="paddle::DATA_AT_GPU"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1af0e02eda06cb53cfb3c576facc550b77a4e22e2ce476902075054c90edb6d00a5"></span><code class="descname">DATA_AT_GPU</code> = 1<a class="headerlink" href="#_CPPv2N6paddle11DATA_AT_GPUE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4974 4975
<dd></dd></dl>

4976 4977 4978
<dl class="member">
<dt id="_CPPv2N6paddle6SYNCEDE">
<span id="paddle::SYNCED"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1af0e02eda06cb53cfb3c576facc550b77ac304ee9e6696f28f15a07b132ebee530"></span><code class="descname">SYNCED</code> = 2<a class="headerlink" href="#_CPPv2N6paddle6SYNCEDE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4979 4980 4981 4982
<dd></dd></dl>

</dd></dl>

4983
</div>
4984
<div class="breathe-sectiondef docutils container">
4985
<p class="breathe-sectiondef-title rubric">Public Functions</p>
Y
Yu Yang 已提交
4986
<dl class="function">
4987 4988 4989 4990 4991
<dt id="_CPPv2N6paddle13CpuGpuVectorT13CpuGpuVectorTE6size_tb">
<span id="paddle::CpuGpuVectorT::CpuGpuVectorT__s.b"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1a1f9130533364a37390a6f2aa200fbe17"></span><code class="descname">CpuGpuVectorT</code><span class="sig-paren">(</span>size_t <em>size</em>, bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorT13CpuGpuVectorTE6size_tb" title="Permalink to this definition">¶</a></dt>
<dd><p>A constructor, create cpuVectorT_ or gpuVectorT_. </p>
<p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
4992 4993 4994
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">size</span></code>: data size. </li>
<li><code class="docutils literal"><span class="pre">useGpu</span></code>: use gpu or not. </li>
4995 4996 4997 4998
</ul>
</dd>
</dl>
</p>
Y
Yu Yang 已提交
4999 5000 5001
</dd></dl>

<dl class="function">
5002 5003 5004 5005 5006
<dt id="_CPPv2N6paddle13CpuGpuVectorT13CpuGpuVectorTERKNSt10shared_ptrI7VectorTI1TEEE">
<span id="paddle::CpuGpuVectorT::CpuGpuVectorT__std::shared_ptr:VectorT:T::CR"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1a979c1b0368d7507682e8547a8354bbaf"></span><code class="descname">CpuGpuVectorT</code><span class="sig-paren">(</span><em class="property">const</em> std::shared_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle7VectorTE" title="paddle::VectorT">VectorT</a>&lt;T&gt;&gt; &amp;<em>src</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorT13CpuGpuVectorTERKNSt10shared_ptrI7VectorTI1TEEE" title="Permalink to this definition">¶</a></dt>
<dd><p>A constructor, create <a class="reference internal" href="#paddleclasspaddle_1_1CpuGpuVectorT"><span class="std std-ref">CpuGpuVectorT</span></a> by <a class="reference internal" href="#paddleclasspaddle_1_1VectorT"><span class="std std-ref">VectorT</span></a>. </p>
<p>If src is CpuVector, cpuVectorT_ is shared data with src.</p>
<p>If src is GpuVector, gpuVectorT_ is shared data with src. </p>
Y
Yu Yang 已提交
5007 5008 5009
</dd></dl>

<dl class="function">
5010 5011 5012 5013 5014 5015 5016 5017 5018 5019
<dt id="_CPPv2N6paddle13CpuGpuVectorT13CpuGpuVectorTE6size_tP1Tb">
<span id="paddle::CpuGpuVectorT::CpuGpuVectorT__s.TP.b"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1a1415aaee45e509e0f8300af297c7ccda"></span><code class="descname">CpuGpuVectorT</code><span class="sig-paren">(</span>size_t <em>size</em>, T *<em>data</em>, bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorT13CpuGpuVectorTE6size_tP1Tb" title="Permalink to this definition">¶</a></dt>
<dd><p>A constructor. </p>
<p>If useGpu is true, data should be located in device and create gpuVectorT_ with data.</p>
<p>If useGpu is false, data should be located in host and create cpuVectorT_ with data.</p>
<p><dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>Data is owned by the caller and should be valid during the life of this vector. Caller is responsible for release the memory. </dd>
</dl>
</p>
Y
Yu Yang 已提交
5020 5021 5022
</dd></dl>

<dl class="function">
5023 5024 5025
<dt id="_CPPv2N6paddle13CpuGpuVectorT13CpuGpuVectorTER13CpuGpuVectorTI1TE6size_t6size_t">
<span id="paddle::CpuGpuVectorT::CpuGpuVectorT__CpuGpuVectorT:T:R.s.s"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1aee74d0d254ac3852dba46cdb31a49958"></span><code class="descname">CpuGpuVectorT</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle13CpuGpuVectorT13CpuGpuVectorTE6size_tb" title="paddle::CpuGpuVectorT::CpuGpuVectorT">CpuGpuVectorT</a>&lt;T&gt; &amp;<em>src</em>, size_t <em>offset</em>, size_t <em>size</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorT13CpuGpuVectorTER13CpuGpuVectorTI1TE6size_t6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
Y
Yu Yang 已提交
5026 5027

<dl class="function">
5028
<dt id="_CPPv2N6paddle13CpuGpuVectorTD0Ev">
5029
<span id="paddle::CpuGpuVectorT::~CpuGpuVectorT"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1ad72ca40b2a1c9e800ffb653113264534"></span><em class="property">virtual</em> <code class="descname">~CpuGpuVectorT</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorTD0Ev" title="Permalink to this definition">¶</a></dt>
5030
<dd></dd></dl>
Y
Yu Yang 已提交
5031 5032

<dl class="function">
5033 5034 5035 5036 5037
<dt id="_CPPv2N6paddle13CpuGpuVectorT6resizeE6size_tb">
<span id="paddle::CpuGpuVectorT::resize__s.b"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1a5b38937d70c713537ecf79b74e1f8605"></span>void <code class="descname">resize</code><span class="sig-paren">(</span>size_t <em>size</em>, bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorT6resizeE6size_tb" title="Permalink to this definition">¶</a></dt>
<dd><p>resize vector. </p>
<p>If useGpu is true, resize gpuVectorT_ and set syncFlag_ to DATA_AT_GPU,</p>
<p>otherwise resize cpuVectorT_ and set syncFlag_ to DATA_AT_CPU. </p>
Y
Yu Yang 已提交
5038 5039 5040
</dd></dl>

<dl class="function">
5041 5042
<dt id="_CPPv2NK6paddle13CpuGpuVectorT9getVectorEb">
<span id="paddle::CpuGpuVectorT::getVector__bC"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1a6788506b61bbdc85e28a90461a48f62b"></span>std::shared_ptr&lt;<em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7VectorTE" title="paddle::VectorT">VectorT</a>&lt;T&gt;&gt; <code class="descname">getVector</code><span class="sig-paren">(</span>bool <em>useGpu</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle13CpuGpuVectorT9getVectorEb" title="Permalink to this definition">¶</a></dt>
5043 5044 5045 5046 5047 5048 5049 5050
<dd><p>return a const cpuVectorT_ or gpuVectorT_. </p>
<p>If useGpu is true, return gpuVectorT_.</p>
<p>If useGpu is false, return cpuVectorT_.</p>
<p><dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>Caller should not change the data. If caller changes const attribute, should set syncFlag_. </dd>
</dl>
</p>
Y
Yu Yang 已提交
5051 5052 5053
</dd></dl>

<dl class="function">
5054 5055 5056 5057 5058 5059 5060 5061
<dt id="_CPPv2N6paddle13CpuGpuVectorT16getMutableVectorEb">
<span id="paddle::CpuGpuVectorT::getMutableVector__b"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1a54804acc00c0885bac715db82e1d6989"></span>std::shared_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle7VectorTE" title="paddle::VectorT">VectorT</a>&lt;T&gt;&gt; &amp;<code class="descname">getMutableVector</code><span class="sig-paren">(</span>bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorT16getMutableVectorEb" title="Permalink to this definition">¶</a></dt>
<dd><p>return a const cpuVectorT_ or gpuVectorT_. </p>
<p><dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>: This interface will change syncFlag_, so if you will not change the data, you should call getVector. </dd>
</dl>
</p>
Y
Yu Yang 已提交
5062 5063 5064
</dd></dl>

<dl class="function">
5065 5066
<dt id="_CPPv2NK6paddle13CpuGpuVectorT7getDataEb">
<span id="paddle::CpuGpuVectorT::getData__bC"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1a9561de23432a24d0b36a5c8a2d9b32d1"></span><em class="property">const</em> T *<code class="descname">getData</code><span class="sig-paren">(</span>bool <em>useGpu</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle13CpuGpuVectorT7getDataEb" title="Permalink to this definition">¶</a></dt>
5067 5068 5069 5070
<dd><p>return const T* data. </p>
<p>If useGpu is true, return device data.</p>
<p>If useGpu is false, return host data. </p>
</dd></dl>
Y
Yu Yang 已提交
5071 5072

<dl class="function">
5073 5074
<dt id="_CPPv2N6paddle13CpuGpuVectorT14getMutableDataEb">
<span id="paddle::CpuGpuVectorT::getMutableData__b"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1a2a82ea47521249fd9d95db800423574f"></span>T *<code class="descname">getMutableData</code><span class="sig-paren">(</span>bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorT14getMutableDataEb" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5075 5076 5077
<dd></dd></dl>

<dl class="function">
5078 5079 5080 5081 5082 5083
<dt id="_CPPv2N6paddle13CpuGpuVectorT7zeroMemEb">
<span id="paddle::CpuGpuVectorT::zeroMem__b"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1aad2bc0f3ae4d0a08f457011f809a8ad6"></span>void <code class="descname">zeroMem</code><span class="sig-paren">(</span>bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorT7zeroMemEb" title="Permalink to this definition">¶</a></dt>
<dd><p>If useGpu is true, gpuVectorT_-&gt;Op().</p>
<p>If useGpu is false, cpuVectorT_-&gt;Op().</p>
<p>Op is zeroMem, fillSequence, ... </p>
</dd></dl>
Y
Yu Yang 已提交
5084 5085

<dl class="function">
5086 5087
<dt id="_CPPv2N6paddle13CpuGpuVectorT12fillSequenceEb">
<span id="paddle::CpuGpuVectorT::fillSequence__b"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1a1eedd1a9c881dfd7f1850492d0dff9f6"></span>void <code class="descname">fillSequence</code><span class="sig-paren">(</span>bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorT12fillSequenceEb" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5088 5089 5090
<dd></dd></dl>

<dl class="function">
5091 5092
<dt id="_CPPv2N6paddle13CpuGpuVectorT10setElementE6size_tRK1Tb">
<span id="paddle::CpuGpuVectorT::setElement__s.TCR.b"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1a21128d0aac397e21befaa7c64ecb26be"></span>void <code class="descname">setElement</code><span class="sig-paren">(</span>size_t <em>i</em>, <em class="property">const</em> T &amp;<em>value</em>, bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorT10setElementE6size_tRK1Tb" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5093 5094 5095
<dd></dd></dl>

<dl class="function">
5096 5097
<dt id="_CPPv2NK6paddle13CpuGpuVectorT10getElementE6size_t">
<span id="paddle::CpuGpuVectorT::getElement__sC"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1a3ebe1be0f6ec371f5de64ed7232bd441"></span>T <code class="descname">getElement</code><span class="sig-paren">(</span>size_t <em>i</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle13CpuGpuVectorT10getElementE6size_t" title="Permalink to this definition">¶</a></dt>
5098 5099
<dd><p>return i-th element. </p>
</dd></dl>
Y
Yu Yang 已提交
5100 5101

<dl class="function">
5102 5103
<dt id="_CPPv2NK6paddle13CpuGpuVectorT7getSizeEv">
<span id="paddle::CpuGpuVectorT::getSizeC"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1a4352e59b4901e4f367261f5e9dcf9128"></span>size_t <code class="descname">getSize</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle13CpuGpuVectorT7getSizeEv" title="Permalink to this definition">¶</a></dt>
5104
<dd><p>return vector size. </p>
Y
Yu Yang 已提交
5105 5106 5107
</dd></dl>

<dl class="function">
5108 5109 5110
<dt id="_CPPv2N6paddle13CpuGpuVectorT9copyToCpuEPK1T6size_t">
<span id="paddle::CpuGpuVectorT::copyToCpu__TCP.s"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1aa50995fa82592869ebd9121d27ebf757"></span>void <code class="descname">copyToCpu</code><span class="sig-paren">(</span><em class="property">const</em> T *<em>data</em>, size_t <em>size</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorT9copyToCpuEPK1T6size_t" title="Permalink to this definition">¶</a></dt>
<dd><p>copy data to cpuVectorT_. </p>
Y
Yu Yang 已提交
5111 5112 5113
</dd></dl>

<dl class="function">
5114 5115 5116
<dt id="_CPPv2N6paddle13CpuGpuVectorT9copyToCpuEPK1T6size_t11hl_stream_t">
<span id="paddle::CpuGpuVectorT::copyToCpu__TCP.s.hl_stream_t"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1a112a2a11dad0d93e6530c02779928cd2"></span>void <code class="descname">copyToCpu</code><span class="sig-paren">(</span><em class="property">const</em> T *<em>data</em>, size_t <em>size</em>, <a class="reference internal" href="../../cuda/utils/utils.html#_CPPv211hl_stream_t" title="hl_stream_t">hl_stream_t</a> <em>stream</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorT9copyToCpuEPK1T6size_t11hl_stream_t" title="Permalink to this definition">¶</a></dt>
<dd><p>copy data to cpuVectorT_ using specifed-stream. </p>
Y
Yu Yang 已提交
5117 5118 5119
</dd></dl>

<dl class="function">
5120 5121 5122
<dt id="_CPPv2N6paddle13CpuGpuVectorT9copyToGpuEPK1T6size_t">
<span id="paddle::CpuGpuVectorT::copyToGpu__TCP.s"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1a944852b016bb7da107ddbe790745247d"></span>void <code class="descname">copyToGpu</code><span class="sig-paren">(</span><em class="property">const</em> T *<em>data</em>, size_t <em>size</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorT9copyToGpuEPK1T6size_t" title="Permalink to this definition">¶</a></dt>
<dd><p>copy data to gpuVectorT_. </p>
Y
Yu Yang 已提交
5123 5124 5125
</dd></dl>

<dl class="function">
5126 5127 5128
<dt id="_CPPv2N6paddle13CpuGpuVectorT9copyToGpuEPK1T6size_t11hl_stream_t">
<span id="paddle::CpuGpuVectorT::copyToGpu__TCP.s.hl_stream_t"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1aad94ae5ed37429783465b46eeaa30425"></span>void <code class="descname">copyToGpu</code><span class="sig-paren">(</span><em class="property">const</em> T *<em>data</em>, size_t <em>size</em>, <a class="reference internal" href="../../cuda/utils/utils.html#_CPPv211hl_stream_t" title="hl_stream_t">hl_stream_t</a> <em>stream</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorT9copyToGpuEPK1T6size_t11hl_stream_t" title="Permalink to this definition">¶</a></dt>
<dd><p>copy data to gpuVectorT_ using specifed-stream. </p>
Y
Yu Yang 已提交
5129 5130 5131
</dd></dl>

<dl class="function">
5132 5133 5134 5135 5136
<dt id="_CPPv2N6paddle13CpuGpuVectorT8copyFromERK7VectorTI1TE11hl_stream_t">
<span id="paddle::CpuGpuVectorT::copyFrom__VectorT:T:CR.hl_stream_t"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1a8b438a25ec64fa4caa9700fade637ac6"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7VectorTE" title="paddle::VectorT">VectorT</a>&lt;T&gt; &amp;<em>src</em>, <a class="reference internal" href="../../cuda/utils/utils.html#_CPPv211hl_stream_t" title="hl_stream_t">hl_stream_t</a> <em>stream</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorT8copyFromERK7VectorTI1TE11hl_stream_t" title="Permalink to this definition">¶</a></dt>
<dd><p>copy from src using specifed-stream. </p>
<p>If src is <a class="reference internal" href="#paddleclasspaddle_1_1CpuVectorT"><span class="std std-ref">CpuVectorT</span></a>, copy to cpuVectorT_.</p>
<p>If src is <a class="reference internal" href="#paddleclasspaddle_1_1GpuVectorT"><span class="std std-ref">GpuVectorT</span></a>, copy to gpuVectorT_. </p>
Y
Yu Yang 已提交
5137 5138 5139
</dd></dl>

<dl class="function">
5140 5141 5142 5143 5144 5145 5146 5147 5148 5149
<dt id="_CPPv2N6paddle13CpuGpuVectorT8copyFromEPK1T6size_tb">
<span id="paddle::CpuGpuVectorT::copyFrom__TCP.s.b"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1ad89f849db8e0d30dae9db96fd543f095"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> T *<em>data</em>, size_t <em>size</em>, bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorT8copyFromEPK1T6size_tb" title="Permalink to this definition">¶</a></dt>
<dd><p>copy data. </p>
<p>If useGpu is false, copy host data to cpuVectorT_.</p>
<p>If useGpu is true, copy device data to gpuVectorT_.</p>
<p><dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>data address should consistent with useGpu. </dd>
</dl>
</p>
Y
Yu Yang 已提交
5150 5151 5152
</dd></dl>

<dl class="function">
5153 5154 5155 5156 5157 5158 5159 5160
<dt id="_CPPv2N6paddle13CpuGpuVectorT8copyFromEPK1T6size_t11hl_stream_tb">
<span id="paddle::CpuGpuVectorT::copyFrom__TCP.s.hl_stream_t.b"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1a0ef093da428a6f06ca4c7e5474526828"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> T *<em>data</em>, size_t <em>size</em>, <a class="reference internal" href="../../cuda/utils/utils.html#_CPPv211hl_stream_t" title="hl_stream_t">hl_stream_t</a> <em>stream</em>, bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorT8copyFromEPK1T6size_t11hl_stream_tb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle13CpuGpuVectorT8copyFromER13CpuGpuVectorTI1TE6size_t6size_tb11hl_stream_t">
<span id="paddle::CpuGpuVectorT::copyFrom__CpuGpuVectorT:T:R.s.s.b.hl_stream_t"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1ae584e1eae458707f7fb3cf5efea39542"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle13CpuGpuVectorTE" title="paddle::CpuGpuVectorT">CpuGpuVectorT</a>&lt;T&gt; &amp;<em>src</em>, size_t <em>offset</em>, size_t <em>size</em>, bool <em>useGpu</em>, <a class="reference internal" href="../../cuda/utils/utils.html#_CPPv211hl_stream_t" title="hl_stream_t">hl_stream_t</a> <em>stream</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorT8copyFromER13CpuGpuVectorTI1TE6size_t6size_tb11hl_stream_t" title="Permalink to this definition">¶</a></dt>
<dd><p>copy from (src + offset) using specifed-stream. </p>
Y
Yu Yang 已提交
5161 5162 5163
</dd></dl>

<dl class="function">
5164 5165 5166
<dt id="_CPPv2N6paddle13CpuGpuVectorT8copyFromER13CpuGpuVectorTI1TE11hl_stream_t">
<span id="paddle::CpuGpuVectorT::copyFrom__CpuGpuVectorT:T:R.hl_stream_t"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1a3cd301e40cfd98c99b26ec9ba22bb548"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle13CpuGpuVectorTE" title="paddle::CpuGpuVectorT">CpuGpuVectorT</a>&lt;T&gt; &amp;<em>src</em>, <a class="reference internal" href="../../cuda/utils/utils.html#_CPPv211hl_stream_t" title="hl_stream_t">hl_stream_t</a> <em>stream</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorT8copyFromER13CpuGpuVectorTI1TE11hl_stream_t" title="Permalink to this definition">¶</a></dt>
<dd><p>copy from src using specifed-stream. </p>
Y
Yu Yang 已提交
5167 5168 5169
</dd></dl>

<dl class="function">
5170 5171
<dt id="_CPPv2NK6paddle13CpuGpuVectorT7getSyncEv">
<span id="paddle::CpuGpuVectorT::getSyncC"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1ae3b1dc682e90c35e26d206fe2711e30a"></span><a class="reference internal" href="#_CPPv2N6paddle10SyncedFlagE" title="paddle::SyncedFlag">SyncedFlag</a> *<code class="descname">getSync</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle13CpuGpuVectorT7getSyncEv" title="Permalink to this definition">¶</a></dt>
5172
<dd><p>return sync_. </p>
Y
Yu Yang 已提交
5173 5174 5175
</dd></dl>

<dl class="function">
5176 5177 5178 5179
<dt id="_CPPv2N6paddle13CpuGpuVectorT7setSyncEP10SyncedFlag">
<span id="paddle::CpuGpuVectorT::setSync__SyncedFlagP"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1aae8fc9af3befe97b950d382a5b7449ba"></span>void <code class="descname">setSync</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle10SyncedFlagE" title="paddle::SyncedFlag">SyncedFlag</a> *<em>sync</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorT7setSyncEP10SyncedFlag" title="Permalink to this definition">¶</a></dt>
<dd><p>set sync_. </p>
</dd></dl>
Y
Yu Yang 已提交
5180 5181

<dl class="function">
5182 5183
<dt id="_CPPv2N6paddle13CpuGpuVectorT7setSyncE10SyncedFlag">
<span id="paddle::CpuGpuVectorT::setSync__SyncedFlag"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1a9f339c1e9aac175d108b73e5b9c3fafa"></span>void <code class="descname">setSync</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle10SyncedFlagE" title="paddle::SyncedFlag">SyncedFlag</a> <em>syncFlag</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorT7setSyncE10SyncedFlag" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5184 5185 5186
<dd></dd></dl>

<dl class="function">
5187 5188
<dt id="_CPPv2N6paddle13CpuGpuVectorT7setSyncEb">
<span id="paddle::CpuGpuVectorT::setSync__b"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1a4213bf978e31db89d0ea6472a00de7f8"></span>void <code class="descname">setSync</code><span class="sig-paren">(</span>bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorT7setSyncEb" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5189 5190
<dd></dd></dl>

5191
</div>
5192
<div class="breathe-sectiondef docutils container">
5193
<p class="breathe-sectiondef-title rubric">Public Static Functions</p>
Y
Yu Yang 已提交
5194
<dl class="function">
5195 5196
<dt id="_CPPv2N6paddle13CpuGpuVectorT6createE6size_tb">
<span id="paddle::CpuGpuVectorT::create__s.b"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1a83cef5e66f4ae874f8b6bea482dd3a76"></span>std::shared_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle13CpuGpuVectorTE" title="paddle::CpuGpuVectorT">CpuGpuVectorT</a>&lt;T&gt;&gt; <code class="descname">create</code><span class="sig-paren">(</span>size_t <em>size</em>, bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorT6createE6size_tb" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5197 5198 5199
<dd></dd></dl>

<dl class="function">
5200 5201 5202 5203
<dt id="_CPPv2N6paddle13CpuGpuVectorT14resizeOrCreateERNSt10shared_ptrI13CpuGpuVectorTI1TEEE6size_tb">
<span id="paddle::CpuGpuVectorT::resizeOrCreate__std::shared_ptr:CpuGpuVectorT:T::R.s.b"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1aaf490c52ad7b1a83f6470a6860e8b167"></span>void <code class="descname">resizeOrCreate</code><span class="sig-paren">(</span>std::shared_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle13CpuGpuVectorTE" title="paddle::CpuGpuVectorT">CpuGpuVectorT</a>&lt;T&gt;&gt; &amp;<em>vec</em>, size_t <em>size</em>, bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorT14resizeOrCreateERNSt10shared_ptrI13CpuGpuVectorTI1TEEE6size_tb" title="Permalink to this definition">¶</a></dt>
<dd><p>resize or create <a class="reference internal" href="#paddleclasspaddle_1_1CpuGpuVectorT"><span class="std std-ref">CpuGpuVectorT</span></a>. </p>
</dd></dl>
Y
Yu Yang 已提交
5204 5205

</div>
5206
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5207 5208
<p class="breathe-sectiondef-title rubric">Protected Functions</p>
<dl class="function">
5209 5210
<dt id="_CPPv2N6paddle13CpuGpuVectorT14resizeOrCreateE6size_tb">
<span id="paddle::CpuGpuVectorT::resizeOrCreate__s.b"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1a6a6b111e0f771a3dd5193be019404be1"></span>void <code class="descname">resizeOrCreate</code><span class="sig-paren">(</span>size_t <em>size</em>, bool <em>useGpu</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorT14resizeOrCreateE6size_tb" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5211 5212 5213
<dd></dd></dl>

<dl class="function">
5214 5215 5216 5217 5218 5219
<dt id="_CPPv2N6paddle13CpuGpuVectorT9copyToCpuEv">
<span id="paddle::CpuGpuVectorT::copyToCpu"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1a09cad1a825f4e161eb776b9cd9e3c98c"></span>void <code class="descname">copyToCpu</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorT9copyToCpuEv" title="Permalink to this definition">¶</a></dt>
<dd><p>copy between cpuVectorT_ and gpuVectorT_. </p>
<p>If syncFlag_ is DATA_AT_CPU and SYNCED, do nothing.</p>
<p>If syncFlag_ is DATA_AT_GPU, copy gpuVectorT_ to cpuVectorT_ and set syncFlag_ to SYNCED. </p>
</dd></dl>
Y
Yu Yang 已提交
5220 5221

<dl class="function">
5222 5223 5224 5225 5226 5227
<dt id="_CPPv2N6paddle13CpuGpuVectorT9copyToGpuEv">
<span id="paddle::CpuGpuVectorT::copyToGpu"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1a4276b9db3ef652a4cd1a7498da860070"></span>void <code class="descname">copyToGpu</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorT9copyToGpuEv" title="Permalink to this definition">¶</a></dt>
<dd><p>copy between cpuVectorT_ and gpuVectorT_. </p>
<p>If syncFlag_ is DATA_AT_GPU and SYNCED, do nothing.</p>
<p>If syncFlag_ is DATA_AT_CPU, copy cpuVectorT_ to gpuVectorT_ and set syncFlag_ to SYNCED. </p>
</dd></dl>
Y
Yu Yang 已提交
5228 5229

</div>
5230
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5231 5232
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
5233 5234 5235 5236
<dt id="_CPPv2N6paddle13CpuGpuVectorT11cpuVectorT_E">
<span id="paddle::CpuGpuVectorT::cpuVectorT___std::shared_ptr:VectorT:T::"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1a935fedc8989e028cfe25fb1cfd65a666"></span>std::shared_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle7VectorTE" title="paddle::VectorT">VectorT</a>&lt;T&gt;&gt; <code class="descname">cpuVectorT_</code><a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorT11cpuVectorT_E" title="Permalink to this definition">¶</a></dt>
<dd><p>host pointer. </p>
</dd></dl>
Y
Yu Yang 已提交
5237

5238 5239 5240 5241 5242
<dl class="member">
<dt id="_CPPv2N6paddle13CpuGpuVectorT11gpuVectorT_E">
<span id="paddle::CpuGpuVectorT::gpuVectorT___std::shared_ptr:VectorT:T::"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1a81255cfb91f0c1eab2b9e58380f8b6b7"></span>std::shared_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle7VectorTE" title="paddle::VectorT">VectorT</a>&lt;T&gt;&gt; <code class="descname">gpuVectorT_</code><a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorT11gpuVectorT_E" title="Permalink to this definition">¶</a></dt>
<dd><p>device pointer. </p>
</dd></dl>
Y
Yu Yang 已提交
5243

5244 5245 5246 5247 5248 5249 5250 5251 5252
<dl class="member">
<dt id="_CPPv2N6paddle13CpuGpuVectorT9syncFlag_E">
<span id="paddle::CpuGpuVectorT::syncFlag___SyncedFlag"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1adc42accfc8692e56192d23084615d782"></span><a class="reference internal" href="#_CPPv2N6paddle10SyncedFlagE" title="paddle::SyncedFlag">SyncedFlag</a> <code class="descname">syncFlag_</code><a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorT9syncFlag_E" title="Permalink to this definition">¶</a></dt>
<dd><p>specify current data address. </p>
</dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle13CpuGpuVectorT5sync_E">
<span id="paddle::CpuGpuVectorT::sync___SyncedFlagP"></span><span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1a36e69ff988aa6d2598b7c25f5364bf56"></span><a class="reference internal" href="#_CPPv2N6paddle10SyncedFlagE" title="paddle::SyncedFlag">SyncedFlag</a> *<code class="descname">sync_</code><a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorT5sync_E" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5253 5254 5255 5256 5257 5258 5259 5260
<dd></dd></dl>

</div>
</dd></dl>

</dd></dl>

<dl class="type">
5261 5262
<dt>
<span class="target" id="paddlenamespacepaddle"></span><em class="property">namespace </em><code class="descname">paddle</code></dt>
5263
<dd><div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5264 5265 5266 5267 5268 5269 5270 5271 5272 5273
<p class="breathe-sectiondef-title rubric">Typedefs</p>
<dl class="type">
<dt id="_CPPv2N6paddle22hl_sparse_matrix_s_ptrE">
<span id="paddle::hl_sparse_matrix_s_ptr"></span><span class="target" id="paddlenamespacepaddle_1a8b6a95139495ce30abad0815dc36e876"></span><em class="property">typedef </em>std::shared_ptr&lt;<a class="reference internal" href="../../cuda/utils/utils.html#_CPPv219_hl_sparse_matrix_s" title="_hl_sparse_matrix_s">_hl_sparse_matrix_s</a>&gt; <code class="descname">hl_sparse_matrix_s_ptr</code><a class="headerlink" href="#_CPPv2N6paddle22hl_sparse_matrix_s_ptrE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<dl class="class">
<dt id="_CPPv2N6paddle15GpuSparseMatrixE">
<span id="paddle::GpuSparseMatrix"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix"></span><em class="property">class </em><code class="descname">GpuSparseMatrix</code><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrixE" title="Permalink to this definition">¶</a></dt>
5274
<dd><p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Matrix"><span class="std std-ref">paddle::Matrix</span></a></p>
5275
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291 5292 5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix15GpuSparseMatrixE6size_t6size_t6size_t15SparseValueType12SparseFormatb">
<span id="paddle::GpuSparseMatrix::GpuSparseMatrix__s.s.s.SparseValueType.SparseFormat.b"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1a55556ff23511ea89ca8d3ca1b8956d62"></span><code class="descname">GpuSparseMatrix</code><span class="sig-paren">(</span>size_t <em>height</em>, size_t <em>width</em>, size_t <em>nnz</em>, <a class="reference internal" href="#_CPPv2N6paddle15SparseValueTypeE" title="paddle::SparseValueType">SparseValueType</a> <em>valueType</em> = FLOAT_VALUE, <a class="reference internal" href="#_CPPv2N6paddle12SparseFormatE" title="paddle::SparseFormat">SparseFormat</a> <em>format_</em> = SPARSE_CSR, bool <em>trans</em> = false<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix15GpuSparseMatrixE6size_t6size_t6size_t15SparseValueType12SparseFormatb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix15GpuSparseMatrixE15GpuMemHandlePtr22hl_sparse_matrix_s_ptr6size_t6size_t6size_t15SparseValueType12SparseFormatb15MemoryHandlePtr">
<span id="paddle::GpuSparseMatrix::GpuSparseMatrix__GpuMemHandlePtr.hl_sparse_matrix_s_ptr.s.s.s.SparseValueType.SparseFormat.b.MemoryHandlePtr"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1a010fcf5fc1b64aaa25830d6cca00c111"></span><code class="descname">GpuSparseMatrix</code><span class="sig-paren">(</span><a class="reference internal" href="../utils/utils.html#_CPPv2N6paddle15GpuMemHandlePtrE" title="paddle::GpuMemHandlePtr">GpuMemHandlePtr</a> <em>dataHandle</em>, <a class="reference internal" href="#_CPPv2N6paddle22hl_sparse_matrix_s_ptrE" title="paddle::hl_sparse_matrix_s_ptr">hl_sparse_matrix_s_ptr</a> <em>sMatrix</em>, size_t <em>height</em>, size_t <em>width</em>, size_t <em>nnz</em>, <a class="reference internal" href="#_CPPv2N6paddle15SparseValueTypeE" title="paddle::SparseValueType">SparseValueType</a> <em>valueType</em> = FLOAT_VALUE, <a class="reference internal" href="#_CPPv2N6paddle12SparseFormatE" title="paddle::SparseFormat">SparseFormat</a> <em>format_</em> = SPARSE_CSR, bool <em>trans</em> = false, <a class="reference internal" href="../utils/utils.html#_CPPv2N6paddle15MemoryHandlePtrE" title="paddle::MemoryHandlePtr">MemoryHandlePtr</a> <em>sMemoryHandle</em> = NULL<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix15GpuSparseMatrixE15GpuMemHandlePtr22hl_sparse_matrix_s_ptr6size_t6size_t6size_t15SparseValueType12SparseFormatb15MemoryHandlePtr" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix15GpuSparseMatrixEP4realPiPi6size_t6size_t6size_t15SparseValueType12SparseFormatb">
<span id="paddle::GpuSparseMatrix::GpuSparseMatrix__realP.iP.iP.s.s.s.SparseValueType.SparseFormat.b"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1a604d93f29f8465e8a70a93a0abfa7cdd"></span><code class="descname">GpuSparseMatrix</code><span class="sig-paren">(</span>real *<em>value</em>, int *<em>rows</em>, int *<em>cols</em>, size_t <em>height</em>, size_t <em>width</em>, size_t <em>nnz</em>, <a class="reference internal" href="#_CPPv2N6paddle15SparseValueTypeE" title="paddle::SparseValueType">SparseValueType</a> <em>valueType</em>, <a class="reference internal" href="#_CPPv2N6paddle12SparseFormatE" title="paddle::SparseFormat">SparseFormat</a> <em>format</em>, bool <em>trans</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix15GpuSparseMatrixEP4realPiPi6size_t6size_t6size_t15SparseValueType12SparseFormatb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix15GpuSparseMatrixE22hl_sparse_matrix_s_ptr6size_t6size_t6size_t15SparseValueType12SparseFormatb15MemoryHandlePtr">
<span id="paddle::GpuSparseMatrix::GpuSparseMatrix__hl_sparse_matrix_s_ptr.s.s.s.SparseValueType.SparseFormat.b.MemoryHandlePtr"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1a1fa089a1a162f60d33f52a78dc718c6f"></span><code class="descname">GpuSparseMatrix</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle22hl_sparse_matrix_s_ptrE" title="paddle::hl_sparse_matrix_s_ptr">hl_sparse_matrix_s_ptr</a> <em>sMatrix</em>, size_t <em>height</em>, size_t <em>width</em>, size_t <em>nnz</em>, <a class="reference internal" href="#_CPPv2N6paddle15SparseValueTypeE" title="paddle::SparseValueType">SparseValueType</a> <em>valueType</em>, <a class="reference internal" href="#_CPPv2N6paddle12SparseFormatE" title="paddle::SparseFormat">SparseFormat</a> <em>format</em>, bool <em>trans</em>, <a class="reference internal" href="../utils/utils.html#_CPPv2N6paddle15MemoryHandlePtrE" title="paddle::MemoryHandlePtr">MemoryHandlePtr</a> <em>sMemoryHandle</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix15GpuSparseMatrixE22hl_sparse_matrix_s_ptr6size_t6size_t6size_t15SparseValueType12SparseFormatb15MemoryHandlePtr" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrixD0Ev">
<span id="paddle::GpuSparseMatrix::~GpuSparseMatrix"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1a7f88fc01ffc5d429829f3e8167ce8434"></span><code class="descname">~GpuSparseMatrix</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrixD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix6resizeE6size_t6size_t6size_t15SparseValueType12SparseFormat">
5304
<span id="paddle::GpuSparseMatrix::resize__s.s.s.SparseValueType.SparseFormat"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1a3e3dd306dfa5ac767589b473d51a17eb"></span>void <code class="descname">resize</code><span class="sig-paren">(</span>size_t <em>newHeight</em>, size_t <em>newWidth</em>, size_t <em>newNnz</em>, <a class="reference internal" href="#_CPPv2N6paddle15SparseValueTypeE" title="paddle::SparseValueType">SparseValueType</a> <em>valueType</em>, <a class="reference internal" href="#_CPPv2N6paddle12SparseFormatE" title="paddle::SparseFormat">SparseFormat</a> <em>format</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix6resizeE6size_t6size_t6size_t15SparseValueType12SparseFormat" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5305 5306 5307 5308 5309 5310 5311 5312 5313
<dd><p><dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>This should only be used for sparse matrix. </dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix6resizeE6size_t6size_t">
5314
<span id="paddle::GpuSparseMatrix::resize__s.s"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1ae86013bd18d33c2fae6a231e5e3862f4"></span>void <code class="descname">resize</code><span class="sig-paren">(</span>size_t <em>newHeight</em>, size_t <em>newWidth</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix6resizeE6size_t6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5315 5316
<dd><p><dl class="docutils">
<dt><strong>Note</strong></dt>
5317
<dd>Original data may not be preserved after <a class="reference internal" href="#paddleclasspaddle_1_1GpuSparseMatrix_1a3e3dd306dfa5ac767589b473d51a17eb"><span class="std std-ref">resize()</span></a>. </dd>
Y
Yu Yang 已提交
5318 5319 5320 5321 5322 5323 5324 5325 5326 5327 5328 5329 5330 5331 5332 5333 5334 5335 5336 5337 5338 5339 5340 5341 5342 5343 5344 5345 5346 5347 5348
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix15sparseResizeCSREv">
<span id="paddle::GpuSparseMatrix::sparseResizeCSR"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1ab9003154bd379113b3f42c5e4ea5300b"></span>void <code class="descname">sparseResizeCSR</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix15sparseResizeCSREv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix15sparseResizeCSCEv">
<span id="paddle::GpuSparseMatrix::sparseResizeCSC"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1ae48bd4d26b50bd539619bfc1a812805c"></span>void <code class="descname">sparseResizeCSC</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix15sparseResizeCSCEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix9resizeCSRE6size_t6size_t6size_t15SparseValueType">
<span id="paddle::GpuSparseMatrix::resizeCSR__s.s.s.SparseValueType"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1ad74e1bb1c77643ec8c97e41d59541592"></span>void <code class="descname">resizeCSR</code><span class="sig-paren">(</span>size_t <em>newHeight</em>, size_t <em>newWidth</em>, size_t <em>newNnz</em>, <a class="reference internal" href="#_CPPv2N6paddle15SparseValueTypeE" title="paddle::SparseValueType">SparseValueType</a> <em>valueType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix9resizeCSRE6size_t6size_t6size_t15SparseValueType" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix9resizeCSCE6size_t6size_t6size_t15SparseValueType">
<span id="paddle::GpuSparseMatrix::resizeCSC__s.s.s.SparseValueType"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1add55f9f2a02714faef2518d902a9b4b3"></span>void <code class="descname">resizeCSC</code><span class="sig-paren">(</span>size_t <em>newHeight</em>, size_t <em>newWidth</em>, size_t <em>newNnz</em>, <a class="reference internal" href="#_CPPv2N6paddle15SparseValueTypeE" title="paddle::SparseValueType">SparseValueType</a> <em>valueType</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix9resizeCSCE6size_t6size_t6size_t15SparseValueType" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix3mulEK12GpuMatrixPtrK12GpuMatrixPtr4real4real">
<span id="paddle::GpuSparseMatrix::mul__GpuMatrixPtrC.GpuMatrixPtrC.real.real"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1a156e35a80168f0ca0326a4ab02084a45"></span>void <code class="descname">mul</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle12GpuMatrixPtrE" title="paddle::GpuMatrixPtr">GpuMatrixPtr</a> <em>a</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle12GpuMatrixPtrE" title="paddle::GpuMatrixPtr">GpuMatrixPtr</a> <em>b</em>, real <em>scaleAB</em>, real <em>scaleT</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix3mulEK12GpuMatrixPtrK12GpuMatrixPtr4real4real" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix12getTransposeEv">
5349
<span id="paddle::GpuSparseMatrix::getTranspose"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1ab50716217245d6b09aca530ac36b72f0"></span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">getTranspose</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix12getTransposeEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5350 5351 5352 5353 5354
<dd><p>B = A , B.trans = !A.trans. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix9transposeE9MatrixPtrb">
5355
<span id="paddle::GpuSparseMatrix::transpose__MatrixPtr.b"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1abdc9853fdd18fd993e43860a86128a0b"></span>void <code class="descname">transpose</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>matTrans</em>, bool <em>memAlloc</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix9transposeE9MatrixPtrb" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5356 5357 5358 5359 5360
<dd><p>B = A&#8217;. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix8copyFromERK6Matrix">
5361
<span id="paddle::GpuSparseMatrix::copyFrom__MatrixCR"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1a0dd9bd33720c7b960458353c104a7ab6"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>src</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix8copyFromERK6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5362 5363 5364 5365
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix8copyFromERK6Matrix11hl_stream_t">
5366
<span id="paddle::GpuSparseMatrix::copyFrom__MatrixCR.hl_stream_t"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1afa8489f9265d28b887815038f6c21cd8"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>src</em>, <a class="reference internal" href="../../cuda/utils/utils.html#_CPPv211hl_stream_t" title="hl_stream_t">hl_stream_t</a> <em>stream</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix8copyFromERK6Matrix11hl_stream_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix11copyFromCSRER15CpuSparseMatrix11hl_stream_t">
<span id="paddle::GpuSparseMatrix::copyFromCSR__CpuSparseMatrixR.hl_stream_t"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1acb7e4107bbe167b4394a7037104b0d02"></span>void <code class="descname">copyFromCSR</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle15CpuSparseMatrixE" title="paddle::CpuSparseMatrix">CpuSparseMatrix</a> &amp;<em>src</em>, <a class="reference internal" href="../../cuda/utils/utils.html#_CPPv211hl_stream_t" title="hl_stream_t">hl_stream_t</a> <em>stream</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix11copyFromCSRER15CpuSparseMatrix11hl_stream_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix11copyFromCSCER15CpuSparseMatrix11hl_stream_t">
<span id="paddle::GpuSparseMatrix::copyFromCSC__CpuSparseMatrixR.hl_stream_t"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1a55e54d69167b6078cdf4ad45e9b9b1f4"></span>void <code class="descname">copyFromCSC</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle15CpuSparseMatrixE" title="paddle::CpuSparseMatrix">CpuSparseMatrix</a> &amp;<em>src</em>, <a class="reference internal" href="../../cuda/utils/utils.html#_CPPv211hl_stream_t" title="hl_stream_t">hl_stream_t</a> <em>stream</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix11copyFromCSCER15CpuSparseMatrix11hl_stream_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix8copyFromERK7IVector">
5381
<span id="paddle::GpuSparseMatrix::copyFrom__IVectorCR"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1a0f3d89d187f0f431c61441f9115ece4c"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>src</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix8copyFromERK7IVector" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400
<dd><p>convert a int vector to a real matrix. </p>
<p>(1) source and dest are both in CPU.</p>
<p>(2) sizes are exactly match. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix8copyFromERK7IVector11hl_stream_t">
<span id="paddle::GpuSparseMatrix::copyFrom__IVectorCR.hl_stream_t"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1a7a335a2416af15f21faba0d8f00045e8"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>src</em>, <a class="reference internal" href="../../cuda/utils/utils.html#_CPPv211hl_stream_t" title="hl_stream_t">hl_stream_t</a> <em>stream</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix8copyFromERK7IVector11hl_stream_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> T&gt;</dt>
<dt id="_CPPv2N6paddle15GpuSparseMatrix8copyFromEP7int64_tP7int64_tP1T11hl_stream_t">
<span id="paddle::GpuSparseMatrix::copyFrom__int64_tP.int64_tP.TP.hl_stream_t"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1a74b1497f311d3375a848813c61a44578"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span>int64_t *<em>ids</em>, int64_t *<em>indices</em>, T *<em>data</em>, <a class="reference internal" href="../../cuda/utils/utils.html#_CPPv211hl_stream_t" title="hl_stream_t">hl_stream_t</a> <em>stream</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix8copyFromEP7int64_tP7int64_tP1T11hl_stream_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix6setRowE6size_t6size_tPKjPK4real">
5401
<span id="paddle::GpuSparseMatrix::setRow__s.s.unsigned-iCP.realCP"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1afd46bc089ada7f3c56530f0dd2fe6a7d"></span>void <code class="descname">setRow</code><span class="sig-paren">(</span>size_t <em>row</em>, size_t <em>colNum</em>, <em class="property">const</em> unsigned int *<em>cols</em>, <em class="property">const</em> real *<em>values</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix6setRowE6size_t6size_tPKjPK4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5402 5403 5404 5405 5406
<dd><p>This should only be used for sparse matrix. </p>
<p>Currently must be called for each row in order. The matrix is not valid until setRow is called for the last row. </p>
</dd></dl>

<dl class="function">
5407 5408
<dt id="_CPPv2NK6paddle15GpuSparseMatrix12getValueTypeEv">
<span id="paddle::GpuSparseMatrix::getValueTypeC"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1a6db9d7044115b23eef3da3d1d8dfffeb"></span><a class="reference internal" href="#_CPPv2N6paddle15SparseValueTypeE" title="paddle::SparseValueType">SparseValueType</a> <code class="descname">getValueType</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle15GpuSparseMatrix12getValueTypeEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5409 5410 5411
<dd></dd></dl>

<dl class="function">
5412 5413
<dt id="_CPPv2NK6paddle15GpuSparseMatrix9getFormatEv">
<span id="paddle::GpuSparseMatrix::getFormatC"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1a62225cd1ec06f93c49bd32d338c32b3e"></span><a class="reference internal" href="#_CPPv2N6paddle12SparseFormatE" title="paddle::SparseFormat">SparseFormat</a> <code class="descname">getFormat</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle15GpuSparseMatrix9getFormatEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5414 5415 5416
<dd></dd></dl>

<dl class="function">
5417 5418
<dt id="_CPPv2NK6paddle15GpuSparseMatrix10getRowColsE6size_t">
<span id="paddle::GpuSparseMatrix::getRowCols__sC"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1aa82f46716068735354fc4ae63c06992b"></span><em class="property">const</em> int *<code class="descname">getRowCols</code><span class="sig-paren">(</span>size_t <em>x</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle15GpuSparseMatrix10getRowColsE6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5419 5420 5421
<dd></dd></dl>

<dl class="function">
5422 5423
<dt id="_CPPv2NK6paddle15GpuSparseMatrix12getRowValuesE6size_t">
<span id="paddle::GpuSparseMatrix::getRowValues__sC"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1a62410b8ab57a4953a27bcf63ae48e10d"></span><em class="property">const</em> real *<code class="descname">getRowValues</code><span class="sig-paren">(</span>size_t <em>x</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle15GpuSparseMatrix12getRowValuesE6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5424 5425 5426
<dd></dd></dl>

<dl class="function">
5427 5428
<dt id="_CPPv2NK6paddle15GpuSparseMatrix9getColNumE6size_t">
<span id="paddle::GpuSparseMatrix::getColNum__sC"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1ad6fadafb20012a973e2e3b93254188f0"></span>size_t <code class="descname">getColNum</code><span class="sig-paren">(</span>size_t <em>x</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle15GpuSparseMatrix9getColNumE6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5429 5430 5431
<dd></dd></dl>

<dl class="function">
5432 5433
<dt id="_CPPv2NK6paddle15GpuSparseMatrix5printERNSt7ostreamE">
<span id="paddle::GpuSparseMatrix::print__osRC"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1aec488780562343a90ac790af62daff6a"></span>void <code class="descname">print</code><span class="sig-paren">(</span>std::ostream &amp;<em>os</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle15GpuSparseMatrix5printERNSt7ostreamE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5434 5435 5436 5437 5438
<dd><p>print out the values of elements to os </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix7zeroMemEv">
5439
<span id="paddle::GpuSparseMatrix::zeroMem"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1a75191eed4868a4bdb89d3c44b5958143"></span>void <code class="descname">zeroMem</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix7zeroMemEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5440 5441 5442 5443 5444 5445 5446 5447 5448 5449 5450
<dd><p>only set value_ of FLOAT_VALUE sparse matrix to zero </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix4add3EP9GpuMatrix">
<span id="paddle::GpuSparseMatrix::add3__GpuMatrixP"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1a735196555d4c46bc5ad233fe36445f7d"></span>void <code class="descname">add3</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle9GpuMatrixE" title="paddle::GpuMatrix">GpuMatrix</a> *<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix4add3EP9GpuMatrix" title="Permalink to this definition">¶</a></dt>
<dd><p>sparseMatrix += denseMatrix </p>
<p>Named add3 just because add/add2 has been used in BaseMatrix.cu and they are not virtual function.</p>
<p>Only add value of same (row, col) index in dense matrix and do not use others values.</p>
<p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
5451 5452
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">b</span></code>: dense matrix </li>
Y
Yu Yang 已提交
5453 5454 5455 5456 5457 5458 5459 5460
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix4add3E9MatrixPtr">
5461
<span id="paddle::GpuSparseMatrix::add3__MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1a28303f17e7c3f6f3de1376dc05321b2b"></span>void <code class="descname">add3</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix4add3E9MatrixPtr" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5462 5463 5464 5465 5466 5467
<dd><p>matrix elment-wise add </p>
<p>Named add3 just because add/add2 has been used in BaseMatrix.cu and they are not virtual function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix7addBiasER6Matrix4real">
5468
<span id="paddle::GpuSparseMatrix::addBias__MatrixR.real"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1a0bdc83a2524f7881d39fd90ce3593f64"></span>void <code class="descname">addBias</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>b</em>, real <em>scale</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix7addBiasER6Matrix4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5469 5470 5471
<dd><p>sparseMatrix[i,j] += bias[j], (j is the col index of sparse matrix) </p>
<p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
5472 5473 5474
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">b</span></code>: bias, dense matrix and height = 1 </li>
<li><code class="docutils literal"><span class="pre">scale</span></code>: scale of b </li>
Y
Yu Yang 已提交
5475 5476 5477 5478 5479 5480 5481
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
5482 5483
<dt id="_CPPv2NK6paddle15GpuSparseMatrix7getRowsEv">
<span id="paddle::GpuSparseMatrix::getRowsC"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1ab876ca0dd1c4b33c2a5bb61aedd9739e"></span>int *<code class="descname">getRows</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle15GpuSparseMatrix7getRowsEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5484 5485 5486 5487
<dd><p>return rows, which is gpu address </p>
</dd></dl>

<dl class="function">
5488 5489
<dt id="_CPPv2NK6paddle15GpuSparseMatrix7getColsEv">
<span id="paddle::GpuSparseMatrix::getColsC"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1a74ca289301438fc18888cbc9b551b34a"></span>int *<code class="descname">getCols</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle15GpuSparseMatrix7getColsEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5490 5491 5492 5493
<dd><p>return cols, which is gpu address </p>
</dd></dl>

<dl class="function">
5494 5495
<dt id="_CPPv2NK6paddle15GpuSparseMatrix8getValueEv">
<span id="paddle::GpuSparseMatrix::getValueC"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1a4c9a6b4c5e6d8cf0a4cae1a42716f81e"></span>real *<code class="descname">getValue</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle15GpuSparseMatrix8getValueEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5496 5497 5498 5499 5500
<dd><p>return value, which is gpu address </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix7getDataEv">
5501
<span id="paddle::GpuSparseMatrix::getData"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1a009428b374149bf260e0abbdd57a3c8c"></span>real *<code class="descname">getData</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix7getDataEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5502
<dd><p>return value_ of sparse matrix </p>
5503
<p>Some times <a class="reference internal" href="#paddleclasspaddle_1_1CpuSparseMatrix"><span class="std std-ref">CpuSparseMatrix</span></a> maybe <a class="reference internal" href="#paddleclasspaddle_1_1Matrix"><span class="std std-ref">Matrix</span></a>, if getValue, must dynamic_cast to <a class="reference internal" href="#paddleclasspaddle_1_1CpuSparseMatrix"><span class="std std-ref">CpuSparseMatrix</span></a>, getData is convenient to get value </p>
Y
Yu Yang 已提交
5504 5505 5506
</dd></dl>

<dl class="function">
5507 5508
<dt id="_CPPv2NK6paddle15GpuSparseMatrix7getDataEv">
<span id="paddle::GpuSparseMatrix::getDataC"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1a1ea7be6ace7f0f936e149e4c3491326c"></span><em class="property">const</em> real *<code class="descname">getData</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle15GpuSparseMatrix7getDataEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5509 5510 5511 5512
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix6rowMaxER7IVectorR6Matrix">
5513
<span id="paddle::GpuSparseMatrix::rowMax__IVectorR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1a11cf56bbf49bdf94769ee8ac131cff74"></span>void <code class="descname">rowMax</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>maxIds</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>maxVal</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix6rowMaxER7IVectorR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5514 5515 5516 5517
<dd><p>Get top k value of each row in sparse matrix. </p>
<p>Store the value in maxVal and theirs index in maxIds. k = maxVal.width</p>
<p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
5518 5519 5520
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">maxIds</span></code>: index of top k </li>
<li><code class="docutils literal"><span class="pre">maxVal</span></code>: value of top k </li>
Y
Yu Yang 已提交
5521 5522 5523 5524 5525 5526 5527 5528
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix3mulEK9MatrixPtrK9MatrixPtr4real4real">
5529 5530
<span id="paddle::GpuSparseMatrix::mul__MatrixPtrC.MatrixPtrC.real.real"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1a3e2e49d9f3311b0fe6f97c26e375d6d5"></span>void <code class="descname">mul</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>a</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>b</em>, real <em>scaleAB</em>, real <em>scaleT</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix3mulEK9MatrixPtrK9MatrixPtr4real4real" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">scaleAB</span><span class="o">*</span><span class="p">(</span><span class="n">a</span><span class="o">*</span><span class="n">b</span><span class="p">)</span> <span class="o">+</span> <span class="n">scaleT</span><span class="o">*</span><span class="n">this</span>
Y
Yu Yang 已提交
5531 5532
</pre></div>
</div>
5533
 </p>
Y
Yu Yang 已提交
5534 5535 5536 5537 5538 5539 5540 5541 5542
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix8copyFromER15CpuSparseMatrix11hl_stream_t">
<span id="paddle::GpuSparseMatrix::copyFrom__CpuSparseMatrixR.hl_stream_t"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1a4e7eef319b074bb2990c66f937f72fd9"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle15CpuSparseMatrixE" title="paddle::CpuSparseMatrix">CpuSparseMatrix</a> &amp;<em>src</em>, <a class="reference internal" href="../../cuda/utils/utils.html#_CPPv211hl_stream_t" title="hl_stream_t">hl_stream_t</a> <em>stream</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix8copyFromER15CpuSparseMatrix11hl_stream_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix8copyFromER15GpuSparseMatrix11hl_stream_t">
5543
<span id="paddle::GpuSparseMatrix::copyFrom__GpuSparseMatrixR.hl_stream_t"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1abaefb057bc4e7be9df0c19887325eff1"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle15GpuSparseMatrixE" title="paddle::GpuSparseMatrix">GpuSparseMatrix</a> &amp;<em>src</em>, <a class="reference internal" href="../../cuda/utils/utils.html#_CPPv211hl_stream_t" title="hl_stream_t">hl_stream_t</a> <em>stream</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix8copyFromER15GpuSparseMatrix11hl_stream_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5544 5545 5546 5547
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix8trimFromERK15CpuSparseMatrix">
5548
<span id="paddle::GpuSparseMatrix::trimFrom__CpuSparseMatrixCR"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1a5d09231a9dfddfa1604a453ca0e4019d"></span>void <code class="descname">trimFrom</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle15CpuSparseMatrixE" title="paddle::CpuSparseMatrix">CpuSparseMatrix</a> &amp;<em>src</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix8trimFromERK15CpuSparseMatrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5549 5550 5551 5552 5553 5554 5555 5556 5557 5558 5559 5560 5561
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix11trimFromCSRERK15CpuSparseMatrix">
<span id="paddle::GpuSparseMatrix::trimFromCSR__CpuSparseMatrixCR"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1a1a5eaa0062874c0284aecfab3cf6c66b"></span>void <code class="descname">trimFromCSR</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle15CpuSparseMatrixE" title="paddle::CpuSparseMatrix">CpuSparseMatrix</a> &amp;<em>src</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix11trimFromCSRERK15CpuSparseMatrix" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix11trimFromCSCERK15CpuSparseMatrix">
<span id="paddle::GpuSparseMatrix::trimFromCSC__CpuSparseMatrixCR"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1a038a146b9e5c1ccd5ff9d4d6e5814432"></span>void <code class="descname">trimFromCSC</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle15CpuSparseMatrixE" title="paddle::CpuSparseMatrix">CpuSparseMatrix</a> &amp;<em>src</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix11trimFromCSCERK15CpuSparseMatrix" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
5562 5563
<dt id="_CPPv2NK6paddle15GpuSparseMatrix8isSparseEv">
<span id="paddle::GpuSparseMatrix::isSparseC"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1a71efa38bcd9870ee6943439b66002fa6"></span>bool <code class="descname">isSparse</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle15GpuSparseMatrix8isSparseEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5564 5565 5566
<dd></dd></dl>

</div>
5567
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5568 5569 5570 5571 5572 5573 5574 5575 5576 5577 5578 5579 5580 5581 5582 5583 5584 5585 5586 5587 5588 5589 5590 5591 5592 5593 5594 5595 5596 5597 5598 5599 5600 5601 5602 5603 5604 5605 5606 5607 5608 5609
<p class="breathe-sectiondef-title rubric">Public Members</p>
<dl class="member">
<dt id="_CPPv2N6paddle15GpuSparseMatrix14sMemoryHandle_E">
<span id="paddle::GpuSparseMatrix::sMemoryHandle___MemoryHandlePtr"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1ac2ecb455451edec76a3315e6ccfa054a"></span><a class="reference internal" href="../utils/utils.html#_CPPv2N6paddle15MemoryHandlePtrE" title="paddle::MemoryHandlePtr">MemoryHandlePtr</a> <code class="descname">sMemoryHandle_</code><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix14sMemoryHandle_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle15GpuSparseMatrix5rows_E">
<span id="paddle::GpuSparseMatrix::rows___iP"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1a2dacd8c848fdd5874045ffc4bf500e72"></span>int *<code class="descname">rows_</code><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix5rows_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle15GpuSparseMatrix5cols_E">
<span id="paddle::GpuSparseMatrix::cols___iP"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1a0a67f5b344a00e75337e022fc00cd0e1"></span>int *<code class="descname">cols_</code><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix5cols_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle15GpuSparseMatrix6value_E">
<span id="paddle::GpuSparseMatrix::value___realP"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1acd64ba0f3fb07827aee1c7f4d74feff5"></span>real *<code class="descname">value_</code><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix6value_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle15GpuSparseMatrix4end_E">
<span id="paddle::GpuSparseMatrix::end___cCP"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1aa8779ab22bb488058d54a1093d9ba3ba"></span><em class="property">const</em> char *<code class="descname">end_</code><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix4end_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle15GpuSparseMatrix8sMatrix_E">
<span id="paddle::GpuSparseMatrix::sMatrix___hl_sparse_matrix_s_ptr"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1a726b10e082dc92da67705d52ac0dc5aa"></span><a class="reference internal" href="#_CPPv2N6paddle22hl_sparse_matrix_s_ptrE" title="paddle::hl_sparse_matrix_s_ptr">hl_sparse_matrix_s_ptr</a> <code class="descname">sMatrix_</code><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix8sMatrix_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle15GpuSparseMatrix10valueType_E">
<span id="paddle::GpuSparseMatrix::valueType___SparseValueType"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1a184505ace72c60b2640e57edca9441b0"></span><a class="reference internal" href="#_CPPv2N6paddle15SparseValueTypeE" title="paddle::SparseValueType">SparseValueType</a> <code class="descname">valueType_</code><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix10valueType_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle15GpuSparseMatrix7format_E">
<span id="paddle::GpuSparseMatrix::format___SparseFormat"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1ae768ee3d8bc3fd4d0794d5fcad3b182b"></span><a class="reference internal" href="#_CPPv2N6paddle12SparseFormatE" title="paddle::SparseFormat">SparseFormat</a> <code class="descname">format_</code><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix7format_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
5610
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630
<p class="breathe-sectiondef-title rubric">Protected Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix12sparseResizeEv">
<span id="paddle::GpuSparseMatrix::sparseResize"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1aeff535cca706d8c14d6d7160412271ad"></span>void <code class="descname">sparseResize</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix12sparseResizeEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix7copyRowEi6size_tPK18sparse_non_value_t">
<span id="paddle::GpuSparseMatrix::copyRow__i.s.sparse_non_value_tCP"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1a13e6cb5f5e98e6289f208c24b823fa5f"></span>void <code class="descname">copyRow</code><span class="sig-paren">(</span>int <em>offsets</em>, size_t <em>colNum</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle18sparse_non_value_tE" title="paddle::sparse_non_value_t">sparse_non_value_t</a> *<em>row</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix7copyRowEi6size_tPK18sparse_non_value_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix7copyRowEi6size_tPK20sparse_float_value_t">
<span id="paddle::GpuSparseMatrix::copyRow__i.s.sparse_float_value_tCP"></span><span class="target" id="paddleclasspaddle_1_1GpuSparseMatrix_1a044a8db12b1e3d34774c1b8a48298045"></span>void <code class="descname">copyRow</code><span class="sig-paren">(</span>int <em>offsets</em>, size_t <em>colNum</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle20sparse_float_value_tE" title="paddle::sparse_float_value_t">sparse_float_value_t</a> *<em>row</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix7copyRowEi6size_tPK20sparse_float_value_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<dl class="class">
<dt id="_CPPv2N6paddle15GpuSparseMatrix7ElementE">
<span id="paddle::GpuSparseMatrix::Element"></span><span class="target" id="paddlestructpaddle_1_1GpuSparseMatrix_1_1Element"></span><em class="property">struct </em><code class="descname">Element</code><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix7ElementE" title="Permalink to this definition">¶</a></dt>
5631
<dd><div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5632 5633 5634 5635 5636 5637 5638
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix7Element7ElementEii4real">
<span id="paddle::GpuSparseMatrix::Element::Element__i.i.real"></span><span class="target" id="paddlestructpaddle_1_1GpuSparseMatrix_1_1Element_1aed7420c494a5388158949a1f0e7b008c"></span><code class="descname">Element</code><span class="sig-paren">(</span>int <em>rowIn</em>, int <em>colIn</em>, real <em>valIn</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix7Element7ElementEii4real" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
5639
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662
<p class="breathe-sectiondef-title rubric">Public Members</p>
<dl class="member">
<dt id="_CPPv2N6paddle15GpuSparseMatrix7Element3rowE">
<span id="paddle::GpuSparseMatrix::Element::row__i"></span><span class="target" id="paddlestructpaddle_1_1GpuSparseMatrix_1_1Element_1a711eb7b539e9ed9d93d8aa293655f4ec"></span>int <code class="descname">row</code><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix7Element3rowE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle15GpuSparseMatrix7Element3colE">
<span id="paddle::GpuSparseMatrix::Element::col__i"></span><span class="target" id="paddlestructpaddle_1_1GpuSparseMatrix_1_1Element_1acd5437d6ce9dc15abf2a36e649d3e7e4"></span>int <code class="descname">col</code><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix7Element3colE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle15GpuSparseMatrix7Element3valE">
<span id="paddle::GpuSparseMatrix::Element::val__real"></span><span class="target" id="paddlestructpaddle_1_1GpuSparseMatrix_1_1Element_1aab08be399281c9a6fd94b9bd13a9ac09"></span>real <code class="descname">val</code><a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix7Element3valE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</dd></dl>

</dd></dl>

5663
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5664 5665 5666 5667 5668 5669 5670 5671
<p class="breathe-sectiondef-title rubric">Functions</p>
<dl class="function">
<dt id="_CPPv214P_DECLARE_bool31allow_inefficient_sparse_update">
<span id="P_DECLARE_bool__allow_inefficient_sparse_update"></span><span class="target" id="paddleSparseRowMatrix_8h_1a021315553199433300cf2edb3cfad12f"></span><code class="descname">P_DECLARE_bool</code><span class="sig-paren">(</span>allow_inefficient_sparse_update<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv214P_DECLARE_bool31allow_inefficient_sparse_update" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<dl class="type">
5672 5673
<dt>
<span class="target" id="paddlenamespacepaddle"></span><em class="property">namespace </em><code class="descname">paddle</code></dt>
Y
Yu Yang 已提交
5674 5675 5676 5677
<dd><dl class="class">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrixE">
<span id="paddle::SparseRowCpuMatrix"></span><span class="target" id="paddleclasspaddle_1_1SparseRowCpuMatrix"></span><em class="property">class </em><code class="descname">SparseRowCpuMatrix</code><a class="headerlink" href="#_CPPv2N6paddle18SparseRowCpuMatrixE" title="Permalink to this definition">¶</a></dt>
<dd><em>#include &lt;SparseRowMatrix.h&gt;</em><p>Sparse Row </p>
5678 5679
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1CpuMatrix"><span class="std std-ref">paddle::CpuMatrix</span></a></p>
<p>Subclassed by <a class="reference internal" href="#paddleclasspaddle_1_1SparseAutoGrowRowCpuMatrix"><span class="std std-ref">paddle::SparseAutoGrowRowCpuMatrix</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1SparsePrefetchRowCpuMatrix"><span class="std std-ref">paddle::SparsePrefetchRowCpuMatrix</span></a></p>
5680
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5681 5682 5683 5684 5685 5686 5687
<p class="breathe-sectiondef-title rubric">Public Types</p>
<dl class="type">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrix12IndexDictPtrE">
<span id="paddle::SparseRowCpuMatrix::IndexDictPtr"></span><span class="target" id="paddleclasspaddle_1_1SparseRowCpuMatrix_1abaafe55f48472263fbb1884b87ae433e"></span><em class="property">typedef </em>std::shared_ptr&lt;<a class="reference internal" href="#_CPPv2N6paddle18SparseRowCpuMatrix9IndexDictE" title="paddle::SparseRowCpuMatrix::IndexDict">IndexDict</a>&gt; <code class="descname">IndexDictPtr</code><a class="headerlink" href="#_CPPv2N6paddle18SparseRowCpuMatrix12IndexDictPtrE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
5688
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5689 5690 5691 5692 5693 5694 5695 5696 5697
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrix18SparseRowCpuMatrixE15CpuMemHandlePtr6size_t6size_t12IndexDictPtrb">
<span id="paddle::SparseRowCpuMatrix::SparseRowCpuMatrix__CpuMemHandlePtr.s.s.IndexDictPtr.b"></span><span class="target" id="paddleclasspaddle_1_1SparseRowCpuMatrix_1a37aa8dc01c7dfdbb37b35ffe56cd7f26"></span><code class="descname">SparseRowCpuMatrix</code><span class="sig-paren">(</span><a class="reference internal" href="../utils/utils.html#_CPPv2N6paddle15CpuMemHandlePtrE" title="paddle::CpuMemHandlePtr">CpuMemHandlePtr</a> <em>dataHandle</em>, size_t <em>height</em>, size_t <em>width</em>, <a class="reference internal" href="#_CPPv2N6paddle18SparseRowCpuMatrix12IndexDictPtrE" title="paddle::SparseRowCpuMatrix::IndexDictPtr">IndexDictPtr</a> <em>indexDictHandle</em> = nullptr, bool <em>trans</em> = false<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18SparseRowCpuMatrix18SparseRowCpuMatrixE15CpuMemHandlePtr6size_t6size_t12IndexDictPtrb" title="Permalink to this definition">¶</a></dt>
<dd><p>heightStore is max number of rows of the sparse matrix. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrixD0Ev">
5698
<span id="paddle::SparseRowCpuMatrix::~SparseRowCpuMatrix"></span><span class="target" id="paddleclasspaddle_1_1SparseRowCpuMatrix_1a2bd1df4d96eff23908149aee09bae72d"></span><em class="property">virtual</em> <code class="descname">~SparseRowCpuMatrix</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18SparseRowCpuMatrixD0Ev" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5699 5700 5701 5702 5703 5704 5705 5706
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrix6getRowE6size_t">
<span id="paddle::SparseRowCpuMatrix::getRow__s"></span><span class="target" id="paddleclasspaddle_1_1SparseRowCpuMatrix_1a067d4a9ccc732aa307dad64ae06b47bf"></span>real *<code class="descname">getRow</code><span class="sig-paren">(</span>size_t <em>row</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18SparseRowCpuMatrix6getRowE6size_t" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the row buf</p>
<p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
5707 5708
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">row</span></code>: row id in the original matrix </li>
Y
Yu Yang 已提交
5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrix11getLocalRowE6size_t">
<span id="paddle::SparseRowCpuMatrix::getLocalRow__s"></span><span class="target" id="paddleclasspaddle_1_1SparseRowCpuMatrix_1a3199b92efbbd3dd561113eadc8021c7e"></span>real *<code class="descname">getLocalRow</code><span class="sig-paren">(</span>size_t <em>row</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18SparseRowCpuMatrix11getLocalRowE6size_t" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the row buf</p>
<p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
5721 5722
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">row</span></code>: row id in local storage </li>
Y
Yu Yang 已提交
5723 5724 5725 5726 5727 5728 5729 5730 5731 5732
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrix12reserveStoreEv">
<span id="paddle::SparseRowCpuMatrix::reserveStore"></span><span class="target" id="paddleclasspaddle_1_1SparseRowCpuMatrix_1a22a49bcee5a94f7874c109e7a0b72ffa"></span>void <code class="descname">reserveStore</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18SparseRowCpuMatrix12reserveStoreEv" title="Permalink to this definition">¶</a></dt>
<dd><p>reserve the storage for rows according to current size of indexDictHandle.</p>
5733
<p>This is only used when <a class="reference internal" href="#paddleclasspaddle_1_1SparseRowCpuMatrix"><span class="std std-ref">SparseRowCpuMatrix</span></a> is constructed with indexDictHandle. </p>
Y
Yu Yang 已提交
5734 5735 5736 5737
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrix9getRowBufE6size_t">
5738
<span id="paddle::SparseRowCpuMatrix::getRowBuf__s"></span><span class="target" id="paddleclasspaddle_1_1SparseRowCpuMatrix_1a498229262619adcc3fc7b7097d61f858"></span><em class="property">virtual</em> real *<code class="descname">getRowBuf</code><span class="sig-paren">(</span>size_t <em>row</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18SparseRowCpuMatrix9getRowBufE6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5739 5740 5741 5742
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrix3mulEP15CpuSparseMatrixP9CpuMatrix4real4real">
5743
<span id="paddle::SparseRowCpuMatrix::mul__CpuSparseMatrixP.CpuMatrixP.real.real"></span><span class="target" id="paddleclasspaddle_1_1SparseRowCpuMatrix_1a219a27c6b84f2cc977ac9c743b45bb52"></span>void <code class="descname">mul</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle15CpuSparseMatrixE" title="paddle::CpuSparseMatrix">CpuSparseMatrix</a> *<em>a</em>, <a class="reference internal" href="#_CPPv2N6paddle9CpuMatrixE" title="paddle::CpuMatrix">CpuMatrix</a> *<em>b</em>, real <em>scaleAB</em>, real <em>scaleT</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18SparseRowCpuMatrix3mulEP15CpuSparseMatrixP9CpuMatrix4real4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5744 5745 5746 5747
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrix8copyFromEPK4real6size_t">
5748
<span id="paddle::SparseRowCpuMatrix::copyFrom__realCP.s"></span><span class="target" id="paddleclasspaddle_1_1SparseRowCpuMatrix_1acdd9c181f838c309773f438f23f1e404"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> real *<em>src</em>, size_t <em>size</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18SparseRowCpuMatrix8copyFromEPK4real6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5749
<dd><p>Fill data according to row indexs added, setup indices inside.</p>
5750
<p><em>src</em> and <em>size</em> are data and size of normal dense <a class="reference internal" href="#paddleclasspaddle_1_1CpuMatrix"><span class="std std-ref">CpuMatrix</span></a>. </p>
Y
Yu Yang 已提交
5751 5752 5753 5754
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrix7zeroMemEv">
5755
<span id="paddle::SparseRowCpuMatrix::zeroMem"></span><span class="target" id="paddleclasspaddle_1_1SparseRowCpuMatrix_1a92fa7f4a64f3d353c26ce5c438e36146"></span>void <code class="descname">zeroMem</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18SparseRowCpuMatrix7zeroMemEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5756 5757 5758 5759 5760 5761 5762 5763 5764 5765 5766 5767 5768 5769 5770 5771 5772 5773 5774 5775 5776 5777 5778 5779 5780 5781 5782 5783 5784 5785 5786 5787 5788 5789 5790 5791 5792 5793
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrix12applyL1DecayE4real4real">
<span id="paddle::SparseRowCpuMatrix::applyL1Decay__real.real"></span><span class="target" id="paddleclasspaddle_1_1SparseRowCpuMatrix_1ae841369346473804ec95cfea7ccca9a9"></span>void <code class="descname">applyL1Decay</code><span class="sig-paren">(</span>real <em>learningRate</em>, real <em>decayRate</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18SparseRowCpuMatrix12applyL1DecayE4real4real" title="Permalink to this definition">¶</a></dt>
<dd><p>apply L1 to all sparse rows, should be apply after indices ready. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrix12clearIndicesEv">
<span id="paddle::SparseRowCpuMatrix::clearIndices"></span><span class="target" id="paddleclasspaddle_1_1SparseRowCpuMatrix_1a1fdc9a3e517475289426572ed1116786"></span>void <code class="descname">clearIndices</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18SparseRowCpuMatrix12clearIndicesEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrix13zeroMemThreadE6size_t6size_t">
<span id="paddle::SparseRowCpuMatrix::zeroMemThread__s.s"></span><span class="target" id="paddleclasspaddle_1_1SparseRowCpuMatrix_1ab4f844cb8cc67725ab5fe4638f8e030d"></span>void <code class="descname">zeroMemThread</code><span class="sig-paren">(</span>size_t <em>tid</em>, size_t <em>numThreads</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18SparseRowCpuMatrix13zeroMemThreadE6size_t6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrix9sgdUpdateER10BaseMatrixR7IVector4reali4realbb">
<span id="paddle::SparseRowCpuMatrix::sgdUpdate__BaseMatrixR.IVectorR.real.i.real.b.b"></span><span class="target" id="paddleclasspaddle_1_1SparseRowCpuMatrix_1af2efb2d5ba47c4f42602833b0e215f80"></span>void <code class="descname">sgdUpdate</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle10BaseMatrixE" title="paddle::BaseMatrix">BaseMatrix</a> &amp;<em>value</em>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>t0</em>, real <em>learningRate</em>, int <em>currentTime</em>, real <em>decayRate</em>, bool <em>useL1</em>, bool <em>fini</em> = false<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18SparseRowCpuMatrix9sgdUpdateER10BaseMatrixR7IVector4reali4realbb" title="Permalink to this definition">¶</a></dt>
<dd><p>value -= grad * learningRate, this is gradient.</p>
<p>If L1 decay set use L1, else if L2 set use L2, otherwise no decay atall.</p>
<p>t0 is a int vector used by L1/L2 decay, size = height of parameter matrix, store the time that each weight row last updated.</p>
<p>Time is batchId, currentTime is current batchId.</p>
<p>While pass finished, caller should call this func one more time with (fini=true) to let weight decay catch up current time. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrix5addToER10BaseMatrixRNSt6vectorI8uint32_tEE6size_t6size_t">
<span id="paddle::SparseRowCpuMatrix::addTo__BaseMatrixR.std::vector:uint32_t:R.s.s"></span><span class="target" id="paddleclasspaddle_1_1SparseRowCpuMatrix_1a990fd0c58aa099c9a95cef431a09a885"></span>void <code class="descname">addTo</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle10BaseMatrixE" title="paddle::BaseMatrix">BaseMatrix</a> &amp;<em>dest</em>, std::vector&lt;uint32_t&gt; &amp;<em>ids</em>, size_t <em>tid</em>, size_t <em>numThreads</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18SparseRowCpuMatrix5addToER10BaseMatrixRNSt6vectorI8uint32_tEE6size_t6size_t" title="Permalink to this definition">¶</a></dt>
<dd><p>merge rows in <em>this</em> to <em>dest</em> for designated thread</p>
<p>values add to <em>dest</em> matrix</p>
<p>ids occured in <em>this</em> append to <em>ids</em> filtered by (id % numThreads == tid) </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrix5addToER18SparseRowCpuMatrix6size_t6size_t">
5794 5795 5796
<span id="paddle::SparseRowCpuMatrix::addTo__SparseRowCpuMatrixR.s.s"></span><span class="target" id="paddleclasspaddle_1_1SparseRowCpuMatrix_1a8ed9272e19b0878c9f2e2712b0067aa0"></span>void <code class="descname">addTo</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle18SparseRowCpuMatrixE" title="paddle::SparseRowCpuMatrix">SparseRowCpuMatrix</a> &amp;<em>dest</em>, size_t <em>tid</em>, size_t <em>numThreads</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18SparseRowCpuMatrix5addToER18SparseRowCpuMatrix6size_t6size_t" title="Permalink to this definition">¶</a></dt>
<dd><p>the second version <a class="reference internal" href="#paddleclasspaddle_1_1SparseRowCpuMatrix_1a990fd0c58aa099c9a95cef431a09a885"><span class="std std-ref">addTo()</span></a>, <em>dest</em> is a <a class="reference internal" href="#paddleclasspaddle_1_1SparseRowCpuMatrix"><span class="std std-ref">SparseRowCpuMatrix</span></a>.</p>
<p>The dest&#8217;s indices should be setup already, <a class="reference internal" href="#paddleclasspaddle_1_1SparseRowCpuMatrix_1a990fd0c58aa099c9a95cef431a09a885"><span class="std std-ref">addTo()</span></a> will check src ids is exist in dest&#8217;s indices. </p>
Y
Yu Yang 已提交
5797 5798 5799
</dd></dl>

<dl class="function">
5800 5801
<dt id="_CPPv2NK6paddle18SparseRowCpuMatrix18getIndexDictHandleEv">
<span id="paddle::SparseRowCpuMatrix::getIndexDictHandleC"></span><span class="target" id="paddleclasspaddle_1_1SparseRowCpuMatrix_1af8328452fa663ba52703e0101145640c"></span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle18SparseRowCpuMatrix12IndexDictPtrE" title="paddle::SparseRowCpuMatrix::IndexDictPtr">IndexDictPtr</a> &amp;<code class="descname">getIndexDictHandle</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle18SparseRowCpuMatrix18getIndexDictHandleEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrix12checkIndicesEv">
<span id="paddle::SparseRowCpuMatrix::checkIndices"></span><span class="target" id="paddleclasspaddle_1_1SparseRowCpuMatrix_1a392414d42c586bab4bda56f38a41b6c9"></span>void <code class="descname">checkIndices</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18SparseRowCpuMatrix12checkIndicesEv" title="Permalink to this definition">¶</a></dt>
<dd><p>check all local and global indices consistency </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrix10checkIndexE6size_t">
<span id="paddle::SparseRowCpuMatrix::checkIndex__s"></span><span class="target" id="paddleclasspaddle_1_1SparseRowCpuMatrix_1a891e015b6b4fc101894f5bda23adc170"></span>void <code class="descname">checkIndex</code><span class="sig-paren">(</span>size_t <em>i</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18SparseRowCpuMatrix10checkIndexE6size_t" title="Permalink to this definition">¶</a></dt>
<dd><p>check whether row <em>i</em> exist in indices </p>
</dd></dl>

<dl class="function">
5817 5818
<dt id="_CPPv2NK6paddle18SparseRowCpuMatrix15getLocalIndicesEv">
<span id="paddle::SparseRowCpuMatrix::getLocalIndicesC"></span><span class="target" id="paddleclasspaddle_1_1SparseRowCpuMatrix_1a733b636ac462220e59798c2ab706c218"></span>std::vector&lt;unsigned int&gt; &amp;<code class="descname">getLocalIndices</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle18SparseRowCpuMatrix15getLocalIndicesEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5819 5820 5821
<dd></dd></dl>

</div>
5822
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5823 5824 5825 5826 5827 5828 5829 5830 5831 5832 5833 5834 5835 5836 5837 5838 5839 5840 5841 5842 5843 5844 5845 5846 5847
<p class="breathe-sectiondef-title rubric">Protected Functions</p>
<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">typename</em> Func&gt;</dt>
<dt id="_CPPv2N6paddle18SparseRowCpuMatrix5applyE4Func">
<span id="paddle::SparseRowCpuMatrix::apply__Func"></span><span class="target" id="paddleclasspaddle_1_1SparseRowCpuMatrix_1a62115849d19e64feff8cd8a8be319364"></span>void <code class="descname">apply</code><span class="sig-paren">(</span>Func <em>f</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18SparseRowCpuMatrix5applyE4Func" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrix4initE6size_t6size_t">
<span id="paddle::SparseRowCpuMatrix::init__s.s"></span><span class="target" id="paddleclasspaddle_1_1SparseRowCpuMatrix_1a581d458132e287f0c18bbfb04675f3a1"></span>void <code class="descname">init</code><span class="sig-paren">(</span>size_t <em>height</em>, size_t <em>width</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18SparseRowCpuMatrix4initE6size_t6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrix9clearRowsEv">
<span id="paddle::SparseRowCpuMatrix::clearRows"></span><span class="target" id="paddleclasspaddle_1_1SparseRowCpuMatrix_1ae0c0aedd56aa34bf6fb0cc2e963cf1b8"></span>void <code class="descname">clearRows</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18SparseRowCpuMatrix9clearRowsEv" title="Permalink to this definition">¶</a></dt>
<dd><p>clear row indices. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrix14checkStoreSizeEv">
<span id="paddle::SparseRowCpuMatrix::checkStoreSize"></span><span class="target" id="paddleclasspaddle_1_1SparseRowCpuMatrix_1af3b73a964750c54b3f1d3059b2f91635"></span>void <code class="descname">checkStoreSize</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle18SparseRowCpuMatrix14checkStoreSizeEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
5848
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5849 5850 5851 5852 5853 5854 5855 5856 5857 5858 5859 5860 5861 5862 5863 5864 5865 5866 5867 5868 5869 5870 5871 5872 5873 5874 5875
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrix9storeMat_E">
<span id="paddle::SparseRowCpuMatrix::storeMat___CpuMatrix"></span><span class="target" id="paddleclasspaddle_1_1SparseRowCpuMatrix_1a4227c70d798cda037151679f564e8e58"></span><a class="reference internal" href="#_CPPv2N6paddle9CpuMatrixE" title="paddle::CpuMatrix">CpuMatrix</a> <code class="descname">storeMat_</code><a class="headerlink" href="#_CPPv2N6paddle18SparseRowCpuMatrix9storeMat_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrix9rowStore_E">
<span id="paddle::SparseRowCpuMatrix::rowStore___std::vector:real.AlignedAllocator:real.32::"></span><span class="target" id="paddleclasspaddle_1_1SparseRowCpuMatrix_1a9da2f5e26e29517e81c0e05801a968bc"></span>std::vector&lt;real, AlignedAllocator&lt;real, 32&gt;&gt; <code class="descname">rowStore_</code><a class="headerlink" href="#_CPPv2N6paddle18SparseRowCpuMatrix9rowStore_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrix16indexDictHandle_E">
<span id="paddle::SparseRowCpuMatrix::indexDictHandle___IndexDictPtr"></span><span class="target" id="paddleclasspaddle_1_1SparseRowCpuMatrix_1a0a039a6c03b9bdc538bd9f711e5bc748"></span><a class="reference internal" href="#_CPPv2N6paddle18SparseRowCpuMatrix12IndexDictPtrE" title="paddle::SparseRowCpuMatrix::IndexDictPtr">IndexDictPtr</a> <code class="descname">indexDictHandle_</code><a class="headerlink" href="#_CPPv2N6paddle18SparseRowCpuMatrix16indexDictHandle_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrix13localIndices_E">
<span id="paddle::SparseRowCpuMatrix::localIndices___std::vector:unsigned-i:P"></span><span class="target" id="paddleclasspaddle_1_1SparseRowCpuMatrix_1ae90f6199d1483bf8002f5eae1712a6c5"></span>std::vector&lt;unsigned int&gt; *<code class="descname">localIndices_</code><a class="headerlink" href="#_CPPv2N6paddle18SparseRowCpuMatrix13localIndices_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrix14globalIndices_E">
<span id="paddle::SparseRowCpuMatrix::globalIndices___unsigned-iP"></span><span class="target" id="paddleclasspaddle_1_1SparseRowCpuMatrix_1a64334f68216d9cb5899a1732f09e7706"></span>unsigned int *<code class="descname">globalIndices_</code><a class="headerlink" href="#_CPPv2N6paddle18SparseRowCpuMatrix14globalIndices_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
5876
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5877 5878 5879 5880 5881 5882 5883 5884 5885 5886
<p class="breathe-sectiondef-title rubric">Protected Static Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrix10kUnusedId_E">
<span id="paddle::SparseRowCpuMatrix::kUnusedId___unsigned-iC"></span><span class="target" id="paddleclasspaddle_1_1SparseRowCpuMatrix_1ab78959e61c55b784d66fff4d1f7c2eca"></span><em class="property">const</em> unsigned int <code class="descname">kUnusedId_</code><a class="headerlink" href="#_CPPv2N6paddle18SparseRowCpuMatrix10kUnusedId_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<dl class="class">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrix9IndexDictE">
<span id="paddle::SparseRowCpuMatrix::IndexDict"></span><span class="target" id="paddlestructpaddle_1_1SparseRowCpuMatrix_1_1IndexDict"></span><em class="property">struct </em><code class="descname">IndexDict</code><a class="headerlink" href="#_CPPv2N6paddle18SparseRowCpuMatrix9IndexDictE" title="Permalink to this definition">¶</a></dt>
5887
<dd><div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903
<p class="breathe-sectiondef-title rubric">Public Members</p>
<dl class="member">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrix9IndexDict12localIndicesE">
<span id="paddle::SparseRowCpuMatrix::IndexDict::localIndices__std::vector:unsigned-i:"></span><span class="target" id="paddlestructpaddle_1_1SparseRowCpuMatrix_1_1IndexDict_1ab32be323b5fdac1fd1a436b264f1c6d2"></span>std::vector&lt;unsigned int&gt; <code class="descname">localIndices</code><a class="headerlink" href="#_CPPv2N6paddle18SparseRowCpuMatrix9IndexDict12localIndicesE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrix9IndexDict13globalIndicesE">
<span id="paddle::SparseRowCpuMatrix::IndexDict::globalIndices__std::vector:unsigned-i:"></span><span class="target" id="paddlestructpaddle_1_1SparseRowCpuMatrix_1_1IndexDict_1a39f3d08d0b2f2bf8d8edab15ec181f5f"></span>std::vector&lt;unsigned int&gt; <code class="descname">globalIndices</code><a class="headerlink" href="#_CPPv2N6paddle18SparseRowCpuMatrix9IndexDict13globalIndicesE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</dd></dl>

5904 5905 5906 5907 5908
<dl class="class">
<dt id="_CPPv2N6paddle26SparsePrefetchRowCpuMatrixE">
<span id="paddle::SparsePrefetchRowCpuMatrix"></span><span class="target" id="paddleclasspaddle_1_1SparsePrefetchRowCpuMatrix"></span><em class="property">class </em><code class="descname">SparsePrefetchRowCpuMatrix</code><a class="headerlink" href="#_CPPv2N6paddle26SparsePrefetchRowCpuMatrixE" title="Permalink to this definition">¶</a></dt>
<dd><em>#include &lt;SparseRowMatrix.h&gt;</em><p>For prefetching parameters from remote <a class="reference internal" href="../../parameter/parameter/parameter.html#paddleclasspaddle_1_1Parameter"><span class="std std-ref">Parameter</span></a> server. </p>
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1SparseRowCpuMatrix"><span class="std std-ref">paddle::SparseRowCpuMatrix</span></a></p>
5909
<div class="breathe-sectiondef docutils container">
5910 5911 5912 5913 5914 5915 5916 5917 5918 5919 5920 5921 5922 5923 5924 5925 5926 5927 5928 5929 5930 5931 5932 5933 5934 5935
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle26SparsePrefetchRowCpuMatrix26SparsePrefetchRowCpuMatrixE15CpuMemHandlePtr6size_t6size_t12IndexDictPtrP14SyncThreadPoolb">
<span id="paddle::SparsePrefetchRowCpuMatrix::SparsePrefetchRowCpuMatrix__CpuMemHandlePtr.s.s.IndexDictPtr.SyncThreadPoolP.b"></span><span class="target" id="paddleclasspaddle_1_1SparsePrefetchRowCpuMatrix_1a31b930e8b2973911b69eacedd4073fbe"></span><code class="descname">SparsePrefetchRowCpuMatrix</code><span class="sig-paren">(</span><a class="reference internal" href="../utils/utils.html#_CPPv2N6paddle15CpuMemHandlePtrE" title="paddle::CpuMemHandlePtr">CpuMemHandlePtr</a> <em>dataHandle</em>, size_t <em>height</em>, size_t <em>width</em>, IndexDictPtr <em>indexDictHandle</em> = nullptr, <a class="reference internal" href="../../utils/lock.html#_CPPv2N6paddle14SyncThreadPoolE" title="paddle::SyncThreadPool">SyncThreadPool</a> *<em>pool</em> = nullptr, bool <em>trans</em> = false<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle26SparsePrefetchRowCpuMatrix26SparsePrefetchRowCpuMatrixE15CpuMemHandlePtr6size_t6size_t12IndexDictPtrP14SyncThreadPoolb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle26SparsePrefetchRowCpuMatrix7addRowsE9MatrixPtr">
<span id="paddle::SparsePrefetchRowCpuMatrix::addRows__MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1SparsePrefetchRowCpuMatrix_1abe3ef69b5bcab386aa790aa77d7090f0"></span>void <code class="descname">addRows</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>input</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle26SparsePrefetchRowCpuMatrix7addRowsE9MatrixPtr" title="Permalink to this definition">¶</a></dt>
<dd><p>Extract feature ids from <em>input</em>, to fill row indexs.</p>
<p><em>input</em> must be sparse matrix.</p>
<p>Can call many times before setup. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle26SparsePrefetchRowCpuMatrix7addRowsE10IVectorPtr">
<span id="paddle::SparsePrefetchRowCpuMatrix::addRows__IVectorPtr"></span><span class="target" id="paddleclasspaddle_1_1SparsePrefetchRowCpuMatrix_1a8f788926cd11c3d9ac4d78a2fc9b1dd8"></span>void <code class="descname">addRows</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle10IVectorPtrE" title="paddle::IVectorPtr">IVectorPtr</a> <em>ids</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle26SparsePrefetchRowCpuMatrix7addRowsE10IVectorPtr" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle26SparsePrefetchRowCpuMatrix12setupIndicesEv">
<span id="paddle::SparsePrefetchRowCpuMatrix::setupIndices"></span><span class="target" id="paddleclasspaddle_1_1SparsePrefetchRowCpuMatrix_1aed709cd048ccd0b09ea559d7d215de51"></span>void <code class="descname">setupIndices</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle26SparsePrefetchRowCpuMatrix12setupIndicesEv" title="Permalink to this definition">¶</a></dt>
<dd><p>setup global indices of SparseRowMatrix after finish add rows. </p>
</dd></dl>

</div>
5936
<div class="breathe-sectiondef docutils container">
5937 5938 5939 5940 5941 5942 5943
<p class="breathe-sectiondef-title rubric">Protected Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle26SparsePrefetchRowCpuMatrix7addRowsEPKj6size_t">
<span id="paddle::SparsePrefetchRowCpuMatrix::addRows__unsigned-iCP.s"></span><span class="target" id="paddleclasspaddle_1_1SparsePrefetchRowCpuMatrix_1aa3f5fb326dc347c8886c18eb4c6894cb"></span>void <code class="descname">addRows</code><span class="sig-paren">(</span><em class="property">const</em> unsigned int *<em>ids</em>, size_t <em>len</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle26SparsePrefetchRowCpuMatrix7addRowsEPKj6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
5944
<div class="breathe-sectiondef docutils container">
5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle26SparsePrefetchRowCpuMatrix5pool_E">
<span id="paddle::SparsePrefetchRowCpuMatrix::pool___SyncThreadPoolP"></span><span class="target" id="paddleclasspaddle_1_1SparsePrefetchRowCpuMatrix_1a1fa232633831ecf543efcdfd4a074162"></span><a class="reference internal" href="../../utils/lock.html#_CPPv2N6paddle14SyncThreadPoolE" title="paddle::SyncThreadPool">SyncThreadPool</a> *<code class="descname">pool_</code><a class="headerlink" href="#_CPPv2N6paddle26SparsePrefetchRowCpuMatrix5pool_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

<dl class="class">
<dt id="_CPPv2N6paddle26SparseAutoGrowRowCpuMatrixE">
<span id="paddle::SparseAutoGrowRowCpuMatrix"></span><span class="target" id="paddleclasspaddle_1_1SparseAutoGrowRowCpuMatrix"></span><em class="property">class </em><code class="descname">SparseAutoGrowRowCpuMatrix</code><a class="headerlink" href="#_CPPv2N6paddle26SparseAutoGrowRowCpuMatrixE" title="Permalink to this definition">¶</a></dt>
<dd><p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1SparseRowCpuMatrix"><span class="std std-ref">paddle::SparseRowCpuMatrix</span></a></p>
<p>Subclassed by <a class="reference internal" href="#paddleclasspaddle_1_1CacheRowCpuMatrix"><span class="std std-ref">paddle::CacheRowCpuMatrix</span></a></p>
5959
<div class="breathe-sectiondef docutils container">
5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle26SparseAutoGrowRowCpuMatrix26SparseAutoGrowRowCpuMatrixE6size_t6size_t12IndexDictPtrb">
<span id="paddle::SparseAutoGrowRowCpuMatrix::SparseAutoGrowRowCpuMatrix__s.s.IndexDictPtr.b"></span><span class="target" id="paddleclasspaddle_1_1SparseAutoGrowRowCpuMatrix_1ad855556f352d22cb3ae676ccc380e5af"></span><code class="descname">SparseAutoGrowRowCpuMatrix</code><span class="sig-paren">(</span>size_t <em>height</em>, size_t <em>width</em>, IndexDictPtr <em>indexDictHandle</em> = nullptr, bool <em>trans</em> = false<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle26SparseAutoGrowRowCpuMatrix26SparseAutoGrowRowCpuMatrixE6size_t6size_t12IndexDictPtrb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle26SparseAutoGrowRowCpuMatrix6getRowE6size_t">
<span id="paddle::SparseAutoGrowRowCpuMatrix::getRow__s"></span><span class="target" id="paddleclasspaddle_1_1SparseAutoGrowRowCpuMatrix_1a95031d1d32ccf1b1404778a804bee386"></span>real *<code class="descname">getRow</code><span class="sig-paren">(</span>size_t <em>row</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle26SparseAutoGrowRowCpuMatrix6getRowE6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle26SparseAutoGrowRowCpuMatrix9getRowBufE6size_t">
5973
<span id="paddle::SparseAutoGrowRowCpuMatrix::getRowBuf__s"></span><span class="target" id="paddleclasspaddle_1_1SparseAutoGrowRowCpuMatrix_1a4c751edebc02fcdecee78c74e310233c"></span><em class="property">virtual</em> real *<code class="descname">getRowBuf</code><span class="sig-paren">(</span>size_t <em>row</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle26SparseAutoGrowRowCpuMatrix9getRowBufE6size_t" title="Permalink to this definition">¶</a></dt>
5974 5975 5976 5977
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle26SparseAutoGrowRowCpuMatrix3mulEP15CpuSparseMatrixP9CpuMatrix4real4real">
5978
<span id="paddle::SparseAutoGrowRowCpuMatrix::mul__CpuSparseMatrixP.CpuMatrixP.real.real"></span><span class="target" id="paddleclasspaddle_1_1SparseAutoGrowRowCpuMatrix_1a19cf0de26cbcc36d41cce22e17812c17"></span>void <code class="descname">mul</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle15CpuSparseMatrixE" title="paddle::CpuSparseMatrix">CpuSparseMatrix</a> *<em>a</em>, <a class="reference internal" href="#_CPPv2N6paddle9CpuMatrixE" title="paddle::CpuMatrix">CpuMatrix</a> *<em>b</em>, real <em>scaleAB</em>, real <em>scaleT</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle26SparseAutoGrowRowCpuMatrix3mulEP15CpuSparseMatrixP9CpuMatrix4real4real" title="Permalink to this definition">¶</a></dt>
5979 5980 5981 5982 5983 5984 5985 5986 5987
<dd></dd></dl>

</div>
</dd></dl>

<dl class="class">
<dt id="_CPPv2N6paddle17CacheRowCpuMatrixE">
<span id="paddle::CacheRowCpuMatrix"></span><span class="target" id="paddleclasspaddle_1_1CacheRowCpuMatrix"></span><em class="property">class </em><code class="descname">CacheRowCpuMatrix</code><a class="headerlink" href="#_CPPv2N6paddle17CacheRowCpuMatrixE" title="Permalink to this definition">¶</a></dt>
<dd><p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1SparseAutoGrowRowCpuMatrix"><span class="std std-ref">paddle::SparseAutoGrowRowCpuMatrix</span></a></p>
5988
<div class="breathe-sectiondef docutils container">
5989 5990 5991 5992 5993 5994 5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle17CacheRowCpuMatrix17CacheRowCpuMatrixE6size_t6size_t12IndexDictPtrb">
<span id="paddle::CacheRowCpuMatrix::CacheRowCpuMatrix__s.s.IndexDictPtr.b"></span><span class="target" id="paddleclasspaddle_1_1CacheRowCpuMatrix_1a8d0f013eb468382050af016bf0c6793d"></span><code class="descname">CacheRowCpuMatrix</code><span class="sig-paren">(</span>size_t <em>height</em>, size_t <em>width</em>, IndexDictPtr <em>indexDictHandle</em> = nullptr, bool <em>trans</em> = false<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17CacheRowCpuMatrix17CacheRowCpuMatrixE6size_t6size_t12IndexDictPtrb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle17CacheRowCpuMatrix13setSourceDataE12CpuVectorPtr">
<span id="paddle::CacheRowCpuMatrix::setSourceData__CpuVectorPtr"></span><span class="target" id="paddleclasspaddle_1_1CacheRowCpuMatrix_1ad9ed0e1e1685c378e7706f20dd90c9e4"></span>void <code class="descname">setSourceData</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle12CpuVectorPtrE" title="paddle::CpuVectorPtr">CpuVectorPtr</a> <em>sourceVec</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17CacheRowCpuMatrix13setSourceDataE12CpuVectorPtr" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle17CacheRowCpuMatrix6getRowE6size_t">
<span id="paddle::CacheRowCpuMatrix::getRow__s"></span><span class="target" id="paddleclasspaddle_1_1CacheRowCpuMatrix_1a17775d9566b81059da97aba49d5ebac2"></span>real *<code class="descname">getRow</code><span class="sig-paren">(</span>size_t <em>row</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17CacheRowCpuMatrix6getRowE6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle17CacheRowCpuMatrix9getRowBufE6size_t">
6007
<span id="paddle::CacheRowCpuMatrix::getRowBuf__s"></span><span class="target" id="paddleclasspaddle_1_1CacheRowCpuMatrix_1a13c147d430388ec006190621c41d86cc"></span><em class="property">virtual</em> real *<code class="descname">getRowBuf</code><span class="sig-paren">(</span>size_t <em>row</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17CacheRowCpuMatrix9getRowBufE6size_t" title="Permalink to this definition">¶</a></dt>
6008 6009 6010 6011
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle17CacheRowCpuMatrix3mulEP15CpuSparseMatrixP9CpuMatrix4real4real">
6012
<span id="paddle::CacheRowCpuMatrix::mul__CpuSparseMatrixP.CpuMatrixP.real.real"></span><span class="target" id="paddleclasspaddle_1_1CacheRowCpuMatrix_1a34655a2c67d15b7450324b1af427962b"></span>void <code class="descname">mul</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle15CpuSparseMatrixE" title="paddle::CpuSparseMatrix">CpuSparseMatrix</a> *<em>a</em>, <a class="reference internal" href="#_CPPv2N6paddle9CpuMatrixE" title="paddle::CpuMatrix">CpuMatrix</a> *<em>b</em>, real <em>scaleAB</em>, real <em>scaleT</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle17CacheRowCpuMatrix3mulEP15CpuSparseMatrixP9CpuMatrix4real4real" title="Permalink to this definition">¶</a></dt>
6013 6014 6015
<dd></dd></dl>

</div>
6016
<div class="breathe-sectiondef docutils container">
6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030
<p class="breathe-sectiondef-title rubric">Public Members</p>
<dl class="member">
<dt id="_CPPv2N6paddle17CacheRowCpuMatrix14sourceDataVec_E">
<span id="paddle::CacheRowCpuMatrix::sourceDataVec___CpuVectorPtr"></span><span class="target" id="paddleclasspaddle_1_1CacheRowCpuMatrix_1ab1c99f90dbc677e2f76c0a86326efdff"></span><a class="reference internal" href="#_CPPv2N6paddle12CpuVectorPtrE" title="paddle::CpuVectorPtr">CpuVectorPtr</a> <code class="descname">sourceDataVec_</code><a class="headerlink" href="#_CPPv2N6paddle17CacheRowCpuMatrix14sourceDataVec_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle17CacheRowCpuMatrix11sourceData_E">
<span id="paddle::CacheRowCpuMatrix::sourceData___realP"></span><span class="target" id="paddleclasspaddle_1_1CacheRowCpuMatrix_1a317adcd99f2bae60fcc210b9d7cd16cc"></span>real *<code class="descname">sourceData_</code><a class="headerlink" href="#_CPPv2N6paddle17CacheRowCpuMatrix11sourceData_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

Y
Yu Yang 已提交
6031 6032 6033
<dl class="class">
<dt id="_CPPv2N6paddle21SparseRowIdsCpuMatrixE">
<span id="paddle::SparseRowIdsCpuMatrix"></span><span class="target" id="paddleclasspaddle_1_1SparseRowIdsCpuMatrix"></span><em class="property">class </em><code class="descname">SparseRowIdsCpuMatrix</code><a class="headerlink" href="#_CPPv2N6paddle21SparseRowIdsCpuMatrixE" title="Permalink to this definition">¶</a></dt>
6034 6035 6036
<dd><em>#include &lt;SparseRowMatrix.h&gt;</em><p>Sparse Row Ids <a class="reference internal" href="#paddleclasspaddle_1_1Matrix"><span class="std std-ref">Matrix</span></a>.</p>
<p>mostly same as <a class="reference internal" href="#paddleclasspaddle_1_1CpuMatrix"><span class="std std-ref">CpuMatrix</span></a>, but maintain sparse row ids occured, ids are hashed by worker thread id. </p>
<p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1CpuMatrix"><span class="std std-ref">paddle::CpuMatrix</span></a></p>
6037
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle21SparseRowIdsCpuMatrix21SparseRowIdsCpuMatrixE15CpuMemHandlePtr6size_t6size_tb">
<span id="paddle::SparseRowIdsCpuMatrix::SparseRowIdsCpuMatrix__CpuMemHandlePtr.s.s.b"></span><span class="target" id="paddleclasspaddle_1_1SparseRowIdsCpuMatrix_1a93e7fa5322d3552c57a758b96f619772"></span><code class="descname">SparseRowIdsCpuMatrix</code><span class="sig-paren">(</span><a class="reference internal" href="../utils/utils.html#_CPPv2N6paddle15CpuMemHandlePtrE" title="paddle::CpuMemHandlePtr">CpuMemHandlePtr</a> <em>dataHandle</em>, size_t <em>height</em>, size_t <em>width</em>, bool <em>trans</em> = false<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle21SparseRowIdsCpuMatrix21SparseRowIdsCpuMatrixE15CpuMemHandlePtr6size_t6size_tb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle21SparseRowIdsCpuMatrix15setNumOfThreadsE6size_t">
<span id="paddle::SparseRowIdsCpuMatrix::setNumOfThreads__s"></span><span class="target" id="paddleclasspaddle_1_1SparseRowIdsCpuMatrix_1a06b6e7291a273e2ff02586f9caf19536"></span>void <code class="descname">setNumOfThreads</code><span class="sig-paren">(</span>size_t <em>numOfThreads</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle21SparseRowIdsCpuMatrix15setNumOfThreadsE6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle21SparseRowIdsCpuMatrix6getIdsE6size_t">
<span id="paddle::SparseRowIdsCpuMatrix::getIds__s"></span><span class="target" id="paddleclasspaddle_1_1SparseRowIdsCpuMatrix_1a11eb280fb34159d2817498d908531cf9"></span>std::vector&lt;uint32_t&gt; &amp;<code class="descname">getIds</code><span class="sig-paren">(</span>size_t <em>threadId</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle21SparseRowIdsCpuMatrix6getIdsE6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
6055
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067
<p class="breathe-sectiondef-title rubric">Private Members</p>
<dl class="member">
<dt id="_CPPv2N6paddle21SparseRowIdsCpuMatrix9idsArray_E">
<span id="paddle::SparseRowIdsCpuMatrix::idsArray___std::vector:std::vector:uint32_t::"></span><span class="target" id="paddleclasspaddle_1_1SparseRowIdsCpuMatrix_1a270d82a33a8535514608ccb3b144ba20"></span>std::vector&lt;std::vector&lt;uint32_t&gt;&gt; <code class="descname">idsArray_</code><a class="headerlink" href="#_CPPv2N6paddle21SparseRowIdsCpuMatrix9idsArray_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</dd></dl>

<dl class="type">
6068 6069
<dt>
<span class="target" id="paddlenamespacepaddle"></span><em class="property">namespace </em><code class="descname">paddle</code></dt>
Y
Yu Yang 已提交
6070 6071 6072
<dd><dl class="class">
<dt id="_CPPv2N6paddle15CpuSparseMatrixE">
<span id="paddle::CpuSparseMatrix"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix"></span><em class="property">class </em><code class="descname">CpuSparseMatrix</code><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrixE" title="Permalink to this definition">¶</a></dt>
6073
<dd><p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Matrix"><span class="std std-ref">paddle::Matrix</span></a></p>
6074
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix15CpuSparseMatrixE6size_t6size_t6size_t15SparseValueType12SparseFormatb">
<span id="paddle::CpuSparseMatrix::CpuSparseMatrix__s.s.s.SparseValueType.SparseFormat.b"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a34acdf7baf6d264c0d5e1f0bbcb6804b"></span><code class="descname">CpuSparseMatrix</code><span class="sig-paren">(</span>size_t <em>height</em>, size_t <em>width</em>, size_t <em>nnz</em>, <a class="reference internal" href="#_CPPv2N6paddle15SparseValueTypeE" title="paddle::SparseValueType">SparseValueType</a> <em>valueType</em> = FLOAT_VALUE, <a class="reference internal" href="#_CPPv2N6paddle12SparseFormatE" title="paddle::SparseFormat">SparseFormat</a> <em>format</em> = SPARSE_CSR, bool <em>trans</em> = false<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix15CpuSparseMatrixE6size_t6size_t6size_t15SparseValueType12SparseFormatb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix15CpuSparseMatrixE15CpuMemHandlePtr6size_t6size_t6size_t15SparseValueType12SparseFormatb">
<span id="paddle::CpuSparseMatrix::CpuSparseMatrix__CpuMemHandlePtr.s.s.s.SparseValueType.SparseFormat.b"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a4a2f9e11e0637a541332716b1e01c0b3"></span><code class="descname">CpuSparseMatrix</code><span class="sig-paren">(</span><a class="reference internal" href="../utils/utils.html#_CPPv2N6paddle15CpuMemHandlePtrE" title="paddle::CpuMemHandlePtr">CpuMemHandlePtr</a> <em>memHandle</em>, size_t <em>height</em>, size_t <em>width</em>, size_t <em>nnz</em>, <a class="reference internal" href="#_CPPv2N6paddle15SparseValueTypeE" title="paddle::SparseValueType">SparseValueType</a> <em>valueType</em>, <a class="reference internal" href="#_CPPv2N6paddle12SparseFormatE" title="paddle::SparseFormat">SparseFormat</a> <em>format</em>, bool <em>trans</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix15CpuSparseMatrixE15CpuMemHandlePtr6size_t6size_t6size_t15SparseValueType12SparseFormatb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix15CpuSparseMatrixEP4realPiPi6size_t6size_t6size_t15SparseValueType12SparseFormatb">
<span id="paddle::CpuSparseMatrix::CpuSparseMatrix__realP.iP.iP.s.s.s.SparseValueType.SparseFormat.b"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a10ce5c299cc25ac621a30e2b30f5780b"></span><code class="descname">CpuSparseMatrix</code><span class="sig-paren">(</span>real *<em>data</em>, int *<em>rows</em>, int *<em>cols</em>, size_t <em>height</em>, size_t <em>width</em>, size_t <em>nnz</em>, <a class="reference internal" href="#_CPPv2N6paddle15SparseValueTypeE" title="paddle::SparseValueType">SparseValueType</a> <em>valueType</em>, <a class="reference internal" href="#_CPPv2N6paddle12SparseFormatE" title="paddle::SparseFormat">SparseFormat</a> <em>format</em>, bool <em>trans</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix15CpuSparseMatrixEP4realPiPi6size_t6size_t6size_t15SparseValueType12SparseFormatb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrixD0Ev">
<span id="paddle::CpuSparseMatrix::~CpuSparseMatrix"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a921f914ce090a1029d3235512b6795df"></span><code class="descname">~CpuSparseMatrix</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrixD0Ev" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix6resizeE6size_t6size_t6size_t15SparseValueType12SparseFormat">
6098
<span id="paddle::CpuSparseMatrix::resize__s.s.s.SparseValueType.SparseFormat"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a4155e77db1e544efb5662d85a93e2e8c"></span>void <code class="descname">resize</code><span class="sig-paren">(</span>size_t <em>newHeight</em>, size_t <em>newWidth</em>, size_t <em>newNnz</em>, <a class="reference internal" href="#_CPPv2N6paddle15SparseValueTypeE" title="paddle::SparseValueType">SparseValueType</a> <em>valueType</em>, <a class="reference internal" href="#_CPPv2N6paddle12SparseFormatE" title="paddle::SparseFormat">SparseFormat</a> <em>format</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix6resizeE6size_t6size_t6size_t15SparseValueType12SparseFormat" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6099 6100 6101 6102 6103 6104 6105 6106 6107
<dd><p><dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>This should only be used for sparse matrix. </dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix6resizeE6size_t6size_t">
6108
<span id="paddle::CpuSparseMatrix::resize__s.s"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a4399aed20faa28e3cfabf50bababe117"></span>void <code class="descname">resize</code><span class="sig-paren">(</span>size_t <em>newHeight</em>, size_t <em>newWidth</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix6resizeE6size_t6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6109 6110
<dd><p><dl class="docutils">
<dt><strong>Note</strong></dt>
6111
<dd>Original data may not be preserved after <a class="reference internal" href="#paddleclasspaddle_1_1CpuSparseMatrix_1a4155e77db1e544efb5662d85a93e2e8c"><span class="std std-ref">resize()</span></a>. </dd>
Y
Yu Yang 已提交
6112 6113 6114 6115 6116 6117
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix12getTransposeEv">
6118
<span id="paddle::CpuSparseMatrix::getTranspose"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1af870c958a401a45882b5806b19f58936"></span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">getTranspose</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix12getTransposeEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6119 6120 6121 6122 6123 6124 6125 6126
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix12getValueTypeEv">
<span id="paddle::CpuSparseMatrix::getValueType"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1aa0aacdf48cb004ede5a2f5f5310b9a25"></span><a class="reference internal" href="#_CPPv2N6paddle15SparseValueTypeE" title="paddle::SparseValueType">SparseValueType</a> <code class="descname">getValueType</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix12getValueTypeEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
6127 6128
<dt id="_CPPv2NK6paddle15CpuSparseMatrix12getRowValuesE6size_t">
<span id="paddle::CpuSparseMatrix::getRowValues__sC"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a3083eb4f2e49b7d1e31c7da731c8066c"></span>real *<code class="descname">getRowValues</code><span class="sig-paren">(</span>size_t <em>i</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle15CpuSparseMatrix12getRowValuesE6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6129 6130 6131
<dd></dd></dl>

<dl class="function">
6132 6133
<dt id="_CPPv2NK6paddle15CpuSparseMatrix10getRowColsE6size_t">
<span id="paddle::CpuSparseMatrix::getRowCols__sC"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a3ada8e67bf3254c092106e141ac970e7"></span>int *<code class="descname">getRowCols</code><span class="sig-paren">(</span>size_t <em>i</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle15CpuSparseMatrix10getRowColsE6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6134 6135 6136
<dd></dd></dl>

<dl class="function">
6137 6138
<dt id="_CPPv2NK6paddle15CpuSparseMatrix14fillRowIndicesER10IVectorPtr">
<span id="paddle::CpuSparseMatrix::fillRowIndices__IVectorPtrRC"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1ab2d919b6fcee3c76682318d7f93d006d"></span>void <code class="descname">fillRowIndices</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle10IVectorPtrE" title="paddle::IVectorPtr">IVectorPtr</a> &amp;<em>outVec</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle15CpuSparseMatrix14fillRowIndicesER10IVectorPtr" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6139 6140 6141 6142
<dd><p>fill row indices of each value in CSR matrix </p>
</dd></dl>

<dl class="function">
6143 6144
<dt id="_CPPv2NK6paddle15CpuSparseMatrix9getColNumE6size_t">
<span id="paddle::CpuSparseMatrix::getColNum__sC"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a95ad74d50a9f242b3aa31af2632ac561"></span>size_t <code class="descname">getColNum</code><span class="sig-paren">(</span>size_t <em>i</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle15CpuSparseMatrix9getColNumE6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6145 6146 6147
<dd></dd></dl>

<dl class="function">
6148 6149
<dt id="_CPPv2NK6paddle15CpuSparseMatrix9getColumnE6size_t">
<span id="paddle::CpuSparseMatrix::getColumn__sC"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a5f3e4adaa2a67383ffda30662001e124"></span>real *<code class="descname">getColumn</code><span class="sig-paren">(</span>size_t <em>i</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle15CpuSparseMatrix9getColumnE6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6150 6151 6152
<dd></dd></dl>

<dl class="function">
6153 6154
<dt id="_CPPv2NK6paddle15CpuSparseMatrix14getColStartIdxE6size_t">
<span id="paddle::CpuSparseMatrix::getColStartIdx__sC"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a9443be7291f420c9587ee2b25f705a5e"></span>size_t <code class="descname">getColStartIdx</code><span class="sig-paren">(</span>size_t <em>i</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle15CpuSparseMatrix14getColStartIdxE6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6155 6156 6157
<dd></dd></dl>

<dl class="function">
6158 6159
<dt id="_CPPv2NK6paddle15CpuSparseMatrix14getRowStartIdxE6size_t">
<span id="paddle::CpuSparseMatrix::getRowStartIdx__sC"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a970fae1acadaefb87203d1d938991b21"></span>size_t <code class="descname">getRowStartIdx</code><span class="sig-paren">(</span>size_t <em>i</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle15CpuSparseMatrix14getRowStartIdxE6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6160 6161 6162
<dd></dd></dl>

<dl class="function">
6163 6164
<dt id="_CPPv2NK6paddle15CpuSparseMatrix9getRowNumE6size_t">
<span id="paddle::CpuSparseMatrix::getRowNum__sC"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a40eba9cb5c42db3f01afdc2e84991a65"></span>size_t <code class="descname">getRowNum</code><span class="sig-paren">(</span>size_t <em>i</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle15CpuSparseMatrix9getRowNumE6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6165 6166 6167 6168
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix6getSumEv">
6169
<span id="paddle::CpuSparseMatrix::getSum"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a2a557ad9526c1ac460b43749cc174d0d"></span><em class="property">virtual</em> real <code class="descname">getSum</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix6getSumEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6170 6171 6172 6173
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix6squareEv">
6174
<span id="paddle::CpuSparseMatrix::square"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1aa79f4339a4162390433ac7511e1fcc4e"></span><em class="property">virtual</em> void <code class="descname">square</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix6squareEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6175 6176 6177 6178
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix6getMinEv">
6179
<span id="paddle::CpuSparseMatrix::getMin"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a2a8dbf7bedfddfc38dde95be012ac2a9"></span><em class="property">virtual</em> real <code class="descname">getMin</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix6getMinEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6180 6181 6182 6183 6184
<dd><p>only consider nonzero values. the actual min value should compare with 0.0. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix6getMaxEv">
6185
<span id="paddle::CpuSparseMatrix::getMax"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1af98c7d0712911dbe273b53ba76b43277"></span><em class="property">virtual</em> real <code class="descname">getMax</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix6getMaxEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6186 6187 6188 6189 6190
<dd><p>only consider nonzero values. the actual max value should compare with 0.0. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix6rowMaxER7IVectorR6Matrix">
6191
<span id="paddle::CpuSparseMatrix::rowMax__IVectorR.MatrixR"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a7724e18286ae958b8c5709f075cf6dc0"></span>void <code class="descname">rowMax</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>maxIds</em>, <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>max</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix6rowMaxER7IVectorR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6192
<dd><p>Get the top k elements of each row of this matrix. </p>
6193
<p>The column ids and values of these elements are stored in maxIds and max respectively. where k is the size of maxIds. And note that the top k elements are not sorted. </p>
Y
Yu Yang 已提交
6194 6195 6196
</dd></dl>

<dl class="function">
6197 6198
<dt id="_CPPv2NK6paddle15CpuSparseMatrix7getRowsEv">
<span id="paddle::CpuSparseMatrix::getRowsC"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a740b1c167012e7b6a9b81eb923151673"></span>int *<code class="descname">getRows</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle15CpuSparseMatrix7getRowsEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6199 6200 6201
<dd></dd></dl>

<dl class="function">
6202 6203
<dt id="_CPPv2NK6paddle15CpuSparseMatrix7getColsEv">
<span id="paddle::CpuSparseMatrix::getColsC"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a9c3792852b2df93555942b4bb2ac0fb4"></span>int *<code class="descname">getCols</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle15CpuSparseMatrix7getColsEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6204 6205 6206
<dd></dd></dl>

<dl class="function">
6207 6208
<dt id="_CPPv2NK6paddle15CpuSparseMatrix8getValueEv">
<span id="paddle::CpuSparseMatrix::getValueC"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a40f69430208a0e46e93b18ac3cfc2e2c"></span>real *<code class="descname">getValue</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle15CpuSparseMatrix8getValueEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6209 6210 6211
<dd></dd></dl>

<dl class="function">
6212 6213
<dt id="_CPPv2NK6paddle15CpuSparseMatrix9getFormatEv">
<span id="paddle::CpuSparseMatrix::getFormatC"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a526078f5d43f68348a0d141af9177ada"></span><a class="reference internal" href="#_CPPv2N6paddle12SparseFormatE" title="paddle::SparseFormat">SparseFormat</a> <code class="descname">getFormat</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle15CpuSparseMatrix9getFormatEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6214 6215 6216
<dd></dd></dl>

<dl class="function">
6217 6218
<dt id="_CPPv2NK6paddle15CpuSparseMatrix12getValueTypeEv">
<span id="paddle::CpuSparseMatrix::getValueTypeC"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1afe9fd0a7068cd3f1059a00cce3921f8e"></span><a class="reference internal" href="#_CPPv2N6paddle15SparseValueTypeE" title="paddle::SparseValueType">SparseValueType</a> <code class="descname">getValueType</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle15CpuSparseMatrix12getValueTypeEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6219 6220 6221 6222
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix7getDataEv">
6223
<span id="paddle::CpuSparseMatrix::getData"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a81369a4079e250485999656878f19eed"></span>real *<code class="descname">getData</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix7getDataEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6224
<dd><p>return value_ of sparse matrix </p>
6225
<p>Some times <a class="reference internal" href="#paddleclasspaddle_1_1CpuSparseMatrix"><span class="std std-ref">CpuSparseMatrix</span></a> maybe <a class="reference internal" href="#paddleclasspaddle_1_1Matrix"><span class="std std-ref">Matrix</span></a>, if getValue, must dynamic_cast to <a class="reference internal" href="#paddleclasspaddle_1_1CpuSparseMatrix"><span class="std std-ref">CpuSparseMatrix</span></a>, getData is convenient to get value </p>
Y
Yu Yang 已提交
6226 6227 6228
</dd></dl>

<dl class="function">
6229 6230
<dt id="_CPPv2NK6paddle15CpuSparseMatrix7getDataEv">
<span id="paddle::CpuSparseMatrix::getDataC"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a96a25527f84aa2f7fe753270fa90caa3"></span><em class="property">const</em> real *<code class="descname">getData</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle15CpuSparseMatrix7getDataEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6231 6232 6233 6234
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix7zeroMemEv">
6235
<span id="paddle::CpuSparseMatrix::zeroMem"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a04c3c1e00dca85bb2f9a796128b97751"></span>void <code class="descname">zeroMem</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix7zeroMemEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6236 6237 6238 6239 6240
<dd><p>only set value_ of FLOAT_VALUE sparse matrix to zero </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix9transposeE9MatrixPtrb">
6241
<span id="paddle::CpuSparseMatrix::transpose__MatrixPtr.b"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1af4a5c907cd779bbf0ab4fce7ff260be7"></span>void <code class="descname">transpose</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>matTrans</em>, bool <em>memAlloc</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix9transposeE9MatrixPtrb" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6242 6243 6244 6245 6246
<dd><p>mem MUST be alloced outside (memAlloc=false) </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix3mulE9MatrixPtr9MatrixPtr4real4real">
6247 6248
<span id="paddle::CpuSparseMatrix::mul__MatrixPtr.MatrixPtr.real.real"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a7bb8e17a7720d254cba7329647a7bab0"></span>void <code class="descname">mul</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>a</em>, <a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>b</em>, real <em>scaleAB</em>, real <em>scaleT</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix3mulE9MatrixPtr9MatrixPtr4real4real" title="Permalink to this definition">¶</a></dt>
<dd><p><div class="highlight-default"><div class="highlight"><pre><span></span><span class="n">this</span> <span class="o">=</span> <span class="n">scaleAB</span><span class="o">*</span><span class="p">(</span><span class="n">a</span><span class="o">*</span><span class="n">b</span><span class="p">)</span> <span class="o">+</span> <span class="n">scaleT</span><span class="o">*</span><span class="n">this</span>
Y
Yu Yang 已提交
6249 6250
</pre></div>
</div>
6251
 </p>
Y
Yu Yang 已提交
6252 6253 6254 6255 6256 6257 6258 6259 6260 6261
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix4add3EP9CpuMatrix">
<span id="paddle::CpuSparseMatrix::add3__CpuMatrixP"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1af3c68b84c45c406efcb37a5504f4d772"></span>void <code class="descname">add3</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle9CpuMatrixE" title="paddle::CpuMatrix">CpuMatrix</a> *<em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix4add3EP9CpuMatrix" title="Permalink to this definition">¶</a></dt>
<dd><p>sparseMatrix += denseMatrix </p>
<p>Named add3 just because add/add2 has been used in BaseMatrix.cu and they are not virtual function.</p>
<p>Only add value of same (row, col) index in dense matrix and do not use others values whoes postions are not in sparse matirx.</p>
<p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
6262 6263
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">b</span></code>: dense matrix </li>
Y
Yu Yang 已提交
6264 6265 6266 6267 6268 6269 6270 6271
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix4add3E9MatrixPtr">
6272
<span id="paddle::CpuSparseMatrix::add3__MatrixPtr"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a11707e0ef4f48f85cfcaafae20e1a9e1"></span>void <code class="descname">add3</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <em>b</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix4add3E9MatrixPtr" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6273 6274 6275 6276 6277 6278
<dd><p>matrix elment-wise add </p>
<p>Named add3 just because add/add2 has been used in BaseMatrix.cu and they are not virtual function. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix7addBiasER6Matrix4real">
6279
<span id="paddle::CpuSparseMatrix::addBias__MatrixR.real"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1aa5d2698a3c2cfa8bc8dd4f5923cd718a"></span>void <code class="descname">addBias</code><span class="sig-paren">(</span><a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>b</em>, real <em>scale</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix7addBiasER6Matrix4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6280 6281 6282
<dd><p>sparseMatrix[i,j] += bias[j], (j is the col index of sparse matrix) </p>
<p><dl class="docutils">
<dt><strong>Parameters</strong></dt>
6283 6284 6285
<dd><ul class="breatheparameterlist first last simple">
<li><code class="docutils literal"><span class="pre">b</span></code>: bias, dense matrix and height = 1 </li>
<li><code class="docutils literal"><span class="pre">scale</span></code>: scale of b </li>
Y
Yu Yang 已提交
6286 6287 6288 6289 6290 6291 6292
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
6293 6294
<dt id="_CPPv2NK6paddle15CpuSparseMatrix5printERNSt7ostreamE">
<span id="paddle::CpuSparseMatrix::print__osRC"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a0da9246e3ca83bb64059ee92cb1e96e6"></span>void <code class="descname">print</code><span class="sig-paren">(</span>std::ostream &amp;<em>os</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle15CpuSparseMatrix5printERNSt7ostreamE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6295 6296 6297 6298
<dd><p>print out the values of elements to os </p>
</dd></dl>

<dl class="function">
6299 6300
<dt id="_CPPv2NK6paddle15CpuSparseMatrix11printOneRowERNSt7ostreamE6size_t">
<span id="paddle::CpuSparseMatrix::printOneRow__osR.sC"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1acc9861a28037a85118ec694eb9431e73"></span>void <code class="descname">printOneRow</code><span class="sig-paren">(</span>std::ostream &amp;<em>os</em>, size_t <em>idx</em><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle15CpuSparseMatrix11printOneRowERNSt7ostreamE6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6301 6302 6303 6304 6305
<dd><p>print one row to os </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix6setRowE6size_t6size_tPKjPK4real">
6306
<span id="paddle::CpuSparseMatrix::setRow__s.s.unsigned-iCP.realCP"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a8945025ca56f9a4734a159549caae969"></span>void <code class="descname">setRow</code><span class="sig-paren">(</span>size_t <em>row</em>, size_t <em>colNum</em>, <em class="property">const</em> unsigned int *<em>cols</em>, <em class="property">const</em> real *<em>values</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix6setRowE6size_t6size_tPKjPK4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6307 6308 6309 6310 6311 6312
<dd><p>This should only be used for sparse matrix. </p>
<p>Currently must be called for each row in order. The matrix is not valid until setRow is called for the last row. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix16randomizeUniformEv">
6313
<span id="paddle::CpuSparseMatrix::randomizeUniform"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a06b9c755fb3cedb385c3f0fffc7b7c6e"></span>void <code class="descname">randomizeUniform</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix16randomizeUniformEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6314 6315 6316 6317 6318 6319 6320 6321 6322
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix8copyFromERK15GpuSparseMatrix11hl_stream_t">
<span id="paddle::CpuSparseMatrix::copyFrom__GpuSparseMatrixCR.hl_stream_t"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a0391d9c29a182a33420ad1ba07bac192"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle15GpuSparseMatrixE" title="paddle::GpuSparseMatrix">GpuSparseMatrix</a> &amp;<em>src</em>, <a class="reference internal" href="../../cuda/utils/utils.html#_CPPv211hl_stream_t" title="hl_stream_t">hl_stream_t</a> <em>stream</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix8copyFromERK15GpuSparseMatrix11hl_stream_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix8copyFromERK6Matrix11hl_stream_t">
6323
<span id="paddle::CpuSparseMatrix::copyFrom__MatrixCR.hl_stream_t"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a552c0980b4be03088b68d0f58bddb055"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>src</em>, <a class="reference internal" href="../../cuda/utils/utils.html#_CPPv211hl_stream_t" title="hl_stream_t">hl_stream_t</a> <em>stream</em> = HPPL_STREAM_DEFAULT<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix8copyFromERK6Matrix11hl_stream_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6324 6325 6326 6327
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix8copyFromERK6Matrix">
6328
<span id="paddle::CpuSparseMatrix::copyFrom__MatrixCR"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a7615d66b703ce37fa708c2d503213557"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle6MatrixE" title="paddle::Matrix">Matrix</a> &amp;<em>src</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix8copyFromERK6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix18getTmpSparseMatrixE6size_t6size_t">
<span id="paddle::CpuSparseMatrix::getTmpSparseMatrix__s.s"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a50c4a6cbd1fb7f2863360c5982da5b0c"></span><a class="reference internal" href="#_CPPv2N6paddle18CpuSparseMatrixPtrE" title="paddle::CpuSparseMatrixPtr">CpuSparseMatrixPtr</a> <code class="descname">getTmpSparseMatrix</code><span class="sig-paren">(</span>size_t <em>height</em>, size_t <em>width</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix18getTmpSparseMatrixE6size_t6size_t" title="Permalink to this definition">¶</a></dt>
<dd><p>Get a temporary matrix. This is threadsafe. It should be only used temporarily, i.e. do not store it or use it as return value.</p>
<p><dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>Do NOT use large amount of tmp matrix. </dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix9subMatrixE6size_t6size_t">
6344
<span id="paddle::CpuSparseMatrix::subMatrix__s.s"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a7a516151eec3c79aa79724194c1eecc1"></span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">subMatrix</code><span class="sig-paren">(</span>size_t <em>startRow</em>, size_t <em>numRows</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix9subMatrixE6size_t6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix8copyFromERNSt6vectorIiEERNSt6vectorIiEERNSt6vectorI4realEE">
<span id="paddle::CpuSparseMatrix::copyFrom__std::vector:i:R.std::vector:i:R.std::vector:real:R"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a0957f35621ee61ddb611def10702e162"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span>std::vector&lt;int&gt; &amp;<em>rows</em>, std::vector&lt;int&gt; &amp;<em>cols</em>, std::vector&lt;real&gt; &amp;<em>values</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix8copyFromERNSt6vectorIiEERNSt6vectorIiEERNSt6vectorI4realEE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix8copyFromERK9CpuMatrix">
<span id="paddle::CpuSparseMatrix::copyFrom__CpuMatrixCR"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a3360c064f510d5b47735bcb3bf17ea10"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle9CpuMatrixE" title="paddle::CpuMatrix">CpuMatrix</a> &amp;<em>src</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix8copyFromERK9CpuMatrix" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix8copyFromERK15CpuSparseMatrix">
6359
<span id="paddle::CpuSparseMatrix::copyFrom__CpuSparseMatrixCR"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a0941a8937fd7fe62e465b5a1f71fdb62"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle15CpuSparseMatrixE" title="paddle::CpuSparseMatrix">CpuSparseMatrix</a> &amp;<em>src</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix8copyFromERK15CpuSparseMatrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6360 6361 6362 6363
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix8trimFromERK15CpuSparseMatrix">
6364
<span id="paddle::CpuSparseMatrix::trimFrom__CpuSparseMatrixCR"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1af3688f62fa2a922f4f3d18c29ff58c6f"></span>void <code class="descname">trimFrom</code><span class="sig-paren">(</span><em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle15CpuSparseMatrixE" title="paddle::CpuSparseMatrix">CpuSparseMatrix</a> &amp;<em>src</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix8trimFromERK15CpuSparseMatrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6365 6366 6367 6368 6369 6370 6371 6372 6373 6374 6375 6376 6377 6378 6379 6380 6381 6382 6383 6384 6385 6386 6387 6388 6389 6390 6391 6392
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix7copyRowEi6size_tPK18sparse_non_value_t">
<span id="paddle::CpuSparseMatrix::copyRow__i.s.sparse_non_value_tCP"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a908aecaef1af80d9dd45a9021efd075e"></span>void <code class="descname">copyRow</code><span class="sig-paren">(</span>int <em>offsets</em>, size_t <em>colNum</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle18sparse_non_value_tE" title="paddle::sparse_non_value_t">sparse_non_value_t</a> *<em>row</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix7copyRowEi6size_tPK18sparse_non_value_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix7copyRowEi6size_tPK20sparse_float_value_t">
<span id="paddle::CpuSparseMatrix::copyRow__i.s.sparse_float_value_tCP"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1add6f5a7a848b674e35d4d9d8f92ba469"></span>void <code class="descname">copyRow</code><span class="sig-paren">(</span>int <em>offsets</em>, size_t <em>colNum</em>, <em class="property">const</em> <a class="reference internal" href="#_CPPv2N6paddle20sparse_float_value_tE" title="paddle::sparse_float_value_t">sparse_float_value_t</a> *<em>row</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix7copyRowEi6size_tPK20sparse_float_value_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> T&gt;</dt>
<dt id="_CPPv2N6paddle15CpuSparseMatrix8copyFromEP7int64_tP7int64_tP1T">
<span id="paddle::CpuSparseMatrix::copyFrom__int64_tP.int64_tP.TP"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a0e2b9279f0f81e3170758b471abc0cd7"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span>int64_t *<em>ids</em>, int64_t *<em>indices</em>, T *<em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix8copyFromEP7int64_tP7int64_tP1T" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> T&gt;</dt>
<dt id="_CPPv2N6paddle15CpuSparseMatrix8copyFromEP7int64_tP1T">
<span id="paddle::CpuSparseMatrix::copyFrom__int64_tP.TP"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a792eab9a97d18ae12fa9ed8374775d5f"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span>int64_t *<em>indices</em>, T *<em>data</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix8copyFromEP7int64_tP1T" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix8copyFromEPK4real6size_t">
6393
<span id="paddle::CpuSparseMatrix::copyFrom__realCP.s"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a70dac0c9df2b97ff061d790b50309a9b"></span>void <code class="descname">copyFrom</code><span class="sig-paren">(</span><em class="property">const</em> real *<em>src</em>, size_t <em>size</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix8copyFromEPK4real6size_t" title="Permalink to this definition">¶</a></dt>
6394 6395
<dd><p>If this is <a class="reference internal" href="#paddleclasspaddle_1_1GpuMatrix"><span class="std std-ref">GpuMatrix</span></a>, src is assumed to be CPU memory</p>
<p>If this is <a class="reference internal" href="#paddleclasspaddle_1_1CpuMatrix"><span class="std std-ref">CpuMatrix</span></a>, src is assumed to be CPU memory </p>
Y
Yu Yang 已提交
6396 6397 6398
</dd></dl>

<dl class="function">
6399 6400
<dt id="_CPPv2NK6paddle15CpuSparseMatrix8isSparseEv">
<span id="paddle::CpuSparseMatrix::isSparseC"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a13b4d5c8fbd8bc919c6ce1f6382917b2"></span>bool <code class="descname">isSparse</code><span class="sig-paren">(</span><span class="sig-paren">)</span> <em class="property">const</em><a class="headerlink" href="#_CPPv2NK6paddle15CpuSparseMatrix8isSparseEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
6401 6402 6403
<dd></dd></dl>

</div>
6404
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6405 6406 6407 6408 6409 6410 6411
<p class="breathe-sectiondef-title rubric">Protected Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix12sparseResizeEv">
<span id="paddle::CpuSparseMatrix::sparseResize"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1abb118160dfc56624645def85051bd974"></span>void <code class="descname">sparseResize</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix12sparseResizeEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
6412
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6413 6414 6415 6416 6417 6418 6419 6420 6421 6422 6423 6424 6425 6426 6427 6428 6429 6430 6431 6432 6433 6434 6435 6436 6437 6438 6439
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle15CpuSparseMatrix5rows_E">
<span id="paddle::CpuSparseMatrix::rows___iP"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1ac04b5da421706ebdba88e3543d6b3698"></span>int *<code class="descname">rows_</code><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix5rows_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle15CpuSparseMatrix5cols_E">
<span id="paddle::CpuSparseMatrix::cols___iP"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a8e4eed1d684ffa99595a47a7db0dcfd3"></span>int *<code class="descname">cols_</code><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix5cols_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle15CpuSparseMatrix6value_E">
<span id="paddle::CpuSparseMatrix::value___realP"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a285658d190386227e3cb8748a323708c"></span>real *<code class="descname">value_</code><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix6value_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle15CpuSparseMatrix7format_E">
<span id="paddle::CpuSparseMatrix::format___SparseFormat"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a8096f20e3993e7999f204bdf7c778cc4"></span><a class="reference internal" href="#_CPPv2N6paddle12SparseFormatE" title="paddle::SparseFormat">SparseFormat</a> <code class="descname">format_</code><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix7format_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle15CpuSparseMatrix10valueType_E">
<span id="paddle::CpuSparseMatrix::valueType___SparseValueType"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a19e3447f2939f240e10b815d85523907"></span><a class="reference internal" href="#_CPPv2N6paddle15SparseValueTypeE" title="paddle::SparseValueType">SparseValueType</a> <code class="descname">valueType_</code><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix10valueType_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
6440
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6441 6442 6443 6444 6445 6446 6447 6448 6449 6450 6451 6452
<p class="breathe-sectiondef-title rubric">Protected Static Attributes</p>
<dl class="member">
<dt id="_CPPv2N6paddle15CpuSparseMatrix17DEFAULT_AVG_WIDTHE">
<span id="paddle::CpuSparseMatrix::DEFAULT_AVG_WIDTH__sC"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a8f1ccf9b26003c1e8d5c44b60338a45a"></span><em class="property">const</em> size_t <code class="descname">DEFAULT_AVG_WIDTH</code><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix17DEFAULT_AVG_WIDTHE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="member">
<dt id="_CPPv2N6paddle15CpuSparseMatrix13cpuLocalMats_E">
<span id="paddle::CpuSparseMatrix::cpuLocalMats___ThreadLocal:std::vector:CpuSparseMatrixPtr::"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a30ae6b9563011641e4ea5d2f0880aeda"></span>ThreadLocal&lt;std::vector&lt;<a class="reference internal" href="#_CPPv2N6paddle18CpuSparseMatrixPtrE" title="paddle::CpuSparseMatrixPtr">CpuSparseMatrixPtr</a>&gt;&gt; <code class="descname">cpuLocalMats_</code><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix13cpuLocalMats_E" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
6453
<div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6454 6455 6456
<p class="breathe-sectiondef-title rubric">Private Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix5cloneE6size_t6size_tb">
6457
<span id="paddle::CpuSparseMatrix::clone__s.s.b"></span><span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a3f3c3b23911a8f7c242d874ac3117664"></span><a class="reference internal" href="#_CPPv2N6paddle9MatrixPtrE" title="paddle::MatrixPtr">MatrixPtr</a> <code class="descname">clone</code><span class="sig-paren">(</span>size_t <em>height</em> = 0, size_t <em>width</em> = 0, bool <em>useGpu</em> = false<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix5cloneE6size_t6size_tb" title="Permalink to this definition">¶</a></dt>
6458
<dd><p>Create a matrix with the same type (<a class="reference internal" href="#paddleclasspaddle_1_1GpuMatrix"><span class="std std-ref">GpuMatrix</span></a>, <a class="reference internal" href="#paddleclasspaddle_1_1CpuMatrix"><span class="std std-ref">CpuMatrix</span></a>, NonValueSparseMatrix, etc.) as this. </p>
Y
Yu Yang 已提交
6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469 6470
<p>If height and width is zero, the new matrix will have the same size as this, otherwise the new matrix will have the specified size. </p>
</dd></dl>

</div>
</dd></dl>

</dd></dl>

</div>
<div class="section" id="others">
<h2>Others<a class="headerlink" href="#others" title="Permalink to this headline">¶</a></h2>
<dl class="type">
6471 6472
<dt>
<span class="target" id="paddlenamespacepaddle"></span><em class="property">namespace </em><code class="descname">paddle</code></dt>
6473
<dd><div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6474 6475 6476 6477 6478 6479 6480 6481
<p class="breathe-sectiondef-title rubric">Functions</p>
<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> T&gt;</dt>
<dt id="_CPPv2N6paddle4gemmEK15CBLAS_TRANSPOSEK15CBLAS_TRANSPOSEKiKiKiK1TPK1TKiPK1TKiK1TP1TKi">
<span id="paddle::gemm__CBLAS_TRANSPOSEC.CBLAS_TRANSPOSEC.iC.iC.iC.TC.TCP.iC.TCP.iC.TC.TP.iC"></span><span class="target" id="paddlenamespacepaddle_1ad2c1982361eb54e4cddd694a3c8bf743"></span>void <code class="descname">gemm</code><span class="sig-paren">(</span><em class="property">const</em> CBLAS_TRANSPOSE <em>transA</em>, <em class="property">const</em> CBLAS_TRANSPOSE <em>transB</em>, <em class="property">const</em> int <em>M</em>, <em class="property">const</em> int <em>N</em>, <em class="property">const</em> int <em>K</em>, <em class="property">const</em> T <em>alpha</em>, <em class="property">const</em> T *<em>A</em>, <em class="property">const</em> int <em>lda</em>, <em class="property">const</em> T *<em>B</em>, <em class="property">const</em> int <em>ldb</em>, <em class="property">const</em> T <em>beta</em>, T *<em>C</em>, <em class="property">const</em> int <em>ldc</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle4gemmEK15CBLAS_TRANSPOSEK15CBLAS_TRANSPOSEKiKiKiK1TPK1TKiPK1TKiK1TP1TKi" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

6482 6483 6484 6485 6486 6487 6488 6489 6490 6491 6492 6493 6494 6495
<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> T&gt;</dt>
<dt id="_CPPv2N6paddle5getrfEK11CBLAS_ORDERKiKiP1TKiPi">
<span id="paddle::getrf__CBLAS_ORDERC.iC.iC.TP.iC.iP"></span><span class="target" id="paddlenamespacepaddle_1a3a3055f043013222f46d69ce84703e82"></span>int <code class="descname">getrf</code><span class="sig-paren">(</span><em class="property">const</em> CBLAS_ORDER <em>Order</em>, <em class="property">const</em> int <em>M</em>, <em class="property">const</em> int <em>N</em>, T *<em>A</em>, <em class="property">const</em> int <em>lda</em>, int *<em>ipiv</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5getrfEK11CBLAS_ORDERKiKiP1TKiPi" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> T&gt;</dt>
<dt id="_CPPv2N6paddle5getriEK11CBLAS_ORDERKiP1TKiPKi">
<span id="paddle::getri__CBLAS_ORDERC.iC.TP.iC.iCP"></span><span class="target" id="paddlenamespacepaddle_1a3f9e4c4f49bf33e52bc9ff29681cc5cd"></span>int <code class="descname">getri</code><span class="sig-paren">(</span><em class="property">const</em> CBLAS_ORDER <em>Order</em>, <em class="property">const</em> int <em>N</em>, T *<em>A</em>, <em class="property">const</em> int <em>lda</em>, <em class="property">const</em> int *<em>ipiv</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle5getriEK11CBLAS_ORDERKiP1TKiPKi" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

Y
Yu Yang 已提交
6496 6497 6498 6499 6500 6501 6502 6503 6504 6505 6506 6507 6508 6509 6510 6511 6512 6513
<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> T&gt;</dt>
<dt id="_CPPv2N6paddle4axpyEKiK1TPK1TP1T">
<span id="paddle::axpy__iC.TC.TCP.TP"></span><span class="target" id="paddlenamespacepaddle_1a48332b1002e41dc7bda84ff8d91cde5f"></span>void <code class="descname">axpy</code><span class="sig-paren">(</span><em class="property">const</em> int <em>n</em>, <em class="property">const</em> T <em>alpha</em>, <em class="property">const</em> T *<em>x</em>, T *<em>y</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle4axpyEKiK1TPK1TP1T" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> T&gt;</dt>
<dt id="_CPPv2N6paddle10dotProductEKiPK1TPK1T">
<span id="paddle::dotProduct__iC.TCP.TCP"></span><span class="target" id="paddlenamespacepaddle_1a55c259c2966869556e47bd40843eabce"></span>T <code class="descname">dotProduct</code><span class="sig-paren">(</span><em class="property">const</em> int <em>n</em>, <em class="property">const</em> T *<em>x</em>, <em class="property">const</em> T *<em>y</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle10dotProductEKiPK1TPK1T" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

<dl class="type">
6514 6515
<dt>
<span class="target" id="paddlenamespacepaddle"></span><em class="property">namespace </em><code class="descname">paddle</code></dt>
Y
Yu Yang 已提交
6516 6517 6518
<dd><dl class="type">
<dt id="_CPPv2N6paddle4simdE">
<span id="paddle::simd"></span><span class="target" id="paddlenamespacepaddle_1_1simd"></span><em class="property">namespace </em><code class="descname">simd</code><a class="headerlink" href="#_CPPv2N6paddle4simdE" title="Permalink to this definition">¶</a></dt>
6519
<dd><div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6520 6521 6522 6523 6524 6525 6526 6527 6528 6529 6530 6531 6532 6533 6534 6535 6536 6537 6538 6539 6540 6541 6542 6543 6544 6545 6546 6547 6548 6549 6550 6551 6552 6553 6554 6555 6556 6557 6558 6559 6560 6561 6562 6563 6564 6565 6566 6567 6568 6569 6570 6571 6572 6573 6574 6575 6576 6577 6578 6579 6580 6581 6582 6583 6584 6585 6586 6587 6588 6589 6590 6591 6592 6593 6594 6595 6596 6597 6598 6599 6600 6601 6602 6603 6604 6605 6606
<p class="breathe-sectiondef-title rubric">Functions</p>
<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">typename</em> Type&gt;</dt>
<dt id="_CPPv2N6paddle4simd5addToEP4TypePK4Type6size_t">
<span id="paddle::simd::addTo__TypeP.TypeCP.s"></span><span class="target" id="paddlenamespacepaddle_1_1simd_1a3d148ed46ded9872c1f889f326ba4a46"></span>void <code class="descname">addTo</code><span class="sig-paren">(</span>Type *<em>a</em>, <em class="property">const</em> Type *<em>b</em>, size_t <em>len</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle4simd5addToEP4TypePK4Type6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">typename</em> Type&gt;</dt>
<dt id="_CPPv2N6paddle4simd10batchAddToEP4TypeA_PK4Typei6size_t">
<span id="paddle::simd::batchAddTo__TypeP.TypeCPA.i.s"></span><span class="target" id="paddlenamespacepaddle_1_1simd_1a39ac3a1075ac9bfd0754df7ed8741cce"></span>void <code class="descname">batchAddTo</code><span class="sig-paren">(</span>Type *<em>a</em>, <em class="property">const</em> Type *<em>b</em>[], int <em>batch</em>, size_t <em>len</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle4simd10batchAddToEP4TypeA_PK4Typei6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">typename</em> Type&gt;</dt>
<dt id="_CPPv2N6paddle4simd6colMaxEP4TypePK4Typeii">
<span id="paddle::simd::colMax__TypeP.TypeCP.i.i"></span><span class="target" id="paddlenamespacepaddle_1_1simd_1a881df92dbe93de53e8ec35ab54dbfea8"></span>void <code class="descname">colMax</code><span class="sig-paren">(</span>Type *<em>result</em>, <em class="property">const</em> Type *<em>data</em>, int <em>dim</em>, int <em>numSamples</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle4simd6colMaxEP4TypePK4Typeii" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">typename</em> Type&gt;</dt>
<dt id="_CPPv2N6paddle4simd7decayL1EP4TypeP4TypeP4Type4Type6size_t">
<span id="paddle::simd::decayL1__TypeP.TypeP.TypeP.Type.s"></span><span class="target" id="paddlenamespacepaddle_1_1simd_1aebf61a0c721399f3fae9eda82c3773ed"></span>void <code class="descname">decayL1</code><span class="sig-paren">(</span>Type *<em>dst</em>, Type *<em>src</em>, Type *<em>lr</em>, Type <em>lambda</em>, size_t <em>len</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle4simd7decayL1EP4TypeP4TypeP4Type4Type6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">typename</em> Type&gt;</dt>
<dt id="_CPPv2N6paddle4simd7decayL1EP4TypeP4Type4Type6size_t">
<span id="paddle::simd::decayL1__TypeP.TypeP.Type.s"></span><span class="target" id="paddlenamespacepaddle_1_1simd_1aa727134ae6c7b239c4a155f68c1a1288"></span>void <code class="descname">decayL1</code><span class="sig-paren">(</span>Type *<em>dst</em>, Type *<em>src</em>, Type <em>lambda</em>, size_t <em>len</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle4simd7decayL1EP4TypeP4Type4Type6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;size_t <em>AlignSize</em>&gt;</dt>
<dt id="_CPPv2N6paddle4simd14isPointerAlignEPv">
<span id="paddle::simd::isPointerAlign__voidP"></span><span class="target" id="paddlenamespacepaddle_1_1simd_1a9214da4b1c6613c526d47c765096bfe4"></span>bool <code class="descname">isPointerAlign</code><span class="sig-paren">(</span>void *<em>ptr</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle4simd14isPointerAlignEPv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle4simd9vec_checkE6size_t">
<span id="paddle::simd::vec_check__s"></span><span class="target" id="paddlenamespacepaddle_1_1simd_1a4642dd53e9d70fe92630bd11a1ce540a"></span>bool <code class="descname">vec_check</code><span class="sig-paren">(</span>size_t <em>len</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle4simd9vec_checkE6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;&gt;</dt>
<dt id="_CPPv2N6paddle4simd5addToEPfPKf6size_t">
<span id="paddle::simd::addTo__floatP.floatCP.s"></span><span class="target" id="paddlenamespacepaddle_1_1simd_1aab2594eab02b62b31186377faa761f10"></span>void <code class="descname">addTo</code><span class="sig-paren">(</span>float *<em>a</em>, <em class="property">const</em> float *<em>b</em>, size_t <em>len</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle4simd5addToEPfPKf6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;&gt;</dt>
<dt id="_CPPv2N6paddle4simd10batchAddToEPfA_PKfi6size_t">
<span id="paddle::simd::batchAddTo__floatP.floatCPA.i.s"></span><span class="target" id="paddlenamespacepaddle_1_1simd_1afb6fb03dba13a445e1f16ad72a0bf5d2"></span>void <code class="descname">batchAddTo</code><span class="sig-paren">(</span>float *<em>a</em>, <em class="property">const</em> float *<em>b</em>[], int <em>batch</em>, size_t <em>len</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle4simd10batchAddToEPfA_PKfi6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;&gt;</dt>
<dt id="_CPPv2N6paddle4simd6colMaxEPfPKfii">
<span id="paddle::simd::colMax__floatP.floatCP.i.i"></span><span class="target" id="paddlenamespacepaddle_1_1simd_1a5cdf7ec8fb4ccf6609a03cc29cc1b234"></span>void <code class="descname">colMax</code><span class="sig-paren">(</span>float *<em>result</em>, <em class="property">const</em> float *<em>data</em>, int <em>dim</em>, int <em>numSamples</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle4simd6colMaxEPfPKfii" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;&gt;</dt>
<dt id="_CPPv2N6paddle4simd7decayL1EPfPff6size_t">
<span id="paddle::simd::decayL1__floatP.floatP.float.s"></span><span class="target" id="paddlenamespacepaddle_1_1simd_1adfad8d1a1cac4aff90e41bec8a0d4d3d"></span>void <code class="descname">decayL1</code><span class="sig-paren">(</span>float *<em>dst</em>, float *<em>src</em>, float <em>lambda</em>, size_t <em>len</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle4simd7decayL1EPfPff6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;&gt;</dt>
<dt id="_CPPv2N6paddle4simd7decayL1EPfPfPff6size_t">
<span id="paddle::simd::decayL1__floatP.floatP.floatP.float.s"></span><span class="target" id="paddlenamespacepaddle_1_1simd_1a44d42a41368a16c7bb89995317d60208"></span>void <code class="descname">decayL1</code><span class="sig-paren">(</span>float *<em>dst</em>, float *<em>src</em>, float *<em>lr</em>, float <em>lambda</em>, size_t <em>len</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle4simd7decayL1EPfPfPff6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<dl class="type">
<dt id="_CPPv2N6paddle4simd5naiveE">
<span id="paddle::simd::naive"></span><span class="target" id="paddlenamespacepaddle_1_1simd_1_1naive"></span><em class="property">namespace </em><code class="descname">naive</code><a class="headerlink" href="#_CPPv2N6paddle4simd5naiveE" title="Permalink to this definition">¶</a></dt>
6607
<dd><div class="breathe-sectiondef docutils container">
Y
Yu Yang 已提交
6608 6609 6610 6611 6612 6613 6614 6615 6616 6617 6618 6619 6620 6621 6622 6623 6624 6625 6626 6627 6628 6629 6630 6631 6632 6633 6634 6635 6636 6637 6638 6639 6640 6641 6642 6643 6644 6645 6646 6647 6648 6649 6650 6651 6652 6653 6654 6655 6656 6657 6658 6659 6660 6661 6662 6663 6664 6665 6666 6667 6668 6669 6670 6671 6672 6673 6674 6675 6676 6677 6678 6679 6680 6681 6682 6683 6684 6685 6686 6687 6688 6689 6690
<p class="breathe-sectiondef-title rubric">Functions</p>
<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">typename</em> Type&gt;</dt>
<dt id="_CPPv2N6paddle4simd5naive5addToEP4TypePK4Type6size_t">
<span id="paddle::simd::naive::addTo__TypeP.TypeCP.s"></span><span class="target" id="paddlenamespacepaddle_1_1simd_1_1naive_1aeb9c963df3d6c791eda884433033b3a5"></span>void <code class="descname">addTo</code><span class="sig-paren">(</span>Type *<em>a</em>, <em class="property">const</em> Type *<em>b</em>, size_t <em>len</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle4simd5naive5addToEP4TypePK4Type6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">typename</em> Type&gt;</dt>
<dt id="_CPPv2N6paddle4simd5naive10batchAddToEP4TypeA_PK4Typei6size_t">
<span id="paddle::simd::naive::batchAddTo__TypeP.TypeCPA.i.s"></span><span class="target" id="paddlenamespacepaddle_1_1simd_1_1naive_1a23e6c6647154186e277d0587ed56c002"></span>void <code class="descname">batchAddTo</code><span class="sig-paren">(</span>Type *<em>a</em>, <em class="property">const</em> Type *<em>b</em>[], int <em>batch</em>, size_t <em>len</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle4simd5naive10batchAddToEP4TypeA_PK4Typei6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">typename</em> Type&gt;</dt>
<dt id="_CPPv2N6paddle4simd5naive6colMaxEP4TypePK4Typeii">
<span id="paddle::simd::naive::colMax__TypeP.TypeCP.i.i"></span><span class="target" id="paddlenamespacepaddle_1_1simd_1_1naive_1aa31dfa8115265c6c1cfbeb51b8ed1d42"></span>void <code class="descname">colMax</code><span class="sig-paren">(</span>Type *<em>result</em>, <em class="property">const</em> Type *<em>data</em>, int <em>dim</em>, int <em>numSamples</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle4simd5naive6colMaxEP4TypePK4Typeii" title="Permalink to this definition">¶</a></dt>
<dd><p><dl class="docutils">
<dt><strong>Note</strong></dt>
<dd>this method is unused in paddle. </dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">typename</em> Type&gt;</dt>
<dt id="_CPPv2N6paddle4simd5naive7decayL1EP4TypeP4TypeP4Type4Type6size_t">
<span id="paddle::simd::naive::decayL1__TypeP.TypeP.TypeP.Type.s"></span><span class="target" id="paddlenamespacepaddle_1_1simd_1_1naive_1aedd7f70e58f6b5860860fd22895d85ff"></span>void <code class="descname">decayL1</code><span class="sig-paren">(</span>Type *<em>dst</em>, Type *<em>src</em>, Type *<em>lr</em>, Type <em>lambda</em>, size_t <em>len</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle4simd5naive7decayL1EP4TypeP4TypeP4Type4Type6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> Type&gt;</dt>
<dt id="_CPPv2N6paddle4simd5naive7decayL1EP4TypeP4Type4Type6size_t">
<span id="paddle::simd::naive::decayL1__TypeP.TypeP.Type.s"></span><span class="target" id="paddlenamespacepaddle_1_1simd_1_1naive_1a0f647ea71ec2c7c6d7fb354c4b778ef4"></span>void <code class="descname">decayL1</code><span class="sig-paren">(</span>Type *<em>dst</em>, Type *<em>src</em>, Type <em>lambda</em>, size_t <em>len</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle4simd5naive7decayL1EP4TypeP4Type4Type6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
</dd></dl>

</dd></dl>

</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../../../index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">Matrix</a><ul>
<li><a class="reference internal" href="#base">Base</a></li>
<li><a class="reference internal" href="#sparse-matrix">Sparse Matrix</a></li>
<li><a class="reference internal" href="#others">Others</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="index.html"
                        title="previous chapter">Matrix Documents</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="../utils/index.html"
                        title="next chapter">Utils Documents</a></p>
  <div role="note" aria-label="source link">
    <h3>This Page</h3>
    <ul class="this-page-menu">
      <li><a href="../../../_sources/source/math/matrix/matrix.txt"
            rel="nofollow">Show Source</a></li>
    </ul>
   </div>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <form class="search" action="../../../search.html" method="get">
6691 6692
      <div><input type="text" name="q" /></div>
      <div><input type="submit" value="Go" /></div>
Y
Yu Yang 已提交
6693 6694 6695 6696 6697 6698 6699 6700 6701 6702 6703 6704 6705 6706 6707 6708 6709 6710 6711 6712 6713 6714 6715 6716
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../../../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../../../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="../utils/index.html" title="Utils Documents"
             >next</a> |</li>
        <li class="right" >
          <a href="index.html" title="Matrix Documents"
             >previous</a> |</li>
6717 6718 6719
        <li class="nav-item nav-item-0"><a href="../../../index.html">PaddlePaddle  documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../../index.html" >Source Code Documents</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="index.html" >Matrix Documents</a> &#187;</li> 
Y
Yu Yang 已提交
6720 6721 6722
      </ul>
    </div>
    <div class="footer" role="contentinfo">
6723
        &#169; Copyright 2016, PaddlePaddle developers.
6724
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.9.
Y
Yu Yang 已提交
6725 6726 6727
    </div>
  </body>
</html>