|
198 | 198 | <a href="../../purpose_and_scope.html" class="md-nav__link">Purpose and scope</a>
|
199 | 199 |
|
200 | 200 |
|
| 201 | + </li> |
| 202 | + <li class="md-nav__item"> |
| 203 | + |
| 204 | + |
| 205 | + <a href="../../terms_and_definitions.html" class="md-nav__link">Terms and Definitions</a> |
| 206 | + |
| 207 | + |
201 | 208 | </li>
|
202 | 209 | <li class="md-nav__item">
|
203 | 210 |
|
@@ -466,31 +473,24 @@ <h1 id="api-specification-generated-array-api-all--page-root">all<a class="heade
|
466 | 473 | <dt class="sig sig-object py" id="array_api.all">
|
467 | 474 | <span class="sig-name descname"><span class="pre">all</span></span><span class="sig-paren">(</span><em class="sig-param"><span class="n"><span class="pre">x</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">array</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">/</span></span></em>, <em class="sig-param"><span class="o"><span class="pre">*</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">axis</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">int</span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">Tuple</span><span class="p"><span class="pre">[</span></span><span class="pre">int</span><span class="p"><span class="pre">,</span></span><span class="w"> </span><span class="p"><span class="pre">...</span></span><span class="p"><span class="pre">]</span></span><span class="w"> </span><span class="p"><span class="pre">|</span></span><span class="w"> </span><span class="pre">None</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">None</span></span></em>, <em class="sig-param"><span class="n"><span class="pre">keepdims</span></span><span class="p"><span class="pre">:</span></span><span class="w"> </span><span class="n"><span class="pre">bool</span></span><span class="w"> </span><span class="o"><span class="pre">=</span></span><span class="w"> </span><span class="default_value"><span class="pre">False</span></span></em><span class="sig-paren">)</span> <span class="sig-return"><span class="sig-return-icon">→</span> <span class="sig-return-typehint"><span class="pre">array</span></span></span><a class="headerlink" href="#array_api.all" title="Link to this definition">¶</a></dt>
|
468 | 475 | <dd><p>Tests whether all input array elements evaluate to <code class="docutils literal notranslate"><span class="pre">True</span></code> along a specified axis.</p>
|
469 |
| -<div class="admonition note"> |
470 |
| -<p class="admonition-title">Note</p> |
471 |
| -<p>Positive infinity, negative infinity, and NaN must evaluate to <code class="docutils literal notranslate"><span class="pre">True</span></code>.</p> |
472 |
| -</div> |
473 |
| -<div class="admonition note"> |
474 |
| -<p class="admonition-title">Note</p> |
475 |
| -<p>If <code class="docutils literal notranslate"><span class="pre">x</span></code> has a complex floating-point data type, elements having a non-zero component (real or imaginary) must evaluate to <code class="docutils literal notranslate"><span class="pre">True</span></code>.</p> |
476 |
| -</div> |
477 |
| -<div class="admonition note"> |
478 |
| -<p class="admonition-title">Note</p> |
479 |
| -<p>If <code class="docutils literal notranslate"><span class="pre">x</span></code> is an empty array or the size of the axis (dimension) along which to evaluate elements is zero, the test result must be <code class="docutils literal notranslate"><span class="pre">True</span></code>.</p> |
480 |
| -</div> |
481 | 476 | <dl class="field-list simple">
|
482 | 477 | <dt class="field-odd">Parameters<span class="colon">:</span></dt>
|
483 | 478 | <dd class="field-odd"><ul class="simple">
|
484 | 479 | <li><p><strong>x</strong> (<em>array</em>) – input array.</p></li>
|
485 |
| -<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 to perform a logical AND reduction. By default, a logical AND reduction must be performed over the entire array. If a tuple of integers, logical AND reductions must be performed over multiple axes. A valid <code class="docutils literal notranslate"><span class="pre">axis</span></code> must 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 rank (number of dimensions) of <code class="docutils literal notranslate"><span class="pre">x</span></code>. If an <code class="docutils literal notranslate"><span class="pre">axis</span></code> is specified as a negative integer, the function must determine the axis along which to perform a reduction by counting backward from the last dimension (where <code class="docutils literal notranslate"><span class="pre">-1</span></code> refers to the last dimension). If provided an invalid <code class="docutils literal notranslate"><span class="pre">axis</span></code>, the function must raise an exception. Default: <code class="docutils literal notranslate"><span class="pre">None</span></code>.</p></li> |
486 |
| -<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> |
| 480 | +<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 to perform a logical AND reduction. By default, a logical AND reduction <strong>must</strong> be performed over the entire array. If a tuple of integers, logical AND reductions <strong>must</strong> be performed over multiple axes. A valid <code class="docutils literal notranslate"><span class="pre">axis</span></code> <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 <code class="docutils literal notranslate"><span class="pre">axis</span></code> is specified as a negative integer, the function <strong>must</strong> determine the axis along which to perform a reduction 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 <code class="docutils literal notranslate"><span class="pre">axis</span></code>, the function <strong>must</strong> raise an exception. Default: <code class="docutils literal notranslate"><span class="pre">None</span></code>.</p></li> |
| 481 | +<li><p><strong>keepdims</strong> (<em>bool</em>) – If <code class="docutils literal notranslate"><span class="pre">True</span></code>, the reduced axes <strong>must</strong> be included in the result as singleton dimensions, and, accordingly, the result <strong>must</strong> be broadcast-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 <strong>must not</strong> be included in the result. Default: <code class="docutils literal notranslate"><span class="pre">False</span></code>.</p></li> |
487 | 482 | </ul>
|
488 | 483 | </dd>
|
489 | 484 | <dt class="field-even">Returns<span class="colon">:</span></dt>
|
490 |
| -<dd class="field-even"><p><strong>out</strong> (<em>array</em>) – if a logical AND reduction was performed over the entire array, the returned array must be a zero-dimensional array containing the test result; otherwise, the returned array must be a non-zero-dimensional array containing the test results. The returned array must have a data type of <code class="docutils literal notranslate"><span class="pre">bool</span></code>.</p> |
| 485 | +<dd class="field-even"><p><strong>out</strong> (<em>array</em>) – if a logical AND reduction was performed over the entire array, the returned array <strong>must</strong> be a zero-dimensional array containing the test result. Otherwise, the returned array <strong>must</strong> be a non-zero-dimensional array containing the test results. The returned array <strong>must</strong> have a data type of <code class="docutils literal notranslate"><span class="pre">bool</span></code>.</p> |
491 | 486 | </dd>
|
492 | 487 | </dl>
|
493 | 488 | <p class="rubric">Notes</p>
|
| 489 | +<ul class="simple"> |
| 490 | +<li><p>Positive infinity, negative infinity, and NaN <strong>must</strong> evaluate to <code class="docutils literal notranslate"><span class="pre">True</span></code>.</p></li> |
| 491 | +<li><p>If <code class="docutils literal notranslate"><span class="pre">x</span></code> has a complex floating-point data type, elements having a non-zero component (real or imaginary) <strong>must</strong> evaluate to <code class="docutils literal notranslate"><span class="pre">True</span></code>.</p></li> |
| 492 | +<li><p>If <code class="docutils literal notranslate"><span class="pre">x</span></code> is an empty array or the size of the axis along which to evaluate elements is zero, the test result <strong>must</strong> be <code class="docutils literal notranslate"><span class="pre">True</span></code>.</p></li> |
| 493 | +</ul> |
494 | 494 | <div class="versionchanged">
|
495 | 495 | <p><span class="versionmodified changed">Changed in version 2022.12: </span>Added complex data type support.</p>
|
496 | 496 | </div>
|
|
0 commit comments