array-api
array-api copied to clipboard
RFC document, tooling and other content related to the array API standard
### Preface I do not think that I am the best person to champion this effort, as I am far from the most informed person here on Lazy arrays. I'm...
The spec stipulates that `meshgrid` returns a list of arrays, https://data-apis.org/array-api/draft/API_specification/generated/array_api.meshgrid.html NumPy and Pytorch, however, return tuples. Jax and CuPy return lists. Makes me wonder if specifying a list is...
closes gh-923. Per discussion in the community meeting, https://hackmd.io/zn5bvdZTQIeJmb3RW1B-8g#Meeting-minutes-15-May-2025 and the resolution of https://github.com/data-apis/array-api/issues/923#issuecomment-2885639657, spell out explicitly that `None` is an allowed return value of the `default_device`.
This PR: - resolves https://github.com/data-apis/array-api/issues/854 by adding `isin` to the specification. - of the keyword arguments determined according to array comparison [data](https://github.com/data-apis/array-api-comparison/blob/8cd85d8bcafdd71b4f18df3e7bd9fccd1507d1ee/signatures/sets/isin.md), this PR chooses to support only the `invert`...
This PR - resolves https://github.com/data-apis/array-api/issues/812 by adding `bincount` to the specification for counting the number of occurrences of each element in an input integer array. - based on [comparison data](https://github.com/data-apis/array-api-comparison/blob/312c75bb5589a1c5fe8c6de6f8b8a196dc5f1e71/signatures/statistics/bincount.md),...
## Prior art - NumPy - https://numpy.org/doc/stable/reference/generated/numpy.isin.html - CuPy - https://docs.cupy.dev/en/latest/reference/generated/cupy.isin.html - Dask - https://docs.dask.org/en/stable/generated/dask.array.isin.html - JAX - https://jax.readthedocs.io/en/latest/_autosummary/jax.numpy.isin.html - PyTorch - https://pytorch.org/docs/stable/generated/torch.isin.html - ndonnx - https://ndonnx.readthedocs.io/en/latest/api/ndonnx.additional.html#ndonnx.additional.isin - MLX -...
This RFC proposes adding an API to the specification for explicitly broadcasting a list of shapes to a single shape. ## Overview Based on array API comparison [data](https://github.com/data-apis/array-api-comparison/blob/c5fe8c3263d41a9bff0ec5a920a21c8ed7bdd16b/signatures/manipulation/broadcast_shapes.md), this API,...
Sorry, I don't know the discussion, a question for @leofang or @tqchen probably. The docs for the stream say that: > If stream is -1, the value may be used...
The following patterns are quite common [1]: `x = np.r_(x[0], x, x[-1])` and `x = np.r_[0, x]`. Neither of these can be directly replaced by `xp.concat` because the latter requires...
PyTorch has a special device, `meta`, which is a dummy device with no underlying data. This is a very powerful testing tool. However, PyTorch has not implemented special support for...