You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<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 <codeclass="docutils literal notranslate"><spanclass="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>
466
466
<p>If <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> is a one-dimensional array, providing an <codeclass="docutils literal notranslate"><spanclass="pre">axis</span></code> is optional; however, if <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> has more than one dimension, providing an <codeclass="docutils literal notranslate"><spanclass="pre">axis</span></code> is required.</p>
467
467
</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 <codeclass="docutils literal notranslate"><spanclass="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 <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code>, the returned array must have the same data type as <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code>, unless <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> has an integer data type supporting a smaller range of values than the default integer data type (e.g., <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> has an <codeclass="docutils literal notranslate"><spanclass="pre">int16</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">uint32</span></code> data type and the default integer data type is <codeclass="docutils literal notranslate"><spanclass="pre">int64</span></code>). In those latter cases:</p>
469
469
<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 <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> has a smaller range of values than the data type of <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> (e.g., <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> has data type <codeclass="docutils literal notranslate"><spanclass="pre">int64</span></code> and the default data type is <codeclass="docutils literal notranslate"><spanclass="pre">int32</span></code>, or <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> has data type <codeclass="docutils literal notranslate"><spanclass="pre">uint64</span></code> and the default data type is <codeclass="docutils literal notranslate"><spanclass="pre">int64</span></code>), the returned array must have the same data type as <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code>.</p></li>
471
-
<li><p>if the default data type corresponding to the data type “kind” of <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> has the same or a larger range of values than the data type of <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code>,</p>
472
-
<ul>
473
-
<li><p>if <codeclass="docutils literal notranslate"><spanclass="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 <codeclass="docutils literal notranslate"><spanclass="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>
475
470
<li><p>if <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> has a signed integer data type (e.g., <codeclass="docutils literal notranslate"><spanclass="pre">int16</span></code>), the returned array must have the default integer data type.</p></li>
476
471
<li><p>if <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> has an unsigned integer data type (e.g., <codeclass="docutils literal notranslate"><spanclass="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 <codeclass="docutils literal notranslate"><spanclass="pre">int32</span></code>, the returned array must have a <codeclass="docutils literal notranslate"><spanclass="pre">uint32</span></code> data type).</p></li>
477
472
</ul>
478
-
</li>
479
-
</ul>
480
-
<p>If the data type (either specified or resolved) differs from the data type of <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code>, the input array should be cast to the specified data type before computing the sum. Default: <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code>.</p>
481
-
<divclass="admonition note">
482
-
<pclass="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 <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code>, the input array should be cast to the specified data type before computing the sum (rationale: the <codeclass="docutils literal notranslate"><spanclass="pre">dtype</span></code> keyword argument is intended to help prevent overflows). Default: <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code>.</p>
485
474
</p></li>
486
475
<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: <codeclass="docutils literal notranslate"><spanclass="pre">False</span></code>.</p></li>
<li><p><strong>x</strong> (<em>array</em>) – input array. Should have a numeric data type.</p></li>
465
465
<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: <codeclass="docutils literal notranslate"><spanclass="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 <codeclass="docutils literal notranslate"><spanclass="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 <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code>, the returned array must have the same data type as <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code>, unless <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> has an integer data type supporting a smaller range of values than the default integer data type (e.g., <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> has an <codeclass="docutils literal notranslate"><spanclass="pre">int16</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">uint32</span></code> data type and the default integer data type is <codeclass="docutils literal notranslate"><spanclass="pre">int64</span></code>). In those latter cases:</p>
467
467
<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 <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> has a smaller range of values than the data type of <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> (e.g., <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> has data type <codeclass="docutils literal notranslate"><spanclass="pre">int64</span></code> and the default data type is <codeclass="docutils literal notranslate"><spanclass="pre">int32</span></code>, or <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> has data type <codeclass="docutils literal notranslate"><spanclass="pre">uint64</span></code> and the default data type is <codeclass="docutils literal notranslate"><spanclass="pre">int64</span></code>), the returned array must have the same data type as <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code>.</p></li>
469
-
<li><p>if the default data type corresponding to the data type “kind” of <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> has the same or a larger range of values than the data type of <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code>,
470
-
- if <codeclass="docutils literal notranslate"><spanclass="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 <codeclass="docutils literal notranslate"><spanclass="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 <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> has a signed integer data type (e.g., <codeclass="docutils literal notranslate"><spanclass="pre">int16</span></code>), the returned array must have the default integer data type.
473
-
- if <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> has an unsigned integer data type (e.g., <codeclass="docutils literal notranslate"><spanclass="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 <codeclass="docutils literal notranslate"><spanclass="pre">int32</span></code>, the returned array must have a <codeclass="docutils literal notranslate"><spanclass="pre">uint32</span></code> data type).</p></li>
468
+
<li><p>if <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> has a signed integer data type (e.g., <codeclass="docutils literal notranslate"><spanclass="pre">int16</span></code>), the returned array must have the default integer data type.</p></li>
469
+
<li><p>if <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> has an unsigned integer data type (e.g., <codeclass="docutils literal notranslate"><spanclass="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 <codeclass="docutils literal notranslate"><spanclass="pre">int32</span></code>, the returned array must have a <codeclass="docutils literal notranslate"><spanclass="pre">uint32</span></code> data type).</p></li>
474
470
</ul>
475
-
<p>If the data type (either specified or resolved) differs from the data type of <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code>, the input array should be cast to the specified data type before computing the product. Default: <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code>.</p>
476
-
<divclass="admonition note">
477
-
<pclass="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 <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code>, the input array should be cast to the specified data type before computing the sum (rationale: the <codeclass="docutils literal notranslate"><spanclass="pre">dtype</span></code> keyword argument is intended to help prevent overflows). Default: <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code>.</p>
480
472
</p></li>
481
473
<li><p><strong>keepdims</strong> (<em>bool</em>) – if <codeclass="docutils literal notranslate"><spanclass="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 <aclass="reference internal" href="../broadcasting.html#broadcasting"><spanclass="std std-ref">Broadcasting</span></a>). Otherwise, if <codeclass="docutils literal notranslate"><spanclass="pre">False</span></code>, the reduced axes (dimensions) must not be included in the result. Default: <codeclass="docutils literal notranslate"><spanclass="pre">False</span></code>.</p></li>
<li><p><strong>x</strong> (<em>array</em>) – input array. Should have a numeric data type.</p></li>
465
465
<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: <codeclass="docutils literal notranslate"><spanclass="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 <codeclass="docutils literal notranslate"><spanclass="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 <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code>, the returned array must have the same data type as <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code>, unless <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> has an integer data type supporting a smaller range of values than the default integer data type (e.g., <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> has an <codeclass="docutils literal notranslate"><spanclass="pre">int16</span></code> or <codeclass="docutils literal notranslate"><spanclass="pre">uint32</span></code> data type and the default integer data type is <codeclass="docutils literal notranslate"><spanclass="pre">int64</span></code>). In those latter cases:</p>
467
467
<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 <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> has a smaller range of values than the data type of <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> (e.g., <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> has data type <codeclass="docutils literal notranslate"><spanclass="pre">int64</span></code> and the default data type is <codeclass="docutils literal notranslate"><spanclass="pre">int32</span></code>, or <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> has data type <codeclass="docutils literal notranslate"><spanclass="pre">uint64</span></code> and the default data type is <codeclass="docutils literal notranslate"><spanclass="pre">int64</span></code>), the returned array must have the same data type as <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code>.</p></li>
469
-
<li><p>if the default data type corresponding to the data type “kind” of <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> has the same or a larger range of values than the data type of <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code>,
470
-
- if <codeclass="docutils literal notranslate"><spanclass="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 <codeclass="docutils literal notranslate"><spanclass="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 <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> has a signed integer data type (e.g., <codeclass="docutils literal notranslate"><spanclass="pre">int16</span></code>), the returned array must have the default integer data type.
473
-
- if <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> has an unsigned integer data type (e.g., <codeclass="docutils literal notranslate"><spanclass="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 <codeclass="docutils literal notranslate"><spanclass="pre">int32</span></code>, the returned array must have a <codeclass="docutils literal notranslate"><spanclass="pre">uint32</span></code> data type).</p></li>
468
+
<li><p>if <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> has a signed integer data type (e.g., <codeclass="docutils literal notranslate"><spanclass="pre">int16</span></code>), the returned array must have the default integer data type.</p></li>
469
+
<li><p>if <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code> has an unsigned integer data type (e.g., <codeclass="docutils literal notranslate"><spanclass="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 <codeclass="docutils literal notranslate"><spanclass="pre">int32</span></code>, the returned array must have a <codeclass="docutils literal notranslate"><spanclass="pre">uint32</span></code> data type).</p></li>
474
470
</ul>
475
-
<p>If the data type (either specified or resolved) differs from the data type of <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code>, the input array should be cast to the specified data type before computing the sum. Default: <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code>.</p>
476
-
<divclass="admonition note">
477
-
<pclass="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 <codeclass="docutils literal notranslate"><spanclass="pre">x</span></code>, the input array should be cast to the specified data type before computing the sum (rationale: the <codeclass="docutils literal notranslate"><spanclass="pre">dtype</span></code> keyword argument is intended to help prevent overflows). Default: <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code>.</p>
480
472
</p></li>
481
473
<li><p><strong>keepdims</strong> (<em>bool</em>) – if <codeclass="docutils literal notranslate"><spanclass="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 <aclass="reference internal" href="../broadcasting.html#broadcasting"><spanclass="std std-ref">Broadcasting</span></a>). Otherwise, if <codeclass="docutils literal notranslate"><spanclass="pre">False</span></code>, the reduced axes (dimensions) must not be included in the result. Default: <codeclass="docutils literal notranslate"><spanclass="pre">False</span></code>.</p></li>
0 commit comments