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
<spanclass="sig-name descname"><spanclass="pre">__array_namespace_info__</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">Info</span></span></span><aclass="headerlink" href="#array_api.info.__array_namespace_info__" title="Link to this definition">¶</a></dt>
475
475
<dd><p>Returns a namespace with Array API namespace inspection utilities.</p>
476
-
<p>See <aclass="reference internal" href="../inspection.html#inspection"><spanclass="std std-ref">Inspection</span></a> for a list of inspection APIs.</p>
<ddclass="field-odd"><p><strong>out</strong> (<em>Info</em>) – An object containing Array API namespace inspection utilities.</p>
478
+
<ddclass="field-odd"><p><strong>out</strong> (<em>Info</em>) – an object containing Array API namespace inspection utilities.</p>
480
479
</dd>
481
480
</dl>
482
481
<pclass="rubric">Notes</p>
483
-
<p>The returned object may be either a namespace or a class, so long as an Array API user can access inspection utilities as follows:</p>
482
+
<ulclass="simple">
483
+
<li><p>See <aclass="reference internal" href="../inspection.html#inspection"><spanclass="std std-ref">Inspection</span></a> for a list of inspection APIs.</p></li>
484
+
<li><p>The returned object <strong>may</strong> be either a namespace or a class, as long as an Array API user can access inspection utilities as follows:</p></li>
<spanclass="sig-name descname"><spanclass="pre">capabilities</span></span><spanclass="sig-paren">(</span><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">Capabilities</span></span></span><aclass="headerlink" href="#array_api.info.capabilities" title="Link to this definition">¶</a></dt>
475
475
<dd><p>Returns a dictionary of array library capabilities.</p>
476
-
<p>The dictionary must contain the following keys:</p>
477
-
<ulclass="simple">
478
-
<li><p><codeclass="code docutils literal notranslate"><spanclass="pre">"boolean</span><spanclass="pre">indexing"</span></code>: boolean indicating whether an array library supports boolean indexing. If a conforming implementation fully supports boolean indexing in compliance with this specification (see <aclass="reference internal" href="../indexing.html#indexing"><spanclass="std std-ref">Indexing</span></a>), the corresponding dictionary value must be <codeclass="docutils literal notranslate"><spanclass="pre">True</span></code>; otherwise, the value must be <codeclass="docutils literal notranslate"><spanclass="pre">False</span></code>.</p></li>
479
-
<li><p><codeclass="code docutils literal notranslate"><spanclass="pre">"data-dependent</span><spanclass="pre">shapes"</span></code>: boolean indicating whether an array library supports data-dependent output shapes. If a conforming implementation fully supports all APIs included in this specification (excluding boolean indexing) which have data-dependent output shapes, as explicitly demarcated throughout the specification, the corresponding dictionary value must be <codeclass="docutils literal notranslate"><spanclass="pre">True</span></code>; otherwise, the value must be <codeclass="docutils literal notranslate"><spanclass="pre">False</span></code>.</p></li>
480
-
<li><p><codeclass="code docutils literal notranslate"><spanclass="pre">"max</span><spanclass="pre">dimensions"</span></code>: maximum number of supported dimensions. If a conforming implementation supports arrays having an arbitrary number of dimensions (potentially infinite), the corresponding dictionary value must be <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code>; otherwise, the value must be a finite integer.</p></li>
<ddclass="field-odd"><p><strong>out</strong> (<em>Capabilities</em>) – a dictionary of array library capabilities.</p>
478
+
<ddclass="field-odd"><p><strong>out</strong> (<em>Capabilities</em>) – a dictionary of array library capabilities. The returned dictionary <strong>must</strong> contain the following keys:</p>
479
+
<ulclass="simple">
480
+
<li><p><codeclass="code docutils literal notranslate"><spanclass="pre">"boolean</span><spanclass="pre">indexing"</span></code>: boolean indicating whether an array library supports boolean indexing. If a conforming implementation fully supports boolean indexing in compliance with this specification (see <aclass="reference internal" href="../indexing.html#indexing"><spanclass="std std-ref">Indexing</span></a>), the corresponding dictionary value <strong>must</strong> be <codeclass="docutils literal notranslate"><spanclass="pre">True</span></code>; otherwise, the value <strong>must</strong> be <codeclass="docutils literal notranslate"><spanclass="pre">False</span></code>.</p></li>
481
+
<li><p><codeclass="code docutils literal notranslate"><spanclass="pre">"data-dependent</span><spanclass="pre">shapes"</span></code>: boolean indicating whether an array library supports data-dependent output shapes. If a conforming implementation fully supports all APIs included in this specification (excluding boolean indexing) which have data-dependent output shapes, as explicitly demarcated throughout the specification, the corresponding dictionary value <strong>must</strong> be <codeclass="docutils literal notranslate"><spanclass="pre">True</span></code>; otherwise, the value <strong>must</strong> be <codeclass="docutils literal notranslate"><spanclass="pre">False</span></code>.</p></li>
482
+
<li><p><codeclass="code docutils literal notranslate"><spanclass="pre">"max</span><spanclass="pre">dimensions"</span></code>: maximum number of supported dimensions. If a conforming implementation supports arrays having an arbitrary number of dimensions (potentially infinite), the corresponding dictionary value <strong>must</strong> be <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code>; otherwise, the value <strong>must</strong> be a finite integer.</p></li>
<spanclass="sig-name descname"><spanclass="pre">default_dtypes</span></span><spanclass="sig-paren">(</span><emclass="sig-param"><spanclass="o"><spanclass="pre">*</span></span></em>, <emclass="sig-param"><spanclass="n"><spanclass="pre">device</span></span><spanclass="p"><spanclass="pre">:</span></span><spanclass="w"></span><spanclass="n"><spanclass="pre">device</span><spanclass="w"></span><spanclass="p"><spanclass="pre">|</span></span><spanclass="w"></span><spanclass="pre">None</span></span><spanclass="w"></span><spanclass="o"><spanclass="pre">=</span></span><spanclass="w"></span><spanclass="default_value"><spanclass="pre">None</span></span></em><spanclass="sig-paren">)</span><spanclass="sig-return"><spanclass="sig-return-icon">→</span><spanclass="sig-return-typehint"><spanclass="pre">DefaultDataTypes</span></span></span><aclass="headerlink" href="#array_api.info.default_dtypes" title="Link to this definition">¶</a></dt>
475
475
<dd><p>Returns a dictionary containing default data types.</p>
476
-
<p>The dictionary must have the following keys:</p>
<ddclass="field-odd"><p><strong>device</strong> (<em>Optional</em><em>[</em><em>device</em><em>]</em>) – device for which to return default data types. If <codeclass="docutils literal notranslate"><spanclass="pre">device</span></code> is <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code>, the returned data types <strong>must</strong> be the default data types for the current device; otherwise, the returned data types <strong>must</strong> be default data types specific to the specified device. Default: <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code>.</p>
<ddclass="field-even"><p><strong>out</strong> (<em>DefaultDataTypes</em>) – a dictionary containing the default data type for respective data type kinds. The returned dictionary <strong>must</strong> have the following keys:</p>
477
482
<ulclass="simple">
478
483
<li><p><codeclass="code docutils literal notranslate"><spanclass="pre">"real</span><spanclass="pre">floating"</span></code>: default real floating-point data type.</p></li>
479
484
<li><p><codeclass="code docutils literal notranslate"><spanclass="pre">"complex</span><spanclass="pre">floating"</span></code>: default complex floating-point data type.</p></li>
480
485
<li><p><codeclass="code docutils literal notranslate"><spanclass="pre">"integral"</span></code>: default integral data type.</p></li>
481
486
<li><p><codeclass="code docutils literal notranslate"><spanclass="pre">"indexing"</span></code>: default array index data type.</p></li>
482
487
</ul>
483
-
<p>Dictionary values must be the corresponding data type object.</p>
<ddclass="field-odd"><p><strong>device</strong> (<em>Optional</em><em>[</em><em>device</em><em>]</em>) – <p>device for which to return default data types. If <codeclass="docutils literal notranslate"><spanclass="pre">device</span></code> is <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code>, the returned data types must be the default data types for the current device; otherwise, the returned data types must be default data types specific to the specified device. Default: <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code>.</p>
487
-
<divclass="admonition note">
488
-
<pclass="admonition-title">Note</p>
489
-
<p>Some array libraries have the concept of a device context manager, allowing library consumers to manage the current device context. When <codeclass="docutils literal notranslate"><spanclass="pre">device</span></code> is <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code>, libraries supporting a device context should return the default data types for the current device. For libraries without a context manager or supporting only a single device, those libraries should return the default data types for the default device.</p>
<ddclass="field-even"><p><strong>out</strong> (<em>DefaultDataTypes</em>) – a dictionary containing the default data type for respective data type kinds.</p>
488
+
<p>Dictionary values <strong>must</strong> be the corresponding data type object.</p>
495
489
</dd>
496
490
</dl>
497
491
<pclass="rubric">Notes</p>
492
+
<ulclass="simple">
493
+
<li><p>Some array libraries have the concept of a device context manager, allowing library consumers to manage the current device context. When <codeclass="docutils literal notranslate"><spanclass="pre">device</span></code> is <codeclass="docutils literal notranslate"><spanclass="pre">None</span></code>, libraries supporting a device context <strong>must</strong> return the default data types for the current device. For libraries without a context manager or supporting only a single device, those libraries <strong>must</strong> return the default data types for the default device.</p></li>
<p>Each device object (see <aclass="reference internal" href="../../design_topics/device_support.html#device-support"><spanclass="std std-ref">Device support</span></a>) in the list of returned devices must be an object which can be provided as a valid keyword-argument to array creation functions.</p>
482
+
<ulclass="simple">
483
+
<li><p>Each device object (see <aclass="reference internal" href="../../design_topics/device_support.html#device-support"><spanclass="std std-ref">Device support</span></a>) in the list of returned devices <strong>must</strong> be an object which can be provided as a valid keyword-argument to array creation functions.</p></li>
0 commit comments