numpy.__array_namespace_info__#

class numpy.__array_namespace_info__[source]#

Get the array API inspection namespace for NumPy.

The array API inspection namespace defines the following functions:

  • capabilities()

  • default_device()

  • default_dtypes()

  • dtypes()

  • devices()

See https://data-apis.org/array-api/latest/API_specification/inspection.html for more details.

Returns:
infoModuleType

The array API inspection namespace for NumPy.

Examples

>>> info = np.__array_namespace_info__()
>>> info.default_dtypes()
{'real floating': numpy.float64,
 'complex floating': numpy.complex128,
 'integral': numpy.int64,
 'indexing': numpy.int64}

Methods

capabilities()

Return a dictionary of array API library capabilities.

default_device()

The default device used for new NumPy arrays.

default_dtypes(*[, device])

The default data types used for new NumPy arrays.

devices()

The devices supported by NumPy.

dtypes(*[, device, kind])

The array API data types supported by NumPy.