Skip to content

Commit 1c1e930

Browse files
author
array-api-bot
committed
Deploy: 7274050
1 parent 43a64a7 commit 1c1e930

File tree

5 files changed

+15
-50
lines changed

5 files changed

+15
-50
lines changed

Diff for: draft/API_specification/generated/array_api.cumulative_sum.html

+2-13
Original file line numberDiff line numberDiff line change
@@ -465,23 +465,12 @@ <h1 id="api-specification-generated-array-api-cumulative-sum--page-root">cumulat
465465
<li><p><strong>axis</strong> (<em>Optional</em><em>[</em><em>int</em><em>]</em>) – <p>axis along which a cumulative sum 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 sum by counting from the last dimension.</p>
466466
<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>
467467
</p></li>
468-
<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>,</p>
468+
<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>
469469
<ul>
470-
<li><p>if the default data type corresponding to the data type “kind” (integer, real-valued floating-point, or complex floating-point) of <code class="docutils literal notranslate"><span class="pre">x</span></code> has a smaller range of values than the data type of <code class="docutils literal notranslate"><span class="pre">x</span></code> (e.g., <code class="docutils literal notranslate"><span class="pre">x</span></code> has data type <code class="docutils literal notranslate"><span class="pre">int64</span></code> and the default data type is <code class="docutils literal notranslate"><span class="pre">int32</span></code>, or <code class="docutils literal notranslate"><span class="pre">x</span></code> has data type <code class="docutils literal notranslate"><span class="pre">uint64</span></code> and the default data type is <code class="docutils literal notranslate"><span class="pre">int64</span></code>), the returned array must have the same data type as <code class="docutils literal notranslate"><span class="pre">x</span></code>.</p></li>
471-
<li><p>if the default data type corresponding to the data type “kind” of <code class="docutils literal notranslate"><span class="pre">x</span></code> has the same or a larger range of values than the data type of <code class="docutils literal notranslate"><span class="pre">x</span></code>,</p>
472-
<ul>
473-
<li><p>if <code class="docutils literal notranslate"><span class="pre">x</span></code> has a real-valued floating-point data type, the returned array must have the default real-valued floating-point data type.</p></li>
474-
<li><p>if <code class="docutils literal notranslate"><span class="pre">x</span></code> has a complex floating-point data type, the returned array must have the default complex floating-point data type.</p></li>
475470
<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>
476471
<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>
477472
</ul>
478-
</li>
479-
</ul>
480-
<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 sum. Default: <code class="docutils literal notranslate"><span class="pre">None</span></code>.</p>
481-
<div class="admonition note">
482-
<p class="admonition-title">Note</p>
483-
<p>keyword argument is intended to help prevent data type overflows.</p>
484-
</div>
473+
<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 sum (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>
485474
</p></li>
486475
<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 additive identity (i.e., zero). Default: <code class="docutils literal notranslate"><span class="pre">False</span></code>.</p></li>
487476
</ul>

Diff for: draft/API_specification/generated/array_api.prod.html

+4-12
Original file line numberDiff line numberDiff line change
@@ -463,20 +463,12 @@ <h1 id="api-specification-generated-array-api-prod--page-root">prod<a class="hea
463463
<dd class="field-odd"><ul class="simple">
464464
<li><p><strong>x</strong> (<em>array</em>) – input array. Should have a numeric data type.</p></li>
465465
<li><p><strong>axis</strong> (<em>Optional</em><em>[</em><em>Union</em><em>[</em><em>int</em><em>, </em><em>Tuple</em><em>[</em><em>int</em><em>, </em><em>...</em><em>]</em><em>]</em><em>]</em>) – axis or axes along which products must be computed. By default, the product must be computed over the entire array. If a tuple of integers, products must be computed over multiple axes. Default: <code class="docutils literal notranslate"><span class="pre">None</span></code>.</p></li>
466-
<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>,</p>
466+
<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>
467467
<ul>
468-
<li><p>if the default data type corresponding to the data type “kind” (integer, real-valued floating-point, or complex floating-point) of <code class="docutils literal notranslate"><span class="pre">x</span></code> has a smaller range of values than the data type of <code class="docutils literal notranslate"><span class="pre">x</span></code> (e.g., <code class="docutils literal notranslate"><span class="pre">x</span></code> has data type <code class="docutils literal notranslate"><span class="pre">int64</span></code> and the default data type is <code class="docutils literal notranslate"><span class="pre">int32</span></code>, or <code class="docutils literal notranslate"><span class="pre">x</span></code> has data type <code class="docutils literal notranslate"><span class="pre">uint64</span></code> and the default data type is <code class="docutils literal notranslate"><span class="pre">int64</span></code>), the returned array must have the same data type as <code class="docutils literal notranslate"><span class="pre">x</span></code>.</p></li>
469-
<li><p>if the default data type corresponding to the data type “kind” of <code class="docutils literal notranslate"><span class="pre">x</span></code> has the same or a larger range of values than the data type of <code class="docutils literal notranslate"><span class="pre">x</span></code>,
470-
- if <code class="docutils literal notranslate"><span class="pre">x</span></code> has a real-valued floating-point data type, the returned array must have the default real-valued floating-point data type.
471-
- if <code class="docutils literal notranslate"><span class="pre">x</span></code> has a complex floating-point data type, the returned array must have the default complex floating-point data type.
472-
- 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.
473-
- 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>
468+
<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>
469+
<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>
474470
</ul>
475-
<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. Default: <code class="docutils literal notranslate"><span class="pre">None</span></code>.</p>
476-
<div class="admonition note">
477-
<p class="admonition-title">Note</p>
478-
<p>This keyword argument is intended to help prevent data type overflows.</p>
479-
</div>
471+
<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 sum (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>
480472
</p></li>
481473
<li><p><strong>keepdims</strong> (<em>bool</em>) – if <code class="docutils literal notranslate"><span class="pre">True</span></code>, the reduced axes (dimensions) must be included in the result as singleton dimensions, and, accordingly, the result must be compatible with the input array (see <a class="reference internal" href="../broadcasting.html#broadcasting"><span class="std std-ref">Broadcasting</span></a>). Otherwise, if <code class="docutils literal notranslate"><span class="pre">False</span></code>, the reduced axes (dimensions) must not be included in the result. Default: <code class="docutils literal notranslate"><span class="pre">False</span></code>.</p></li>
482474
</ul>

Diff for: draft/API_specification/generated/array_api.sum.html

+4-12
Original file line numberDiff line numberDiff line change
@@ -463,20 +463,12 @@ <h1 id="api-specification-generated-array-api-sum--page-root">sum<a class="heade
463463
<dd class="field-odd"><ul class="simple">
464464
<li><p><strong>x</strong> (<em>array</em>) – input array. Should have a numeric data type.</p></li>
465465
<li><p><strong>axis</strong> (<em>Optional</em><em>[</em><em>Union</em><em>[</em><em>int</em><em>, </em><em>Tuple</em><em>[</em><em>int</em><em>, </em><em>...</em><em>]</em><em>]</em><em>]</em>) – axis or axes along which sums must be computed. By default, the sum must be computed over the entire array. If a tuple of integers, sums must be computed over multiple axes. Default: <code class="docutils literal notranslate"><span class="pre">None</span></code>.</p></li>
466-
<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>,</p>
466+
<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>
467467
<ul>
468-
<li><p>if the default data type corresponding to the data type “kind” (integer, real-valued floating-point, or complex floating-point) of <code class="docutils literal notranslate"><span class="pre">x</span></code> has a smaller range of values than the data type of <code class="docutils literal notranslate"><span class="pre">x</span></code> (e.g., <code class="docutils literal notranslate"><span class="pre">x</span></code> has data type <code class="docutils literal notranslate"><span class="pre">int64</span></code> and the default data type is <code class="docutils literal notranslate"><span class="pre">int32</span></code>, or <code class="docutils literal notranslate"><span class="pre">x</span></code> has data type <code class="docutils literal notranslate"><span class="pre">uint64</span></code> and the default data type is <code class="docutils literal notranslate"><span class="pre">int64</span></code>), the returned array must have the same data type as <code class="docutils literal notranslate"><span class="pre">x</span></code>.</p></li>
469-
<li><p>if the default data type corresponding to the data type “kind” of <code class="docutils literal notranslate"><span class="pre">x</span></code> has the same or a larger range of values than the data type of <code class="docutils literal notranslate"><span class="pre">x</span></code>,
470-
- if <code class="docutils literal notranslate"><span class="pre">x</span></code> has a real-valued floating-point data type, the returned array must have the default real-valued floating-point data type.
471-
- if <code class="docutils literal notranslate"><span class="pre">x</span></code> has a complex floating-point data type, the returned array must have the default complex floating-point data type.
472-
- 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.
473-
- 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>
468+
<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>
469+
<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>
474470
</ul>
475-
<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 sum. Default: <code class="docutils literal notranslate"><span class="pre">None</span></code>.</p>
476-
<div class="admonition note">
477-
<p class="admonition-title">Note</p>
478-
<p>keyword argument is intended to help prevent data type overflows.</p>
479-
</div>
471+
<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 sum (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>
480472
</p></li>
481473
<li><p><strong>keepdims</strong> (<em>bool</em>) – if <code class="docutils literal notranslate"><span class="pre">True</span></code>, the reduced axes (dimensions) must be included in the result as singleton dimensions, and, accordingly, the result must be compatible with the input array (see <a class="reference internal" href="../broadcasting.html#broadcasting"><span class="std std-ref">Broadcasting</span></a>). Otherwise, if <code class="docutils literal notranslate"><span class="pre">False</span></code>, the reduced axes (dimensions) must not be included in the result. Default: <code class="docutils literal notranslate"><span class="pre">False</span></code>.</p></li>
482474
</ul>

0 commit comments

Comments
 (0)