diff --git a/numpy/array_api/__init__.py b/numpy/array_api/__init__.py index 964873faab20..77f227882e3e 100644 --- a/numpy/array_api/__init__.py +++ b/numpy/array_api/__init__.py @@ -125,7 +125,7 @@ __all__ = ["__array_api_version__"] -from ._constants import e, inf, nan, pi +from ._constants import e, inf, nan, pi, newaxis __all__ += ["e", "inf", "nan", "pi"] diff --git a/numpy/array_api/_constants.py b/numpy/array_api/_constants.py index 9541941e7c6f..15ab81d16d93 100644 --- a/numpy/array_api/_constants.py +++ b/numpy/array_api/_constants.py @@ -4,3 +4,4 @@ inf = np.inf nan = np.nan pi = np.pi +newaxis = np.newaxis diff --git a/numpy/array_api/linalg.py b/numpy/array_api/linalg.py index e8011aca6c5c..67a66bc185e6 100644 --- a/numpy/array_api/linalg.py +++ b/numpy/array_api/linalg.py @@ -318,9 +318,9 @@ def _solve(a, b): # This does nothing currently but is left in because it will be relevant # when complex dtype support is added to the spec in 2022. signature = 'DD->D' if isComplexType(t) else 'dd->d' - with errstate(call=_raise_linalgerror_singular, invalid='call', - over='ignore', divide='ignore', under='ignore'): - r = gufunc(a, b, signature=signature, extobj=extobj) + with np.errstate(call=_raise_linalgerror_singular, invalid='call', + over='ignore', divide='ignore', under='ignore'): + r = gufunc(a, b, signature=signature) return wrap(r.astype(result_t, copy=False))