[Numpy-discussion] A little about XND (original) (raw)
Marten van Kerkwijk m.h.vankerkwijk at gmail.com
Mon Jun 18 21:04:19 EDT 2018
- Previous message (by thread): [Numpy-discussion] A little about XND
- Next message (by thread): [Numpy-discussion] rackspace ssl certificates
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi Stefan,
Just to clarify: the ? we propose in the NEP is really for matmul - it indicates a true missing dimension (i.e., the array cannot have outer broadcast dimensions as well). For inner loop broadcasting, I'm proposing a "|1" post-fix, which means a dimension could also be missing, but can also be there and be 1, in which case it can do outer broadcast as well. So, for your function in your notation, it might look like:
"... * N|1 * int64, ... * N|1 * int64 -> ... * N * int64"
(Note that the output of course always has N - if both inputs have 1 then N=1; it is not meant to be absent).
I think that actually looks quite clear, although perhaps one might want parentheses around it (since "|" = "or" normally does not have precedence over "*" = multiply), i.e.,
"... * (N|1) * int64, ... * (N|1) * int64 -> ... * N * int64"
All the best,
Marten -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20180618/4f0f0e93/attachment.html>
- Previous message (by thread): [Numpy-discussion] A little about XND
- Next message (by thread): [Numpy-discussion] rackspace ssl certificates
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]