[Numpy-discussion] Adding to the non-dispatched implementation of NumPy methods
shoyer at gmail.com
Mon Apr 15 11:30:06 EDT 2019
We have a proposed a revision to NEP-18 (__array_function__). The proposal
is for an adding an alias to the non-dispatched version of NumPy array
functions in the __numpy_implementaiton__ function attribute:
I believe this attribute improves the protocol in three ways:
1. It provides a hook that __array_function__ methods can use to call
implementation intended for NumPy arrays. This allows for "partial
implementations" of NumPy's API, which turns out to useful even for some
array libraries that reimplement nearly everything (namely, for CuPy and
2. It allows for fast access to the non-dispatching version of NumPy
3. Internally, the implementation of numpy.ndarray.__array_function__ now
looks identical to how we encourage outside developers to write their own
__array_function__ methods. The dispatching logic no longer includes a
special case for NumPy arrays.
Feedback would be greatly welcomed!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion