matrix.html 745.6 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 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112
      </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>
<div class="breathe-sectiondef container">
<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>
<dd><div class="breathe-sectiondef container">
<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 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 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
<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>
<dd><div class="breathe-sectiondef container">
<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>
<dd><div class="breathe-sectiondef container">
<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>
<div class="breathe-sectiondef container">
<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>
Y
Yu Yang 已提交
190 191 192 193 194 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
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixTD0Ev">
<span id="paddle::BaseMatrixT::~BaseMatrixT"></span>virtual <span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a9b163bb6d40396e08e09227a5c05803c"></span><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>
<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 232 233 234 235 236 237 238 239 240
</pre></div>
</div>
</p>
</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 242 243
<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>
<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 246 247 248 249 250 251 252
</pre></div>
</div>
</p>
</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 256
<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>
<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 259 260 261 262 263 264 265
</pre></div>
</div>
</p>
</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 269 270 271
<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>
<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 286 287 288 289 290 291 292
</pre></div>
</div>
</p>
</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 308 309 310 311 312 313 314
</pre></div>
</div>
</p>
</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 318
<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>
<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 337 338 339 340 341 342 343
</pre></div>
</div>
</p>
</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 360 361 362 363 364 365 366
</pre></div>
</div>
</p>
</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 370 371 372 373 374
<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>
<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 377 378 379 380 381 382 383
</pre></div>
</div>
</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, <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 387 388 389
<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>
 <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 397 398 399 400 401 402 403
</pre></div>
</div>
</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, <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 408 409 410
<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>
  <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 418 419 420 421 422 423 424
</pre></div>
</div>
</p>
</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 428
<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">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 431 432 433 434 435 436 437
</pre></div>
</div>
</p>
</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="_CPPv2N6paddle11BaseMatrixT8applyRowE3Agg5SaverR11BaseMatrixT">
438
<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 已提交
439
<dd><p>a aggregate expression that apply each row of matrix b.</p>
440 441 442
<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">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 已提交
443 444 445 446 447 448 449 450 451
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt>
<em class="property">template </em>&lt;<em class="property">class</em> Agg&gt;</dt>
<dt id="_CPPv2N6paddle11BaseMatrixT8applyColE3AggR11BaseMatrixT">
452
<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 已提交
453
<dd><p>a aggregate expression that apply each column of matrix b.</p>
454 455
<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>
  <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 已提交
456 457 458 459 460 461 462 463 464
</pre></div>
</div>
</p>
</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">
465
<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 已提交
466
<dd><p>a aggregate expression that apply each column of matrix b.</p>
467 468 469
<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>
  <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 已提交
470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT6useGpuEv">
<span id="paddle::BaseMatrixT::useGpu"></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> const<a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT6useGpuEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT6rowBufE6size_t">
<span id="paddle::BaseMatrixT::rowBuf__s"></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> const<a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT6rowBufE6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT6rowBufE6size_t">
487
<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 已提交
488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543
<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>
544
<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 已提交
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
</pre></div>
</div>
</p>
</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>
573
<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 已提交
574 575 576 577 578 579 580 581
</pre></div>
</div>
</p>
</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>
582
<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 已提交
583 584 585 586 587 588 589 590
</pre></div>
</div>
</p>
</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>
591
<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 已提交
592 593 594 595 596 597 598 599 600 601 602 603 604 605 606
</pre></div>
</div>
</p>
</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>
607
<dd><p> <div class="highlight-default"><div class="highlight"><pre><span></span>a = a &gt; p ? 1.0f : 0.0f
Y
Yu Yang 已提交
608 609 610 611 612 613 614 615
</pre></div>
</div>
</p>
</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>
616
<dd><p> <div class="highlight-default"><div class="highlight"><pre><span></span>a = a &gt; p ? a : p
Y
Yu Yang 已提交
617 618 619 620 621 622 623
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT6assignER11BaseMatrixT">
624 625
<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>
<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 已提交
626 627 628 629 630 631 632
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT14assignAtOffsetER11BaseMatrixT7int64_t">
633 634 635
<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>
<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>
 <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 已提交
636

637 638
<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 已提交
639

640
<span class="n">Otherwise</span><span class="p">,</span> <span class="n">FATAL</span>
Y
Yu Yang 已提交
641 642 643 644 645 646 647
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT3addER11BaseMatrixT">
648
<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 已提交
649 650 651 652 653
<dd><p>this = this + b </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT11addAtOffsetER11BaseMatrixT7int64_t">
654 655 656
<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>
<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>
 <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 已提交
657

658 659
<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 已提交
660

661
<span class="n">Otherwise</span><span class="p">,</span> <span class="n">FATAL</span>
Y
Yu Yang 已提交
662 663 664 665 666 667 668
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT12addColVectorER11BaseMatrixT">
669
<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 已提交
670 671 672 673
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT12addRowVectorER11BaseMatrixT">
674
<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 已提交
675 676 677 678
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT7addBiasER11BaseMatrixT1T">
679
<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 已提交
680 681 682 683
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT12mulRowVectorER11BaseMatrixT">
684
<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 已提交
685 686 687 688
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT12divRowVectorER11BaseMatrixT">
689
<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 已提交
690 691 692 693
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT6addP2PER11BaseMatrixT">
694
<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 已提交
695 696 697 698
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT3addER11BaseMatrixT1T">
699 700
<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>
<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 已提交
701 702 703 704 705 706 707
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT3addER11BaseMatrixT1T1T">
708 709
<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>
<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 已提交
710 711 712 713 714 715 716
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT3subER11BaseMatrixT">
717 718
<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>
<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 已提交
719 720 721 722 723 724 725
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT3subER11BaseMatrixT1T">
726 727
<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>
<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 已提交
728 729 730 731 732 733 734
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT4reluER11BaseMatrixT">
735 736
<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>
<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 已提交
737 738 739 740 741 742 743
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT14reluDerivativeER11BaseMatrixT">
744
<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 已提交
745 746 747 748
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT8softreluER11BaseMatrixT">
749 750
<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>
<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 已提交
751 752 753 754 755 756 757
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT18softreluDerivativeER11BaseMatrixT">
758
<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 已提交
759 760 761 762
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT5breluER11BaseMatrixT">
763 764
<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>
<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 已提交
765 766 767 768 769 770 771
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT15breluDerivativeER11BaseMatrixT">
772
<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 已提交
773 774 775 776
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT6squareER11BaseMatrixT">
777 778
<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>
<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 已提交
779 780 781 782 783 784 785
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT16squareDerivativeER11BaseMatrixT">
786
<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 已提交
787 788 789 790
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT4tanhER11BaseMatrixT">
791 792
<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>
<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 已提交
793 794 795 796 797 798 799
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT14tanhDerivativeER11BaseMatrixT">
800
<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 已提交
801 802 803 804
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT10scaledTanhER11BaseMatrixT1T1T">
805 806
<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>
<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 已提交
807 808 809 810 811 812 813
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT20scaledTanhDerivativeER11BaseMatrixT1T1T">
814
<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 已提交
815 816 817 818
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT10reciprocalER11BaseMatrixT">
819 820
<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>
<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 已提交
821 822 823 824 825 826 827
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT20reciprocalDerivativeER11BaseMatrixT">
828
<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 已提交
829 830 831 832
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT3absER11BaseMatrixT">
833 834
<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>
<dd><p> <div class="highlight-default"><div class="highlight"><pre><span></span>b = this &gt; 0.0f ? this : -this
Y
Yu Yang 已提交
835 836 837 838 839 840 841
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT13absDerivativeER11BaseMatrixT">
842
<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 已提交
843 844 845 846
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT7sigmoidER11BaseMatrixT">
847 848
<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>
<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 已提交
849 850 851 852 853 854 855
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT17sigmoidDerivativeER11BaseMatrixT">
856
<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 已提交
857 858 859 860
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT13expDerivativeER11BaseMatrixT">
861 862
<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>
<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 已提交
863 864 865 866 867 868 869
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT4signER11BaseMatrixT">
870
<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 已提交
871 872 873 874
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT3expER11BaseMatrixT">
875
<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 已提交
876 877 878 879
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT3powER11BaseMatrixT1T">
880
<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 已提交
881 882 883 884
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT3logER11BaseMatrixT">
885
<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 已提交
886 887 888 889
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT4sqrtER11BaseMatrixT">
890
<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 已提交
891 892 893 894
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT9addScalarER11BaseMatrixT1T">
895
<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 已提交
896 897 898 899
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT9subScalarER11BaseMatrixT1T">
900
<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 已提交
901 902 903 904
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT9mulScalarER11BaseMatrixT1T">
905
<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 已提交
906 907 908 909
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT9divScalarER11BaseMatrixT1T">
910
<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 已提交
911 912 913 914
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT9scalarDivER11BaseMatrixT1T">
915
<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 已提交
916 917 918 919
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT7invSqrtER11BaseMatrixT">
920 921
<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>
<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 已提交
922 923 924 925 926 927 928
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT9isEqualToER11BaseMatrixT1T">
929
<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 已提交
930 931 932 933 934
<dd><p>this = (b == value) </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT16softCrossEntropyER11BaseMatrixTR11BaseMatrixT">
935
<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 已提交
936 937 938 939 940
<dd><p>ternary operator. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT18softCrossEntropyBpER11BaseMatrixTR11BaseMatrixT">
941
<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 已提交
942 943 944 945
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT23binaryLabelCrossEntropyER11BaseMatrixTR11BaseMatrixT">
946
<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 已提交
947 948 949 950
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT25binaryLabelCrossEntropyBpER11BaseMatrixTR11BaseMatrixT">
951
<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 已提交
952 953 954 955
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT3addER11BaseMatrixTR11BaseMatrixT">
956 957
<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>
<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 已提交
958 959 960 961 962 963 964
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT3addER11BaseMatrixT1TR11BaseMatrixT1T">
965 966
<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>
<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 已提交
967 968 969 970 971 972 973
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT3subER11BaseMatrixTR11BaseMatrixT">
974 975
<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>
<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 已提交
976 977 978 979 980 981 982
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT3subER11BaseMatrixT1TR11BaseMatrixT1T">
983 984
<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>
<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 已提交
985 986 987 988 989 990 991
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT4add2ER11BaseMatrixTR11BaseMatrixT">
992 993
<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>
<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 已提交
994 995 996 997 998 999 1000
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT4add2ER11BaseMatrixTR11BaseMatrixT1T1T1T">
1001 1002
<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>
<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 已提交
1003 1004 1005 1006 1007 1008 1009
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT4add3ER11BaseMatrixTR11BaseMatrixTR11BaseMatrixT1T1T1T">
1010 1011
<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>
<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 已提交
1012 1013 1014 1015 1016 1017 1018
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT9sgdUpdateER11BaseMatrixTR11BaseMatrixT1T1T1T">
1019 1020
<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>
<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 已提交
1021 1022 1023 1024 1025 1026 1027 1028
<span class="n">this</span> <span class="o">+=</span> <span class="n">mom</span>
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT9sgdUpdateER11BaseMatrixTR11BaseMatrixTR11BaseMatrixT1T1T1T">
1029 1030
<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>
<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 已提交
1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044
<span class="n">this</span> <span class="o">+=</span> <span class="n">mom</span>
</pre></div>
</div>
</p>
</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">
1045
<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 已提交
1046 1047 1048 1049 1050 1051 1052 1053 1054
<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">
1055
<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 已提交
1056 1057 1058 1059
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT6dotMulER11BaseMatrixT">
1060 1061
<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>
<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 已提交
1062 1063 1064 1065 1066 1067 1068
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT6dotMulER11BaseMatrixTR11BaseMatrixT">
1069 1070
<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>
<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 已提交
1071 1072 1073 1074 1075 1076 1077
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT6dotDivER11BaseMatrixTR11BaseMatrixT">
1078 1079
<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>
<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 已提交
1080 1081 1082 1083 1084 1085 1086
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT6dotDivER11BaseMatrixTR11BaseMatrixT1T1T">
1087 1088
<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>
<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 已提交
1089 1090 1091 1092 1093 1094 1095
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT8rankLossER11BaseMatrixTR11BaseMatrixTR11BaseMatrixT">
1096 1097
<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>
<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 已提交
1098 1099 1100 1101 1102 1103 1104
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT10rankLossBpER11BaseMatrixTR11BaseMatrixTR11BaseMatrixT">
1105
<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 已提交
1106 1107 1108 1109
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT22logisticRegressionLossER11BaseMatrixTR11BaseMatrixT">
1110 1111
<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>
<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 已提交
1112 1113 1114 1115 1116 1117 1118
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT24logisticRegressionLossBpER11BaseMatrixTR11BaseMatrixT">
1119 1120
<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>
<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 已提交
1121 1122 1123 1124 1125 1126 1127
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT10biggerThanER11BaseMatrixTR11BaseMatrixT">
1128 1129
<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>
<dd><p> <div class="highlight-default"><div class="highlight"><pre><span></span>this = b &gt; c ? 1.0 : 0.0
Y
Yu Yang 已提交
1130 1131 1132 1133 1134 1135 1136
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT10biggerThanER11BaseMatrixTR11BaseMatrixTR11BaseMatrixT">
1137 1138
<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>
<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 已提交
1139 1140 1141 1142 1143 1144 1145
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT3maxER11BaseMatrixTR11BaseMatrixT">
1146 1147
<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>
<dd><p> <div class="highlight-default"><div class="highlight"><pre><span></span>this = b&gt;c ? b : c
Y
Yu Yang 已提交
1148 1149 1150 1151 1152 1153 1154
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT25binaryClassificationErrorE6size_tR11BaseMatrixTR11BaseMatrixT1T">
1155 1156
<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>
<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 已提交
1157 1158 1159 1160 1161 1162 1163
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT26binaryClassificationError2E6size_tR11BaseMatrixTR11BaseMatrixT1T">
1164
<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 已提交
1165 1166 1167 1168
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT12dotMulSquareER11BaseMatrixT">
1169 1170
<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>
<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 已提交
1171 1172 1173 1174 1175 1176 1177
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT12dotSquareMulER11BaseMatrixT">
1178 1179
<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>
<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 已提交
1180 1181 1182 1183 1184 1185 1186
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT12dotMulSquareER11BaseMatrixTR11BaseMatrixT">
1187 1188
<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>
<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 已提交
1189 1190 1191 1192 1193 1194 1195
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT15dotSquareSquareER11BaseMatrixTR11BaseMatrixT">
1196 1197
<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>
<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 已提交
1198 1199 1200 1201 1202 1203 1204
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT15dotMulSquareSumER11BaseMatrixTR11BaseMatrixT1T1T">
1205 1206
<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>
<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 已提交
1207 1208 1209 1210 1211 1212 1213
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT12dotSquareSumER11BaseMatrixTR11BaseMatrixT1T1T">
1214 1215
<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>
<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 已提交
1216 1217 1218 1219 1220 1221 1222
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT9dotMulSumER11BaseMatrixTR11BaseMatrixT1T1T">
1223 1224
<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>
<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 已提交
1225 1226 1227 1228 1229 1230 1231
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT12addSquareSumER11BaseMatrixTR11BaseMatrixT11BaseMatrixT1T1T1T">
1232 1233
<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>
<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 已提交
1234 1235 1236 1237 1238 1239 1240
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT9addSquareER11BaseMatrixT1T">
1241 1242
<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>
<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 已提交
1243 1244 1245 1246 1247 1248 1249
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT14decayAddSquareER11BaseMatrixT1T1T">
1250 1251
<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>
<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 已提交
1252 1253 1254 1255 1256 1257 1258
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT17decayAddSquareMulER11BaseMatrixTR11BaseMatrixT1T1T">
1259 1260
<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>
<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 已提交
1261 1262 1263 1264 1265 1266 1267
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT10reciprocalER11BaseMatrixT1T1T">
1268 1269
<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>
<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 已提交
1270 1271 1272 1273 1274 1275 1276
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT13reciprocalSumER11BaseMatrixTR11BaseMatrixT1T1T1T">
1277 1278
<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>
<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 已提交
1279 1280 1281 1282 1283 1284 1285
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT12copyAndClearER11BaseMatrixT">
1286 1287
<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>
<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 已提交
1288 1289 1290 1291 1292 1293 1294
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT9rowDotMulE6size_tR11BaseMatrixTR11BaseMatrixT">
1295 1296
<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>
<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 已提交
1297 1298 1299 1300 1301 1302 1303
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT10rowDotMul2E6size_tR11BaseMatrixTR11BaseMatrixT">
1304
<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 已提交
1305 1306 1307 1308
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT12addDotMulVMMER11BaseMatrixTR11BaseMatrixT">
1309
<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 已提交
1310
<dd><p>this is vector (one row matrix)</p>
1311 1312
<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>
   <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 已提交
1313 1314 1315 1316 1317 1318 1319
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT13addDotMulVMM2ER11BaseMatrixTR11BaseMatrixT">
1320
<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 已提交
1321 1322 1323 1324
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT12addDotMulMMVER11BaseMatrixTR11BaseMatrixT">
1325
<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 已提交
1326
<dd><p>c is vector (one row matrix)</p>
1327 1328
<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>
   <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 已提交
1329 1330 1331 1332 1333 1334 1335
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT13addDotMulMMV2ER11BaseMatrixTR11BaseMatrixT">
1336
<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 已提交
1337 1338 1339 1340
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT9addDotMulER11BaseMatrixTR11BaseMatrixT1T1T">
1341 1342
<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>
<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 已提交
1343 1344 1345 1346 1347 1348 1349
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT8rowScaleE6size_tR11BaseMatrixTR11BaseMatrixT">
1350 1351
<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>
<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 已提交
1352 1353 1354 1355 1356 1357 1358
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT9rowScale2E6size_tR11BaseMatrixTR11BaseMatrixT">
1359
<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 已提交
1360 1361 1362 1363
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT8colScaleE6size_tR11BaseMatrixTR11BaseMatrixT">
1364 1365
<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>
<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 已提交
1366 1367 1368 1369 1370 1371 1372
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT11addColScaleE6size_tR11BaseMatrixTR11BaseMatrixT">
1373 1374
<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>
<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 已提交
1375 1376 1377 1378 1379 1380 1381
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT11addRowScaleE6size_tR11BaseMatrixTR11BaseMatrixT">
1382 1383
<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>
<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 已提交
1384 1385 1386 1387 1388 1389 1390
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT7sumRowsER11BaseMatrixT">
1391
<span id="paddle::BaseMatrixT::sumRows__BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a6d376950d514bb5cf83cd79b9c993e12"></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><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT7sumRowsER11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1392 1393 1394 1395 1396
<dd><p>calculate the sum of each row of the matrix b. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT7maxRowsER11BaseMatrixT">
1397
<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 已提交
1398 1399 1400 1401 1402
<dd><p>calculate the maximum value of each row of the matrix b. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT7minRowsER11BaseMatrixT">
1403
<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 已提交
1404 1405 1406 1407 1408
<dd><p>calculate the minimum value of each row of the matrix b. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT7sumColsER11BaseMatrixT">
1409
<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 已提交
1410 1411 1412 1413 1414
<dd><p>calculate the sum of each column of the matrix b. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT7maxColsER11BaseMatrixT">
1415
<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 已提交
1416 1417 1418 1419 1420
<dd><p>calculate the maximum value of each column of the matrix b. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT7minColsER11BaseMatrixT">
1421
<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 已提交
1422 1423 1424 1425 1426
<dd><p>calculate the minimum value of each column of the matrix b. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT7sumColsER11BaseMatrixT1T">
1427
<span id="paddle::BaseMatrixT::sumCols__BaseMatrixTR.T"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1aed1e624be8c691b8192836baa7911116"></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>scale</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT7sumColsER11BaseMatrixT1T" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1428 1429 1430 1431
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT12sumOfSquaresER11BaseMatrixTR11BaseMatrixT">
1432
<span id="paddle::BaseMatrixT::sumOfSquares__BaseMatrixTR.BaseMatrixTR"></span><span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1aff32e946f611b089eaa65bd83fa1853a"></span>void <code class="descname">sumOfSquares</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="#_CPPv2N6paddle11BaseMatrixT12sumOfSquaresER11BaseMatrixTR11BaseMatrixT" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1433 1434 1435 1436 1437
<dd><p>calculate the sum of each row of (b - c)^2. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT6rowAddE6size_tR11BaseMatrixTR11BaseMatrixT1T">
1438 1439
<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>
<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 已提交
1440 1441 1442 1443 1444 1445 1446
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT6rowPowE6size_tR11BaseMatrixTR11BaseMatrixT">
1447 1448
<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>
<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 已提交
1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle11BaseMatrixT8isSparseEv">
<span id="paddle::BaseMatrixT::isSparse"></span>virtual <span class="target" id="paddleclasspaddle_1_1BaseMatrixT_1a1f6af0331a1c6981522ff2b2f9f62520"></span>bool <code class="descname">isSparse</code><span class="sig-paren">(</span><span class="sig-paren">)</span> const<a class="headerlink" href="#_CPPv2N6paddle11BaseMatrixT8isSparseEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<div class="breathe-sectiondef container">
<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">
1502
<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>
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 1544 1545 1546 1547 1548 1549 1550 1551 1552 1553
<dd><div class="breathe-sectiondef container">
<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>
<div class="breathe-sectiondef container">
<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>
1554 1555 1556 1557 1558 1559 1560 1561 1562 1563 1564
<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>
<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>
              <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 已提交
1565 1566 1567 1568 1569 1570 1571 1572 1573 1574 1575 1576 1577 1578 1579 1580 1581 1582 1583 1584 1585 1586 1587 1588 1589 1590
</pre></div>
</div>
</p>
<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>
<div class="breathe-sectiondef container">
<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">
1591 1592 1593 1594 1595
<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>
Y
Yu Yang 已提交
1596 1597 1598
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
1599 1600 1601
<dt id="_CPPv2N6paddle6MatrixD0Ev">
<span id="paddle::Matrix::~Matrix"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a9eb0570627d3b1fa1a7023bf23dbd9c4"></span><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>
<dd></dd></dl>
Y
Yu Yang 已提交
1602 1603

<dl class="function">
1604 1605 1606 1607 1608
<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 已提交
1609 1610

<dl class="function">
1611 1612 1613 1614
<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 已提交
1615 1616

<dl class="function">
1617 1618
<dt id="_CPPv2N6paddle6Matrix8getWidthEv">
<span id="paddle::Matrix::getWidth"></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> const<a class="headerlink" href="#_CPPv2N6paddle6Matrix8getWidthEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1619 1620 1621
<dd></dd></dl>

<dl class="function">
1622 1623
<dt id="_CPPv2N6paddle6Matrix9getHeightEv">
<span id="paddle::Matrix::getHeight"></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> const<a class="headerlink" href="#_CPPv2N6paddle6Matrix9getHeightEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1624 1625 1626
<dd></dd></dl>

<dl class="function">
1627 1628
<dt id="_CPPv2N6paddle6Matrix9getStrideEv">
<span id="paddle::Matrix::getStride"></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> const<a class="headerlink" href="#_CPPv2N6paddle6Matrix9getStrideEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1629 1630 1631
<dd></dd></dl>

<dl class="function">
1632 1633
<dt id="_CPPv2N6paddle6Matrix13getElementCntEv">
<span id="paddle::Matrix::getElementCnt"></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> const<a class="headerlink" href="#_CPPv2N6paddle6Matrix13getElementCntEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1634 1635 1636
<dd></dd></dl>

<dl class="function">
1637 1638 1639
<dt id="_CPPv2N6paddle6Matrix7getDataEv">
<span id="paddle::Matrix::getData"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a122a426cf48abdbba3eae689d655c4ab"></span>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>
<dd></dd></dl>
Y
Yu Yang 已提交
1640 1641

<dl class="function">
1642 1643 1644
<dt id="_CPPv2N6paddle6Matrix7getDataEv">
virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1aa8a2ffb8e06ea97ce3442fa0ffe9f45f"></span><em class="property">const</em> real *<code class="descname">getData</code><span class="sig-paren">(</span><span class="sig-paren">)</span> const<a class="headerlink" href="#_CPPv2N6paddle6Matrix7getDataEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
Y
Yu Yang 已提交
1645 1646

