On Tue, Jul 5, 2022 at 9:10 PM <rmccampbell7@gmail.com> wrote:
Oh nevermind, I see that this is added as an experimental module in the latest numpy version. It would be nice to not have to have another whole set of APIs, but on the other hand the numpy API is so messy and inconsistent that maybe it is a good thing :) But it does mean now we have at least 9 different functions/methods/operators that can compute dot products 😢 (not even including the other array_api functions...)
The idea of the array API is to have a standard API across all Python array libraries. numpy.array_api is currently implemented as a fully conformant version of that API, but the plan is to eventually make NumPy itself conform as well (so vecdot should be added to numpy at some point).
I see that currently the vecdot function returns a 2x2 array from two 2x3 APIs, which matches np.inner but is not what I would expect. Does your fix make it instead return a 1-d length-2 array?
Yes. I incorrectly implemented vecdot using tensordot, but with my PR this would return a shape (2,) array (with the default axis=-1). Aaron Meurer
_______________________________________________ NumPy-Discussion mailing list -- numpy-discussion@python.org To unsubscribe send an email to numpy-discussion-leave@python.org https://mail.python.org/mailman3/lists/numpy-discussion.python.org/ Member address: asmeurer@gmail.com