[Numpy-discussion] Allowing broadcasting of code dimensions in generalized ufuncs (original) (raw)
Marten van Kerkwijk m.h.vankerkwijk at gmail.com
Fri Jun 15 10:07:22 EDT 2018
- Previous message (by thread): [Numpy-discussion] Allowing broadcasting of code dimensions in generalized ufuncs
- Next message (by thread): [Numpy-discussion] Python 3 compatible examples
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi All,
The discussion on the gufunc signature enhancements seems to have stalled a bit, but while it was going I've tried to update the NEP correspondingly. The NEP is now merged, so can viewed more easily, at http://www.numpy.org/neps/nep-0020-gufunc-signature-enhancement.html
My own quite possibly biased summary of the discussion so far is that:
Frozen dimensions are generally seen as a good idea; other implementations may be possible, but are not as clear.
Flexible dimensions have little use beyond matmul; the main discussion is whether there is a better way. In my opinion, the main benefit of the current proposal is that it allows operator overrides to all work the same way (via array_ufunc), independent of any assumptions about the object that does the override (such as that it has a shape).
Broadcastable dimensions had less support, but mostly for lack of examples; there now is one beyond all_equal, for which a gufunc is more clearly the proper route: a weighted average (which has obvious extensions).
A general benefit of course is that there is actual code for all three; it
would certainly be nice if we could fully support matmul
and @
in 1.16.
So, the question would seem whether the NEP should be accepted or rejected (with part acceptance of course being possible, though I note that flexible and broadcastable share a lot of implementation, so in my opinion it is somewhat pointless to do just one of them).
All the best,
Marten -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20180615/b1186068/attachment.html>
- Previous message (by thread): [Numpy-discussion] Allowing broadcasting of code dimensions in generalized ufuncs
- Next message (by thread): [Numpy-discussion] Python 3 compatible examples
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]