<dl class="function">
1647 1648 1649
<dt id="_CPPv2N6paddle6Matrix12isTransposedEv">
<span id="paddle::Matrix::isTransposed"></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> const<a class="headerlink" href="#_CPPv2N6paddle6Matrix12isTransposedEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
Y
Yu Yang 已提交
1650 1651

<dl class="function">
1652 1653
<dt id="_CPPv2N6paddle6Matrix12isContiguousEv">
<span id="paddle::Matrix::isContiguous"></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> const<a class="headerlink" href="#_CPPv2N6paddle6Matrix12isContiguousEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1654 1655 1656
<dd></dd></dl>

<dl class="function">
1657 1658
<dt id="_CPPv2N6paddle6Matrix7getRowsEv">
<span id="paddle::Matrix::getRows"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1ad3e509174de91ab16afd614734c4fdb4"></span>int *<code class="descname">getRows</code><span class="sig-paren">(</span><span class="sig-paren">)</span> const<a class="headerlink" href="#_CPPv2N6paddle6Matrix7getRowsEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1659 1660 1661
<dd></dd></dl>

<dl class="function">
1662 1663
<dt id="_CPPv2N6paddle6Matrix7getColsEv">
<span id="paddle::Matrix::getCols"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1ac6d2e9788d593a26d7c83cf2b011427b"></span>int *<code class="descname">getCols</code><span class="sig-paren">(</span><span class="sig-paren">)</span> const<a class="headerlink" href="#_CPPv2N6paddle6Matrix7getColsEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1664 1665 1666
<dd></dd></dl>

<dl class="function">
1667 1668
<dt id="_CPPv2N6paddle6Matrix9getFormatEv">
<span id="paddle::Matrix::getFormat"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1ab37794b499e5c469f38add2d85c422b2"></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> const<a class="headerlink" href="#_CPPv2N6paddle6Matrix9getFormatEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1669 1670 1671
<dd></dd></dl>

<dl class="function">
1672 1673
<dt id="_CPPv2N6paddle6Matrix12getValueTypeEv">
<span id="paddle::Matrix::getValueType"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1ac8d19b93ddd2b78babe36ecd3f3a43b2"></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> const<a class="headerlink" href="#_CPPv2N6paddle6Matrix12getValueTypeEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1674 1675 1676
<dd></dd></dl>

<dl class="function">
1677 1678 1679 1680
<dt id="_CPPv2N6paddle6Matrix4add3E9MatrixPtr">
<span id="paddle::Matrix::add3__MatrixPtr"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1aff61ccdd23b83e18fb5cbd404d4fa7ff"></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="#_CPPv2N6paddle6Matrix4add3E9MatrixPtr" title="Permalink to this definition">¶</a></dt>
<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 已提交
1681 1682 1683
</dd></dl>

<dl class="function">
1684 1685
<dt id="_CPPv2N6paddle6Matrix15getMemoryHandleEv">
<span id="paddle::Matrix::getMemoryHandle"></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> const<a class="headerlink" href="#_CPPv2N6paddle6Matrix15getMemoryHandleEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1686 1687 1688
<dd></dd></dl>

<dl class="function">
1689 1690
<dt id="_CPPv2N6paddle6Matrix7zeroMemEv">
<span id="paddle::Matrix::zeroMem"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a75a12ea41f84bd4a1a96b10e5fca62e7"></span>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 已提交
1691 1692 1693
<dd></dd></dl>

<dl class="function">
1694 1695 1696
<dt id="_CPPv2N6paddle6Matrix8resetOneEv">
<span id="paddle::Matrix::resetOne"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a3183c4917b89abbe8798006f54306821"></span>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>
Y
Yu Yang 已提交
1697 1698

<dl class="function">
1699 1700
<dt id="_CPPv2N6paddle6Matrix8copyFromERK6Matrix">
<span id="paddle::Matrix::copyFrom__MatrixCR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a3eb60a6b368fcf4aac25d7248147ba10"></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="#_CPPv2N6paddle6Matrix8copyFromERK6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1701 1702 1703
<dd></dd></dl>

<dl class="function">
1704 1705
<dt id="_CPPv2N6paddle6Matrix8trimFromERK15CpuSparseMatrix">
<span id="paddle::Matrix::trimFrom__CpuSparseMatrixCR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a88666babcb5beec1a83beaede78b26cf"></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="#_CPPv2N6paddle6Matrix8trimFromERK15CpuSparseMatrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1706 1707 1708
<dd></dd></dl>

<dl class="function">
1709 1710
<dt id="_CPPv2N6paddle6Matrix8copyFromERK6Matrix11hl_stream_t">
<span id="paddle::Matrix::copyFrom__MatrixCR.hl_stream_t"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a4229b26af746a50fd6b9e96dba602402"></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="#_CPPv2N6paddle6Matrix8copyFromERK6Matrix11hl_stream_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1711 1712 1713
<dd></dd></dl>

<dl class="function">
1714 1715 1716
<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 已提交
1717 1718

<dl class="function">
1719 1720 1721
<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 已提交
1722 1723

<dl class="function">
1724 1725 1726
<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 已提交
1727 1728

<dl class="function">
1729 1730 1731
<dt id="_CPPv2N6paddle6Matrix9subMatrixE6size_t6size_t">
<span id="paddle::Matrix::subMatrix__s.s"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1aceaeeccc687dd995147e7728823b7fe0"></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="#_CPPv2N6paddle6Matrix9subMatrixE6size_t6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
Y
Yu Yang 已提交
1732 1733

<dl class="function">
1734 1735 1736
<dt id="_CPPv2N6paddle6Matrix9subMatrixE6size_t6size_t9MatrixPtr">
<span id="paddle::Matrix::subMatrix__s.s.MatrixPtr"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a5531a209ed774f7a5a8ea9102e5b0878"></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>, <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>
<dd></dd></dl>
Y
Yu Yang 已提交
1737 1738

<dl class="function">
1739 1740 1741 1742
<dt id="_CPPv2N6paddle6Matrix8copyFromEPK4real6size_t">
<span id="paddle::Matrix::copyFrom__realCP.s"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a9f28b1ba8eef75c83e414445eb0a166f"></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="#_CPPv2N6paddle6Matrix8copyFromEPK4real6size_t" title="Permalink to this definition">¶</a></dt>
<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 已提交
1743 1744 1745
</dd></dl>

<dl class="function">
1746 1747
<dt id="_CPPv2N6paddle6Matrix8copyFromEPK4realPK7int64_t">
<span id="paddle::Matrix::copyFrom__realCP.int64_tCP"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1abad40f3937321a255ab240bc4ffe65ca"></span>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 已提交
1748 1749 1750
<dd></dd></dl>

<dl class="function">
1751 1752 1753 1754 1755
<dt id="_CPPv2N6paddle6Matrix8copyFromERK7IVector">
<span id="paddle::Matrix::copyFrom__IVectorCR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a159966437890625711f3317dacb326ba"></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="#_CPPv2N6paddle6Matrix8copyFromERK7IVector" title="Permalink to this definition">¶</a></dt>
<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 已提交
1756 1757 1758
</dd></dl>

<dl class="function">
1759 1760
<dt id="_CPPv2N6paddle6Matrix14copyByRowIndexER6MatrixR7IVector">
<span id="paddle::Matrix::copyByRowIndex__MatrixR.IVectorR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a4f59ce1c02e1516a53b1dd5247d8d356"></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>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>rowIndex</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix14copyByRowIndexER6MatrixR7IVector" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1761 1762 1763
<dd></dd></dl>

<dl class="function">
1764 1765 1766 1767
<dt id="_CPPv2N6paddle6Matrix5cloneE6size_t6size_tb">
<span id="paddle::Matrix::clone__s.s.b"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a816f16646009185165ea31b469b48c29"></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="#_CPPv2N6paddle6Matrix5cloneE6size_t6size_tb" title="Permalink to this definition">¶</a></dt>
<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 已提交
1768 1769 1770
</dd></dl>

<dl class="function">
1771 1772
<dt id="_CPPv2N6paddle6Matrix9getRowBufE6size_t">
<span id="paddle::Matrix::getRowBuf__s"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a386a807da0977a14484ed7f55a2ab74d"></span>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 已提交
1773 1774 1775
<dd></dd></dl>

<dl class="function">
1776 1777
<dt id="_CPPv2N6paddle6Matrix10getElementE6size_t6size_t">
<span id="paddle::Matrix::getElement__s.s"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a4eb5224fc979b75adf343562cb2874e4"></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> const<a class="headerlink" href="#_CPPv2N6paddle6Matrix10getElementE6size_t6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1778 1779 1780
<dd></dd></dl>

<dl class="function">
1781 1782
<dt id="_CPPv2N6paddle6Matrix6getSumEv">
<span id="paddle::Matrix::getSum"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a4fa992891924f6a21bcf0a20ac7c849b"></span>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 已提交
1783 1784 1785
<dd></dd></dl>

<dl class="function">
1786 1787
<dt id="_CPPv2N6paddle6Matrix16accumulateColSumER6Matrix">
<span id="paddle::Matrix::accumulateColSum__MatrixR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1abaa5845c6e3d882bfbe699b2073e3e7f"></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="#_CPPv2N6paddle6Matrix16accumulateColSumER6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1788 1789 1790
<dd></dd></dl>

<dl class="function">
1791 1792
<dt id="_CPPv2N6paddle6Matrix9getAbsSumEv">
<span id="paddle::Matrix::getAbsSum"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1aaccb97a47b8c16a83866d7a39272c148"></span>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 已提交
1793 1794 1795
<dd></dd></dl>

<dl class="function">
1796 1797 1798 1799 1800 1801 1802
<dt id="_CPPv2N6paddle6Matrix6resizeE6size_t6size_t">
<span id="paddle::Matrix::resize__s.s"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a6d71f7f4f1bdc9e2f35fff1a8a337d42"></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> = 0<a class="headerlink" href="#_CPPv2N6paddle6Matrix6resizeE6size_t6size_t" title="Permalink to this definition">¶</a></dt>
<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 已提交
1803 1804 1805
</dd></dl>

<dl class="function">
1806 1807 1808 1809 1810 1811 1812
<dt id="_CPPv2N6paddle6Matrix6resizeE6size_t6size_t6size_t15SparseValueType12SparseFormat">
<span id="paddle::Matrix::resize__s.s.s.SparseValueType.SparseFormat"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a0e93c008467c9e7b94226bb9dae4c6ba"></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> = 0<a class="headerlink" href="#_CPPv2N6paddle6Matrix6resizeE6size_t6size_t6size_t15SparseValueType12SparseFormat" title="Permalink to this definition">¶</a></dt>
<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 已提交
1813 1814 1815
</dd></dl>

<dl class="function">
1816 1817 1818 1819 1820 1821 1822 1823 1824
<dt id="_CPPv2N6paddle6Matrix6setRowE6size_t6size_tPKjPK4real">
<span id="paddle::Matrix::setRow__s.s.unsigned-iCP.realCP"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a9800da2b4a8ce1c01057dd4e2c3970b8"></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> = 0<a class="headerlink" href="#_CPPv2N6paddle6Matrix6setRowE6size_t6size_tPKjPK4real" title="Permalink to this definition">¶</a></dt>
<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">
<span id="paddle::Matrix::getTranspose"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1ad522b2d78bde26cae9c0f33ea76eee0c"></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> = 0<a class="headerlink" href="#_CPPv2N6paddle6Matrix12getTransposeEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1825 1826 1827
<dd></dd></dl>

<dl class="function">
1828 1829 1830 1831
<dt id="_CPPv2N6paddle6Matrix9transposeE9MatrixPtrb">
<span id="paddle::Matrix::transpose__MatrixPtr.b"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a25cab2491db8897ae00f024719f2a96c"></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="#_CPPv2N6paddle6Matrix9transposeE9MatrixPtrb" title="Permalink to this definition">¶</a></dt>
<dd><p>hard transpose. </p>
<p>allocate matTrans&#8217; memory outside, then set memAlloc as false; else set as true. </p>
Y
Yu Yang 已提交
1832 1833 1834
</dd></dl>

<dl class="function">
1835 1836 1837
<dt id="_CPPv2N6paddle6Matrix5clearEv">
<span id="paddle::Matrix::clear"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1aca8c0331ecfa2b5ad252a55d938a670f"></span>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>
<dd><p>Only set all variables to 0 or NULL but not free them. </p>
Y
Yu Yang 已提交
1838 1839 1840
</dd></dl>

<dl class="function">
1841 1842 1843
<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 已提交
1844 1845

<dl class="function">
1846 1847 1848
<dt id="_CPPv2N6paddle6Matrix7addBiasER6Matrix4real">
<span id="paddle::Matrix::addBias__MatrixR.real"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1af7482755326cd9026bb6a17207a4ee22"></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="#_CPPv2N6paddle6Matrix7addBiasER6Matrix4real" title="Permalink to this definition">¶</a></dt>
<dd><p>add b to each sample of this. </p>
Y
Yu Yang 已提交
1849 1850 1851
</dd></dl>

<dl class="function">
1852 1853 1854
<dt id="_CPPv2N6paddle6Matrix11collectBiasER6Matrix4real">
<span id="paddle::Matrix::collectBias__MatrixR.real"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a5948cac5ff5715652491b1c729b580aa"></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="#_CPPv2N6paddle6Matrix11collectBiasER6Matrix4real" title="Permalink to this definition">¶</a></dt>
<dd><p>add each sample from a to this. </p>
Y
Yu Yang 已提交
1855 1856 1857
</dd></dl>

<dl class="function">
1858 1859
<dt id="_CPPv2N6paddle6Matrix18sequenceAvgForwardER6MatrixRK7IVectori">
<span id="paddle::Matrix::sequenceAvgForward__MatrixR.IVectorCR.i"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a9972fecfa489042ad8124ff291d03035"></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="#_CPPv2N6paddle6Matrix18sequenceAvgForwardER6MatrixRK7IVectori" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1860 1861 1862
<dd></dd></dl>

<dl class="function">
1863 1864 1865
<dt id="_CPPv2N6paddle6Matrix3mulEK9MatrixPtrK9MatrixPtr4real4real">
<span id="paddle::Matrix::mul__MatrixPtrC.MatrixPtrC.real.real"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a7e478eb594c0efbca130dd8ffee21ab6"></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="#_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 已提交
1866 1867 1868 1869 1870 1871
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
1872 1873 1874 1875
<dt id="_CPPv2N6paddle6Matrix15addColumnVectorERK6Matrix">
<span id="paddle::Matrix::addColumnVector__MatrixCR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a8017cf90c7bdcd5eb947283ee617ff40"></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="#_CPPv2N6paddle6Matrix15addColumnVectorERK6Matrix" title="Permalink to this definition">¶</a></dt>
<dd><p>Add a vector (column) b to matrix a, column by column. </p>
</dd></dl>
Y
Yu Yang 已提交
1876 1877

<dl class="function">
1878 1879 1880 1881 1882 1883 1884 1885 1886
<dt id="_CPPv2N6paddle6Matrix12addByBitCodeE6size_tRK7IVectorRK6Matrix">
<span id="paddle::Matrix::addByBitCode__s.IVectorCR.MatrixCR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1af5db28eff7769d32914da55766e5f879"></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="#_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>
  <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>
</p>
</dd></dl>
Y
Yu Yang 已提交
1887 1888

<dl class="function">
1889 1890 1891 1892 1893 1894 1895 1896 1897
<dt id="_CPPv2N6paddle6Matrix20addByBitCodeBackwardE6size_tRK7IVectorR6Matrix">
<span id="paddle::Matrix::addByBitCodeBackward__s.IVectorCR.MatrixR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a3ef12b0995a131f40058a59dce7b9b11"></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="#_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>
  <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>
</p>
</dd></dl>
Y
Yu Yang 已提交
1898 1899

<dl class="function">
1900 1901 1902 1903 1904
<dt id="_CPPv2N6paddle6Matrix12mulByBitCodeE6size_tRK7IVectorRK6MatrixRK6Matrix">
<span id="paddle::Matrix::mulByBitCode__s.IVectorCR.MatrixCR.MatrixCR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a48a2577bfdb79fdd67644d0123fd10df"></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="#_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>
  <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 已提交
1905 1906 1907 1908 1909 1910
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
1911 1912 1913 1914 1915
<dt id="_CPPv2N6paddle6Matrix26mulByBitCodeBackwardWeightE6size_tRK7IVectorR6MatrixRK6Matrix">
<span id="paddle::Matrix::mulByBitCodeBackwardWeight__s.IVectorCR.MatrixR.MatrixCR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a7ac04f922418cb9e3bd683133a3188be"></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="#_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>
  <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 已提交
1916 1917 1918 1919 1920 1921
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
1922 1923 1924 1925 1926
<dt id="_CPPv2N6paddle6Matrix25mulByBitCodeBackwardErrorE6size_tRK7IVectorRK6MatrixR6Matrix">
<span id="paddle::Matrix::mulByBitCodeBackwardError__s.IVectorCR.MatrixCR.MatrixR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a243bd2c96ef914a01a45eb5192e285f5"></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="#_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>
  <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 已提交
1927 1928 1929 1930 1931 1932
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
1933 1934 1935 1936 1937
<dt id="_CPPv2N6paddle6Matrix12sumByBitCodeE6size_tR7IVectorR6Matrix4real">
<span id="paddle::Matrix::sumByBitCode__s.IVectorR.MatrixR.real"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a392403a8498bc2e3c636e0bc72fd089c"></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="#_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
  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 已提交
1938 1939 1940 1941 1942 1943
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
1944 1945 1946 1947 1948
<dt id="_CPPv2N6paddle6Matrix12subByBitCodeE6size_tR7IVector">
<span id="paddle::Matrix::subByBitCode__s.IVectorR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a2a3f3386f54fba1959566a046053ee9f"></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="#_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>
 <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 已提交
1949 1950 1951 1952 1953 1954
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
1955 1956 1957
<dt id="_CPPv2N6paddle6Matrix6rowSumER6Matrix">
<span id="paddle::Matrix::rowSum__MatrixR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1aac84337da8ed13474d9f8366fa8890da"></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="#_CPPv2N6paddle6Matrix6rowSumER6Matrix" title="Permalink to this definition">¶</a></dt>
<dd><p>add the sum of each row of this to mat </p>
Y
Yu Yang 已提交
1958 1959 1960
</dd></dl>

<dl class="function">
1961 1962 1963
<dt id="_CPPv2N6paddle6Matrix6rowMaxER6Matrix">
<span id="paddle::Matrix::rowMax__MatrixR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a7bc5f6706454830f800fb91ced413eb0"></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="#_CPPv2N6paddle6Matrix6rowMaxER6Matrix" title="Permalink to this definition">¶</a></dt>
<dd><p>set the max of each row of this to mat </p>
Y
Yu Yang 已提交
1964 1965 1966
</dd></dl>

<dl class="function">
1967 1968
<dt id="_CPPv2N6paddle6Matrix6colMaxER6Matrix">
<span id="paddle::Matrix::colMax__MatrixR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1ac89c66983c6376c64d468a2e47890a8d"></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="#_CPPv2N6paddle6Matrix6colMaxER6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1969 1970 1971
<dd></dd></dl>

<dl class="function">
1972 1973 1974
<dt id="_CPPv2N6paddle6Matrix8rowMaxIdER7IVector">
<span id="paddle::Matrix::rowMaxId__IVectorR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a735ca6afdf370bcd9ebb651c539c619a"></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="#_CPPv2N6paddle6Matrix8rowMaxIdER7IVector" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>
Y
Yu Yang 已提交
1975 1976

<dl class="function">
1977 1978
<dt id="_CPPv2N6paddle6Matrix6rowMaxER7IVectorR6Matrix">
<span id="paddle::Matrix::rowMax__IVectorR.MatrixR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a6c3aca70393342be128eab1f2e6dc379"></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="#_CPPv2N6paddle6Matrix6rowMaxER7IVectorR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
1979 1980 1981 1982 1983
<dd><p>Get the top k elements of each row of this matrix. </p>
<p>The column ids and values of these elements are stored in maxIds and max respectively. Note that the top k elements are not sorted. </p>
</dd></dl>

<dl class="function">
1984 1985 1986 1987
<dt id="_CPPv2N6paddle6Matrix14rowNormalizeL1ER6Matrix">
<span id="paddle::Matrix::rowNormalizeL1__MatrixR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a0f5c441da732275ade1b23ca1e0de497"></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="#_CPPv2N6paddle6Matrix14rowNormalizeL1ER6Matrix" title="Permalink to this definition">¶</a></dt>
<dd><p>normalize each row so that the sum of each row is 1. </p>
</dd></dl>
Y
Yu Yang 已提交
1988 1989

<dl class="function">
1990 1991 1992 1993 1994 1995
<dt id="_CPPv2N6paddle6Matrix3mulEK9MatrixPtrK9MatrixPtr">
<span id="paddle::Matrix::mul__MatrixPtrC.MatrixPtrC"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1aeaabdfe815ca3ea45c0c8b4a43f034be"></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="#_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>
</pre></div>
</div>
</p>
Y
Yu Yang 已提交
1996 1997 1998
</dd></dl>

<dl class="function">
1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016 2017 2018 2019 2020 2021 2022 2023 2024 2025 2026 2027 2028 2029 2030 2031 2032 2033 2034 2035 2036 2037 2038 2039 2040 2041 2042
<dt id="_CPPv2N6paddle6Matrix8rightMulER6Matrix4real4real">
<span id="paddle::Matrix::rightMul__MatrixR.real.real"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1aa40dfdc4a16aa02fd756382f317675e8"></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="#_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>
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix8rightMulER6Matrix">
<span id="paddle::Matrix::rightMul__MatrixR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1aa07beb8c8f64b502490d9f0e1210bd06"></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="#_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>
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix7leftMulER6Matrix4real4real">
<span id="paddle::Matrix::leftMul__MatrixR.real.real"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a02e0165c26f9401f2e674ab009f9b641"></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="#_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>
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix7leftMulER6Matrix">
<span id="paddle::Matrix::leftMul__MatrixR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a12aac0ed9bde92d42e078d3514ca3651"></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="#_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>
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix8colMergeER6Matrix">
<span id="paddle::Matrix::colMerge__MatrixR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a033fe5634175ac6fecc55633071c0ece"></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="#_CPPv2N6paddle6Matrix8colMergeER6Matrix" title="Permalink to this definition">¶</a></dt>
<dd><p>merge the element for each col. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix18oneHotCrossEntropyER6MatrixR7IVector">
<span id="paddle::Matrix::oneHotCrossEntropy__MatrixR.IVectorR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1abb4da07da47394cf3838028c55e67d43"></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="#_CPPv2N6paddle6Matrix18oneHotCrossEntropyER6MatrixR7IVector" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2043 2044 2045 2046
<dd><p>copy -log(output[label]) to this-&gt;data[i]. </p>
</dd></dl>

<dl class="function">
2047 2048
<dt id="_CPPv2N6paddle6Matrix20oneHotCrossEntropyBpER6MatrixR7IVector">
<span id="paddle::Matrix::oneHotCrossEntropyBp__MatrixR.IVectorR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a5d9ee3cd2503c63cb802c0a3b3500b93"></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="#_CPPv2N6paddle6Matrix20oneHotCrossEntropyBpER6MatrixR7IVector" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2049 2050 2051 2052
<dd><p>calculate the error of outputV according to label. </p>
</dd></dl>

<dl class="function">
2053 2054
<dt id="_CPPv2N6paddle6Matrix30oneHotCrossEntropyWithSelfNormER6MatrixR7IVector4real">
<span id="paddle::Matrix::oneHotCrossEntropyWithSelfNorm__MatrixR.IVectorR.real"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1abff1991cd2e3ff1bda273e2df15c7921"></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="#_CPPv2N6paddle6Matrix30oneHotCrossEntropyWithSelfNormER6MatrixR7IVector4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2055 2056 2057 2058
<dd><p>copy -log(output[label]) to this-&gt;data[i]. </p>
</dd></dl>

