提交 55255f61 编写于 作者: T Travis CI

Deploy to GitHub Pages: 4cade607

上级 85e775d5
......@@ -332,7 +332,19 @@ reduce_sum
reduce_mean
---------
-----------
.. autofunction:: paddle.v2.fluid.layers.reduce_mean
:noindex:
reduce_max
----------
.. autofunction:: paddle.v2.fluid.layers.reduce_max
:noindex:
reduce_min
----------
.. autofunction:: paddle.v2.fluid.layers.reduce_min
:noindex:
......@@ -1829,6 +1829,96 @@ than the <code class="xref py py-attr docutils literal"><span class="pre">input<
</div>
</dd></dl>
</div>
<div class="section" id="reduce-max">
<h2>reduce_max<a class="headerlink" href="#reduce-max" title="Permalink to this headline"></a></h2>
<dl class="function">
<dt>
<code class="descclassname">paddle.v2.fluid.layers.</code><code class="descname">reduce_max</code><span class="sig-paren">(</span><em>input</em>, <em>dim=None</em>, <em>keep_dim=False</em><span class="sig-paren">)</span></dt>
<dd><p>Computes the maximum of tensor elements over the given dimension.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>input</strong> (<em>Variable</em>) &#8211; The input variable which is a Tensor or LoDTensor.</li>
<li><strong>dim</strong> (<em>int|None</em>) &#8211; The dimension along which the maximum is computed.
If <code class="xref py py-attr docutils literal"><span class="pre">None</span></code>, compute the maximum over all elements of
<code class="xref py py-attr docutils literal"><span class="pre">input</span></code> and return a Tensor variable with a single element,
otherwise must be in the range <span class="math">\([-rank(input), rank(input))\)</span>.
If <span class="math">\(dim &lt; 0\)</span>, the dimension to reduce is <span class="math">\(rank + dim\)</span>.</li>
<li><strong>keep_dim</strong> (<em>bool</em>) &#8211; Whether to reserve the reduced dimension in the
output Tensor. The result tensor will have one fewer dimension
than the <code class="xref py py-attr docutils literal"><span class="pre">input</span></code> unless <code class="xref py py-attr docutils literal"><span class="pre">keep_dim</span></code> is true.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The reduced Tensor variable.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">Variable</p>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Examples</p>
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="c1"># x is a Tensor variable with following elements:</span>
<span class="c1"># [[0.2, 0.3, 0.5, 0.9]</span>
<span class="c1"># [0.1, 0.2, 0.6, 0.7]]</span>
<span class="c1"># Each example is followed by the correspending output tensor.</span>
<span class="n">fluid</span><span class="o">.</span><span class="n">layers</span><span class="o">.</span><span class="n">reduce_max</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="c1"># [0.9]</span>
<span class="n">fluid</span><span class="o">.</span><span class="n">layers</span><span class="o">.</span><span class="n">reduce_max</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">dim</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span> <span class="c1"># [0.2, 0.3, 0.6, 0.9]</span>
<span class="n">fluid</span><span class="o">.</span><span class="n">layers</span><span class="o">.</span><span class="n">reduce_max</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">dim</span><span class="o">=-</span><span class="mi">1</span><span class="p">)</span> <span class="c1"># [0.9, 0.7]</span>
<span class="n">fluid</span><span class="o">.</span><span class="n">layers</span><span class="o">.</span><span class="n">reduce_max</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">dim</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">keep_dim</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span> <span class="c1"># [[0.9], [0.7]]</span>
</pre></div>
</div>
</dd></dl>
</div>
<div class="section" id="reduce-min">
<h2>reduce_min<a class="headerlink" href="#reduce-min" title="Permalink to this headline"></a></h2>
<dl class="function">
<dt>
<code class="descclassname">paddle.v2.fluid.layers.</code><code class="descname">reduce_min</code><span class="sig-paren">(</span><em>input</em>, <em>dim=None</em>, <em>keep_dim=False</em><span class="sig-paren">)</span></dt>
<dd><p>Computes the minimum of tensor elements over the given dimension.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">Parameters:</th><td class="field-body"><ul class="first simple">
<li><strong>input</strong> (<em>Variable</em>) &#8211; The input variable which is a Tensor or LoDTensor.</li>
<li><strong>dim</strong> (<em>int|None</em>) &#8211; The dimension along which the minimum is computed.
If <code class="xref py py-attr docutils literal"><span class="pre">None</span></code>, compute the minimum over all elements of
<code class="xref py py-attr docutils literal"><span class="pre">input</span></code> and return a Tensor variable with a single element,
otherwise must be in the range <span class="math">\([-rank(input), rank(input))\)</span>.
If <span class="math">\(dim &lt; 0\)</span>, the dimension to reduce is <span class="math">\(rank + dim\)</span>.</li>
<li><strong>keep_dim</strong> (<em>bool</em>) &#8211; Whether to reserve the reduced dimension in the
output Tensor. The result tensor will have one fewer dimension
than the <code class="xref py py-attr docutils literal"><span class="pre">input</span></code> unless <code class="xref py py-attr docutils literal"><span class="pre">keep_dim</span></code> is true.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">Returns:</th><td class="field-body"><p class="first">The reduced Tensor variable.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">Return type:</th><td class="field-body"><p class="first last">Variable</p>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Examples</p>
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="c1"># x is a Tensor variable with following elements:</span>
<span class="c1"># [[0.2, 0.3, 0.5, 0.9]</span>
<span class="c1"># [0.1, 0.2, 0.6, 0.7]]</span>
<span class="c1"># Each example is followed by the correspending output tensor.</span>
<span class="n">fluid</span><span class="o">.</span><span class="n">layers</span><span class="o">.</span><span class="n">reduce_min</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="c1"># [0.1]</span>
<span class="n">fluid</span><span class="o">.</span><span class="n">layers</span><span class="o">.</span><span class="n">reduce_min</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">dim</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span> <span class="c1"># [0.1, 0.2, 0.5, 0.7]</span>
<span class="n">fluid</span><span class="o">.</span><span class="n">layers</span><span class="o">.</span><span class="n">reduce_min</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">dim</span><span class="o">=-</span><span class="mi">1</span><span class="p">)</span> <span class="c1"># [0.2, 0.1]</span>
<span class="n">fluid</span><span class="o">.</span><span class="n">layers</span><span class="o">.</span><span class="n">reduce_min</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">dim</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">keep_dim</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span> <span class="c1"># [[0.2], [0.1]]</span>
</pre></div>
</div>
</dd></dl>
</div>
</div>
......
因为 它太大了无法显示 source diff 。你可以改为 查看blob
......@@ -332,7 +332,19 @@ reduce_sum
reduce_mean
---------
-----------
.. autofunction:: paddle.v2.fluid.layers.reduce_mean
:noindex:
reduce_max
----------
.. autofunction:: paddle.v2.fluid.layers.reduce_max
:noindex:
reduce_min
----------
.. autofunction:: paddle.v2.fluid.layers.reduce_min
:noindex:
......@@ -1842,6 +1842,96 @@ than the <code class="xref py py-attr docutils literal"><span class="pre">input<
</div>
</dd></dl>
</div>
<div class="section" id="reduce-max">
<h2>reduce_max<a class="headerlink" href="#reduce-max" title="永久链接至标题"></a></h2>
<dl class="function">
<dt>
<code class="descclassname">paddle.v2.fluid.layers.</code><code class="descname">reduce_max</code><span class="sig-paren">(</span><em>input</em>, <em>dim=None</em>, <em>keep_dim=False</em><span class="sig-paren">)</span></dt>
<dd><p>Computes the maximum of tensor elements over the given dimension.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>input</strong> (<em>Variable</em>) &#8211; The input variable which is a Tensor or LoDTensor.</li>
<li><strong>dim</strong> (<em>int|None</em>) &#8211; The dimension along which the maximum is computed.
If <code class="xref py py-attr docutils literal"><span class="pre">None</span></code>, compute the maximum over all elements of
<code class="xref py py-attr docutils literal"><span class="pre">input</span></code> and return a Tensor variable with a single element,
otherwise must be in the range <span class="math">\([-rank(input), rank(input))\)</span>.
If <span class="math">\(dim &lt; 0\)</span>, the dimension to reduce is <span class="math">\(rank + dim\)</span>.</li>
<li><strong>keep_dim</strong> (<em>bool</em>) &#8211; Whether to reserve the reduced dimension in the
output Tensor. The result tensor will have one fewer dimension
than the <code class="xref py py-attr docutils literal"><span class="pre">input</span></code> unless <code class="xref py py-attr docutils literal"><span class="pre">keep_dim</span></code> is true.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">The reduced Tensor variable.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">Variable</p>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Examples</p>
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="c1"># x is a Tensor variable with following elements:</span>
<span class="c1"># [[0.2, 0.3, 0.5, 0.9]</span>
<span class="c1"># [0.1, 0.2, 0.6, 0.7]]</span>
<span class="c1"># Each example is followed by the correspending output tensor.</span>
<span class="n">fluid</span><span class="o">.</span><span class="n">layers</span><span class="o">.</span><span class="n">reduce_max</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="c1"># [0.9]</span>
<span class="n">fluid</span><span class="o">.</span><span class="n">layers</span><span class="o">.</span><span class="n">reduce_max</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">dim</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span> <span class="c1"># [0.2, 0.3, 0.6, 0.9]</span>
<span class="n">fluid</span><span class="o">.</span><span class="n">layers</span><span class="o">.</span><span class="n">reduce_max</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">dim</span><span class="o">=-</span><span class="mi">1</span><span class="p">)</span> <span class="c1"># [0.9, 0.7]</span>
<span class="n">fluid</span><span class="o">.</span><span class="n">layers</span><span class="o">.</span><span class="n">reduce_max</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">dim</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">keep_dim</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span> <span class="c1"># [[0.9], [0.7]]</span>
</pre></div>
</div>
</dd></dl>
</div>
<div class="section" id="reduce-min">
<h2>reduce_min<a class="headerlink" href="#reduce-min" title="永久链接至标题"></a></h2>
<dl class="function">
<dt>
<code class="descclassname">paddle.v2.fluid.layers.</code><code class="descname">reduce_min</code><span class="sig-paren">(</span><em>input</em>, <em>dim=None</em>, <em>keep_dim=False</em><span class="sig-paren">)</span></dt>
<dd><p>Computes the minimum of tensor elements over the given dimension.</p>
<table class="docutils field-list" frame="void" rules="none">
<col class="field-name" />
<col class="field-body" />
<tbody valign="top">
<tr class="field-odd field"><th class="field-name">参数:</th><td class="field-body"><ul class="first simple">
<li><strong>input</strong> (<em>Variable</em>) &#8211; The input variable which is a Tensor or LoDTensor.</li>
<li><strong>dim</strong> (<em>int|None</em>) &#8211; The dimension along which the minimum is computed.
If <code class="xref py py-attr docutils literal"><span class="pre">None</span></code>, compute the minimum over all elements of
<code class="xref py py-attr docutils literal"><span class="pre">input</span></code> and return a Tensor variable with a single element,
otherwise must be in the range <span class="math">\([-rank(input), rank(input))\)</span>.
If <span class="math">\(dim &lt; 0\)</span>, the dimension to reduce is <span class="math">\(rank + dim\)</span>.</li>
<li><strong>keep_dim</strong> (<em>bool</em>) &#8211; Whether to reserve the reduced dimension in the
output Tensor. The result tensor will have one fewer dimension
than the <code class="xref py py-attr docutils literal"><span class="pre">input</span></code> unless <code class="xref py py-attr docutils literal"><span class="pre">keep_dim</span></code> is true.</li>
</ul>
</td>
</tr>
<tr class="field-even field"><th class="field-name">返回:</th><td class="field-body"><p class="first">The reduced Tensor variable.</p>
</td>
</tr>
<tr class="field-odd field"><th class="field-name">返回类型:</th><td class="field-body"><p class="first last">Variable</p>
</td>
</tr>
</tbody>
</table>
<p class="rubric">Examples</p>
<div class="highlight-python"><div class="highlight"><pre><span></span><span class="c1"># x is a Tensor variable with following elements:</span>
<span class="c1"># [[0.2, 0.3, 0.5, 0.9]</span>
<span class="c1"># [0.1, 0.2, 0.6, 0.7]]</span>
<span class="c1"># Each example is followed by the correspending output tensor.</span>
<span class="n">fluid</span><span class="o">.</span><span class="n">layers</span><span class="o">.</span><span class="n">reduce_min</span><span class="p">(</span><span class="n">x</span><span class="p">)</span> <span class="c1"># [0.1]</span>
<span class="n">fluid</span><span class="o">.</span><span class="n">layers</span><span class="o">.</span><span class="n">reduce_min</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">dim</span><span class="o">=</span><span class="mi">0</span><span class="p">)</span> <span class="c1"># [0.1, 0.2, 0.5, 0.7]</span>
<span class="n">fluid</span><span class="o">.</span><span class="n">layers</span><span class="o">.</span><span class="n">reduce_min</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">dim</span><span class="o">=-</span><span class="mi">1</span><span class="p">)</span> <span class="c1"># [0.2, 0.1]</span>
<span class="n">fluid</span><span class="o">.</span><span class="n">layers</span><span class="o">.</span><span class="n">reduce_min</span><span class="p">(</span><span class="n">x</span><span class="p">,</span> <span class="n">dim</span><span class="o">=</span><span class="mi">1</span><span class="p">,</span> <span class="n">keep_dim</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span> <span class="c1"># [[0.2], [0.1]]</span>
</pre></div>
</div>
</dd></dl>
</div>
</div>
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册