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
Returns a dictionary of array library capabilities.
6690
+
6691
+
The dictionary must contain the following keys:
6692
+
6693
+
- `"boolean indexing"`: boolean indicating whether an array library supports boolean indexing. If a conforming implementation fully supports boolean indexing in compliance with this specification (see :ref:`indexing`), the corresponding dictionary value must be ``True``; otherwise, the value must be ``False``.
6694
+
- `"data-dependent shapes"`: 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 ``True``; otherwise, the value must be ``False``.
Returns a dictionary containing default data types.
6737
+
6738
+
The dictionary must have the following keys:
6739
+
6740
+
- `"real floating"`: default real floating-point data type.
6741
+
- `"complex floating"`: default complex floating-point data type.
6742
+
- `"integral"`: default integral data type.
6743
+
- `"indexing"`: default array index data type.
6744
+
6745
+
Dictionary values must be the corresponding data type object.
6746
+
6747
+
Parameters
6748
+
----------
6749
+
device: Optional[device]
6750
+
device for which to return default data types. If ``device`` is ``None``, 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: ``None``.
6751
+
6752
+
.. note::
6753
+
Some array libraries have the concept of a device context manager, allowing library consumers to manage the current device context. When ``device`` is ``None``, 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.
6754
+
6755
+
Returns
6756
+
-------
6757
+
out: DefaultDataTypes
6758
+
a dictionary containing the default data type for respective data type kinds.
Returns a dictionary of supported *Array API* data types.
6775
+
6776
+
.. note::
6777
+
While specification-conforming array libraries may support additional data types which are not present in this specification, data types which are not present in this specification should not be included in the returned dictionary.
6778
+
6779
+
.. note::
6780
+
Specification-conforming array libraries must only return supported data types having expected properties as described in :ref:`data-types`. For example, if a library decides to alias ``float32`` as ``float64``, that library must not include ``float64`` in the dictionary of supported data types.
6781
+
6782
+
Parameters
6783
+
----------
6784
+
kind: Optional[Union[str, Tuple[str, ...]]]
6785
+
data type kind.
6786
+
6787
+
- If ``kind`` is ``None``, the function must return a dictionary containing all supported Array API data types.
6788
+
6789
+
- If ``kind`` is a string, the function must return a dictionary containing the data types belonging to the specified data type kind. The following data type kinds must be supported:
6790
+
6791
+
- ``'bool'``: boolean data types (e.g., ``bool``).
6792
+
- ``'signed integer'``: signed integer data types (e.g., ``int8``, ``int16``, ``int32``, ``int64``).
- ``'integral'``: integer data types. Shorthand for ``('signed integer', 'unsigned integer')``.
6795
+
- ``'real floating'``: real-valued floating-point data types (e.g., ``float32``, ``float64``).
6796
+
- ``'complex floating'``: complex floating-point data types (e.g., ``complex64``, ``complex128``).
6797
+
- ``'numeric'``: numeric data types. Shorthand for ``('integral', 'real floating', 'complex floating')``.
6798
+
6799
+
- If ``kind`` is a tuple, the tuple specifies a union of data type kinds, and the function must return a dictionary containing the data types belonging to at least one of the specified data type kinds.
6800
+
6801
+
Default: ``None``.
6802
+
device: Optional[device]
6803
+
device for which to return supported data types. If ``device`` is ``None``, the returned data types must be the supported data types for the current device; otherwise, the returned data types must be supported data types specific to the specified device. Default: ``None``.
6804
+
6805
+
.. note::
6806
+
Some array libraries have the concept of a device context manager, allowing library consumers to manage the current device context. When ``device`` is ``None``, libraries supporting a device context should return the supported data types for the current device. For libraries without a context manager or supporting only a single device, those libraries should return the supported data types for the default device.
6807
+
6808
+
Returns
6809
+
-------
6810
+
out: DataTypes
6811
+
a dictionary containing supported data types.
6812
+
6813
+
.. note::
6814
+
Dictionary keys must only consist of canonical names as defined in :ref:`data-types`.
Returns a list of supported devices which are available at runtime.
6831
+
6832
+
Returns
6833
+
-------
6834
+
out: List[device]
6835
+
a list of supported devices.
6836
+
6837
+
Notes
6838
+
-----
6839
+
Each device object (see :ref:`device-support`) in the list of returned devices must be an object which can be provided as a valid keyword-argument to array creation functions.
6840
+
6841
+
Notes
6842
+
-----
6843
+
6844
+
.. versionadded: 2023.12
6845
+
6846
+
"""
6847
+
6848
+
@abstractmethod
6849
+
def__call__(self, /) ->list[TDevice]: ...
6850
+
6851
+
6686
6852
@runtime_checkable
6687
6853
classtake[TArray: _array](Protocol):
6688
6854
"""
@@ -8218,7 +8384,7 @@ class FftNamespace[TArray: _array, TDevice](Protocol):
Returns a dictionary of array library capabilities.
7117
+
7118
+
The dictionary must contain the following keys:
7119
+
7120
+
- `"boolean indexing"`: boolean indicating whether an array library supports boolean indexing. If a conforming implementation fully supports boolean indexing in compliance with this specification (see :ref:`indexing`), the corresponding dictionary value must be ``True``; otherwise, the value must be ``False``.
7121
+
- `"data-dependent shapes"`: 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 ``True``; otherwise, the value must be ``False``.
7122
+
- `"max dimensions"`: 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 ``None``; otherwise, the value must be a finite integer.
7123
+
7124
+
Returns
7125
+
-------
7126
+
out: Capabilities
7127
+
a dictionary of array library capabilities.
7128
+
7129
+
Notes
7130
+
-----
7131
+
7132
+
.. versionadded: 2023.12
7133
+
7134
+
.. versionchanged:: 2024.12
7135
+
Added support for querying the maximum number of supported dimensions.
Returns a dictionary containing default data types.
7168
+
7169
+
The dictionary must have the following keys:
7170
+
7171
+
- `"real floating"`: default real floating-point data type.
7172
+
- `"complex floating"`: default complex floating-point data type.
7173
+
- `"integral"`: default integral data type.
7174
+
- `"indexing"`: default array index data type.
7175
+
7176
+
Dictionary values must be the corresponding data type object.
7177
+
7178
+
Parameters
7179
+
----------
7180
+
device: Optional[device]
7181
+
device for which to return default data types. If ``device`` is ``None``, 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: ``None``.
7182
+
7183
+
.. note::
7184
+
Some array libraries have the concept of a device context manager, allowing library consumers to manage the current device context. When ``device`` is ``None``, 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.
7185
+
7186
+
Returns
7187
+
-------
7188
+
out: DefaultDataTypes
7189
+
a dictionary containing the default data type for respective data type kinds.
Returns a dictionary of supported *Array API* data types.
7206
+
7207
+
.. note::
7208
+
While specification-conforming array libraries may support additional data types which are not present in this specification, data types which are not present in this specification should not be included in the returned dictionary.
7209
+
7210
+
.. note::
7211
+
Specification-conforming array libraries must only return supported data types having expected properties as described in :ref:`data-types`. For example, if a library decides to alias ``float32`` as ``float64``, that library must not include ``float64`` in the dictionary of supported data types.
7212
+
7213
+
Parameters
7214
+
----------
7215
+
kind: Optional[Union[str, Tuple[str, ...]]]
7216
+
data type kind.
7217
+
7218
+
- If ``kind`` is ``None``, the function must return a dictionary containing all supported Array API data types.
7219
+
7220
+
- If ``kind`` is a string, the function must return a dictionary containing the data types belonging to the specified data type kind. The following data type kinds must be supported:
7221
+
7222
+
- ``'bool'``: boolean data types (e.g., ``bool``).
7223
+
- ``'signed integer'``: signed integer data types (e.g., ``int8``, ``int16``, ``int32``, ``int64``).
- ``'integral'``: integer data types. Shorthand for ``('signed integer', 'unsigned integer')``.
7226
+
- ``'real floating'``: real-valued floating-point data types (e.g., ``float32``, ``float64``).
7227
+
- ``'complex floating'``: complex floating-point data types (e.g., ``complex64``, ``complex128``).
7228
+
- ``'numeric'``: numeric data types. Shorthand for ``('integral', 'real floating', 'complex floating')``.
7229
+
7230
+
- If ``kind`` is a tuple, the tuple specifies a union of data type kinds, and the function must return a dictionary containing the data types belonging to at least one of the specified data type kinds.
7231
+
7232
+
Default: ``None``.
7233
+
device: Optional[device]
7234
+
device for which to return supported data types. If ``device`` is ``None``, the returned data types must be the supported data types for the current device; otherwise, the returned data types must be supported data types specific to the specified device. Default: ``None``.
7235
+
7236
+
.. note::
7237
+
Some array libraries have the concept of a device context manager, allowing library consumers to manage the current device context. When ``device`` is ``None``, libraries supporting a device context should return the supported data types for the current device. For libraries without a context manager or supporting only a single device, those libraries should return the supported data types for the default device.
7238
+
7239
+
Returns
7240
+
-------
7241
+
out: DataTypes
7242
+
a dictionary containing supported data types.
7243
+
7244
+
.. note::
7245
+
Dictionary keys must only consist of canonical names as defined in :ref:`data-types`.
Returns a list of supported devices which are available at runtime.
7262
+
7263
+
Returns
7264
+
-------
7265
+
out: List[device]
7266
+
a list of supported devices.
7267
+
7268
+
Notes
7269
+
-----
7270
+
Each device object (see :ref:`device-support`) in the list of returned devices must be an object which can be provided as a valid keyword-argument to array creation functions.
7271
+
7272
+
Notes
7273
+
-----
7274
+
7275
+
.. versionadded: 2023.12
7276
+
7277
+
"""
7278
+
7279
+
@abstractmethod
7280
+
def__call__(self, /) ->list[TDevice]: ...
7281
+
7282
+
7113
7283
@runtime_checkable
7114
7284
classtake[TArray: _array](Protocol):
7115
7285
"""
@@ -8691,7 +8861,7 @@ class FftNamespace[TArray: _array, TDevice, TDtype](Protocol):
0 commit comments