<dl class="function">
2059 2060
<dt id="_CPPv2N6paddle6Matrix32oneHotCrossEntropyWithSelfNormBpER6MatrixR7IVector4real">
<span id="paddle::Matrix::oneHotCrossEntropyWithSelfNormBp__MatrixR.IVectorR.real"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a7ce5dd378e7c007b80a4e6ba186dea3c"></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="#_CPPv2N6paddle6Matrix32oneHotCrossEntropyWithSelfNormBpER6MatrixR7IVector4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2061 2062 2063 2064
<dd><p>calculate the error of outputV according to label. </p>
</dd></dl>

<dl class="function">
2065 2066
<dt id="_CPPv2N6paddle6Matrix12circularConvER6MatrixR6Matrix">
<span id="paddle::Matrix::circularConv__MatrixR.MatrixR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a9966cc1fe5b7097f59fc0b32f40d2923"></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="#_CPPv2N6paddle6Matrix12circularConvER6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2067 2068 2069 2070 2071 2072 2073
<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">
2074 2075
<dt id="_CPPv2N6paddle6Matrix22circularConvDerivativeER6MatrixR6MatrixR6MatrixR6MatrixR6Matrix">
<span id="paddle::Matrix::circularConvDerivative__MatrixR.MatrixR.MatrixR.MatrixR.MatrixR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1aa8379ed7d2e6dbe8789f81288c1a2044"></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="#_CPPv2N6paddle6Matrix22circularConvDerivativeER6MatrixR6MatrixR6MatrixR6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2076 2077 2078
<dd></dd></dl>

<dl class="function">
2079 2080
<dt id="_CPPv2N6paddle6Matrix7softmaxER6Matrix">
<span id="paddle::Matrix::softmax__MatrixR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a46e6094cb4d7572ff9cd87ca977935b1"></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="#_CPPv2N6paddle6Matrix7softmaxER6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2081 2082 2083
<dd></dd></dl>

<dl class="function">
2084 2085
<dt id="_CPPv2N6paddle6Matrix15sequenceSoftmaxER6MatrixRK7IVector">
<span id="paddle::Matrix::sequenceSoftmax__MatrixR.IVectorCR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1aec1227f84891a056845bce5886ee9ffa"></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="#_CPPv2N6paddle6Matrix15sequenceSoftmaxER6MatrixRK7IVector" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2086 2087 2088
<dd></dd></dl>

<dl class="function">
2089 2090
<dt id="_CPPv2N6paddle6Matrix15softmaxBackwardER6Matrix">
<span id="paddle::Matrix::softmaxBackward__MatrixR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a880e9ddfb13d0e5aaf7d0cfa0d8d620e"></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="#_CPPv2N6paddle6Matrix15softmaxBackwardER6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2091 2092 2093
<dd></dd></dl>

<dl class="function">
2094 2095 2096 2097 2098 2099 2100
<dt id="_CPPv2N6paddle6Matrix17softmaxDerivativeER6MatrixR6Matrix">
<span id="paddle::Matrix::softmaxDerivative__MatrixR.MatrixR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a3d6701b1ace72fb1f47ec7f3f314158c"></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="#_CPPv2N6paddle6Matrix17softmaxDerivativeER6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix12sumOfSquaresER6MatrixR6Matrix">
<span id="paddle::Matrix::sumOfSquares__MatrixR.MatrixR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a9615bebedd8189b4d63a963d9d4c9924"></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="#_CPPv2N6paddle6Matrix12sumOfSquaresER6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2101 2102 2103 2104
<dd><p>calculate the sum of squares diff cost. </p>
</dd></dl>

<dl class="function">
2105 2106
<dt id="_CPPv2N6paddle6Matrix14sumOfSquaresBpER6MatrixR6Matrix">
<span id="paddle::Matrix::sumOfSquaresBp__MatrixR.MatrixR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a3e76f6f5f8b70306b66e1e0749c28193"></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="#_CPPv2N6paddle6Matrix14sumOfSquaresBpER6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2107 2108 2109 2110
<dd><p>gradient of sumOfSquares. </p>
</dd></dl>

<dl class="function">
2111 2112
<dt id="_CPPv2N6paddle6Matrix4tanhER6Matrix">
<span id="paddle::Matrix::tanh__MatrixR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1ab4f85947a86a348fa82f099360df4134"></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="#_CPPv2N6paddle6Matrix4tanhER6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2113 2114 2115
<dd></dd></dl>

<dl class="function">
2116 2117
<dt id="_CPPv2N6paddle6Matrix14tanhDerivativeER6Matrix">
<span id="paddle::Matrix::tanhDerivative__MatrixR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a1c292dcf153564e9fc01c79afbc7caf7"></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="#_CPPv2N6paddle6Matrix14tanhDerivativeER6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2118 2119 2120
<dd></dd></dl>

<dl class="function">
2121 2122
<dt id="_CPPv2N6paddle6Matrix8softreluER6Matrix">
<span id="paddle::Matrix::softrelu__MatrixR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a4f93fd82494a81f0e3473044c96229bf"></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="#_CPPv2N6paddle6Matrix8softreluER6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2123 2124 2125
<dd></dd></dl>

<dl class="function">
2126 2127
<dt id="_CPPv2N6paddle6Matrix18softreluDerivativeER6Matrix">
<span id="paddle::Matrix::softreluDerivative__MatrixR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1aecfae4c512544f35970be91c84e9cc04"></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="#_CPPv2N6paddle6Matrix18softreluDerivativeER6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2128 2129 2130
<dd></dd></dl>

<dl class="function">
2131 2132
<dt id="_CPPv2N6paddle6Matrix10scaledTanhER6Matrix4real4real">
<span id="paddle::Matrix::scaledTanh__MatrixR.real.real"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1aa4cb8e38ef9a14a7252baca5985c949e"></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="#_CPPv2N6paddle6Matrix10scaledTanhER6Matrix4real4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2133 2134 2135
<dd></dd></dl>

<dl class="function">
2136 2137
<dt id="_CPPv2N6paddle6Matrix6cosSimER6MatrixR6Matrix4real">
<span id="paddle::Matrix::cosSim__MatrixR.MatrixR.real"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1adb09b0d6750e56844a30eed2fd0f9252"></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> = 1.0f<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix6cosSimER6MatrixR6Matrix4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2138 2139 2140 2141 2142
<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">
2143 2144
<dt id="_CPPv2N6paddle6Matrix16cosSimDerivativeER6MatrixR6MatrixR6MatrixR6MatrixR6Matrix4real">
<span id="paddle::Matrix::cosSimDerivative__MatrixR.MatrixR.MatrixR.MatrixR.MatrixR.real"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a0518c3f43aa8df86657b587b892e236b"></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> = 1.0f<span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle6Matrix16cosSimDerivativeER6MatrixR6MatrixR6MatrixR6MatrixR6Matrix4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2145 2146 2147
<dd></dd></dl>

<dl class="function">
2148 2149
<dt id="_CPPv2N6paddle6Matrix5printERNSt7ostreamE">
<span id="paddle::Matrix::print__osR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1aa6ae154763c7a08df663e42b62bd1315"></span>void <code class="descname">print</code><span class="sig-paren">(</span>std::ostream &amp;<em>os</em><span class="sig-paren">)</span> const<a class="headerlink" href="#_CPPv2N6paddle6Matrix5printERNSt7ostreamE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2150 2151 2152 2153
<dd><p>print out the values of elements to os </p>
</dd></dl>

<dl class="function">
2154 2155
<dt id="_CPPv2N6paddle6Matrix5printERNSt7ostreamE6size_t6size_t">
<span id="paddle::Matrix::print__osR.s.s"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a62d3d13fe13596f7711e09790df637c8"></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> const<a class="headerlink" href="#_CPPv2N6paddle6Matrix5printERNSt7ostreamE6size_t6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2156 2157 2158 2159
<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">
2160 2161
<dt id="_CPPv2N6paddle6Matrix11printOneRowERNSt7ostreamE6size_t">
<span id="paddle::Matrix::printOneRow__osR.s"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a9b6d9d095ec62d82dc146bcd9b3686de"></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> const<a class="headerlink" href="#_CPPv2N6paddle6Matrix11printOneRowERNSt7ostreamE6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2162 2163 2164 2165
<dd><p>print one row to os </p>
</dd></dl>

<dl class="function">
2166 2167
<dt id="_CPPv2N6paddle6Matrix5checkERNSt7ostreamER6Matrixb">
<span id="paddle::Matrix::check__osR.MatrixR.b"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1aaf09e3126318e7102743d53030f0a0da"></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="#_CPPv2N6paddle6Matrix5checkERNSt7ostreamER6Matrixb" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2168 2169 2170
<dd></dd></dl>

<dl class="function">
2171 2172
<dt id="_CPPv2N6paddle6Matrix6getMinEv">
<span id="paddle::Matrix::getMin"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a4de1b6d95d798b723b894347920dbcaa"></span>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 已提交
2173 2174 2175
<dd></dd></dl>

<dl class="function">
2176 2177
<dt id="_CPPv2N6paddle6Matrix6getMaxEv">
<span id="paddle::Matrix::getMax"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a61e9189a777c55dd5f3740ebe99d9b71"></span>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 已提交
2178 2179 2180
<dd></dd></dl>

<dl class="function">
2181 2182
<dt id="_CPPv2N6paddle6Matrix16randomizeUniformEv">
<span id="paddle::Matrix::randomizeUniform"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1ab5f9f4e639704eb3b45893753fc6f7ca"></span>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 已提交
2183 2184 2185
<dd></dd></dl>

<dl class="function">
2186 2187
<dt id="_CPPv2N6paddle6Matrix19classificationErrorE9MatrixPtr10IVectorPtr">
<span id="paddle::Matrix::classificationError__MatrixPtr.IVectorPtr"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a140b3882d42203bf343118d10cd4d76c"></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="#_CPPv2N6paddle6Matrix19classificationErrorE9MatrixPtr10IVectorPtr" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2188 2189 2190 2191 2192 2193
<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">
2194 2195 2196 2197
<dt id="_CPPv2N6paddle6Matrix10convExpandER6Matrixiiiiiiiiiii">
<span id="paddle::Matrix::convExpand__MatrixR.i.i.i.i.i.i.i.i.i.i.i"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1afcd4bb1a5e85eb771855f76d39c53935"></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="#_CPPv2N6paddle6Matrix10convExpandER6Matrixiiiiiiiiiii" title="Permalink to this definition">¶</a></dt>
<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 已提交
2198 2199 2200
</dd></dl>

<dl class="function">
2201 2202 2203 2204
<dt id="_CPPv2N6paddle6Matrix10convShrinkER6Matrixiiiiiiiiiii4real4real">
<span id="paddle::Matrix::convShrink__MatrixR.i.i.i.i.i.i.i.i.i.i.i.real.real"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1ad17a7829868f628d625d5cd5ae0ed6fd"></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="#_CPPv2N6paddle6Matrix10convShrinkER6Matrixiiiiiiiiiii4real4real" title="Permalink to this definition">¶</a></dt>
<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 已提交
2205 2206 2207
</dd></dl>

<dl class="function">
2208 2209
<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>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1afb881a111e85c482e5542c5f04cfe353"></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="#_CPPv2N6paddle6Matrix14maxPoolForwardER6Matrix6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t" title="Permalink to this definition">¶</a></dt>
2210
<dd><p>Pooling forward operation, pick out the largest element in the sizeX of value </p>
Y
Yu Yang 已提交
2211 2212 2213
</dd></dl>

<dl class="function">
2214 2215
<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>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a401f06ce97e359b8f1c0e4a4f0d24b14"></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="#_CPPv2N6paddle6Matrix15maxPoolBackwardER6Matrix6size_t6size_tR6MatrixR6Matrix6size_t6size_t6size_t6size_t6size_t6size_t4real4real6size_t6size_t" title="Permalink to this definition">¶</a></dt>
2216
<dd><p>Pooling backward operation. </p>
Y
Yu Yang 已提交
2217 2218 2219
</dd></dl>

<dl class="function">
2220 2221
<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>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a438160b40b392a0ada4c26f1e41fb2a4"></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="#_CPPv2N6paddle6Matrix14avgPoolForwardER6Matrix6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t" title="Permalink to this definition">¶</a></dt>
2222
<dd><p>Pooling forward operation, caculate the average of sizeX elements. </p>
Y
Yu Yang 已提交
2223 2224 2225
</dd></dl>

<dl class="function">
2226 2227
<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>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1ad0d7b0142b5ff6cdba5850c44adebcf6"></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="#_CPPv2N6paddle6Matrix15avgPoolBackwardER6Matrix6size_t6size_t6size_t6size_t6size_t6size_t6size_t6size_t4real4real6size_t6size_t" title="Permalink to this definition">¶</a></dt>
2228
<dd></dd></dl>
Y
Yu Yang 已提交
2229 2230

<dl class="function">
2231 2232 2233
<dt id="_CPPv2N6paddle6Matrix17crossMapNormalFwdER6Matrix6size_t6size_tR6Matrix6size_t6size_tff">
<span id="paddle::Matrix::crossMapNormalFwd__MatrixR.s.s.MatrixR.s.s.float.float"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a0d474f8284d8973bd37eb3a70abe31b5"></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="#_CPPv2N6paddle6Matrix17crossMapNormalFwdER6Matrix6size_t6size_tR6Matrix6size_t6size_tff" title="Permalink to this definition">¶</a></dt>
<dd><p>normalize-operation. </p>
Y
Yu Yang 已提交
2234 2235 2236
</dd></dl>

<dl class="function">
2237 2238 2239 2240 2241 2242 2243 2244 2245 2246
<dt id="_CPPv2N6paddle6Matrix17crossMapNormalBwdER6MatrixR6MatrixR6MatrixR6Matrix6size_t6size_t6size_t6size_tff">
<span id="paddle::Matrix::crossMapNormalBwd__MatrixR.MatrixR.MatrixR.MatrixR.s.s.s.s.float.float"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a04e9a8320a4e36ff2f3949a3015427c3"></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>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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix18maxSequenceForwardER6MatrixRK7IVectorR7IVector">
<span id="paddle::Matrix::maxSequenceForward__MatrixR.IVectorCR.IVectorR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a06bb9c7e4d1512b44e9e14687e91cef2"></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="#_CPPv2N6paddle6Matrix18maxSequenceForwardER6MatrixRK7IVectorR7IVector" title="Permalink to this definition">¶</a></dt>
<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 已提交
2247 2248 2249
</dd></dl>

<dl class="function">
2250 2251 2252 2253 2254 2255 2256 2257 2258 2259 2260 2261 2262 2263 2264 2265 2266 2267 2268 2269 2270 2271 2272 2273 2274 2275 2276 2277 2278 2279 2280 2281 2282 2283 2284 2285 2286 2287 2288 2289 2290 2291 2292 2293 2294 2295 2296 2297 2298 2299 2300 2301 2302 2303 2304 2305 2306 2307 2308 2309 2310 2311 2312 2313 2314 2315 2316 2317 2318 2319 2320 2321 2322 2323 2324 2325
<dt id="_CPPv2N6paddle6Matrix19maxSequenceBackwardER6MatrixRK7IVectorR7IVector">
<span id="paddle::Matrix::maxSequenceBackward__MatrixR.IVectorCR.IVectorR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a93c2dd752b6628796a83c5aeaf8a5bf4"></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="#_CPPv2N6paddle6Matrix19maxSequenceBackwardER6MatrixRK7IVectorR7IVector" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix24contextProjectionForwardE9MatrixPtr9MatrixPtrRK7IVectorii6size_tb">
<span id="paddle::Matrix::contextProjectionForward__MatrixPtr.MatrixPtr.IVectorCR.i.i.s.b"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a9b52b8eaca408d54fcc76d53e0d936b5"></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="#_CPPv2N6paddle6Matrix24contextProjectionForwardE9MatrixPtr9MatrixPtrRK7IVectorii6size_tb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix25contextProjectionBackwardE9MatrixPtr9MatrixPtrRK7IVectorii6size_tb">
<span id="paddle::Matrix::contextProjectionBackward__MatrixPtr.MatrixPtr.IVectorCR.i.i.s.b"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a0a364ab1d7d16ef5ec53cb8fc65e0f72"></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="#_CPPv2N6paddle6Matrix25contextProjectionBackwardE9MatrixPtr9MatrixPtrRK7IVectorii6size_tb" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix29contextProjectionBackwardDataE9MatrixPtrRK7IVectorii">
<span id="paddle::Matrix::contextProjectionBackwardData__MatrixPtr.IVectorCR.i.i"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1af19f55ae625e870de28257bf30646751"></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="#_CPPv2N6paddle6Matrix29contextProjectionBackwardDataE9MatrixPtrRK7IVectorii" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix31contextProjectionBackwardWeightE9MatrixPtrRK7IVectoriii6size_t">
<span id="paddle::Matrix::contextProjectionBackwardWeight__MatrixPtr.IVectorCR.i.i.i.s"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1adad15b5f753ccebd780dcf5a57400c58"></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="#_CPPv2N6paddle6Matrix31contextProjectionBackwardWeightE9MatrixPtrRK7IVectoriii6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix10selectRowsER6MatrixR7IVector">
<span id="paddle::Matrix::selectRows__MatrixR.IVectorR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a7ee4671196c2c002ec889dc85b197db2"></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="#_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>
<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>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix14selectElementsER6MatrixR7IVector">
<span id="paddle::Matrix::selectElements__MatrixR.IVectorR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a5770811cb7df65c27017a1ce41fa7b5f"></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="#_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>
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix9addToRowsER6MatrixR7IVector">
<span id="paddle::Matrix::addToRows__MatrixR.IVectorR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a698467386b439424193460ba36a02da2"></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="#_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>
<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>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix11addElementsER6MatrixR7IVector">
<span id="paddle::Matrix::addElements__MatrixR.IVectorR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a08ab40bed79df5e2e46e97fe6f3c5874"></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="#_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>
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix28multiBinaryLabelCrossEntropyER6MatrixR6Matrix">
<span id="paddle::Matrix::multiBinaryLabelCrossEntropy__MatrixR.MatrixR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a787925e54669bf8b8a207a7f9a6d8028"></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="#_CPPv2N6paddle6Matrix28multiBinaryLabelCrossEntropyER6MatrixR6Matrix" 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="_CPPv2N6paddle6Matrix30multiBinaryLabelCrossEntropyBpER6MatrixR6Matrix">
<span id="paddle::Matrix::multiBinaryLabelCrossEntropyBp__MatrixR.MatrixR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1af03de87cdf65385eb8edf58f0ec2d45a"></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="#_CPPv2N6paddle6Matrix30multiBinaryLabelCrossEntropyBpER6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2326
<dd><p>The gradient of cross entropy for multi binary labels on output. </p>
2327 2328
<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>
Y
Yu Yang 已提交
2329 2330 2331 2332 2333 2334
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
2335 2336
<dt id="_CPPv2N6paddle6Matrix24classificationErrorMultiER6MatrixR6Matrix4real">
<span id="paddle::Matrix::classificationErrorMulti__MatrixR.MatrixR.real"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1af24da39d66fb9276807fead356750adb"></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="#_CPPv2N6paddle6Matrix24classificationErrorMultiER6MatrixR6Matrix4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2337
<dd><p>Calculate the classification error for multi binary labels. </p>
2338 2339 2340
<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>
           <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 已提交
2341 2342 2343 2344 2345
</pre></div>
</div>
</p>
</dd></dl>

2346 2347 2348 2349 2350 2351 2352 2353 2354 2355 2356 2357 2358 2359 2360 2361 2362 2363 2364 2365 2366 2367 2368 2369 2370 2371 2372 2373
<dl class="function">
<dt id="_CPPv2N6paddle6Matrix16paramReluForwardER6MatrixR6Matrix">
<span id="paddle::Matrix::paramReluForward__MatrixR.MatrixR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1a382f5dd92b7e8d4fa5539f7dffd624b8"></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="#_CPPv2N6paddle6Matrix16paramReluForwardER6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix18paramReluBackwardWER6MatrixR6Matrix">
<span id="paddle::Matrix::paramReluBackwardW__MatrixR.MatrixR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1ae4795969f4a0a36caeceaf0f9c757bee"></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="#_CPPv2N6paddle6Matrix18paramReluBackwardWER6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle6Matrix21paramReluBackwardDiffER6MatrixR6MatrixR6Matrix">
<span id="paddle::Matrix::paramReluBackwardDiff__MatrixR.MatrixR.MatrixR"></span>virtual <span class="target" id="paddleclasspaddle_1_1Matrix_1aeefdd34125baa6bc870e306adc1b5673"></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="#_CPPv2N6paddle6Matrix21paramReluBackwardDiffER6MatrixR6MatrixR6Matrix" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<div class="breathe-sectiondef container">
<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 已提交
2374 2375 2376 2377
</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Static Functions</p>
<dl class="function">
2378 2379
<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 已提交
2380 2381 2382
<dd></dd></dl>

<dl class="function">
2383 2384 2385 2386 2387 2388 2389 2390 2391 2392 2393 2394 2395 2396 2397 2398 2399 2400 2401 2402 2403 2404 2405 2406 2407 2408 2409 2410 2411 2412 2413 2414 2415 2416 2417 2418 2419 2420 2421 2422 2423 2424 2425 2426 2427 2428 2429 2430 2431 2432 2433 2434 2435 2436 2437 2438 2439 2440 2441 2442 2443 2444 2445 2446
<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>
<div class="breathe-sectiondef container">
<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>
<div class="breathe-sectiondef container">
<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 已提交
2447 2448 2449 2450 2451 2452 2453

