Skip to content

Commit 801ae02

Browse files
author
array-api-bot
committed
Deploy: fcdf6ca
1 parent 47886d9 commit 801ae02

File tree

10 files changed

+108
-107
lines changed

10 files changed

+108
-107
lines changed

draft/API_specification/generated/array_api.cumulative_prod.html

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -476,26 +476,26 @@ <h1 id="api-specification-generated-array-api-cumulative-prod--page-root">cumula
476476
<dl class="field-list">
477477
<dt class="field-odd">Parameters<span class="colon">:</span></dt>
478478
<dd class="field-odd"><ul class="simple">
479-
<li><p><strong>x</strong> (<em>array</em>) – input array. Should have one or more dimensions (axes). Should have a numeric data type.</p></li>
480-
<li><p><strong>axis</strong> (<em>Optional</em><em>[</em><em>int</em><em>]</em>) – <p>axis along which a cumulative product must be computed. If <code class="docutils literal notranslate"><span class="pre">axis</span></code> is negative, the function must determine the axis along which to compute a cumulative product by counting from the last dimension.</p>
481-
<p>If <code class="docutils literal notranslate"><span class="pre">x</span></code> is a one-dimensional array, providing an <code class="docutils literal notranslate"><span class="pre">axis</span></code> is optional; however, if <code class="docutils literal notranslate"><span class="pre">x</span></code> has more than one dimension, providing an <code class="docutils literal notranslate"><span class="pre">axis</span></code> is required.</p>
479+
<li><p><strong>x</strong> (<em>array</em>) – input array. <strong>Should</strong> have one or more dimensions (axes). <strong>Should</strong> have a numeric data type.</p></li>
480+
<li><p><strong>axis</strong> (<em>Optional</em><em>[</em><em>int</em><em>]</em>) – <p>axis along which to compute the cumulative product. A valid axis <strong>must</strong> be an integer on the interval <code class="docutils literal notranslate"><span class="pre">[-N,</span> <span class="pre">N)</span></code>, where <code class="docutils literal notranslate"><span class="pre">N</span></code> is the number of axes in <code class="docutils literal notranslate"><span class="pre">x</span></code>. If an axis is specified as a negative integer, the function <strong>must</strong> determine the axis along which to perform the operation by counting backward from the last axis (where <code class="docutils literal notranslate"><span class="pre">-1</span></code> refers to the last axis). If provided an invalid axis, the function <strong>must</strong> raise an exception.</p>
481+
<p>If <code class="docutils literal notranslate"><span class="pre">x</span></code> is a one-dimensional array, providing an <code class="docutils literal notranslate"><span class="pre">axis</span></code> <strong>must</strong> be optional; however, if <code class="docutils literal notranslate"><span class="pre">x</span></code> has more than one dimension, providing an <code class="docutils literal notranslate"><span class="pre">axis</span></code> <strong>must</strong> be required.</p>
482482
</p></li>
483-
<li><p><strong>dtype</strong> (<em>Optional</em><em>[</em><em>dtype</em><em>]</em>) – <p>data type of the returned array. If <code class="docutils literal notranslate"><span class="pre">None</span></code>, the returned array must have the same data type as <code class="docutils literal notranslate"><span class="pre">x</span></code>, unless <code class="docutils literal notranslate"><span class="pre">x</span></code> has an integer data type supporting a smaller range of values than the default integer data type (e.g., <code class="docutils literal notranslate"><span class="pre">x</span></code> has an <code class="docutils literal notranslate"><span class="pre">int16</span></code> or <code class="docutils literal notranslate"><span class="pre">uint32</span></code> data type and the default integer data type is <code class="docutils literal notranslate"><span class="pre">int64</span></code>). In those latter cases:</p>
483+
<li><p><strong>dtype</strong> (<em>Optional</em><em>[</em><em>dtype</em><em>]</em>) – <p>data type of the returned array. If <code class="docutils literal notranslate"><span class="pre">None</span></code>, the returned array <strong>must</strong> have the same data type as <code class="docutils literal notranslate"><span class="pre">x</span></code>, unless <code class="docutils literal notranslate"><span class="pre">x</span></code> has an integer data type supporting a smaller range of values than the default integer data type (e.g., <code class="docutils literal notranslate"><span class="pre">x</span></code> has an <code class="docutils literal notranslate"><span class="pre">int16</span></code> or <code class="docutils literal notranslate"><span class="pre">uint32</span></code> data type and the default integer data type is <code class="docutils literal notranslate"><span class="pre">int64</span></code>). In those latter cases:</p>
484484
<ul>
485-
<li><p>if <code class="docutils literal notranslate"><span class="pre">x</span></code> has a signed integer data type (e.g., <code class="docutils literal notranslate"><span class="pre">int16</span></code>), the returned array must have the default integer data type.</p></li>
486-
<li><p>if <code class="docutils literal notranslate"><span class="pre">x</span></code> has an unsigned integer data type (e.g., <code class="docutils literal notranslate"><span class="pre">uint16</span></code>), the returned array must have an unsigned integer data type having the same number of bits as the default integer data type (e.g., if the default integer data type is <code class="docutils literal notranslate"><span class="pre">int32</span></code>, the returned array must have a <code class="docutils literal notranslate"><span class="pre">uint32</span></code> data type).</p></li>
485+
<li><p>if <code class="docutils literal notranslate"><span class="pre">x</span></code> has a signed integer data type (e.g., <code class="docutils literal notranslate"><span class="pre">int16</span></code>), the returned array <strong>must</strong> have the default integer data type.</p></li>
486+
<li><p>if <code class="docutils literal notranslate"><span class="pre">x</span></code> has an unsigned integer data type (e.g., <code class="docutils literal notranslate"><span class="pre">uint16</span></code>), the returned array <strong>must</strong> have an unsigned integer data type having the same number of bits as the default integer data type (e.g., if the default integer data type is <code class="docutils literal notranslate"><span class="pre">int32</span></code>, the returned array <strong>must</strong> have a <code class="docutils literal notranslate"><span class="pre">uint32</span></code> data type).</p></li>
487487
</ul>
488-
<p>If the data type (either specified or resolved) differs from the data type of <code class="docutils literal notranslate"><span class="pre">x</span></code>, the input array should be cast to the specified data type before computing the product (rationale: the <code class="docutils literal notranslate"><span class="pre">dtype</span></code> keyword argument is intended to help prevent overflows). Default: <code class="docutils literal notranslate"><span class="pre">None</span></code>.</p>
488+
<p>If the data type (either specified or resolved) differs from the data type of <code class="docutils literal notranslate"><span class="pre">x</span></code>, the input array <strong>should</strong> be cast to the specified data type before computing the product (rationale: the <code class="docutils literal notranslate"><span class="pre">dtype</span></code> keyword argument is intended to help prevent overflows). Default: <code class="docutils literal notranslate"><span class="pre">None</span></code>.</p>
489489
</p></li>
490-
<li><p><strong>include_initial</strong> (<em>bool</em>) – boolean indicating whether to include the initial value as the first value in the output. By convention, the initial value must be the multiplicative identity (i.e., one). Default: <code class="docutils literal notranslate"><span class="pre">False</span></code>.</p></li>
490+
<li><p><strong>include_initial</strong> (<em>bool</em>) – boolean indicating whether to include the initial value as the first value in the output. By convention, the initial value <strong>must</strong> be the multiplicative identity (i.e., one). Default: <code class="docutils literal notranslate"><span class="pre">False</span></code>.</p></li>
491491
</ul>
492492
</dd>
493493
<dt class="field-even">Returns<span class="colon">:</span></dt>
494-
<dd class="field-even"><p><strong>out</strong> (<em>array</em>) – an array containing the cumulative products. The returned array must have a data type as described by the <code class="docutils literal notranslate"><span class="pre">dtype</span></code> parameter above.</p>
495-
<p>Let <code class="docutils literal notranslate"><span class="pre">N</span></code> be the size of the axis along which to compute the cumulative product. The returned array must have a shape determined according to the following rules:</p>
494+
<dd class="field-even"><p><strong>out</strong> (<em>array</em>) – an array containing the cumulative products. The returned array <strong>must</strong> have a data type as described by the <code class="docutils literal notranslate"><span class="pre">dtype</span></code> parameter above.</p>
495+
<p>Let <code class="docutils literal notranslate"><span class="pre">M</span></code> be the size of the axis along which to compute the cumulative product. The returned array <strong>must</strong> have a shape determined according to the following rules:</p>
496496
<ul class="simple">
497-
<li><p>if <code class="docutils literal notranslate"><span class="pre">include_initial</span></code> is <code class="docutils literal notranslate"><span class="pre">True</span></code>, the returned array must have the same shape as <code class="docutils literal notranslate"><span class="pre">x</span></code>, except the size of the axis along which to compute the cumulative product must be <code class="docutils literal notranslate"><span class="pre">N+1</span></code>.</p></li>
498-
<li><p>if <code class="docutils literal notranslate"><span class="pre">include_initial</span></code> is <code class="docutils literal notranslate"><span class="pre">False</span></code>, the returned array must have the same shape as <code class="docutils literal notranslate"><span class="pre">x</span></code>.</p></li>
497+
<li><p>if <code class="docutils literal notranslate"><span class="pre">include_initial</span></code> is <code class="docutils literal notranslate"><span class="pre">True</span></code>, the returned array <strong>must</strong> have the same shape as <code class="docutils literal notranslate"><span class="pre">x</span></code>, except the size of the axis along which to compute the cumulative product <strong>must</strong> be <code class="docutils literal notranslate"><span class="pre">M+1</span></code>.</p></li>
498+
<li><p>if <code class="docutils literal notranslate"><span class="pre">include_initial</span></code> is <code class="docutils literal notranslate"><span class="pre">False</span></code>, the returned array <strong>must</strong> have the same shape as <code class="docutils literal notranslate"><span class="pre">x</span></code>.</p></li>
499499
</ul>
500500
</dd>
501501
</dl>
@@ -504,7 +504,7 @@ <h1 id="api-specification-generated-array-api-cumulative-prod--page-root">cumula
504504
<li><p>When <code class="docutils literal notranslate"><span class="pre">x</span></code> is a zero-dimensional array, behavior is unspecified and thus implementation-defined.</p></li>
505505
</ul>
506506
<p><strong>Special Cases</strong></p>
507-
<p>For both real-valued and complex floating-point operands, special cases must be handled as if the operation is implemented by successive application of <a class="reference internal" href="array_api.multiply.html#array_api.multiply" title="array_api.multiply"><code class="xref py py-func docutils literal notranslate"><span class="pre">multiply()</span></code></a>.</p>
507+
<p>For both real-valued and complex floating-point operands, special cases <strong>must</strong> be handled as if the operation is implemented by successive application of <a class="reference internal" href="array_api.multiply.html#array_api.multiply" title="array_api.multiply"><code class="xref py py-func docutils literal notranslate"><span class="pre">multiply()</span></code></a>.</p>
508508
<div class="versionadded">
509509
<p><span class="versionmodified added">New in version 2024.12.</span></p>
510510
</div>

0 commit comments

Comments
 (0)