NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #3060 most downloaded on PyPI
A wrapper around NumPy and other array libraries to make them compatible with the Array API standard
Last release 3 months ago
07 Jun 2026
Release timing varies
gaps range from 3 weeks to 8 months
Nearly every release is documented
notes for 22 of 23 stable releases
Nothing withdrawn
no release was ever pulled
4 years old
23 releases · first in 2022
One column per quarter.
array_namespace can now be used under torch.compile.
array_namespace can now be used under torch.compile.setuptools to meson-python.
Projects vendoring array-api-compat inside a meson project can now
rely on the in-tree meson project definition, which exposes the Python
sources via the sources variable. For example:array_api_compat = subproject('array_api_compat')
array_api_compat_sources = array_api_compat.get_variable('sources')
foreach prefix, files : array_api_compat_sources
py3.install_sources(files, subdir: external_dir / prefix)
endforeach
torch.round now supports complex input.torch.arange now works around missing dtype implementations instead of raising
an exception.Bug fixes:
np.matrix instances are no longer considered to be standard array objects.torch.meshgrid now correctly handles the case of no input arrays.The following users contributed to this release:
Lucas Colley, Evgeni Burovski, Chris Ninham, Dimitri Papadopoulos Orfanos.
This release targets the 2025.12 Array API revision. This includes
This release targets the 2025.12 Array API revision. This includes
__array_api_version__ for the wrapped APIs is now set to 2025.12;linalg.eig and linalg.eigvals;isin and searchsorted to accept Python scalars;expand_dims accepting tuple axes;broadcast_arrays, meshgrid and __array_api_info__().devices() have been
changed to return tuples, not lists;Additionally,
clip wrappers have been fixed to be compatible with torch.vmap.expand_dims wrappers have been fixed to accept its axis argument as a keyword
or positional argument;torch.clip wrappers have been fixed to correctly handle nan scalars;torch.repeat wrapper has been fixed to not error out for short integers;The following users contributed to this release:
Evgeni Burovski, Josh Soref.
Support for Python 3.14 has been added.
torch.take and torch.take_along_axis now support negative indices.torch.meshgrid now correctly processes the indexing argument.ceil, floor, and trunc functions.array_namespace has been sped up via caching.stable parameter of torch.argsort now defaults to True, per the standard.is_jax_array has been adjusted for compatibility with jax>=0.8.2The following users contributed to this release:
Evgeni Burovski, Guido Imperiale, Lucas Colley, Arthur Lacote, Martin Schuck, Matt Haberland.
The build system has been updated to use pyproject.toml instead of setup.py
pyproject.toml instead of setup.pylinalg extension works correctly with pytorch>=2.7.device parameter. Please report any issues you encounter.finfo and iinfo functions now accept array arguments, in accordance with the
Array API spec;torch.asarray function propagates the device of the input array. This works around
the pytorch issue #150199;torch.repeat function is now available;torch.count_nonzero function now correctly handles the case of a tuple axis
arguments and keepdims=True;torch.meshgrid wrapper defaults to indexing="xy", in accordance with the
array API specification;cupy.asarray function now implements the copy=False argument, albeit
at the cost of risking to make a temporary copy.numpy.take_along_axis and cupy.take_along_axis the axis parameter now
defaults to -1, in accordance to the Array API spec.The following users contributed to this release:
Evgeni Burovski, Lucas Colley, Neil Girdhar, Joren Hammudoglu, Guido Imperiale
This is a bugfix release with no new features compared to version 1.11.
This is a bugfix release with no new features compared to version 1.11.
result_type wrapper for pytorch. Previously, result_type had multiple
issues with scalar arguments.clip wrappers. Previously, clip was failing to allow
behaviors which are unspecified by the 2024.12 standard but allowed by the array
libraries.The following users contributed to this release:
Evgeni Burovski Guido Imperiale Magnus Dalen Kvalevåg
This is a bugfix release with no new features compared to version 1.11.
This is a bugfix release with no new features compared to version 1.11.
count_nonzero wrappers: work around the lack of the keepdims argument in
several array libraries (torch, dask, cupy); work around numpy returning python
ints in for some input combinations.The following users contributed to this release:
Evgeni Burovski Guido Imperiale
Nothing published for this version
New function is_writeable_array adds transparent support for readonly arrays, such as JAX arrays or numpy arrays with .flags.writeable=False.
New function is_writeable_array adds transparent support for readonly
arrays, such as JAX arrays or numpy arrays with .flags.writeable=False.
asarray(..., copy=None) with dask backend always copies, so that
copy=None and copy=True are equivalent for the dask backend.
This change is made to be forward compatible with the dask==2024.12
release.
array_namespace accepts (and ignores) None and python scalars (int, float,
complex, bool). This change is to simplify downstream adoption, for
functions where arguments can be either arrays or scalars.
vecdot conjugates its first argument, as stipulated by the Array API spec.
Previously, conjation if the first argument was missing.
__array_api_version__ for the wrapped APIs is now set to 2023.12.
__array_api_version__ for the wrapped APIs is now set to 2023.12.Wrap sign so that it always uses the standard definition for complex
numbers, and always propagates nans.
Wrap dask.array.fft.
Readd python_requires to the package metadata.
New helper functions to determine if a namespace is from a given library ({func}~.is_numpy_namespace, {func}~.is_torch_namespace, etc.).
New helper functions to determine if a namespace is from a given library
({func}~.is_numpy_namespace, {func}~.is_torch_namespace, etc.).
More support for the 2023.12 version of the standard. This includes
cumulative_sum().unstack().sum(), prod(), and trace()
to be inline with the 2023.12 specification (32-bit types no longer
promote to 64-bit when dtype=None).xp.__array_namespace_info__().clip() wrappers.torch.conj now wraps torch.conj_physical, which makes a copy rather
than setting the conjugation bit, as arrays with the conjugation bit set do
not support some APIs.
torch.sign is now wrapped to support complex numbers and propagate nans
properly.
NumPy 2.0 is now wrapped again. Previously it was unwrapped because it has full 2022.12 array API support but it now requires wrapping again for 2023.12 support.
Support for JAX 0.4.32 and newer which implements the array API directly in
jax.numpy.
hypot, minimum, and maximum (new in 2023.12) are wrapped in PyTorch to
support proper scalar type promotion.
Add support for ndonnx. Array API support itself lives in the ndonnx library, but this adds the {func}~.is_ndonnx_array helper function. (@adityagoel4
Add support for ndonnx. Array API
support itself lives in the ndonnx library, but this adds the
{func}~.is_ndonnx_array helper function.
(@adityagoel4512).
Partial support for the 2023.12 version of the standard. This includes
clip().copysign() with correct type promotion.Note that many of the new functions in the 2023.12 version of the standard are already fully implemented in upstream libraries and will already work.
Fix a typo in setup.py (@sunpoet).
Add support for sparse. Note that unlike other array libraries, array-api-compat does not contain any wrappers for sparse functions. All sparse array
Add support for sparse. Note that unlike other array libraries,
array-api-compat does not contain any wrappers for sparse functions. All
sparse array API support is in sparse itself. Thus, there is no
array_api_compat.sparse submodule, and
array_namespace(<pydata/sparse array>) returns the sparse module.
Added the function is_pydata_sparse_array(x).
Fix JAX float0 arrays. See https://github.com/google/jax/issues/20620.
(@NeilGirdhar)
Fix torch.linalg.vector_norm() when axis=().
Fix torch.linalg.solve() to apply the array API standard rules for when
x2 should be treated as a vector vs. a matrix.
Fix PyTorch test failures on CI by skipping uint16, uint32, uint64 tests.
NumPy 2.0 is now left completely unwrapped.
Drop support for Python 3.8.
NumPy 2.0 is now left completely unwrapped.
New flag use_compat to {func}~.array_namespace to force the use or
non-use of the compat wrapper namespace. The default is to return a compat
namespace when it is appropriate.
Fix the copy flag to asarray for NumPy, CuPy, and Dask.
Fix the device flag to asarray for CuPy.
Fix various issues with asarray for Dask.
Test Python 3.12 on CI.
Add more tests for {func}~.array_namespace.
Add more tests for asarray.
Add a test that there are no hard dependencies.
Add HTML documentation. Includes new documentation on the scope of the package and new developer documentation.
Add HTML documentation. Includes new documentation on the scope of the package and new developer documentation.
Fix array_api_compat.numpy.asarray(torch.Tensor) to return a NumPy array.
Allow Python scalars in torch functions.
Fix the torch.std wrapper when correction is an int.
Fix issues with qr and svd in the Dask wrappers.
Add support for Dask (@lithomas1).
Add support for Dask (@lithomas1).
Add support for JAX. Note that unlike other array libraries,
array-api-compat does not contain any wrappers for JAX functions. All JAX
array API support is in JAX itself. Thus, there is no array_api_compat.jax
submodule, and array_namespace(<JAX array>) returns the
jax.experimental.array_api module.
The functions is_numpy_array(x), is_cupy_array(x), is_torch_array(x),
is_dask_array(x), is_jax_array(x) are now part of the public
array_api_compat API.
Add wrappers for the fft extension module for NumPy, CuPy, and PyTorch.
Allow '2022.12' as the api_version in {func}~.array_namespace().
'2021.12' is also supported but will issue a warning since the returned
namespace will still be a 2022.12 compliant one.
Add wrapper for numpy.linalg.solve, which broadcasts the inputs according to the standard.
Add wrappers for various PyTorch linalg functions.
Fix a bug with numpy.linalg.vector_norm(keepdims=True).
BREAKING: Update vecdot wrappers to apply axes before broadcasting, not
after. This matches the updated 2023.12 standard wording, and also the
behavior of the new numpy.vecdot gufunc in NumPy 2.0.
Fix some linalg functions which were supposed to be in both the main namespace and the linalg extension namespace.
Add Ruff to CI. (@adonath)
Test that internal definitions of __all__ are self-consistent, which
should help to avoid issues where wrappers are accidentally not exported to
the compat namespaces properly.
Add support for the upcoming NumPy 2.0 release.
Add support for the upcoming NumPy 2.0 release.
Added a torch wrapper for trace (torch.trace doesn't support the
offset argument or stacking)
Wrap numpy, cupy, and torch nonzero to raise an error for zero-dimensional
input arrays.
Add torch wrapper for newaxis.
Improve error message for array_namespace
Fix linalg.cholesky returning the conjugate of the expected upper decomposition for numpy and cupy.
Releases are now made with GitHub Actions (thanks @matthewfeickert).
Fix torch.result_type() cross-kind promotion
(@lucascolley).
Fix the torch.take() wrapper to make axis optional for ndim = 1.
Add requires-python metadata to the package (@matthewfeickert).
Add 2022.12 standard support. This includes things like adding complex dtype support, adding the new take function, and various minor changes in the s
take function, and various minor changes in the specification.Support "cpu" in CuPy to_device().
Return a new array in NumPy/CuPy reshape(copy=False).
Fix signatures for PyTorch broadcast_to and permute_dims.
Support the linalg extension in the array_api_compat.torch namespace.
Support the linalg extension in the array_api_compat.torch namespace.
Add isdtype().
k keyword argument to tril and triu in torch.Rename get_namespace() to array_namespace() (get_namespace() is maintained as a backwards compatible alias).
get_namespace() to array_namespace() (get_namespace() is
maintained as a backwards compatible alias).The minimum supported NumPy version is now 1.21. Fixed a few issues with
NumPy 1.21 (with unique_* and asarray), although there are also a few
known issues with this version (see the README).
Add api_version to get_namespace().
array_namespace() (née get_namespace()) now works correctly with
torch tensors.
array_namespace() (née get_namespace()) now works correctly with
numpy.array_api arrays.
array_namespace() (née get_namespace()) now raises TypeError instead
of ValueError.
Fix the torch.std wrapper.
Add torch wrappers for ones, empty, and zeros so that shape can be
passed as a keyword argument.
Add helper function size() (required if torch is used as torch.Tensor.size is a method that is incompatible with the array API `.size`).
Added support for PyTorch.
Add helper function size() (required if torch is used as
torch.Tensor.size is a method that is incompatible with the array API
.size).
All wrapper functions that wrap existing library functions now pass through
arbitrary **kwargs.
Added CI to run against the array API testsuite.
Fix sort(stable=False) and argsort(stable=False) with CuPy.
Initial release. Includes support for NumPy and CuPy.
Your coding agent can read these notes before it upgrades. Set up the MCP server →