</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>
2454
<dd><p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Matrix"><span class="std std-ref">paddle::Matrix</span></a></p>
Y
Yu Yang 已提交
2455 2456 2457 2458 2459 2460 2461 2462 2463 2464 2465 2466 2467 2468 2469 2470 2471 2472 2473 2474 2475 2476 2477 2478 2479 2480 2481 2482 2483 2484 2485 2486 2487 2488 2489 2490 2491 2492 2493 2494 2495 2496 2497 2498 2499 2500 2501
<div class="breathe-sectiondef container">
<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">
<span id="paddle::GpuMatrix::zeroMem"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix8resetOneEv">
<span id="paddle::GpuMatrix::resetOne"></span>virtual <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="_CPPv2N6paddle9GpuMatrix6resizeE6size_t6size_t">
<span id="paddle::GpuMatrix::resize__s.s"></span>virtual <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>
<dd><p><dl class="docutils">
<dt><strong>Note</strong></dt>
2502
<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 已提交
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 2530 2531 2532 2533 2534 2535 2536 2537 2538 2539 2540 2541 2542 2543 2544 2545 2546 2547 2548 2549 2550 2551 2552 2553
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix6resizeE6size_t6size_t6size_t15SparseValueType12SparseFormat">
<span id="paddle::GpuMatrix::resize__s.s.s.SparseValueType.SparseFormat"></span>virtual <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>
<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">
<span id="paddle::GpuMatrix::setRow__s.s.unsigned-iCP.realCP"></span>virtual <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>
<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">
<span id="paddle::GpuMatrix::copyFrom__realCP.s"></span>virtual <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>
<dd><p>Copy the data from cpu_memory buffer </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix8copyFromEPK4realPK7int64_t">
<span id="paddle::GpuMatrix::copyFrom__realCP.int64_tCP"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix8copyFromERK6Matrix11hl_stream_t">
<span id="paddle::GpuMatrix::copyFrom__MatrixCR.hl_stream_t"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix8copyFromERK6Matrix">
<span id="paddle::GpuMatrix::copyFrom__MatrixCR"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix8copyFromERK7IVector">
<span id="paddle::GpuMatrix::copyFrom__IVectorCR"></span>virtual <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>
<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">
2554 2555
<dt id="_CPPv2N6paddle9GpuMatrix14copyByRowIndexER6MatrixR7IVector">
<span id="paddle::GpuMatrix::copyByRowIndex__MatrixR.IVectorR"></span>virtual <span class="target" id="paddleclasspaddle_1_1GpuMatrix_1a46f305110a92a4fbdc98faaba0a35951"></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>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>rowIndex</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix14copyByRowIndexER6MatrixR7IVector" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
2556 2557 2558 2559 2560
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix5cloneE6size_t6size_tb">
<span id="paddle::GpuMatrix::clone__s.s.b"></span>virtual <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>
2561
<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 已提交
2562 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 2596 2597 2598 2599 2600 2601 2602 2603 2604 2605 2606 2607 2608 2609 2610 2611 2612 2613 2614 2615
<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">
<dt id="_CPPv2N6paddle9GpuMatrix10getElementE6size_t6size_t">
<span id="paddle::GpuMatrix::getElement__s.s"></span>virtual <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> const<a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix10getElementE6size_t6size_t" title="Permalink to this definition">¶</a></dt>
<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">
<span id="paddle::GpuMatrix::getRowBuf__s"></span>virtual <span class="target" id="paddleclasspaddle_1_1GpuMatrix_1aafc0f3e898ad3370c491ba7b45d31177"></span>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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix6getSumEv">
<span id="paddle::GpuMatrix::getSum"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix16accumulateColSumER6Matrix">
<span id="paddle::GpuMatrix::accumulateColSum__MatrixR"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix9getAbsSumEv">
<span id="paddle::GpuMatrix::getAbsSum"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix12getTransposeEv">
<span id="paddle::GpuMatrix::getTranspose"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix9transposeE9MatrixPtrb">
<span id="paddle::GpuMatrix::transpose__MatrixPtr.b"></span>virtual <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>
<dd><p>hard transpose. </p>
<p>allocate matTrans&#8217; memory outside, then set memAlloc as false; else set as true. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix7addBiasER6Matrix4real">
<span id="paddle::GpuMatrix::addBias__MatrixR.real"></span>virtual <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>
<dd><p>add b to each sample of this. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix11collectBiasER6Matrix4real">
<span id="paddle::GpuMatrix::collectBias__MatrixR.real"></span>virtual <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>
2616
<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 已提交
2617 2618 2619 2620 2621 2622 2623 2624 2625 2626 2627 2628 2629
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix18sequenceAvgForwardER6MatrixRK7IVectori">
<span id="paddle::GpuMatrix::sequenceAvgForward__MatrixR.IVectorCR.i"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix10selectRowsER6MatrixR7IVector">
<span id="paddle::GpuMatrix::selectRows__MatrixR.IVectorR"></span>virtual <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>
2630
<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 已提交
2631 2632 2633 2634 2635 2636 2637 2638
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix14selectElementsER6MatrixR7IVector">
<span id="paddle::GpuMatrix::selectElements__MatrixR.IVectorR"></span>virtual <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>
2639
<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 已提交
2640 2641 2642 2643 2644 2645 2646 2647
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix9addToRowsER6MatrixR7IVector">
<span id="paddle::GpuMatrix::addToRows__MatrixR.IVectorR"></span>virtual <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>
2648
<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 已提交
2649 2650 2651 2652 2653 2654 2655 2656 2657 2658 2659 2660 2661 2662
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix15addColumnVectorERK6Matrix">
<span id="paddle::GpuMatrix::addColumnVector__MatrixCR"></span>virtual <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>
<dd><p>Add a vector (column) b to matrix a, column by column. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix3mulEK9MatrixPtrK9MatrixPtr4real4real">
<span id="paddle::GpuMatrix::mul__MatrixPtrC.MatrixPtrC.real.real"></span>virtual <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>
2663
<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 已提交
2664 2665 2666 2667 2668 2669 2670 2671
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix3mulEK9MatrixPtrK9MatrixPtr">
<span id="paddle::GpuMatrix::mul__MatrixPtrC.MatrixPtrC"></span>virtual <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>
2672
<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 已提交
2673 2674 2675 2676 2677 2678 2679
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix3mulERK9GpuMatrixRK9GpuMatrix4real4real">
2680
<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 已提交
2681 2682 2683 2684
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix3mulERK15GpuSparseMatrixRK9GpuMatrix4real4real">
2685
<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 已提交
2686 2687 2688 2689
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix3mulERK9GpuMatrixRK15GpuSparseMatrix4real4real">
2690
<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 已提交
2691 2692 2693 2694 2695
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix8rightMulER6Matrix4real4real">
<span id="paddle::GpuMatrix::rightMul__MatrixR.real.real"></span>virtual <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>
2696
<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 已提交
2697 2698 2699 2700 2701 2702 2703 2704
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix8rightMulER6Matrix">
<span id="paddle::GpuMatrix::rightMul__MatrixR"></span>virtual <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>
2705
<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 已提交
2706 2707 2708 2709 2710 2711 2712 2713
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix7leftMulER6Matrix4real4real">
<span id="paddle::GpuMatrix::leftMul__MatrixR.real.real"></span>virtual <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>
2714
<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 已提交
2715 2716 2717 2718 2719 2720 2721 2722
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix7leftMulER6Matrix">
<span id="paddle::GpuMatrix::leftMul__MatrixR"></span>virtual <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>
2723
<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 已提交
2724 2725 2726 2727 2728 2729 2730 2731 2732 2733 2734 2735 2736 2737 2738 2739 2740 2741 2742 2743 2744 2745 2746 2747 2748 2749 2750 2751 2752 2753 2754 2755 2756 2757 2758 2759 2760 2761 2762 2763 2764 2765 2766 2767 2768 2769 2770 2771 2772 2773 2774 2775 2776 2777 2778 2779 2780 2781 2782 2783 2784 2785 2786 2787 2788 2789 2790 2791 2792 2793 2794 2795 2796 2797 2798 2799 2800 2801 2802 2803 2804 2805 2806 2807 2808 2809 2810 2811 2812 2813 2814 2815 2816 2817 2818 2819 2820 2821 2822 2823 2824 2825 2826 2827 2828 2829 2830 2831 2832 2833 2834 2835 2836 2837 2838 2839 2840 2841 2842 2843 2844 2845 2846 2847 2848 2849 2850 2851 2852 2853 2854 2855 2856 2857 2858 2859 2860 2861 2862 2863 2864 2865 2866 2867 2868 2869 2870 2871 2872 2873 2874 2875 2876 2877 2878 2879 2880 2881 2882 2883 2884 2885 2886 2887 2888 2889 2890 2891 2892 2893 2894 2895 2896 2897 2898 2899 2900 2901 2902 2903 2904 2905 2906 2907 2908 2909 2910 2911
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix8colMergeER6Matrix">
<span id="paddle::GpuMatrix::colMerge__MatrixR"></span>virtual <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>
<dd><p>merge the element for each col. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix6rowSumER6Matrix">
<span id="paddle::GpuMatrix::rowSum__MatrixR"></span>virtual <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>
<dd><p>add the sum of each row of this to mat </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix6rowMaxER6Matrix">
<span id="paddle::GpuMatrix::rowMax__MatrixR"></span>virtual <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>
<dd><p>set the max of each row of this to mat </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix6rowMaxER7IVectorR6Matrix">
<span id="paddle::GpuMatrix::rowMax__IVectorR.MatrixR"></span>virtual <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>
<dd><p>Get the top k elements of each row of this matrix. </p>
<p>The column ids and values of these elements are stored in maxIds and max respectively. Note that the top k elements are not sorted. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix6colMaxER6Matrix">
<span id="paddle::GpuMatrix::colMax__MatrixR"></span>virtual <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></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix18oneHotCrossEntropyER6MatrixR7IVector">
<span id="paddle::GpuMatrix::oneHotCrossEntropy__MatrixR.IVectorR"></span>virtual <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>
<dd><p>copy -log(output[label]) to this-&gt;data[i]. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix20oneHotCrossEntropyBpER6MatrixR7IVector">
<span id="paddle::GpuMatrix::oneHotCrossEntropyBp__MatrixR.IVectorR"></span>virtual <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>
<dd><p>calculate the error of outputV according to label. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix30oneHotCrossEntropyWithSelfNormER6MatrixR7IVector4real">
<span id="paddle::GpuMatrix::oneHotCrossEntropyWithSelfNorm__MatrixR.IVectorR.real"></span>virtual <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>
<dd><p>copy -log(output[label]) to this-&gt;data[i]. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix32oneHotCrossEntropyWithSelfNormBpER6MatrixR7IVector4real">
<span id="paddle::GpuMatrix::oneHotCrossEntropyWithSelfNormBp__MatrixR.IVectorR.real"></span>virtual <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>
<dd><p>calculate the error of outputV according to label. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix7softmaxER6Matrix">
<span id="paddle::GpuMatrix::softmax__MatrixR"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix15sequenceSoftmaxER6MatrixRK7IVector">
<span id="paddle::GpuMatrix::sequenceSoftmax__MatrixR.IVectorCR"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix15softmaxBackwardER6Matrix">
<span id="paddle::GpuMatrix::softmaxBackward__MatrixR"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix17softmaxDerivativeER6MatrixR6Matrix">
<span id="paddle::GpuMatrix::softmaxDerivative__MatrixR.MatrixR"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix12sumOfSquaresER6MatrixR6Matrix">
<span id="paddle::GpuMatrix::sumOfSquares__MatrixR.MatrixR"></span>virtual <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>
<dd><p>calculate the sum of squares diff cost. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix14sumOfSquaresBpER6MatrixR6Matrix">
<span id="paddle::GpuMatrix::sumOfSquaresBp__MatrixR.MatrixR"></span>virtual <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>
<dd><p>gradient of sumOfSquares. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix4tanhER6Matrix">
<span id="paddle::GpuMatrix::tanh__MatrixR"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix14tanhDerivativeER6Matrix">
<span id="paddle::GpuMatrix::tanhDerivative__MatrixR"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix8softreluER6Matrix">
<span id="paddle::GpuMatrix::softrelu__MatrixR"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix18softreluDerivativeER6Matrix">
<span id="paddle::GpuMatrix::softreluDerivative__MatrixR"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix10scaledTanhER6Matrix4real4real">
<span id="paddle::GpuMatrix::scaledTanh__MatrixR.real.real"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix6cosSimER6MatrixR6Matrix4real">
<span id="paddle::GpuMatrix::cosSim__MatrixR.MatrixR.real"></span>virtual <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>
<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">
<span id="paddle::GpuMatrix::cosSimDerivative__MatrixR.MatrixR.MatrixR.MatrixR.MatrixR.real"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix5printERNSt7ostreamE">
<span id="paddle::GpuMatrix::print__osR"></span>virtual <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> const<a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix5printERNSt7ostreamE" title="Permalink to this definition">¶</a></dt>
<dd><p>print out the values of elements to os </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix5printERNSt7ostreamE6size_t6size_t">
<span id="paddle::GpuMatrix::print__osR.s.s"></span>virtual <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> const<a class="headerlink" href="#_CPPv2N6paddle9GpuMatrix5printERNSt7ostreamE6size_t6size_t" title="Permalink to this definition">¶</a></dt>
<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">
<span id="paddle::GpuMatrix::paramReluForward__MatrixR.MatrixR"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix18paramReluBackwardWER6MatrixR6Matrix">
<span id="paddle::GpuMatrix::paramReluBackwardW__MatrixR.MatrixR"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix21paramReluBackwardDiffER6MatrixR6MatrixR6Matrix">
<span id="paddle::GpuMatrix::paramReluBackwardDiff__MatrixR.MatrixR.MatrixR"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix5checkERNSt7ostreamER6Matrixb">
<span id="paddle::GpuMatrix::check__osR.MatrixR.b"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix16randomizeUniformEv">
<span id="paddle::GpuMatrix::randomizeUniform"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix19classificationErrorE9MatrixPtr10IVectorPtr">
<span id="paddle::GpuMatrix::classificationError__MatrixPtr.IVectorPtr"></span>virtual <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>
<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">
<span id="paddle::GpuMatrix::convExpand__MatrixR.i.i.i.i.i.i.i.i.i.i.i"></span>virtual <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>
<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">
<span id="paddle::GpuMatrix::convShrink__MatrixR.i.i.i.i.i.i.i.i.i.i.i.real.real"></span>virtual <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>
<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">
2912 2913
<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>virtual <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 已提交
2914 2915 2916 2917
<dd><p>Pooling forward operation, pick out the largest element in the sizeX of value </p>
</dd></dl>

<dl class="function">
2918 2919
<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>virtual <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 已提交
2920 2921 2922 2923
<dd><p>Pooling backward operation. </p>
</dd></dl>

<dl class="function">
2924 2925
<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>virtual <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 已提交
2926 2927 2928 2929
<dd><p>Pooling forward operation, caculate the average of sizeX elements. </p>
</dd></dl>

<dl class="function">
2930 2931
<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>virtual <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 已提交
2932 2933 2934
<dd></dd></dl>

<dl class="function">
2935 2936
<dt id="_CPPv2N6paddle9GpuMatrix17crossMapNormalFwdER6Matrix6size_t6size_tR6Matrix6size_t6size_tff">
<span id="paddle::GpuMatrix::crossMapNormalFwd__MatrixR.s.s.MatrixR.s.s.float.float"></span>virtual <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 已提交
2937 2938 2939 2940
<dd><p>normalize-operation. </p>
</dd></dl>

<dl class="function">
2941 2942
<dt id="_CPPv2N6paddle9GpuMatrix17crossMapNormalBwdER6MatrixR6MatrixR6MatrixR6Matrix6size_t6size_t6size_t6size_tff">
<span id="paddle::GpuMatrix::crossMapNormalBwd__MatrixR.MatrixR.MatrixR.MatrixR.s.s.s.s.float.float"></span>virtual <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 已提交
2943 2944 2945 2946 2947 2948 2949 2950 2951 2952 2953 2954 2955 2956 2957 2958 2959 2960 2961 2962 2963 2964 2965 2966 2967 2968 2969 2970 2971 2972 2973 2974 2975 2976
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix18maxSequenceForwardER6MatrixRK7IVectorR7IVector">
<span id="paddle::GpuMatrix::maxSequenceForward__MatrixR.IVectorCR.IVectorR"></span>virtual <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>
<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">
<span id="paddle::GpuMatrix::maxSequenceBackward__MatrixR.IVectorCR.IVectorR"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix24contextProjectionForwardE9MatrixPtr9MatrixPtrRK7IVectorii6size_tb">
<span id="paddle::GpuMatrix::contextProjectionForward__MatrixPtr.MatrixPtr.IVectorCR.i.i.s.b"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix29contextProjectionBackwardDataE9MatrixPtrRK7IVectorii">
<span id="paddle::GpuMatrix::contextProjectionBackwardData__MatrixPtr.IVectorCR.i.i"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9GpuMatrix31contextProjectionBackwardWeightE9MatrixPtrRK7IVectoriii6size_t">
<span id="paddle::GpuMatrix::contextProjectionBackwardWeight__MatrixPtr.IVectorCR.i.i.i.s"></span>virtual <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>

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

<dl class="class">
2977 2978 2979 2980
<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>
Y
Yu Yang 已提交
2981 2982 2983
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
2984 2985 2986
<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 已提交
2987 2988 2989
</dd></dl>

<dl class="function">
2990 2991 2992
<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 已提交
2993 2994

<dl class="function">
2995 2996
<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 已提交
2997 2998 2999
<dd></dd></dl>

<dl class="function">
3000 3001
<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 已提交
3002 3003 3004
<dd></dd></dl>

<dl class="function">
3005 3006
<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 已提交
3007 3008 3009
<dd></dd></dl>

<dl class="function">
3010 3011
<dt id="_CPPv2N6paddle9CpuMatrix7zeroMemEv">
<span id="paddle::CpuMatrix::zeroMem"></span>virtual <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 已提交
3012 3013 3014
<dd></dd></dl>

<dl class="function">
3015 3016
<dt id="_CPPv2N6paddle9CpuMatrix8resetOneEv">
<span id="paddle::CpuMatrix::resetOne"></span>virtual <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>
Y
Yu Yang 已提交
3017 3018 3019
<dd></dd></dl>

<dl class="function">
3020 3021 3022 3023 3024 3025 3026 3027
<dt id="_CPPv2N6paddle9CpuMatrix6resizeE6size_t6size_t">
<span id="paddle::CpuMatrix::resize__s.s"></span>virtual <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>
<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 已提交
3028 3029

<dl class="function">
3030 3031 3032 3033 3034 3035 3036 3037
<dt id="_CPPv2N6paddle9CpuMatrix6resizeE6size_t6size_t6size_t15SparseValueType12SparseFormat">
<span id="paddle::CpuMatrix::resize__s.s.s.SparseValueType.SparseFormat"></span>virtual <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>
<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 已提交
3038 3039

<dl class="function">
3040 3041 3042 3043 3044
<dt id="_CPPv2N6paddle9CpuMatrix6setRowE6size_t6size_tPKjPK4real">
<span id="paddle::CpuMatrix::setRow__s.s.unsigned-iCP.realCP"></span>virtual <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>
<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 已提交
3045 3046

<dl class="function">
3047 3048
<dt id="_CPPv2N6paddle9CpuMatrix10getElementE6size_t6size_t">
<span id="paddle::CpuMatrix::getElement__s.s"></span>virtual <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> const<a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix10getElementE6size_t6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3049 3050 3051
<dd></dd></dl>

<dl class="function">
3052 3053
<dt id="_CPPv2N6paddle9CpuMatrix6getSumEv">
<span id="paddle::CpuMatrix::getSum"></span>virtual <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 已提交
3054 3055 3056
<dd></dd></dl>

<dl class="function">
3057 3058
<dt id="_CPPv2N6paddle9CpuMatrix16accumulateColSumER6Matrix">
<span id="paddle::CpuMatrix::accumulateColSum__MatrixR"></span>virtual <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 已提交
3059 3060 3061
<dd></dd></dl>

<dl class="function">
3062 3063
<dt id="_CPPv2N6paddle9CpuMatrix9getAbsSumEv">
<span id="paddle::CpuMatrix::getAbsSum"></span>virtual <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 已提交
3064 3065 3066
<dd></dd></dl>

<dl class="function">
3067 3068 3069
<dt id="_CPPv2N6paddle9CpuMatrix12getTransposeEv">
<span id="paddle::CpuMatrix::getTranspose"></span>virtual <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>
<dd></dd></dl>
Y
Yu Yang 已提交
3070 3071

<dl class="function">
3072 3073 3074 3075 3076
<dt id="_CPPv2N6paddle9CpuMatrix9transposeE9MatrixPtrb">
<span id="paddle::CpuMatrix::transpose__MatrixPtr.b"></span>virtual <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>
<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 已提交
3077 3078

<dl class="function">
3079 3080
<dt id="_CPPv2N6paddle9CpuMatrix8copyFromERK6Matrix">
<span id="paddle::CpuMatrix::copyFrom__MatrixCR"></span>virtual <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 已提交
3081 3082 3083
<dd></dd></dl>

<dl class="function">
3084 3085
<dt id="_CPPv2N6paddle9CpuMatrix8copyFromERK6Matrix11hl_stream_t">
<span id="paddle::CpuMatrix::copyFrom__MatrixCR.hl_stream_t"></span>virtual <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 已提交
3086 3087 3088
<dd></dd></dl>

<dl class="function">
3089 3090 3091 3092 3093
<dt id="_CPPv2N6paddle9CpuMatrix8copyFromEPK4real6size_t">
<span id="paddle::CpuMatrix::copyFrom__realCP.s"></span>virtual <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>
<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 已提交
3094 3095

<dl class="function">
3096 3097
<dt id="_CPPv2N6paddle9CpuMatrix8copyFromEPK4realPK7int64_t">
<span id="paddle::CpuMatrix::copyFrom__realCP.int64_tCP"></span>virtual <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 已提交
3098 3099 3100
<dd></dd></dl>

<dl class="function">
3101 3102 3103 3104 3105 3106
<dt id="_CPPv2N6paddle9CpuMatrix8copyFromERK7IVector">
<span id="paddle::CpuMatrix::copyFrom__IVectorCR"></span>virtual <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>
<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 已提交
3107 3108

<dl class="function">
3109 3110
<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 已提交
3111 3112 3113
<dd></dd></dl>

<dl class="function">
3114 3115
<dt id="_CPPv2N6paddle9CpuMatrix14copyByRowIndexER6MatrixR7IVector">
<span id="paddle::CpuMatrix::copyByRowIndex__MatrixR.IVectorR"></span>virtual <span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a24837d660ae6691384313b5d399ad5fe"></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>, <a class="reference internal" href="#_CPPv2N6paddle7IVectorE" title="paddle::IVector">IVector</a> &amp;<em>rowIndex</em><span class="sig-paren">)</span><a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix14copyByRowIndexER6MatrixR7IVector" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3116 3117 3118
<dd></dd></dl>

<dl class="function">
3119 3120 3121 3122 3123
<dt id="_CPPv2N6paddle9CpuMatrix5cloneE6size_t6size_tb">
<span id="paddle::CpuMatrix::clone__s.s.b"></span>virtual <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>
<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 已提交
3124 3125

<dl class="function">
3126 3127 3128 3129 3130
<dt id="_CPPv2N6paddle9CpuMatrix10convExpandER6Matrixiiiiiiiiiii">
<span id="paddle::CpuMatrix::convExpand__MatrixR.i.i.i.i.i.i.i.i.i.i.i"></span>virtual <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>
<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 已提交
3131 3132

<dl class="function">
3133 3134 3135 3136 3137
<dt id="_CPPv2N6paddle9CpuMatrix10convShrinkER6Matrixiiiiiiiiiii4real4real">
<span id="paddle::CpuMatrix::convShrink__MatrixR.i.i.i.i.i.i.i.i.i.i.i.real.real"></span>virtual <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>
<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 已提交
3138 3139

<dl class="function">
3140 3141
<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>virtual <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>
3142
<dd><p>Pooling forward operation, pick out the largest element in the sizeX of value </p>
Y
Yu Yang 已提交
3143 3144 3145
</dd></dl>

<dl class="function">
3146 3147
<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>virtual <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>
3148 3149
<dd><p>Pooling backward operation. </p>
</dd></dl>
Y
Yu Yang 已提交
3150 3151

<dl class="function">
3152 3153
<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>virtual <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>
3154
<dd><p>Pooling forward operation, caculate the average of sizeX elements. </p>
Y
Yu Yang 已提交
3155 3156 3157
</dd></dl>

<dl class="function">
3158 3159
<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>virtual <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 已提交
3160 3161 3162
<dd></dd></dl>

<dl class="function">
3163 3164 3165
<dt id="_CPPv2N6paddle9CpuMatrix17crossMapNormalFwdER6Matrix6size_t6size_tR6Matrix6size_t6size_tff">
<span id="paddle::CpuMatrix::crossMapNormalFwd__MatrixR.s.s.MatrixR.s.s.float.float"></span>virtual <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>
<dd><p>normalize-operation. </p>
Y
Yu Yang 已提交
3166 3167 3168
</dd></dl>

<dl class="function">
3169 3170
<dt id="_CPPv2N6paddle9CpuMatrix17crossMapNormalBwdER6MatrixR6MatrixR6MatrixR6Matrix6size_t6size_t6size_t6size_tff">
<span id="paddle::CpuMatrix::crossMapNormalBwd__MatrixR.MatrixR.MatrixR.MatrixR.s.s.s.s.float.float"></span>virtual <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 已提交
3171 3172 3173
<dd></dd></dl>

<dl class="function">
3174 3175 3176 3177 3178 3179 3180 3181
<dt id="_CPPv2N6paddle9CpuMatrix18maxSequenceForwardER6MatrixRK7IVectorR7IVector">
<span id="paddle::CpuMatrix::maxSequenceForward__MatrixR.IVectorCR.IVectorR"></span>virtual <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>
<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">
<span id="paddle::CpuMatrix::maxSequenceBackward__MatrixR.IVectorCR.IVectorR"></span>virtual <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 已提交
3182 3183 3184
<dd></dd></dl>

<dl class="function">
3185 3186
<dt id="_CPPv2N6paddle9CpuMatrix24contextProjectionForwardE9MatrixPtr9MatrixPtrRK7IVectorii6size_tb">
<span id="paddle::CpuMatrix::contextProjectionForward__MatrixPtr.MatrixPtr.IVectorCR.i.i.s.b"></span>virtual <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 已提交
3187 3188 3189
<dd></dd></dl>

<dl class="function">
3190 3191
<dt id="_CPPv2N6paddle9CpuMatrix25contextProjectionBackwardE9MatrixPtr9MatrixPtrRK7IVectorii6size_tb">
<span id="paddle::CpuMatrix::contextProjectionBackward__MatrixPtr.MatrixPtr.IVectorCR.i.i.s.b"></span>virtual <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 已提交
3192 3193 3194
<dd></dd></dl>

<dl class="function">
3195 3196
<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 已提交
3197 3198 3199
<dd></dd></dl>

<dl class="function">
3200 3201 3202
<dt id="_CPPv2N6paddle9CpuMatrix9getRowBufE6size_t">
<span id="paddle::CpuMatrix::getRowBuf__s"></span>virtual <span class="target" id="paddleclasspaddle_1_1CpuMatrix_1a55bfc3c285e4213510fe9b13f0acc6d2"></span>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>
<dd></dd></dl>
Y
Yu Yang 已提交
3203 3204

<dl class="function">
3205 3206 3207
<dt id="_CPPv2N6paddle9CpuMatrix7addBiasER6Matrix4real">
<span id="paddle::CpuMatrix::addBias__MatrixR.real"></span>virtual <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>
<dd><p>add b to each sample of this. </p>
Y
Yu Yang 已提交
3208 3209 3210
</dd></dl>

<dl class="function">
3211 3212 3213
<dt id="_CPPv2N6paddle9CpuMatrix11collectBiasER6Matrix4real">
<span id="paddle::CpuMatrix::collectBias__MatrixR.real"></span>virtual <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>
<dd><p>add each sample of a to this. </p>
Y
Yu Yang 已提交
3214 3215 3216
</dd></dl>

<dl class="function">
3217 3218
<dt id="_CPPv2N6paddle9CpuMatrix18sequenceAvgForwardER6MatrixRK7IVectori">
<span id="paddle::CpuMatrix::sequenceAvgForward__MatrixR.IVectorCR.i"></span>virtual <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 已提交
3219 3220 3221
<dd></dd></dl>

<dl class="function">
3222 3223 3224 3225 3226 3227
<dt id="_CPPv2N6paddle9CpuMatrix10selectRowsER6MatrixR7IVector">
<span id="paddle::CpuMatrix::selectRows__MatrixR.IVectorR"></span>virtual <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>
</pre></div>
</div>
</p>
Y
Yu Yang 已提交
3228 3229 3230
</dd></dl>

<dl class="function">
3231 3232 3233 3234 3235 3236
<dt id="_CPPv2N6paddle9CpuMatrix9addToRowsER6MatrixR7IVector">
<span id="paddle::CpuMatrix::addToRows__MatrixR.IVectorR"></span>virtual <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>
</pre></div>
</div>
</p>
Y
Yu Yang 已提交
3237 3238 3239
</dd></dl>

<dl class="function">
3240 3241 3242 3243 3244 3245 3246
<dt id="_CPPv2N6paddle9CpuMatrix14selectElementsER6MatrixR7IVector">
<span id="paddle::CpuMatrix::selectElements__MatrixR.IVectorR"></span>virtual <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>
</pre></div>
</div>
</p>
</dd></dl>
Y
Yu Yang 已提交
3247 3248

<dl class="function">
3249 3250 3251 3252 3253 3254
<dt id="_CPPv2N6paddle9CpuMatrix11addElementsER6MatrixR7IVector">
<span id="paddle::CpuMatrix::addElements__MatrixR.IVectorR"></span>virtual <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>
</pre></div>
</div>
</p>
Y
Yu Yang 已提交
3255 3256 3257
</dd></dl>

<dl class="function">
3258 3259 3260 3261 3262 3263
<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 已提交
3264 3265 3266
</dd></dl>

<dl class="function">
3267 3268 3269 3270
<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 已提交
3271 3272 3273
<dd></dd></dl>

<dl class="function">
3274 3275 3276 3277 3278 3279 3280 3281 3282
<dt id="_CPPv2N6paddle9CpuMatrix15addColumnVectorERK6Matrix">
<span id="paddle::CpuMatrix::addColumnVector__MatrixCR"></span>virtual <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>
<dd><p>Add a vector (column) b to matrix a, column by column. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9CpuMatrix3mulEK9MatrixPtrK9MatrixPtr4real4real">
<span id="paddle::CpuMatrix::mul__MatrixPtrC.MatrixPtrC.real.real"></span>virtual <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 已提交
3283 3284 3285 3286 3287 3288
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
3289 3290 3291
<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 已提交
3292 3293

<dl class="function">
3294 3295 3296 3297 3298 3299 3300 3301 3302 3303 3304 3305 3306
<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">
<span id="paddle::CpuMatrix::mul__CpuSparseMatrixP.CpuMatrixP.real.real"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9CpuMatrix3mulEK9MatrixPtrK9MatrixPtr">
<span id="paddle::CpuMatrix::mul__MatrixPtrC.MatrixPtrC"></span>virtual <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 已提交
3307 3308 3309 3310 3311 3312
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
3313 3314 3315
<dt id="_CPPv2N6paddle9CpuMatrix8rightMulER6Matrix4real4real">
<span id="paddle::CpuMatrix::rightMul__MatrixR.real.real"></span>virtual <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 已提交
3316 3317 3318 3319 3320 3321
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
3322 3323 3324
<dt id="_CPPv2N6paddle9CpuMatrix8rightMulER6Matrix">
<span id="paddle::CpuMatrix::rightMul__MatrixR"></span>virtual <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 已提交
3325 3326 3327 3328 3329 3330
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
3331 3332 3333
<dt id="_CPPv2N6paddle9CpuMatrix7leftMulER6Matrix4real4real">
<span id="paddle::CpuMatrix::leftMul__MatrixR.real.real"></span>virtual <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 已提交
3334 3335 3336 3337 3338 3339
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
3340 3341 3342
<dt id="_CPPv2N6paddle9CpuMatrix7leftMulER6Matrix">
<span id="paddle::CpuMatrix::leftMul__MatrixR"></span>virtual <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 已提交
3343 3344 3345 3346 3347 3348
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
3349 3350 3351
<dt id="_CPPv2N6paddle9CpuMatrix8colMergeER6Matrix">
<span id="paddle::CpuMatrix::colMerge__MatrixR"></span>virtual <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>
<dd><p>merge the element for each col. </p>
Y
Yu Yang 已提交
3352 3353 3354
</dd></dl>

<dl class="function">
3355 3356
<dt id="_CPPv2N6paddle9CpuMatrix6rowSumER6Matrix">
<span id="paddle::CpuMatrix::rowSum__MatrixR"></span>virtual <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 已提交
3357 3358 3359 3360
<dd><p>add the sum of each row of this to mat </p>
</dd></dl>

<dl class="function">
3361 3362
<dt id="_CPPv2N6paddle9CpuMatrix8rowMaxIdER7IVector">
<span id="paddle::CpuMatrix::rowMaxId__IVectorR"></span>virtual <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 已提交
3363 3364 3365
<dd></dd></dl>

<dl class="function">
3366 3367 3368 3369
<dt id="_CPPv2N6paddle9CpuMatrix6rowMaxER6Matrix">
<span id="paddle::CpuMatrix::rowMax__MatrixR"></span>virtual <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>
<dd><p>set the max of each row of this to mat </p>
</dd></dl>
Y
Yu Yang 已提交
3370 3371

<dl class="function">
3372 3373
<dt id="_CPPv2N6paddle9CpuMatrix6rowMaxER7IVectorR6Matrix">
<span id="paddle::CpuMatrix::rowMax__IVectorR.MatrixR"></span>virtual <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 已提交
3374 3375 3376 3377 3378
<dd><p>Get the top k elements of each row of this matrix. </p>
<p>The column ids and values of these elements are stored in maxIds and max respectively. Note that the top k elements are not sorted. </p>
</dd></dl>

<dl class="function">
3379 3380 3381
<dt id="_CPPv2N6paddle9CpuMatrix6colMaxER6Matrix">
<span id="paddle::CpuMatrix::colMax__MatrixR"></span>virtual <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></dd></dl>
Y
Yu Yang 已提交
3382 3383

<dl class="function">
3384 3385 3386
<dt id="_CPPv2N6paddle9CpuMatrix14rowNormalizeL1ER6Matrix">
<span id="paddle::CpuMatrix::rowNormalizeL1__MatrixR"></span>virtual <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>
<dd><p>normalize each row so that the sum of each row is 1. </p>
Y
Yu Yang 已提交
3387 3388 3389
</dd></dl>

<dl class="function">
3390 3391
<dt id="_CPPv2N6paddle9CpuMatrix18oneHotCrossEntropyER6MatrixR7IVector">
<span id="paddle::CpuMatrix::oneHotCrossEntropy__MatrixR.IVectorR"></span>virtual <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 已提交
3392 3393 3394 3395
<dd><p>copy -log(output[label]) to this-&gt;data[i]. </p>
</dd></dl>

<dl class="function">
3396 3397
<dt id="_CPPv2N6paddle9CpuMatrix20oneHotCrossEntropyBpER6MatrixR7IVector">
<span id="paddle::CpuMatrix::oneHotCrossEntropyBp__MatrixR.IVectorR"></span>virtual <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 已提交
3398 3399 3400 3401
<dd><p>calculate the error of outputV according to label. </p>
</dd></dl>

<dl class="function">
3402 3403
<dt id="_CPPv2N6paddle9CpuMatrix30oneHotCrossEntropyWithSelfNormER6MatrixR7IVector4real">
<span id="paddle::CpuMatrix::oneHotCrossEntropyWithSelfNorm__MatrixR.IVectorR.real"></span>virtual <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 已提交
3404 3405 3406 3407
<dd><p>copy -log(output[label]) to this-&gt;data[i]. </p>
</dd></dl>

<dl class="function">
3408 3409
<dt id="_CPPv2N6paddle9CpuMatrix32oneHotCrossEntropyWithSelfNormBpER6MatrixR7IVector4real">
<span id="paddle::CpuMatrix::oneHotCrossEntropyWithSelfNormBp__MatrixR.IVectorR.real"></span>virtual <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 已提交
3410 3411 3412 3413
<dd><p>calculate the error of outputV according to label. </p>
</dd></dl>

<dl class="function">
3414 3415
<dt id="_CPPv2N6paddle9CpuMatrix12circularConvER6MatrixR6Matrix">
<span id="paddle::CpuMatrix::circularConv__MatrixR.MatrixR"></span>virtual <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 已提交
3416 3417 3418 3419 3420 3421 3422
<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">
3423 3424
<dt id="_CPPv2N6paddle9CpuMatrix22circularConvDerivativeER6MatrixR6MatrixR6MatrixR6MatrixR6Matrix">
<span id="paddle::CpuMatrix::circularConvDerivative__MatrixR.MatrixR.MatrixR.MatrixR.MatrixR"></span>virtual <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 已提交
3425 3426 3427
<dd></dd></dl>

<dl class="function">
3428 3429
<dt id="_CPPv2N6paddle9CpuMatrix7softmaxER6Matrix">
<span id="paddle::CpuMatrix::softmax__MatrixR"></span>virtual <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 已提交
3430 3431 3432
<dd></dd></dl>

<dl class="function">
3433 3434
<dt id="_CPPv2N6paddle9CpuMatrix15sequenceSoftmaxER6MatrixRK7IVector">
<span id="paddle::CpuMatrix::sequenceSoftmax__MatrixR.IVectorCR"></span>virtual <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 已提交
3435 3436 3437
<dd></dd></dl>

<dl class="function">
3438 3439
<dt id="_CPPv2N6paddle9CpuMatrix17softmaxDerivativeER6MatrixR6Matrix">
<span id="paddle::CpuMatrix::softmaxDerivative__MatrixR.MatrixR"></span>virtual <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 已提交
3440 3441 3442
<dd></dd></dl>

<dl class="function">
3443 3444
<dt id="_CPPv2N6paddle9CpuMatrix12sumOfSquaresER6MatrixR6Matrix">
<span id="paddle::CpuMatrix::sumOfSquares__MatrixR.MatrixR"></span>virtual <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 已提交
3445 3446 3447 3448
<dd><p>calculate the sum of squares diff cost. </p>
</dd></dl>

<dl class="function">
3449 3450
<dt id="_CPPv2N6paddle9CpuMatrix14sumOfSquaresBpER6MatrixR6Matrix">
<span id="paddle::CpuMatrix::sumOfSquaresBp__MatrixR.MatrixR"></span>virtual <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 已提交
3451 3452 3453 3454
<dd><p>gradient of sumOfSquares. </p>
</dd></dl>

<dl class="function">
3455 3456
<dt id="_CPPv2N6paddle9CpuMatrix4tanhER6Matrix">
<span id="paddle::CpuMatrix::tanh__MatrixR"></span>virtual <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 已提交
3457 3458 3459
<dd></dd></dl>

<dl class="function">
3460 3461
<dt id="_CPPv2N6paddle9CpuMatrix14tanhDerivativeER6Matrix">
<span id="paddle::CpuMatrix::tanhDerivative__MatrixR"></span>virtual <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 已提交
3462 3463 3464
<dd></dd></dl>

<dl class="function">
3465 3466
<dt id="_CPPv2N6paddle9CpuMatrix8softreluER6Matrix">
<span id="paddle::CpuMatrix::softrelu__MatrixR"></span>virtual <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 已提交
3467 3468 3469
<dd></dd></dl>

<dl class="function">
3470 3471
<dt id="_CPPv2N6paddle9CpuMatrix18softreluDerivativeER6Matrix">
<span id="paddle::CpuMatrix::softreluDerivative__MatrixR"></span>virtual <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 已提交
3472 3473 3474
<dd></dd></dl>

<dl class="function">
3475 3476
<dt id="_CPPv2N6paddle9CpuMatrix10scaledTanhER6Matrix4real4real">
<span id="paddle::CpuMatrix::scaledTanh__MatrixR.real.real"></span>virtual <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 已提交
3477 3478 3479
<dd></dd></dl>

<dl class="function">
3480 3481
<dt id="_CPPv2N6paddle9CpuMatrix6cosSimER6MatrixR6Matrix4real">
<span id="paddle::CpuMatrix::cosSim__MatrixR.MatrixR.real"></span>virtual <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 已提交
3482 3483 3484 3485 3486
<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">
3487 3488
<dt id="_CPPv2N6paddle9CpuMatrix16cosSimDerivativeER6MatrixR6MatrixR6MatrixR6MatrixR6Matrix4real">
<span id="paddle::CpuMatrix::cosSimDerivative__MatrixR.MatrixR.MatrixR.MatrixR.MatrixR.real"></span>virtual <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 已提交
3489 3490 3491
<dd></dd></dl>

<dl class="function">
3492 3493
<dt id="_CPPv2N6paddle9CpuMatrix5printERNSt7ostreamE">
<span id="paddle::CpuMatrix::print__osR"></span>virtual <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> const<a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix5printERNSt7ostreamE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3494 3495 3496 3497
<dd><p>print out the values of elements to os </p>
</dd></dl>

<dl class="function">
3498 3499
<dt id="_CPPv2N6paddle9CpuMatrix5printERNSt7ostreamE6size_t6size_t">
<span id="paddle::CpuMatrix::print__osR.s.s"></span>virtual <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> const<a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix5printERNSt7ostreamE6size_t6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3500 3501 3502 3503
<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">
3504 3505
<dt id="_CPPv2N6paddle9CpuMatrix11printOneRowERNSt7ostreamE6size_t">
<span id="paddle::CpuMatrix::printOneRow__osR.s"></span>virtual <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> const<a class="headerlink" href="#_CPPv2N6paddle9CpuMatrix11printOneRowERNSt7ostreamE6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
3506 3507 3508 3509
<dd><p>print one row to os </p>
</dd></dl>

<dl class="function">
3510 3511
<dt id="_CPPv2N6paddle9CpuMatrix16paramReluForwardER6MatrixR6Matrix">
<span id="paddle::CpuMatrix::paramReluForward__MatrixR.MatrixR"></span>virtual <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 已提交
3512 3513 3514
<dd></dd></dl>

<dl class="function">
3515 3516
<dt id="_CPPv2N6paddle9CpuMatrix18paramReluBackwardWER6MatrixR6Matrix">
<span id="paddle::CpuMatrix::paramReluBackwardW__MatrixR.MatrixR"></span>virtual <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 已提交
3517 3518 3519
<dd></dd></dl>

<dl class="function">
3520 3521
<dt id="_CPPv2N6paddle9CpuMatrix21paramReluBackwardDiffER6MatrixR6MatrixR6Matrix">
<span id="paddle::CpuMatrix::paramReluBackwardDiff__MatrixR.MatrixR.MatrixR"></span>virtual <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 已提交
3522 3523 3524
<dd></dd></dl>

<dl class="function">
3525 3526
<dt id="_CPPv2N6paddle9CpuMatrix5checkERNSt7ostreamER6Matrixb">
<span id="paddle::CpuMatrix::check__osR.MatrixR.b"></span>virtual <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 已提交
3527 3528 3529
<dd></dd></dl>

<dl class="function">
3530 3531 3532 3533 3534 3535 3536 3537 3538 3539 3540 3541 3542 3543 3544 3545 3546
<dt id="_CPPv2N6paddle9CpuMatrix6getMinEv">
<span id="paddle::CpuMatrix::getMin"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9CpuMatrix6getMaxEv">
<span id="paddle::CpuMatrix::getMax"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9CpuMatrix16randomizeUniformEv">
<span id="paddle::CpuMatrix::randomizeUniform"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle9CpuMatrix19classificationErrorE9MatrixPtr10IVectorPtr">
<span id="paddle::CpuMatrix::classificationError__MatrixPtr.IVectorPtr"></span>virtual <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 已提交
3547 3548 3549 3550 3551 3552
<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">
3553 3554 3555 3556 3557 3558 3559 3560
<dt id="_CPPv2N6paddle9CpuMatrix12addByBitCodeE6size_tRK7IVectorRK6Matrix">
<span id="paddle::CpuMatrix::addByBitCode__s.IVectorCR.MatrixCR"></span>virtual <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>
  <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>
</p>
Y
Yu Yang 已提交
3561 3562 3563
</dd></dl>

<dl class="function">
3564 3565 3566 3567 3568 3569 3570 3571
<dt id="_CPPv2N6paddle9CpuMatrix20addByBitCodeBackwardE6size_tRK7IVectorR6Matrix">
<span id="paddle::CpuMatrix::addByBitCodeBackward__s.IVectorCR.MatrixR"></span>virtual <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>
  <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>
</p>
Y
Yu Yang 已提交
3572 3573 3574
</dd></dl>

<dl class="function">
3575 3576 3577 3578 3579 3580 3581 3582
<dt id="_CPPv2N6paddle9CpuMatrix12mulByBitCodeE6size_tRK7IVectorRK6MatrixRK6Matrix">
<span id="paddle::CpuMatrix::mulByBitCode__s.IVectorCR.MatrixCR.MatrixCR"></span>virtual <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>
  <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>
</p>
Y
Yu Yang 已提交
3583 3584 3585
</dd></dl>

<dl class="function">
3586 3587 3588 3589 3590 3591 3592 3593
<dt id="_CPPv2N6paddle9CpuMatrix26mulByBitCodeBackwardWeightE6size_tRK7IVectorR6MatrixRK6Matrix">
<span id="paddle::CpuMatrix::mulByBitCodeBackwardWeight__s.IVectorCR.MatrixR.MatrixCR"></span>virtual <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>
  <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>
</p>
Y
Yu Yang 已提交
3594 3595 3596
</dd></dl>

<dl class="function">
3597 3598 3599 3600 3601
<dt id="_CPPv2N6paddle9CpuMatrix25mulByBitCodeBackwardErrorE6size_tRK7IVectorRK6MatrixR6Matrix">
<span id="paddle::CpuMatrix::mulByBitCodeBackwardError__s.IVectorCR.MatrixCR.MatrixR"></span>virtual <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>
  <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 已提交
3602 3603 3604 3605 3606 3607
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
3608 3609 3610 3611 3612
<dt id="_CPPv2N6paddle9CpuMatrix12sumByBitCodeE6size_tR7IVectorR6Matrix4real">
<span id="paddle::CpuMatrix::sumByBitCode__s.IVectorR.MatrixR.real"></span>virtual <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
  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 已提交
3613 3614 3615 3616 3617 3618
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
3619 3620 3621 3622 3623
<dt id="_CPPv2N6paddle9CpuMatrix12subByBitCodeE6size_tR7IVector">
<span id="paddle::CpuMatrix::subByBitCode__s.IVectorR"></span>virtual <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>
 <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 已提交
3624 3625 3626 3627 3628 3629
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
3630 3631
<dt id="_CPPv2N6paddle9CpuMatrix28multiBinaryLabelCrossEntropyER6MatrixR6Matrix">
<span id="paddle::CpuMatrix::multiBinaryLabelCrossEntropy__MatrixR.MatrixR"></span>virtual <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 已提交
3632
<dd><p>cross entropy for multi binary labels </p>
3633
<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 已提交
3634 3635 3636 3637 3638 3639 3640
          <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">
3641 3642
<dt id="_CPPv2N6paddle9CpuMatrix30multiBinaryLabelCrossEntropyBpER6MatrixR6Matrix">
<span id="paddle::CpuMatrix::multiBinaryLabelCrossEntropyBp__MatrixR.MatrixR"></span>virtual <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 已提交
3643
<dd><p>The gradient of cross entropy for multi binary labels on output. </p>
3644 3645
<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>
Y
Yu Yang 已提交
3646 3647 3648 3649 3650 3651
</pre></div>
</div>
</p>
</dd></dl>

<dl class="function">
3652 3653
<dt id="_CPPv2N6paddle9CpuMatrix24classificationErrorMultiER6MatrixR6Matrix4real">
<span id="paddle::CpuMatrix::classificationErrorMulti__MatrixR.MatrixR.real"></span>virtual <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 已提交
3654
<dd><p>Calculate the classification error for multi binary labels. </p>
3655 3656 3657
<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>
           <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 已提交
3658 3659 3660 3661 3662 3663 3664 3665 3666
</pre></div>
</div>
</p>
</dd></dl>

</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Static Functions</p>
<dl class="function">
3667 3668
<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 已提交
3669 3670 3671
<dd></dd></dl>

<dl class="function">
3672 3673 3674 3675 3676 3677 3678
<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 已提交
3679 3680 3681 3682 3683 3684 3685

</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>
3686
<dd><p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1CpuMatrix"><span class="std std-ref">paddle::CpuMatrix</span></a></p>
Y
Yu Yang 已提交
3687 3688 3689 3690 3691 3692 3693 3694 3695 3696 3697 3698 3699 3700 3701 3702 3703 3704 3705 3706 3707 3708 3709 3710 3711 3712 3713 3714 3715 3716 3717 3718 3719 3720 3721 3722 3723 3724 3725 3726 3727 3728 3729 3730 3731 3732 3733 3734 3735 3736 3737 3738 3739 3740 3741 3742 3743 3744 3745 3746 3747 3748 3749 3750 3751 3752 3753 3754 3755 3756 3757 3758 3759 3760 3761 3762 3763 3764 3765 3766 3767 3768 3769 3770 3771 3772 3773
<div class="breathe-sectiondef container">
<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">
<span id="paddle::SharedCpuMatrix::mul__CpuSparseMatrixP.CpuMatrixP.real.real"></span>virtual <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>
<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>
<div class="breathe-sectiondef container">
<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>
<div class="breathe-sectiondef container">
<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">
3774 3775
<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>
Y
Yu Yang 已提交
3776 3777 3778
<dd><div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Members</p>
<dl class="member">
3779 3780
<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 已提交
3781 3782 3783 3784 3785 3786
<dd></dd></dl>

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

<dl class="class">
3787 3788
<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>
Y
Yu Yang 已提交
3789 3790 3791
<dd><div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Members</p>
<dl class="member">
3792 3793 3794 3795 3796 3797 3798
<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 已提交
3799 3800 3801 3802 3803 3804 3805 3806
<dd></dd></dl>

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

</dd></dl>

