[Numpy-discussion] A little about XND

Marten van Kerkwijk m.h.vankerkwijk at gmail.com
Mon Jun 18 21:04:19 EDT 2018


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>


More information about the NumPy-Discussion mailing list