[Numpy-discussion] Adding to the non-dispatched implementation of NumPy methods
njs at pobox.com
Mon Apr 15 16:20:48 EDT 2019
What's the difference between
More generally, I guess I'm not quite clear on how to think about what the
"no dispatch" version does, because obviously it doesn't make sense to have
*no* dispatch. Instead it's something like "the legacy hard-coded dispatch"?
On Mon, Apr 15, 2019, 08:30 Stephan Hoyer <shoyer at gmail.com> wrote:
> Hi everyone,
> 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
> functions, e.g.,
> 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!
> NumPy-Discussion mailing list
> NumPy-Discussion at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the NumPy-Discussion