<dl class="type">
3807 3808
<dt>
<span class="target" id="paddlenamespacepaddle"></span><em class="property">namespace </em><code class="descname">paddle</code></dt>
Y
Yu Yang 已提交
3809 3810 3811 3812 3813 3814 3815 3816 3817 3818 3819 3820 3821 3822 3823 3824 3825 3826 3827 3828 3829 3830 3831 3832 3833 3834 3835 3836 3837 3838 3839 3840 3841 3842 3843 3844 3845 3846 3847 3848 3849 3850 3851 3852 3853 3854 3855 3856 3857 3858 3859 3860 3861 3862 3863 3864 3865 3866 3867 3868 3869 3870 3871 3872 3873 3874 3875 3876 3877 3878 3879 3880 3881 3882 3883 3884 3885 3886 3887 3888 3889 3890 3891 3892 3893 3894 3895 3896 3897 3898 3899 3900 3901 3902 3903
<dd><div class="breathe-sectiondef container">
<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>
<div class="breathe-sectiondef container">
<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>
3904 3905 3906 3907
<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>
Y
Yu Yang 已提交
3908 3909 3910
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
3911 3912
<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 已提交
3913 3914 3915
<dd></dd></dl>

<dl class="function">
3916 3917
<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 已提交
3918 3919
<dd></dd></dl>

3920 3921 3922
<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 已提交
3923 3924
<dd></dd></dl>

3925 3926 3927 3928
<dl class="function">
<dt id="_CPPv2N6paddle10GpuVectorT9newMemoryE6size_t">
<span id="paddle::GpuVectorT::newMemory__s"></span>virtual <span class="target" id="paddleclasspaddle_1_1GpuVectorT_1adc88649a2403c47fad3bdc7dc4d36142"></span><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>
<dd></dd></dl>
Y
Yu Yang 已提交
3929 3930

<dl class="function">
3931 3932 3933
<dt id="_CPPv2N6paddle10GpuVectorT7zeroMemEv">
<span id="paddle::GpuVectorT::zeroMem"></span>virtual <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>
<dd></dd></dl>
Y
Yu Yang 已提交
3934 3935

<dl class="function">
3936 3937 3938
<dt id="_CPPv2N6paddle10GpuVectorT5resetERK1T">
<span id="paddle::GpuVectorT::reset__TCR"></span>virtual <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>
<dd></dd></dl>
Y
Yu Yang 已提交
3939 3940

<dl class="function">
3941 3942
<dt id="_CPPv2N6paddle10GpuVectorT12fillSequenceEv">
<span id="paddle::GpuVectorT::fillSequence"></span>virtual <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 已提交
3943 3944 3945
<dd></dd></dl>

<dl class="function">
3946 3947 3948 3949 3950 3951
<dt id="_CPPv2N6paddle10GpuVectorT8copyFromEPK1T6size_t">
<span id="paddle::GpuVectorT::copyFrom__TCP.s"></span>virtual <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>
<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 已提交
3952 3953

<dl class="function">
3954 3955 3956 3957 3958
<dt id="_CPPv2N6paddle10GpuVectorT8copyFromEPK1T6size_t11hl_stream_t">
<span id="paddle::GpuVectorT::copyFrom__TCP.s.hl_stream_t"></span>virtual <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>
<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 已提交
3959 3960 3961
</dd></dl>

<dl class="function">
3962 3963 3964
<dt id="_CPPv2N6paddle10GpuVectorT8copyFromERK7VectorTI1TE">
<span id="paddle::GpuVectorT::copyFrom__VectorT:T:CR"></span>virtual <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>
<dd><p>This function will crash if the size of src and dest is different. </p>
Y
Yu Yang 已提交
3965 3966 3967
</dd></dl>

<dl class="function">
3968 3969 3970 3971
<dt id="_CPPv2N6paddle10GpuVectorT8copyFromERK7VectorTI1TE11hl_stream_t">
<span id="paddle::GpuVectorT::copyFrom__VectorT:T:CR.hl_stream_t"></span>virtual <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>
<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 已提交
3972 3973 3974
</dd></dl>

<dl class="function">
3975 3976 3977
<dt id="_CPPv2N6paddle10GpuVectorT10getElementE6size_t">
<span id="paddle::GpuVectorT::getElement__s"></span>virtual <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> const<a class="headerlink" href="#_CPPv2N6paddle10GpuVectorT10getElementE6size_t" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the value for the i&#8217;th element. </p>
Y
Yu Yang 已提交
3978 3979 3980
</dd></dl>

<dl class="function">
3981 3982
<dt id="_CPPv2N6paddle10GpuVectorT10setElementE6size_tRK1T">
<span id="paddle::GpuVectorT::setElement__s.TCR"></span>virtual <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 已提交
3983 3984 3985
<dd></dd></dl>

<dl class="function">
3986 3987 3988
<dt id="_CPPv2N6paddle10GpuVectorT8getPointEK8uint64_t">
<span id="paddle::GpuVectorT::getPoint__uint64_tC"></span>virtual <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>
<dd><p>Get the buffer point with beginPos. </p>
Y
Yu Yang 已提交
3989 3990 3991
</dd></dl>

<dl class="function">
3992 3993
<dt id="_CPPv2N6paddle10GpuVectorT9getAbsSumEv">
<span id="paddle::GpuVectorT::getAbsSum"></span>virtual <span class="target" id="paddleclasspaddle_1_1GpuVectorT_1a07f70a7f6369f4aa3cea861f734c915f"></span>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 已提交
3994 3995 3996
<dd></dd></dl>

<dl class="function">
3997 3998
<dt id="_CPPv2N6paddle10GpuVectorT6getSumEv">
<span id="paddle::GpuVectorT::getSum"></span>virtual <span class="target" id="paddleclasspaddle_1_1GpuVectorT_1a12126096c2a83cacf6697638ade61851"></span>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 已提交
3999 4000 4001
<dd></dd></dl>

<dl class="function">
4002 4003 4004
<dt id="_CPPv2N6paddle10GpuVectorT6getMaxEv">
<span id="paddle::GpuVectorT::getMax"></span>virtual <span class="target" id="paddleclasspaddle_1_1GpuVectorT_1a500da3aa099892b164c02ebf231b9f6d"></span>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>
<dd></dd></dl>
Y
Yu Yang 已提交
4005 4006

<dl class="function">
4007 4008 4009
<dt id="_CPPv2N6paddle10GpuVectorT9getAbsMaxEv">
<span id="paddle::GpuVectorT::getAbsMax"></span>virtual <span class="target" id="paddleclasspaddle_1_1GpuVectorT_1a543043cf7fc4a2efdf69de57b8fcdbde"></span>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>
<dd></dd></dl>
Y
Yu Yang 已提交
4010 4011

<dl class="function">
4012 4013 4014
<dt id="_CPPv2N6paddle10GpuVectorT6getMinEv">
<span id="paddle::GpuVectorT::getMin"></span>virtual <span class="target" id="paddleclasspaddle_1_1GpuVectorT_1ae11e9b8071ab8cf807f292bc7939b977"></span>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>
<dd></dd></dl>
Y
Yu Yang 已提交
4015 4016

<dl class="function">
4017 4018 4019
<dt id="_CPPv2N6paddle10GpuVectorT9isEqualToERK7VectorTI1TERK1T">
<span id="paddle::GpuVectorT::isEqualTo__VectorT:T:CR.TCR"></span>virtual <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>
<dd><p>element-wise calc: this = (b == value) </p>
Y
Yu Yang 已提交
4020 4021 4022
</dd></dl>

<dl class="function">
4023 4024 4025
<dt id="_CPPv2N6paddle10GpuVectorT10selectFromERK7VectorTI1TERK7VectorTIiE">
<span id="paddle::GpuVectorT::selectFrom__VectorT:T:CR.VectorT:i:CR"></span>virtual <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>
<dd><p>select elements indexed by <em>ids</em> from vector <em>src</em> </p>
Y
Yu Yang 已提交
4026 4027 4028
</dd></dl>

<dl class="function">
4029 4030 4031
<dt id="_CPPv2N6paddle10GpuVectorT9histogramERNSt7ostreamEi">
<span id="paddle::GpuVectorT::histogram__osR.i"></span>virtual <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>
<dd><p>print histogram of vector values </p>
Y
Yu Yang 已提交
4032 4033
<p><dl class="docutils">
<dt><strong>Note</strong></dt>
4034
<dd>only exponent histogram supported currently </dd>
Y
Yu Yang 已提交
4035 4036 4037 4038 4039
</dl>
</p>
</dd></dl>

<dl class="function">
4040 4041 4042
<dt id="_CPPv2N6paddle10GpuVectorT4randEv">
<span id="paddle::GpuVectorT::rand"></span>virtual <span class="target" id="paddleclasspaddle_1_1GpuVectorT_1a78102f4439490521a8d9e3bfe35eca33"></span>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>
<dd><p>generate uniform random value for each element </p>
Y
Yu Yang 已提交
4043 4044 4045
</dd></dl>

<dl class="function">
4046 4047 4048
<dt id="_CPPv2N6paddle10GpuVectorT4randE6size_t">
<span id="paddle::GpuVectorT::rand__s"></span>virtual <span class="target" id="paddleclasspaddle_1_1GpuVectorT_1a38bf5008cb839c6a01c58c647a1a5da9"></span>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>
<dd><p>generate uniform random value for each element, data range is from 0 to (classes - 1). </p>
Y
Yu Yang 已提交
4049 4050 4051
</dd></dl>

<dl class="function">
4052 4053 4054
<dt id="_CPPv2N6paddle10GpuVectorT8randnormE4real4real">
<span id="paddle::GpuVectorT::randnorm__real.real"></span>virtual <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>
<dd><p>generate univariate Gaussian distributed random numbers with given mean and standardDeviation. </p>
Y
Yu Yang 已提交
4055 4056 4057
</dd></dl>

<dl class="function">
4058 4059 4060
<dt id="_CPPv2N6paddle10GpuVectorT7uniformE4real4real">
<span id="paddle::GpuVectorT::uniform__real.real"></span>virtual <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>
<dd><p>generate uniform distributed random numbers with given range. </p>
Y
Yu Yang 已提交
4061 4062 4063
</dd></dl>

<dl class="function">
4064 4065 4066 4067
<dt id="_CPPv2N6paddle10GpuVectorT3getE6size_t">
<span id="paddle::GpuVectorT::get__s"></span>virtual <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>
<dd><p>Debug use only. Very inefficient for GPU vector. get the value at pos. </p>
</dd></dl>
Y
Yu Yang 已提交
4068 4069

<dl class="function">
4070 4071 4072 4073
<dt id="_CPPv2N6paddle10GpuVectorT5printERNSt7ostreamE6size_t">
<span id="paddle::GpuVectorT::print__osR.s"></span>virtual <span class="target" id="paddleclasspaddle_1_1GpuVectorT_1ae215964188665591290fa455bdedb4fc"></span>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> const<a class="headerlink" href="#_CPPv2N6paddle10GpuVectorT5printERNSt7ostreamE6size_t" title="Permalink to this definition">¶</a></dt>
<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 已提交
4074 4075

<dl class="function">
4076 4077 4078
<dt id="_CPPv2N6paddle10GpuVectorT15printOneElementERNSt7ostreamE6size_t">
<span id="paddle::GpuVectorT::printOneElement__osR.s"></span>virtual <span class="target" id="paddleclasspaddle_1_1GpuVectorT_1a546b131f3f595424d2e8305acfc7a2e8"></span>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> const<a class="headerlink" href="#_CPPv2N6paddle10GpuVectorT15printOneElementERNSt7ostreamE6size_t" title="Permalink to this definition">¶</a></dt>
<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 已提交
4079 4080 4081 4082 4083 4084
</dd></dl>

</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Protected Functions</p>
<dl class="function">
4085 4086
<dt id="_CPPv2N6paddle10GpuVectorT6copyToEP10CpuVectorTI1TE">
<span id="paddle::GpuVectorT::copyTo__CpuVectorT:T:P"></span>virtual <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> const<a class="headerlink" href="#_CPPv2N6paddle10GpuVectorT6copyToEP10CpuVectorTI1TE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4087 4088 4089
<dd></dd></dl>

<dl class="function">
4090 4091
<dt id="_CPPv2N6paddle10GpuVectorT6copyToEP10GpuVectorTI1TE">
<span id="paddle::GpuVectorT::copyTo__GpuVectorT:T:P"></span>virtual <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> const<a class="headerlink" href="#_CPPv2N6paddle10GpuVectorT6copyToEP10GpuVectorTI1TE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4092 4093 4094 4095 4096 4097 4098 4099 4100 4101
<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>
4102 4103
<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>
Y
Yu Yang 已提交
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 4131 4132 4133 4134 4135 4136 4137 4138 4139 4140 4141 4142 4143 4144 4145 4146 4147 4148 4149 4150 4151 4152 4153 4154 4155 4156 4157 4158 4159 4160 4161 4162 4163 4164 4165 4166 4167 4168 4169 4170 4171 4172 4173
<div class="breathe-sectiondef container">
<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">
<span id="paddle::CpuVectorT::newMemory__s"></span>virtual <span class="target" id="paddleclasspaddle_1_1CpuVectorT_1afdaa90c17b29d988be1fc57571cf94b4"></span><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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT7zeroMemEv">
<span id="paddle::CpuVectorT::zeroMem"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT5resetERK1T">
<span id="paddle::CpuVectorT::reset__TCR"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT12fillSequenceEv">
<span id="paddle::CpuVectorT::fillSequence"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT8copyFromEPK1T6size_t">
<span id="paddle::CpuVectorT::copyFrom__TCP.s"></span>virtual <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>
<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">
<span id="paddle::CpuVectorT::copyFrom__TCP.s.hl_stream_t"></span>virtual <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>
<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">
<span id="paddle::CpuVectorT::copyFrom__VectorT:T:CR"></span>virtual <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>
<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">
<span id="paddle::CpuVectorT::copyFrom__VectorT:T:CR.hl_stream_t"></span>virtual <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>
<dd><p>If use_gpu, this function will push the copy-task to the specifed-stream and return immediately.</p>
4174
<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 已提交
4175 4176 4177 4178
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT6copyToEP10CpuVectorTI1TE">
4179
<span id="paddle::CpuVectorT::copyTo__CpuVectorT:T:P"></span>virtual <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> const<a class="headerlink" href="#_CPPv2N6paddle10CpuVectorT6copyToEP10CpuVectorTI1TE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4180 4181 4182 4183 4184 4185 4186 4187 4188 4189 4190 4191 4192 4193 4194 4195 4196 4197 4198 4199 4200 4201 4202 4203 4204 4205 4206 4207 4208 4209 4210 4211 4212 4213 4214 4215 4216 4217 4218 4219 4220 4221 4222 4223 4224 4225 4226 4227 4228 4229 4230 4231 4232 4233 4234 4235 4236 4237 4238 4239 4240 4241 4242 4243 4244 4245 4246 4247 4248 4249 4250 4251 4252 4253 4254 4255 4256 4257 4258 4259 4260 4261 4262 4263 4264 4265 4266 4267 4268 4269 4270 4271 4272 4273 4274 4275 4276 4277 4278 4279 4280 4281 4282 4283 4284
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT6copyToEP10GpuVectorTI1TE">
<span id="paddle::CpuVectorT::copyTo__GpuVectorT:T:P"></span>virtual <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> const<a class="headerlink" href="#_CPPv2N6paddle10CpuVectorT6copyToEP10GpuVectorTI1TE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT8getPointEK8uint64_t">
<span id="paddle::CpuVectorT::getPoint__uint64_tC"></span>virtual <span class="target" id="paddleclasspaddle_1_1CpuVectorT_1ab9fb3e29de5bae0d03b5ec84f57e11ed"></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="#_CPPv2N6paddle10CpuVectorT8getPointEK8uint64_t" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the buffer point with beginPos. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT10getElementE6size_t">
<span id="paddle::CpuVectorT::getElement__s"></span>virtual <span class="target" id="paddleclasspaddle_1_1CpuVectorT_1a934e3da138a5ec1adf6018235490b16f"></span>T <code class="descname">getElement</code><span class="sig-paren">(</span>size_t <em>i</em><span class="sig-paren">)</span> const<a class="headerlink" href="#_CPPv2N6paddle10CpuVectorT10getElementE6size_t" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the value for the i&#8217;th element. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT10setElementE6size_tRK1T">
<span id="paddle::CpuVectorT::setElement__s.TCR"></span>virtual <span class="target" id="paddleclasspaddle_1_1CpuVectorT_1aab03abbd5a39c65cc9a143c9af480dfc"></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="#_CPPv2N6paddle10CpuVectorT10setElementE6size_tRK1T" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT9getAbsSumEv">
<span id="paddle::CpuVectorT::getAbsSum"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT6getSumEv">
<span id="paddle::CpuVectorT::getSum"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT6getMaxEv">
<span id="paddle::CpuVectorT::getMax"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT9getAbsMaxEv">
<span id="paddle::CpuVectorT::getAbsMax"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT6getMinEv">
<span id="paddle::CpuVectorT::getMin"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT9isEqualToERK7VectorTI1TERK1T">
<span id="paddle::CpuVectorT::isEqualTo__VectorT:T:CR.TCR"></span>virtual <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>
<dd><p>element-wise calc: this = (b == value) </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT10selectFromERK7VectorTI1TERK7VectorTIiE">
<span id="paddle::CpuVectorT::selectFrom__VectorT:T:CR.VectorT:i:CR"></span>virtual <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>
<dd><p>select elements indexed by <em>ids</em> from vector <em>src</em> </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT9histogramERNSt7ostreamEi">
<span id="paddle::CpuVectorT::histogram__osR.i"></span>virtual <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>
<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">
<span id="paddle::CpuVectorT::rand"></span>virtual <span class="target" id="paddleclasspaddle_1_1CpuVectorT_1a1aac47f1b8029ff0c04d2eca388074b4"></span>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>
<dd><p>generate uniform random value for each element </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT4randE6size_t">
<span id="paddle::CpuVectorT::rand__s"></span>virtual <span class="target" id="paddleclasspaddle_1_1CpuVectorT_1a470841d8510c997d9139ead503c0298b"></span>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>
<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">
<span id="paddle::CpuVectorT::randnorm__real.real"></span>virtual <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>
<dd><p>generate univariate Gaussian distributed random numbers with given mean and standardDeviation. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT7uniformE4real4real">
<span id="paddle::CpuVectorT::uniform__real.real"></span>virtual <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>
<dd><p>generate uniform distributed random numbers with given range. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT3getE6size_t">
<span id="paddle::CpuVectorT::get__s"></span>virtual <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>
<dd><p>Debug use only. Very inefficient for GPU vector. get the value at pos. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT5printERNSt7ostreamE6size_t">
<span id="paddle::CpuVectorT::print__osR.s"></span>virtual <span class="target" id="paddleclasspaddle_1_1CpuVectorT_1a0b23837ed1420e9df14648036d00f482"></span>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> const<a class="headerlink" href="#_CPPv2N6paddle10CpuVectorT5printERNSt7ostreamE6size_t" title="Permalink to this definition">¶</a></dt>
4285
<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 已提交
4286 4287 4288 4289 4290
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle10CpuVectorT15printOneElementERNSt7ostreamE6size_t">
<span id="paddle::CpuVectorT::printOneElement__osR.s"></span>virtual <span class="target" id="paddleclasspaddle_1_1CpuVectorT_1a392bdf95e00ab5fb761e959e2b7e9216"></span>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> const<a class="headerlink" href="#_CPPv2N6paddle10CpuVectorT15printOneElementERNSt7ostreamE6size_t" title="Permalink to this definition">¶</a></dt>
4291
<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 已提交
4292 4293 4294 4295 4296 4297 4298
</dd></dl>

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

<dl class="class">
<dt>
4299 4300 4301 4302 4303
<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>
Y
Yu Yang 已提交
4304 4305 4306
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Functions</p>
<dl class="function">
4307 4308
<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 已提交
4309 4310 4311
<dd></dd></dl>

<dl class="function">
4312 4313 4314 4315 4316 4317 4318 4319 4320 4321
<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>
<div class="breathe-sectiondef container">
<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 已提交
4322 4323
<dd></dd></dl>

4324 4325 4326 4327 4328 4329 4330 4331 4332 4333 4334 4335 4336 4337 4338 4339 4340 4341 4342 4343 4344 4345 4346 4347 4348 4349 4350
</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>
<div class="breathe-sectiondef container">
<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>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Functions</p>
Y
Yu Yang 已提交
4351
<dl class="function">
4352 4353
<dt id="_CPPv2N6paddle7VectorTD0Ev">
<span id="paddle::VectorT::~VectorT"></span>virtual <span class="target" id="paddleclasspaddle_1_1VectorT_1a058f30cf858c72abf4b1d4a3d98e9f8e"></span><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 已提交
4354 4355 4356
<dd></dd></dl>

<dl class="function">
4357 4358
<dt id="_CPPv2N6paddle7VectorT7getSizeEv">
<span id="paddle::VectorT::getSize"></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> const<a class="headerlink" href="#_CPPv2N6paddle7VectorT7getSizeEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4359 4360 4361
<dd></dd></dl>

<dl class="function">
4362 4363
<dt id="_CPPv2N6paddle7VectorT7getDataEv">
<span id="paddle::VectorT::getData"></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> const<a class="headerlink" href="#_CPPv2N6paddle7VectorT7getDataEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4364 4365 4366
<dd></dd></dl>

<dl class="function">
4367 4368
<dt id="_CPPv2N6paddle7VectorT7getDataEv">
<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 已提交
4369 4370 4371
<dd></dd></dl>

<dl class="function">
4372 4373
<dt id="_CPPv2N6paddle7VectorT7zeroMemEv">
<span id="paddle::VectorT::zeroMem"></span>virtual <span class="target" id="paddleclasspaddle_1_1VectorT_1ae816e03dc16222e0d50173d79e00b09f"></span>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 已提交
4374 4375 4376
<dd></dd></dl>

<dl class="function">
4377 4378 4379 4380 4381 4382 4383 4384 4385 4386 4387 4388 4389 4390 4391 4392 4393 4394 4395 4396 4397 4398 4399 4400 4401 4402 4403 4404 4405 4406 4407 4408 4409 4410 4411 4412 4413 4414 4415 4416 4417 4418 4419 4420 4421 4422 4423 4424 4425 4426 4427 4428 4429 4430 4431 4432 4433 4434 4435 4436 4437 4438 4439 4440
<dt id="_CPPv2N6paddle7VectorT5resetERK1T">
<span id="paddle::VectorT::reset__TCR"></span>virtual <span class="target" id="paddleclasspaddle_1_1VectorT_1a5519a2f858366edeb55b06165d5c2041"></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> = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT5resetERK1T" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle7VectorT12fillSequenceEv">
<span id="paddle::VectorT::fillSequence"></span>virtual <span class="target" id="paddleclasspaddle_1_1VectorT_1ab3fe29977819f4a33a7ec35520d8a7ca"></span>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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle7VectorT15getMemoryHandleEv">
<span id="paddle::VectorT::getMemoryHandle"></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> const<a class="headerlink" href="#_CPPv2N6paddle7VectorT15getMemoryHandleEv" title="Permalink to this definition">¶</a></dt>
<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">
<span id="paddle::VectorT::newMemory__s"></span>virtual <span class="target" id="paddleclasspaddle_1_1VectorT_1a91513b17b4d9aa8e14bac53f61135e4a"></span><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>
<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>

