array-api-extra
requirements brainstorming
#842
Replies: 5 comments 3 replies
-
I think this is great! And actually |
Beta Was this translation helpful? Give feedback.
-
Why do they need to take an |
Beta Was this translation helpful? Give feedback.
-
Indeed. We should also make it vendorable. And I agree we should make each function isolated so people can easily just copy the functions directly. |
Beta Was this translation helpful? Give feedback.
-
My biggest concern with the package is making sure we have good quality assurance, so that we know the function implementations are correct. That means good tests (we can test against known implementations like NumPy), and also ideally, we can get enough people who are familiar with the various array functions to help review, or even maintain, the package. I would also add that specifically in-scope is implementations or branches in implementations that are specific to a given array library or set of array libraries. For instance, if some libraries already have some fast versions of a given function, we should just dispatch to those, or if some function can be implemented faster for libraries that have access to stride tricks, we should use those when we can. This is of particular importance when it has an impact on performance. |
Beta Was this translation helpful? Give feedback.
-
@lucascolley I went ahead and created an array-api-extra repo and gave you write access. https://github.com/data-apis/array-api-extra Feel free to start prototyping stuff there. If it's helpful, you can copy stuff over from array-api-strict or array-api-compat. |
Beta Was this translation helpful? Give feedback.
-
The idea of a package named something like
array-api-extra
(xpx
?) has been floated in various places. In a sentence, the purpose would be to house array-agnostic implementations of functions which are likely to be useful in a variety of domains (in this sense, the functions belong on or close to the array library level), but are not a part of the standard.Proposed functions so far include
kron
,atleast_nd
,cov
,moveaxis_to_end
,vector_norm
,ravel
, just from SciPy alone. Some of them can be relatively trivial to implement for end-users, but there is still value in having drop-in replacements for existing non-standard functions, especially when converting large codebases. Forming a collection of functions that are needed as consumer libraries convert to array-agnostic implementations should help inform potential additions to the standard, too.These functions would take an
xp
kwarg and perform all computation with that namespace, assuming that it is compatible with the standard.In scope
mean
Out of scope
General package requirements
Design choices
cc @asmeurer @rgommers @izaid, x-ref gh-837, scipy/scipy#21054
Beta Was this translation helpful? Give feedback.
All reactions