This is a small wrapper around NumPy that is compatible with the Array API standard. See also NEP 47.
Unlike numpy.array_api, this is not a strict minimal implementation of the Array API, but rather just an extension of the main NumPy namespace with changes needed to be compliant with the Array API. See https://numpy.org/doc/stable/reference/array_api.html for a full list of changes. In particular, unlike numpy.array_api, this package does not use a separate Array object, but rather just uses numpy.ndarray directly.
Note that some of the functionality in this library is backwards incompatible with NumPy.
This library also supports CuPy in addition to NumPy.
Library authors using the Array API may wish to test against numpy.array_api to ensure they are not using functionality outside of the standard, but prefer this implementation for end users who use NumPy arrays.
To use this library replace
import numpy as npwith
import array_api_compat.numpy as npand replace
import cupy as cpwith
import array_api_compat.cupy as cp