<dl class="function">
<dt id="_CPPv2N6paddle7VectorT8copyFromERK7VectorTI1TE">
<span id="paddle::VectorT::copyFrom__VectorT:T:CR"></span>virtual <span class="target" id="paddleclasspaddle_1_1VectorT_1ad2afa0a39de13b7e43ee3f52ee96a188"></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> = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT8copyFromERK7VectorTI1TE" title="Permalink to this definition">¶</a></dt>
<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">
<span id="paddle::VectorT::copyFrom__VectorT:T:CR.hl_stream_t"></span>virtual <span class="target" id="paddleclasspaddle_1_1VectorT_1a71ab70b536d7c06db3a3f869926172a9"></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> = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT8copyFromERK7VectorTI1TE11hl_stream_t" title="Permalink to this definition">¶</a></dt>
<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">
<span id="paddle::VectorT::copyFrom__TCP.s"></span>virtual <span class="target" id="paddleclasspaddle_1_1VectorT_1a2b5007ca4136f363988babe40ef1ec6a"></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> = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT8copyFromEPK1T6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4441 4442 4443 4444 4445 4446
<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">
4447 4448
<dt id="_CPPv2N6paddle7VectorT8copyFromEPK1T6size_t11hl_stream_t">
<span id="paddle::VectorT::copyFrom__TCP.s.hl_stream_t"></span>virtual <span class="target" id="paddleclasspaddle_1_1VectorT_1a677ffe228a21a557a6c044421a2515f5"></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> = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT8copyFromEPK1T6size_t11hl_stream_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4449 4450 4451 4452 4453 4454
<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">
4455 4456 4457
<dt id="_CPPv2N6paddle7VectorT4execEN14SyncThreadPool7JobFuncE">
<span id="paddle::VectorT::exec__SyncThreadPool::JobFunc"></span>virtual <span class="target" id="paddleclasspaddle_1_1VectorT_1a8513e47ee7f478dac7686802dd42c067"></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="#_CPPv2N6paddle7VectorT4execEN14SyncThreadPool7JobFuncE" title="Permalink to this definition">¶</a></dt>
<dd><p>exec a func in single/multi thread </p>
Y
Yu Yang 已提交
4458 4459 4460
</dd></dl>

<dl class="function">
4461 4462 4463
<dt id="_CPPv2N6paddle7VectorT8getPointEK8uint64_t">
<span id="paddle::VectorT::getPoint__uint64_tC"></span>virtual <span class="target" id="paddleclasspaddle_1_1VectorT_1ac2492c93d55804c084d375829c9cf51b"></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> = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT8getPointEK8uint64_t" title="Permalink to this definition">¶</a></dt>
<dd><p>Get the buffer point with beginPos. </p>
Y
Yu Yang 已提交
4464 4465 4466
</dd></dl>

<dl class="function">
4467 4468
<dt id="_CPPv2N6paddle7VectorT10getElementE6size_t">
<span id="paddle::VectorT::getElement__s"></span>virtual <span class="target" id="paddleclasspaddle_1_1VectorT_1a8914bfb7e5955d8929a153f88b7a9bd2"></span>T <code class="descname">getElement</code><span class="sig-paren">(</span>size_t <em>i</em><span class="sig-paren">)</span> const = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT10getElementE6size_t" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4469 4470 4471 4472
<dd><p>Get the value for the i&#8217;th element. </p>
</dd></dl>

<dl class="function">
4473 4474
<dt id="_CPPv2N6paddle7VectorT10setElementE6size_tRK1T">
<span id="paddle::VectorT::setElement__s.TCR"></span>virtual <span class="target" id="paddleclasspaddle_1_1VectorT_1a5f4b75a7e84ca2144d257666f24771cf"></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> = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT10setElementE6size_tRK1T" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4475 4476 4477
<dd></dd></dl>

<dl class="function">
4478 4479
<dt id="_CPPv2N6paddle7VectorT9getAbsSumEv">
<span id="paddle::VectorT::getAbsSum"></span>virtual <span class="target" id="paddleclasspaddle_1_1VectorT_1aacdde5cf642a32e40a4ba081c67fa7a4"></span>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 已提交
4480 4481 4482
<dd></dd></dl>

<dl class="function">
4483 4484
<dt id="_CPPv2N6paddle7VectorT6getSumEv">
<span id="paddle::VectorT::getSum"></span>virtual <span class="target" id="paddleclasspaddle_1_1VectorT_1adee48c6124c12b67e19dd725bf6d7b79"></span>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 已提交
4485 4486 4487
<dd></dd></dl>

<dl class="function">
4488 4489
<dt id="_CPPv2N6paddle7VectorT6getMaxEv">
<span id="paddle::VectorT::getMax"></span>virtual <span class="target" id="paddleclasspaddle_1_1VectorT_1aafdb8060b02175c76fc132a3624c2a1d"></span>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 已提交
4490 4491 4492
<dd></dd></dl>

<dl class="function">
4493 4494
<dt id="_CPPv2N6paddle7VectorT9getAbsMaxEv">
<span id="paddle::VectorT::getAbsMax"></span>virtual <span class="target" id="paddleclasspaddle_1_1VectorT_1a97ff8d81ad7b604a9372de5c796ae76c"></span>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 已提交
4495 4496 4497
<dd></dd></dl>

<dl class="function">
4498 4499
<dt id="_CPPv2N6paddle7VectorT6getMinEv">
<span id="paddle::VectorT::getMin"></span>virtual <span class="target" id="paddleclasspaddle_1_1VectorT_1ac5311edc5a94d2c993da705e81243ea9"></span>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 已提交
4500 4501 4502
<dd></dd></dl>

<dl class="function">
4503 4504
<dt id="_CPPv2N6paddle7VectorT9isEqualToERK7VectorTI1TERK1T">
<span id="paddle::VectorT::isEqualTo__VectorT:T:CR.TCR"></span>virtual <span class="target" id="paddleclasspaddle_1_1VectorT_1a688b7c52ce826a2b74f97e899520b01b"></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> = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT9isEqualToERK7VectorTI1TERK1T" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4505 4506 4507 4508
<dd><p>element-wise calc: this = (b == value) </p>
</dd></dl>

<dl class="function">
4509 4510
<dt id="_CPPv2N6paddle7VectorT10selectFromERK7VectorTI1TERK7VectorTIiE">
<span id="paddle::VectorT::selectFrom__VectorT:T:CR.VectorT:i:CR"></span>virtual <span class="target" id="paddleclasspaddle_1_1VectorT_1aa7732aea5c5649074ce4c0368a05b56f"></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> = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT10selectFromERK7VectorTI1TERK7VectorTIiE" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4511 4512 4513 4514
<dd><p>select elements indexed by <em>ids</em> from vector <em>src</em> </p>
</dd></dl>

<dl class="function">
4515 4516
<dt id="_CPPv2N6paddle7VectorT9histogramERNSt7ostreamEi">
<span id="paddle::VectorT::histogram__osR.i"></span>virtual <span class="target" id="paddleclasspaddle_1_1VectorT_1a7d6a791c4ea3f9360e60edbb90e8d7fe"></span>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 已提交
4517 4518 4519 4520 4521 4522 4523 4524 4525
<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">
4526 4527
<dt id="_CPPv2N6paddle7VectorT4randEv">
<span id="paddle::VectorT::rand"></span>virtual <span class="target" id="paddleclasspaddle_1_1VectorT_1a690cf875451be316caa46f3d91059479"></span>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 已提交
4528 4529 4530 4531
<dd><p>generate uniform random value for each element </p>
</dd></dl>

<dl class="function">
4532 4533
<dt id="_CPPv2N6paddle7VectorT4randE6size_t">
<span id="paddle::VectorT::rand__s"></span>virtual <span class="target" id="paddleclasspaddle_1_1VectorT_1a59b498f1cbaba04f3aaf93d14a2d5d54"></span>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 已提交
4534 4535 4536 4537
<dd><p>generate uniform random value for each element, data range is from 0 to (classes - 1). </p>
</dd></dl>

<dl class="function">
4538 4539 4540 4541 4542 4543 4544 4545
<dt id="_CPPv2N6paddle7VectorT3getE6size_t">
<span id="paddle::VectorT::get__s"></span>virtual <span class="target" id="paddleclasspaddle_1_1VectorT_1a3200f155f28b7ef25ce3735bd0e68e22"></span>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>
<dd><p>Debug use only. Very inefficient for GPU vector. get the value at pos. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle7VectorT8randnormE4real4real">
<span id="paddle::VectorT::randnorm__real.real"></span>virtual <span class="target" id="paddleclasspaddle_1_1VectorT_1a90dd9ff7e3cda8095d21c233ce9f3ef6"></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> = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT8randnormE4real4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4546 4547 4548 4549
<dd><p>generate univariate Gaussian distributed random numbers with given mean and standardDeviation. </p>
</dd></dl>

<dl class="function">
4550 4551
<dt id="_CPPv2N6paddle7VectorT7uniformE4real4real">
<span id="paddle::VectorT::uniform__real.real"></span>virtual <span class="target" id="paddleclasspaddle_1_1VectorT_1ab671dfaf7c16b9743088e6ee1a9381a9"></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> = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT7uniformE4real4real" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
4552 4553 4554 4555
<dd><p>generate uniform distributed random numbers with given range. </p>
</dd></dl>

<dl class="function">
4556 4557 4558
<dt id="_CPPv2N6paddle7VectorT5printERNSt7ostreamE6size_t">
<span id="paddle::VectorT::print__osR.s"></span>virtual <span class="target" id="paddleclasspaddle_1_1VectorT_1a84826a695b03dd27ca5716472e6ccb05"></span>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> const = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT5printERNSt7ostreamE6size_t" title="Permalink to this definition">¶</a></dt>
<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 已提交
4559 4560 4561
</dd></dl>

<dl class="function">
4562 4563 4564
<dt id="_CPPv2N6paddle7VectorT15printOneElementERNSt7ostreamE6size_t">
<span id="paddle::VectorT::printOneElement__osR.s"></span>virtual <span class="target" id="paddleclasspaddle_1_1VectorT_1a49d5ac85b438235085772f877b51db33"></span>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> const = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT15printOneElementERNSt7ostreamE6size_t" title="Permalink to this definition">¶</a></dt>
<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 已提交
4565 4566
</dd></dl>

4567 4568 4569 4570 4571 4572 4573 4574
</div>
<div class="breathe-sectiondef container">
<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 已提交
4575
<dl class="function">
4576 4577 4578 4579 4580 4581 4582 4583 4584 4585 4586 4587 4588 4589 4590 4591 4592 4593
<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 已提交
4594 4595 4596 4597 4598

</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Protected Functions</p>
<dl class="function">
4599 4600
<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 已提交
4601 4602 4603
<dd></dd></dl>

<dl class="function">
4604 4605 4606 4607 4608 4609 4610 4611 4612 4613 4614 4615 4616 4617 4618 4619 4620 4621 4622 4623 4624 4625 4626 4627 4628 4629 4630 4631 4632 4633 4634 4635 4636
<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">
<dt id="_CPPv2N6paddle7VectorT6copyToEP10CpuVectorTI1TE">
<span id="paddle::VectorT::copyTo__CpuVectorT:T:P"></span>virtual <span class="target" id="paddleclasspaddle_1_1VectorT_1a3c2ec93ad09d0f15127160f176b1085b"></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> const = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT6copyToEP10CpuVectorTI1TE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle7VectorT6copyToEP10GpuVectorTI1TE">
<span id="paddle::VectorT::copyTo__GpuVectorT:T:P"></span>virtual <span class="target" id="paddleclasspaddle_1_1VectorT_1aa643581395e868c32e4f2778730b21ed"></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> const = 0<a class="headerlink" href="#_CPPv2N6paddle7VectorT6copyToEP10GpuVectorTI1TE" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<div class="breathe-sectiondef container">
<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>
<div class="breathe-sectiondef container">
<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 已提交
4637 4638 4639 4640 4641 4642 4643 4644 4645 4646
<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>
4647
<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>
Y
Yu Yang 已提交
4648 4649 4650 4651 4652 4653 4654 4655 4656 4657 4658 4659 4660 4661 4662 4663 4664 4665 4666 4667 4668 4669 4670 4671 4672 4673 4674 4675 4676 4677 4678 4679 4680 4681 4682
<div class="breathe-sectiondef container">
<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">
<span id="paddle::ParallelCpuVectorT::zeroMem"></span>virtual <span class="target" id="paddleclasspaddle_1_1ParallelCpuVectorT_1af2dd92b0a297db292a3198b64468c585"></span>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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18ParallelCpuVectorT8randnormE4real4real">
<span id="paddle::ParallelCpuVectorT::randnorm__real.real"></span>virtual <span class="target" id="paddleclasspaddle_1_1ParallelCpuVectorT_1ac45376a3105d6e43118d2e3666cf5b38"></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="#_CPPv2N6paddle18ParallelCpuVectorT8randnormE4real4real" title="Permalink to this definition">¶</a></dt>
<dd><p>generate univariate Gaussian distributed random numbers with given mean and standardDeviation. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18ParallelCpuVectorT7uniformE4real4real">
<span id="paddle::ParallelCpuVectorT::uniform__real.real"></span>virtual <span class="target" id="paddleclasspaddle_1_1ParallelCpuVectorT_1ade345c9a443c1d2650ee0a301f9d4bd1"></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="#_CPPv2N6paddle18ParallelCpuVectorT7uniformE4real4real" title="Permalink to this definition">¶</a></dt>
<dd><p>generate uniform distributed random numbers with given range. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18ParallelCpuVectorT4execEN14SyncThreadPool7JobFuncE">
<span id="paddle::ParallelCpuVectorT::exec__SyncThreadPool::JobFunc"></span>virtual <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>
<dd><p>exec a func in single/multi thread </p>
</dd></dl>

</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Private Types</p>
<dl class="type">
<dt id="_CPPv2N6paddle18ParallelCpuVectorT8ExecFuncE">
4683
<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 已提交
4684 4685 4686 4687 4688 4689 4690 4691 4692 4693 4694 4695 4696 4697 4698 4699 4700 4701 4702 4703 4704 4705 4706
<dd></dd></dl>

</div>
<div class="breathe-sectiondef container">
<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>
<div class="breathe-sectiondef container">
<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>
4707 4708 4709 4710
<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>
Y
Yu Yang 已提交
4711 4712 4713
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Types</p>
<dl class="type">
4714 4715 4716 4717 4718 4719 4720
<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 已提交
4721
<dl class="member">
4722 4723
<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 已提交
4724 4725
<dd></dd></dl>

4726 4727 4728
<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 已提交
4729 4730
<dd></dd></dl>

4731 4732 4733
<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 已提交
4734 4735 4736 4737
<dd></dd></dl>

</dd></dl>

4738 4739 4740
</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Functions</p>
Y
Yu Yang 已提交
4741
<dl class="function">
4742 4743 4744 4745 4746 4747 4748 4749 4750 4751 4752 4753 4754 4755
<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>
<dd><ul class="breatheparameterlist first last">
<li><code class="first docutils literal"><span class="pre">size</span></code> - <p>data size. </p>
</li>
<li><code class="first docutils literal"><span class="pre">useGpu</span></code> - <p>use gpu or not. </p>
</li>
</ul>
</dd>
</dl>
</p>
Y
Yu Yang 已提交
4756 4757 4758
</dd></dl>

<dl class="function">
4759 4760 4761 4762 4763
<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 已提交
4764 4765 4766
</dd></dl>

<dl class="function">
4767 4768 4769 4770 4771 4772 4773 4774 4775 4776
<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 已提交
4777 4778 4779
</dd></dl>

<dl class="function">
4780 4781 4782
<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 已提交
4783 4784

<dl class="function">
4785 4786 4787
<dt id="_CPPv2N6paddle13CpuGpuVectorTD0Ev">
<span id="paddle::CpuGpuVectorT::~CpuGpuVectorT"></span>virtual <span class="target" id="paddleclasspaddle_1_1CpuGpuVectorT_1ad72ca40b2a1c9e800ffb653113264534"></span><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>
<dd></dd></dl>
Y
Yu Yang 已提交
4788 4789

<dl class="function">
4790 4791 4792 4793 4794
<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 已提交
4795 4796 4797
</dd></dl>

<dl class="function">
4798 4799 4800 4801 4802 4803 4804 4805 4806 4807
<dt id="_CPPv2N6paddle13CpuGpuVectorT9getVectorEb">
<span id="paddle::CpuGpuVectorT::getVector__b"></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> const<a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorT9getVectorEb" title="Permalink to this definition">¶</a></dt>
<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 已提交
4808 4809 4810
</dd></dl>

<dl class="function">
4811 4812 4813 4814 4815 4816 4817 4818
<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 已提交
4819 4820 4821
</dd></dl>

<dl class="function">
4822 4823 4824 4825 4826 4827
<dt id="_CPPv2N6paddle13CpuGpuVectorT7getDataEb">
<span id="paddle::CpuGpuVectorT::getData__b"></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> const<a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorT7getDataEb" title="Permalink to this definition">¶</a></dt>
<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 已提交
4828 4829

<dl class="function">
4830 4831
<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 已提交
4832 4833 4834
<dd></dd></dl>

<dl class="function">
4835 4836 4837 4838 4839 4840
<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 已提交
4841 4842

<dl class="function">
4843 4844
<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 已提交
4845 4846 4847
<dd></dd></dl>

<dl class="function">
4848 4849
<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 已提交
4850 4851 4852
<dd></dd></dl>

<dl class="function">
4853 4854 4855 4856
<dt id="_CPPv2N6paddle13CpuGpuVectorT10getElementE6size_t">
<span id="paddle::CpuGpuVectorT::getElement__s"></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> const<a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorT10getElementE6size_t" title="Permalink to this definition">¶</a></dt>
<dd><p>return i-th element. </p>
</dd></dl>
Y
Yu Yang 已提交
4857 4858

<dl class="function">
4859 4860 4861
<dt id="_CPPv2N6paddle13CpuGpuVectorT7getSizeEv">
<span id="paddle::CpuGpuVectorT::getSize"></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> const<a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorT7getSizeEv" title="Permalink to this definition">¶</a></dt>
<dd><p>return vector size. </p>
Y
Yu Yang 已提交
4862 4863 4864
</dd></dl>

<dl class="function">
4865 4866 4867
<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 已提交
4868 4869 4870
</dd></dl>

<dl class="function">
4871 4872 4873
<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 已提交
4874 4875 4876
</dd></dl>

<dl class="function">
4877 4878 4879
<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 已提交
4880 4881 4882
</dd></dl>

<dl class="function">
4883 4884 4885
<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 已提交
4886 4887 4888
</dd></dl>

<dl class="function">
4889 4890 4891 4892 4893
<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 已提交
4894 4895 4896
</dd></dl>

<dl class="function">
4897 4898 4899 4900 4901 4902 4903 4904 4905 4906
<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 已提交
4907 4908 4909
</dd></dl>

<dl class="function">
4910 4911 4912 4913 4914 4915 4916 4917
<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 已提交
4918 4919 4920
</dd></dl>

<dl class="function">
4921 4922 4923
<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 已提交
4924 4925 4926
</dd></dl>

<dl class="function">
4927 4928 4929
<dt id="_CPPv2N6paddle13CpuGpuVectorT7getSyncEv">
<span id="paddle::CpuGpuVectorT::getSync"></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> const<a class="headerlink" href="#_CPPv2N6paddle13CpuGpuVectorT7getSyncEv" title="Permalink to this definition">¶</a></dt>
<dd><p>return sync_. </p>
Y
Yu Yang 已提交
4930 4931 4932
</dd></dl>

<dl class="function">
4933 4934 4935 4936
<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 已提交
4937 4938

<dl class="function">
4939 4940
<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 已提交
4941 4942 4943
<dd></dd></dl>

<dl class="function">
4944 4945
<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 已提交
4946 4947
<dd></dd></dl>

4948 4949 4950
</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Public Static Functions</p>
Y
Yu Yang 已提交
4951
<dl class="function">
4952 4953
<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 已提交
4954 4955 4956
<dd></dd></dl>

<dl class="function">
4957 4958 4959 4960
<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 已提交
4961 4962 4963 4964 4965

</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Protected Functions</p>
<dl class="function">
4966 4967
<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 已提交
4968 4969 4970
<dd></dd></dl>

<dl class="function">
4971 4972 4973 4974 4975 4976
<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 已提交
4977 4978

<dl class="function">
4979 4980 4981 4982 4983 4984
<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 已提交
4985 4986 4987 4988 4989

</div>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Protected Attributes</p>
<dl class="member">
4990 4991 4992 4993
<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 已提交
4994

4995 4996 4997 4998 4999
<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 已提交
5000

5001 5002 5003 5004 5005 5006 5007 5008 5009
<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 已提交
5010 5011 5012 5013 5014 5015 5016 5017
<dd></dd></dl>

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

</dd></dl>

<dl class="type">
5018 5019
<dt>
<span class="target" id="paddlenamespacepaddle"></span><em class="property">namespace </em><code class="descname">paddle</code></dt>
Y
Yu Yang 已提交
5020 5021 5022 5023 5024 5025 5026 5027 5028 5029 5030
<dd><div class="breathe-sectiondef container">
<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>
5031
<dd><p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Matrix"><span class="std std-ref">paddle::Matrix</span></a></p>
Y
Yu Yang 已提交
5032 5033 5034 5035 5036 5037 5038 5039 5040 5041 5042 5043 5044 5045 5046 5047 5048 5049 5050 5051 5052 5053 5054 5055 5056 5057 5058 5059 5060 5061 5062 5063 5064 5065 5066 5067 5068 5069 5070 5071 5072 5073
<div class="breathe-sectiondef container">
<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">
<span id="paddle::GpuSparseMatrix::resize__s.s.s.SparseValueType.SparseFormat"></span>virtual <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>
<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">
<span id="paddle::GpuSparseMatrix::resize__s.s"></span>virtual <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>
<dd><p><dl class="docutils">
<dt><strong>Note</strong></dt>
5074
<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 已提交
5075 5076 5077 5078 5079 5080 5081 5082 5083 5084 5085 5086 5087 5088 5089 5090 5091 5092 5093 5094 5095 5096 5097 5098 5099 5100 5101 5102 5103 5104 5105 5106 5107 5108 5109 5110 5111 5112 5113 5114 5115 5116 5117 5118 5119 5120 5121 5122 5123 5124 5125 5126 5127 5128 5129 5130 5131 5132 5133 5134 5135 5136 5137 5138 5139 5140 5141 5142 5143 5144 5145 5146 5147 5148 5149 5150 5151 5152 5153 5154 5155 5156 5157 5158 5159 5160 5161 5162 5163 5164 5165 5166 5167 5168 5169 5170 5171 5172 5173 5174 5175 5176 5177 5178 5179 5180 5181 5182 5183 5184 5185 5186 5187 5188 5189 5190 5191 5192 5193 5194 5195 5196 5197 5198 5199 5200 5201 5202 5203 5204 5205 5206 5207 5208 5209 5210 5211 5212 5213 5214 5215 5216 5217 5218 5219 5220 5221 5222 5223 5224 5225 5226 5227 5228 5229 5230 5231 5232 5233 5234 5235 5236 5237 5238 5239 5240 5241 5242 5243 5244 5245 5246 5247 5248 5249 5250 5251 5252 5253 5254 5255 5256 5257 5258 5259 5260 5261 5262
</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">
<span id="paddle::GpuSparseMatrix::getTranspose"></span>virtual <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>
<dd><p>B = A , B.trans = !A.trans. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix9transposeE9MatrixPtrb">
<span id="paddle::GpuSparseMatrix::transpose__MatrixPtr.b"></span>virtual <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>
<dd><p>B = A&#8217;. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix8copyFromERK6Matrix">
<span id="paddle::GpuSparseMatrix::copyFrom__MatrixCR"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix8copyFromERK6Matrix11hl_stream_t">
<span id="paddle::GpuSparseMatrix::copyFrom__MatrixCR.hl_stream_t"></span>virtual <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>
<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">
<span id="paddle::GpuSparseMatrix::copyFrom__IVectorCR"></span>virtual <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>
<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">
<span id="paddle::GpuSparseMatrix::setRow__s.s.unsigned-iCP.realCP"></span>virtual <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>
<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="_CPPv2N6paddle15GpuSparseMatrix12getValueTypeEv">
<span id="paddle::GpuSparseMatrix::getValueType"></span>virtual <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> const<a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix12getValueTypeEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix9getFormatEv">
<span id="paddle::GpuSparseMatrix::getFormat"></span>virtual <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> const<a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix9getFormatEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix10getRowColsE6size_t">
<span id="paddle::GpuSparseMatrix::getRowCols__s"></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> const<a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix10getRowColsE6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix12getRowValuesE6size_t">
<span id="paddle::GpuSparseMatrix::getRowValues__s"></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> const<a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix12getRowValuesE6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix9getColNumE6size_t">
<span id="paddle::GpuSparseMatrix::getColNum__s"></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> const<a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix9getColNumE6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix5printERNSt7ostreamE">
<span id="paddle::GpuSparseMatrix::print__osR"></span>virtual <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> const<a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix5printERNSt7ostreamE" title="Permalink to this definition">¶</a></dt>
<dd><p>print out the values of elements to os </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix7zeroMemEv">
<span id="paddle::GpuSparseMatrix::zeroMem"></span>virtual <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>
<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>
<dd><ul class="breatheparameterlist first last">
<li><code class="first docutils literal"><span class="pre">b</span></code> - <p>dense matrix </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix4add3E9MatrixPtr">
<span id="paddle::GpuSparseMatrix::add3__MatrixPtr"></span>virtual <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>
<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">
<span id="paddle::GpuSparseMatrix::addBias__MatrixR.real"></span>virtual <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>
<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>
<dd><ul class="breatheparameterlist first last">
<li><code class="first docutils literal"><span class="pre">b</span></code> - <p>bias, dense matrix and height = 1 </p>
</li>
<li><code class="first docutils literal"><span class="pre">scale</span></code> - <p>scale of b </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix7getRowsEv">
<span id="paddle::GpuSparseMatrix::getRows"></span>virtual <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> const<a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix7getRowsEv" title="Permalink to this definition">¶</a></dt>
<dd><p>return rows, which is gpu address </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix7getColsEv">
<span id="paddle::GpuSparseMatrix::getCols"></span>virtual <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> const<a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix7getColsEv" title="Permalink to this definition">¶</a></dt>
<dd><p>return cols, which is gpu address </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix8getValueEv">
<span id="paddle::GpuSparseMatrix::getValue"></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> const<a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix8getValueEv" title="Permalink to this definition">¶</a></dt>
<dd><p>return value, which is gpu address </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix7getDataEv">
<span id="paddle::GpuSparseMatrix::getData"></span>virtual <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>
<dd><p>return value_ of sparse matrix </p>
5263
<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 已提交
5264 5265 5266 5267
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix7getDataEv">
5268
virtual <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> const<a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix7getDataEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5269 5270 5271 5272 5273 5274 5275 5276 5277 5278 5279 5280 5281 5282 5283 5284 5285 5286 5287 5288 5289 5290 5291
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix6rowMaxER7IVectorR6Matrix">
<span id="paddle::GpuSparseMatrix::rowMax__IVectorR.MatrixR"></span>virtual <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>
<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>
<dd><ul class="breatheparameterlist first last">
<li><code class="first docutils literal"><span class="pre">maxIds</span></code> - <p>index of top k </p>
</li>
<li><code class="first docutils literal"><span class="pre">maxVal</span></code> - <p>value of top k </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix3mulEK9MatrixPtrK9MatrixPtr4real4real">
<span id="paddle::GpuSparseMatrix::mul__MatrixPtrC.MatrixPtrC.real.real"></span>virtual <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>
5292
<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 已提交
5293 5294 5295 5296 5297 5298 5299 5300 5301 5302 5303 5304
</pre></div>
</div>
</p>
</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">
5305
<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 已提交
5306 5307 5308 5309 5310 5311 5312 5313 5314 5315 5316 5317 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 5349 5350 5351 5352 5353 5354 5355 5356 5357 5358 5359 5360 5361 5362 5363 5364 5365 5366 5367 5368 5369 5370 5371 5372 5373 5374 5375 5376 5377 5378 5379 5380 5381 5382 5383 5384 5385 5386 5387 5388 5389 5390 5391 5392 5393 5394 5395 5396 5397 5398 5399 5400 5401 5402 5403 5404 5405 5406 5407 5408 5409 5410 5411 5412 5413 5414 5415 5416 5417 5418 5419 5420 5421 5422 5423 5424 5425 5426 5427 5428 5429 5430 5431 5432 5433
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15GpuSparseMatrix8trimFromERK15CpuSparseMatrix">
<span id="paddle::GpuSparseMatrix::trimFrom__CpuSparseMatrixCR"></span>virtual <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>
<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">
<dt id="_CPPv2N6paddle15GpuSparseMatrix8isSparseEv">
<span id="paddle::GpuSparseMatrix::isSparse"></span>virtual <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> const<a class="headerlink" href="#_CPPv2N6paddle15GpuSparseMatrix8isSparseEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<div class="breathe-sectiondef container">
<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>
<div class="breathe-sectiondef container">
<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>
<dd><div class="breathe-sectiondef container">
<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>
<div class="breathe-sectiondef container">
<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>

<div class="breathe-sectiondef container">
<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">
5434 5435
<dt>
<span class="target" id="paddlenamespacepaddle"></span><em class="property">namespace </em><code class="descname">paddle</code></dt>
Y
Yu Yang 已提交
5436 5437 5438 5439
<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>
5440 5441
<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>
Y
Yu Yang 已提交
5442 5443 5444 5445 5446 5447 5448 5449 5450 5451 5452 5453 5454 5455 5456 5457 5458 5459 5460 5461 5462 5463 5464 5465 5466 5467 5468 5469 5470 5471 5472 5473 5474 5475 5476 5477 5478 5479 5480 5481 5482 5483 5484 5485 5486 5487 5488 5489 5490 5491 5492 5493 5494 5495 5496
<div class="breathe-sectiondef container">
<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>
<div class="breathe-sectiondef container">
<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">
<span id="paddle::SparseRowCpuMatrix::~SparseRowCpuMatrix"></span>virtual <span class="target" id="paddleclasspaddle_1_1SparseRowCpuMatrix_1a2bd1df4d96eff23908149aee09bae72d"></span><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>
<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>
<dd><ul class="breatheparameterlist first last">
<li><code class="first docutils literal"><span class="pre">row</span></code> - <p>row id in the original matrix </p>
</li>
</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>
<dd><ul class="breatheparameterlist first last">
<li><code class="first docutils literal"><span class="pre">row</span></code> - <p>row id in local storage </p>
</li>
</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>
5497
<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 已提交
5498 5499 5500 5501 5502 5503 5504 5505 5506 5507 5508 5509 5510 5511 5512 5513
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrix9getRowBufE6size_t">
<span id="paddle::SparseRowCpuMatrix::getRowBuf__s"></span>virtual <span class="target" id="paddleclasspaddle_1_1SparseRowCpuMatrix_1a498229262619adcc3fc7b7097d61f858"></span>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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrix3mulEP15CpuSparseMatrixP9CpuMatrix4real4real">
<span id="paddle::SparseRowCpuMatrix::mul__CpuSparseMatrixP.CpuMatrixP.real.real"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrix8copyFromEPK4real6size_t">
<span id="paddle::SparseRowCpuMatrix::copyFrom__realCP.s"></span>virtual <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>
<dd><p>Fill data according to row indexs added, setup indices inside.</p>
5514
<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 已提交
5515 5516 5517 5518 5519 5520 5521 5522 5523 5524 5525 5526 5527 5528 5529 5530 5531 5532 5533 5534 5535 5536 5537 5538 5539 5540 5541 5542 5543 5544 5545 5546 5547 5548 5549 5550 5551 5552 5553 5554 5555 5556 5557
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrix7zeroMemEv">
<span id="paddle::SparseRowCpuMatrix::zeroMem"></span>virtual <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>
<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">
5558 5559 5560
<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 已提交
5561 5562 5563 5564 5565 5566 5567 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 5610 5611 5612 5613 5614 5615 5616 5617 5618 5619 5620 5621 5622 5623 5624 5625 5626 5627 5628 5629 5630 5631 5632 5633 5634 5635 5636 5637 5638 5639 5640 5641 5642 5643 5644 5645 5646 5647 5648 5649 5650 5651 5652 5653 5654 5655 5656 5657 5658 5659 5660 5661 5662 5663 5664 5665 5666 5667
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrix18getIndexDictHandleEv">
<span id="paddle::SparseRowCpuMatrix::getIndexDictHandle"></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> const<a class="headerlink" href="#_CPPv2N6paddle18SparseRowCpuMatrix18getIndexDictHandleEv" title="Permalink to this definition">¶</a></dt>
<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">
<dt id="_CPPv2N6paddle18SparseRowCpuMatrix15getLocalIndicesEv">
<span id="paddle::SparseRowCpuMatrix::getLocalIndices"></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> const<a class="headerlink" href="#_CPPv2N6paddle18SparseRowCpuMatrix15getLocalIndicesEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<div class="breathe-sectiondef container">
<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>
<div class="breathe-sectiondef container">
<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>
<div class="breathe-sectiondef container">
<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>
<dd><div class="breathe-sectiondef container">
<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>

5668 5669 5670 5671 5672 5673 5674 5675 5676 5677 5678 5679 5680 5681 5682 5683 5684 5685 5686 5687 5688 5689 5690 5691 5692 5693 5694 5695 5696 5697 5698 5699 5700 5701 5702 5703 5704 5705 5706 5707 5708 5709 5710 5711 5712 5713 5714 5715 5716 5717 5718 5719 5720 5721 5722 5723 5724 5725 5726 5727 5728 5729 5730 5731 5732 5733 5734 5735 5736 5737 5738 5739 5740 5741 5742 5743 5744 5745 5746 5747 5748 5749 5750 5751 5752 5753 5754 5755 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 5794
<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>
<div class="breathe-sectiondef container">
<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>
<div class="breathe-sectiondef container">
<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>
<div class="breathe-sectiondef container">
<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>
<div class="breathe-sectiondef container">
<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">
<span id="paddle::SparseAutoGrowRowCpuMatrix::getRowBuf__s"></span>virtual <span class="target" id="paddleclasspaddle_1_1SparseAutoGrowRowCpuMatrix_1a4c751edebc02fcdecee78c74e310233c"></span>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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle26SparseAutoGrowRowCpuMatrix3mulEP15CpuSparseMatrixP9CpuMatrix4real4real">
<span id="paddle::SparseAutoGrowRowCpuMatrix::mul__CpuSparseMatrixP.CpuMatrixP.real.real"></span>virtual <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>
<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>
<div class="breathe-sectiondef container">
<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">
<span id="paddle::CacheRowCpuMatrix::getRowBuf__s"></span>virtual <span class="target" id="paddleclasspaddle_1_1CacheRowCpuMatrix_1a13c147d430388ec006190621c41d86cc"></span>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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle17CacheRowCpuMatrix3mulEP15CpuSparseMatrixP9CpuMatrix4real4real">
<span id="paddle::CacheRowCpuMatrix::mul__CpuSparseMatrixP.CpuMatrixP.real.real"></span>virtual <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>
<dd></dd></dl>

</div>
<div class="breathe-sectiondef container">
<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 已提交
5795 5796 5797
<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>
5798 5799 5800
<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>
Y
Yu Yang 已提交
5801 5802 5803 5804 5805 5806 5807 5808 5809 5810 5811 5812 5813 5814 5815 5816 5817 5818 5819 5820 5821 5822 5823 5824 5825 5826 5827 5828 5829 5830 5831
<div class="breathe-sectiondef container">
<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>
<div class="breathe-sectiondef container">
<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">
5832 5833
<dt>
<span class="target" id="paddlenamespacepaddle"></span><em class="property">namespace </em><code class="descname">paddle</code></dt>
Y
Yu Yang 已提交
5834 5835 5836
<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>
5837
<dd><p>Inherits from <a class="reference internal" href="#paddleclasspaddle_1_1Matrix"><span class="std std-ref">paddle::Matrix</span></a></p>
Y
Yu Yang 已提交
5838 5839 5840 5841 5842 5843 5844 5845 5846 5847 5848 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
<div class="breathe-sectiondef container">
<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">
<span id="paddle::CpuSparseMatrix::resize__s.s.s.SparseValueType.SparseFormat"></span>virtual <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>
<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">
<span id="paddle::CpuSparseMatrix::resize__s.s"></span>virtual <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>
<dd><p><dl class="docutils">
<dt><strong>Note</strong></dt>
5875
<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 已提交
5876 5877 5878 5879 5880 5881 5882 5883 5884 5885 5886 5887 5888 5889 5890 5891 5892 5893 5894 5895 5896 5897 5898 5899 5900 5901 5902 5903 5904 5905 5906 5907 5908 5909 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 5936 5937 5938 5939 5940 5941 5942 5943 5944 5945 5946 5947 5948 5949 5950 5951 5952 5953 5954 5955 5956 5957 5958 5959 5960 5961 5962 5963 5964 5965 5966 5967 5968 5969 5970 5971 5972 5973 5974 5975 5976 5977 5978 5979 5980 5981
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix12getTransposeEv">
<span id="paddle::CpuSparseMatrix::getTranspose"></span>virtual <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>
<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">
<dt id="_CPPv2N6paddle15CpuSparseMatrix12getRowValuesE6size_t">
<span id="paddle::CpuSparseMatrix::getRowValues__s"></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> const<a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix12getRowValuesE6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix10getRowColsE6size_t">
<span id="paddle::CpuSparseMatrix::getRowCols__s"></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> const<a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix10getRowColsE6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix14fillRowIndicesER10IVectorPtr">
<span id="paddle::CpuSparseMatrix::fillRowIndices__IVectorPtrR"></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> const<a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix14fillRowIndicesER10IVectorPtr" title="Permalink to this definition">¶</a></dt>
<dd><p>fill row indices of each value in CSR matrix </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix9getColNumE6size_t">
<span id="paddle::CpuSparseMatrix::getColNum__s"></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> const<a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix9getColNumE6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix9getColumnE6size_t">
<span id="paddle::CpuSparseMatrix::getColumn__s"></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> const<a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix9getColumnE6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix14getColStartIdxE6size_t">
<span id="paddle::CpuSparseMatrix::getColStartIdx__s"></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> const<a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix14getColStartIdxE6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix14getRowStartIdxE6size_t">
<span id="paddle::CpuSparseMatrix::getRowStartIdx__s"></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> const<a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix14getRowStartIdxE6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix9getRowNumE6size_t">
<span id="paddle::CpuSparseMatrix::getRowNum__s"></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> const<a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix9getRowNumE6size_t" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix6getSumEv">
<span id="paddle::CpuSparseMatrix::getSum"></span>virtual <span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a2a557ad9526c1ac460b43749cc174d0d"></span>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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix6squareEv">
<span id="paddle::CpuSparseMatrix::square"></span>virtual <span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1aa79f4339a4162390433ac7511e1fcc4e"></span>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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix6getMinEv">
<span id="paddle::CpuSparseMatrix::getMin"></span>virtual <span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1a2a8dbf7bedfddfc38dde95be012ac2a9"></span>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>
<dd><p>only consider nonzero values. the actual min value should compare with 0.0. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix6getMaxEv">
<span id="paddle::CpuSparseMatrix::getMax"></span>virtual <span class="target" id="paddleclasspaddle_1_1CpuSparseMatrix_1af98c7d0712911dbe273b53ba76b43277"></span>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>
<dd><p>only consider nonzero values. the actual max value should compare with 0.0. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix6rowMaxER7IVectorR6Matrix">
<span id="paddle::CpuSparseMatrix::rowMax__IVectorR.MatrixR"></span>virtual <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>
<dd><p>Get the top k elements of each row of this matrix. </p>
<p>The column ids and values of these elements are stored in maxIds and max respectively. Note that the top k elements are not sorted. </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix7getRowsEv">
<span id="paddle::CpuSparseMatrix::getRows"></span>virtual <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> const<a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix7getRowsEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix7getColsEv">
<span id="paddle::CpuSparseMatrix::getCols"></span>virtual <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> const<a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix7getColsEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix8getValueEv">
<span id="paddle::CpuSparseMatrix::getValue"></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> const<a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix8getValueEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix9getFormatEv">
<span id="paddle::CpuSparseMatrix::getFormat"></span>virtual <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> const<a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix9getFormatEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix12getValueTypeEv">
5982
virtual <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> const<a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix12getValueTypeEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5983 5984 5985 5986 5987 5988
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix7getDataEv">
<span id="paddle::CpuSparseMatrix::getData"></span>virtual <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>
<dd><p>return value_ of sparse matrix </p>
5989
<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 已提交
5990 5991 5992 5993
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix7getDataEv">
5994
virtual <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> const<a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix7getDataEv" title="Permalink to this definition">¶</a></dt>
Y
Yu Yang 已提交
5995 5996 5997 5998 5999 6000 6001 6002 6003 6004 6005 6006 6007 6008 6009 6010 6011
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix7zeroMemEv">
<span id="paddle::CpuSparseMatrix::zeroMem"></span>virtual <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>
<dd><p>only set value_ of FLOAT_VALUE sparse matrix to zero </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix9transposeE9MatrixPtrb">
<span id="paddle::CpuSparseMatrix::transpose__MatrixPtr.b"></span>virtual <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>
<dd><p>mem MUST be alloced outside (memAlloc=false) </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix3mulE9MatrixPtr9MatrixPtr4real4real">
<span id="paddle::CpuSparseMatrix::mul__MatrixPtr.MatrixPtr.real.real"></span>virtual <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>
6012
<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 已提交
6013 6014 6015 6016 6017 6018 6019 6020 6021 6022 6023 6024 6025 6026 6027 6028 6029 6030 6031 6032 6033 6034 6035 6036 6037 6038 6039 6040 6041 6042 6043 6044 6045 6046 6047 6048 6049 6050 6051 6052 6053 6054 6055 6056 6057 6058 6059 6060 6061 6062 6063 6064 6065 6066 6067 6068 6069 6070 6071 6072 6073 6074 6075 6076 6077 6078 6079 6080 6081 6082 6083 6084 6085 6086 6087 6088 6089 6090 6091 6092 6093 6094 6095 6096 6097 6098 6099 6100 6101 6102 6103 6104 6105 6106 6107 6108 6109 6110 6111 6112 6113 6114 6115 6116 6117 6118 6119 6120 6121 6122 6123 6124 6125
</pre></div>
</div>
</p>
</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>
<dd><ul class="breatheparameterlist first last">
<li><code class="first docutils literal"><span class="pre">b</span></code> - <p>dense matrix </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix4add3E9MatrixPtr">
<span id="paddle::CpuSparseMatrix::add3__MatrixPtr"></span>virtual <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>
<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">
<span id="paddle::CpuSparseMatrix::addBias__MatrixR.real"></span>virtual <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>
<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>
<dd><ul class="breatheparameterlist first last">
<li><code class="first docutils literal"><span class="pre">b</span></code> - <p>bias, dense matrix and height = 1 </p>
</li>
<li><code class="first docutils literal"><span class="pre">scale</span></code> - <p>scale of b </p>
</li>
</ul>
</dd>
</dl>
</p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix5printERNSt7ostreamE">
<span id="paddle::CpuSparseMatrix::print__osR"></span>virtual <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> const<a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix5printERNSt7ostreamE" title="Permalink to this definition">¶</a></dt>
<dd><p>print out the values of elements to os </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix11printOneRowERNSt7ostreamE6size_t">
<span id="paddle::CpuSparseMatrix::printOneRow__osR.s"></span>virtual <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> const<a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix11printOneRowERNSt7ostreamE6size_t" title="Permalink to this definition">¶</a></dt>
<dd><p>print one row to os </p>
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix6setRowE6size_t6size_tPKjPK4real">
<span id="paddle::CpuSparseMatrix::setRow__s.s.unsigned-iCP.realCP"></span>virtual <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>
<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">
<span id="paddle::CpuSparseMatrix::randomizeUniform"></span>virtual <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>
<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">
<span id="paddle::CpuSparseMatrix::copyFrom__MatrixCR.hl_stream_t"></span>virtual <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>
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix8copyFromERK6Matrix">
<span id="paddle::CpuSparseMatrix::copyFrom__MatrixCR"></span>virtual <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>
<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">
<span id="paddle::CpuSparseMatrix::subMatrix__s.s"></span>virtual <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>
<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">
6126
<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 已提交
6127 6128 6129 6130
<dd></dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix8trimFromERK15CpuSparseMatrix">
6131
<span id="paddle::CpuSparseMatrix::trimFrom__CpuSparseMatrixCR"></span>virtual <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 已提交
6132 6133 6134 6135 6136 6137 6138 6139 6140 6141 6142 6143 6144 6145 6146 6147 6148 6149 6150 6151 6152 6153 6154 6155 6156 6157 6158 6159 6160
<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">
<span id="paddle::CpuSparseMatrix::copyFrom__realCP.s"></span>virtual <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>
6161 6162
<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 已提交
6163 6164 6165 6166 6167 6168 6169 6170 6171 6172 6173 6174 6175 6176 6177 6178 6179 6180 6181 6182 6183 6184 6185 6186 6187 6188 6189 6190 6191 6192 6193 6194 6195 6196 6197 6198 6199 6200 6201 6202 6203 6204 6205 6206 6207 6208 6209 6210 6211 6212 6213 6214 6215 6216 6217 6218 6219 6220 6221 6222 6223 6224
</dd></dl>

<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix8isSparseEv">
<span id="paddle::CpuSparseMatrix::isSparse"></span>virtual <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> const<a class="headerlink" href="#_CPPv2N6paddle15CpuSparseMatrix8isSparseEv" title="Permalink to this definition">¶</a></dt>
<dd></dd></dl>

</div>
<div class="breathe-sectiondef container">
<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>
<div class="breathe-sectiondef container">
<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>
<div class="breathe-sectiondef container">
<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>
<div class="breathe-sectiondef container">
<p class="breathe-sectiondef-title rubric">Private Functions</p>
<dl class="function">
<dt id="_CPPv2N6paddle15CpuSparseMatrix5cloneE6size_t6size_tb">
<span id="paddle::CpuSparseMatrix::clone__s.s.b"></span>virtual <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>
6225
<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 已提交
6226 6227 6228 6229 6230 6231 6232 6233 6234 6235 6236 6237
<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">
6238 6239
<dt>
<span class="target" id="paddlenamespacepaddle"></span><em class="property">namespace </em><code class="descname">paddle</code></dt>
Y
Yu Yang 已提交
6240 6241 6242 6243 6244 6245 6246 6247 6248 6249 6250 6251 6252 6253 6254 6255 6256 6257 6258 6259 6260 6261 6262 6263 6264 6265 6266
<dd><div class="breathe-sectiondef container">
<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>

<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">
6267 6268
<dt>
<span class="target" id="paddlenamespacepaddle"></span><em class="property">namespace </em><code class="descname">paddle</code></dt>
Y
Yu Yang 已提交
6269 6270 6271 6272 6273 6274 6275 6276 6277 6278 6279 6280 6281 6282 6283 6284 6285 6286 6287 6288 6289 6290 6291 6292 6293 6294 6295 6296 6297 6298 6299 6300 6301 6302 6303 6304 6305 6306 6307 6308 6309 6310 6311 6312 6313 6314 6315 6316 6317 6318 6319 6320 6321 6322 6323 6324 6325 6326 6327 6328 6329 6330 6331 6332 6333 6334 6335 6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 6347 6348 6349 6350 6351 6352 6353 6354 6355 6356 6357 6358 6359 6360 6361 6362 6363 6364 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 6393 6394 6395 6396 6397 6398 6399 6400 6401 6402 6403 6404 6405 6406 6407 6408 6409 6410 6411 6412 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 6440 6441 6442 6443
<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>
<dd><div class="breathe-sectiondef container">
<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>
<dd><div class="breathe-sectiondef container">
<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">
6444 6445
      <div><input type="text" name="q" /></div>
      <div><input type="submit" value="Go" /></div>
Y
Yu Yang 已提交
6446 6447 6448 6449 6450 6451 6452 6453 6454 6455 6456 6457 6458 6459 6460 6461 6462 6463 6464 6465 6466 6467 6468 6469
      <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>
6470 6471 6472
        <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 已提交
6473 6474 6475
      </ul>
    </div>
    <div class="footer" role="contentinfo">
6476
        &#169; Copyright 2016, PaddlePaddle developers.
6477
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.4.8.
Y
Yu Yang 已提交
6478 6479 6480
    </div>
  </body>
</html>