You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on a PR for SciPy that replaces the sum(x * y) pattern with vecdot(x, y), since there are pretty substantial performance advantages. There is at least one place where the code currently relies on the keepdims argument of sum. Should that be accepted by vecdot?
How about axis tuples? I understand this does not look ideal, and I would also be happy if axis tuples were never allowed. But the motivation is the same - there are existing functions that use sum(x * y) and support axis tuples. If vecdot doesn't allow them, these functions all have to manually ravel the axes of x and y separately. (This operation can be moved into a helper function if need be, but hopefully it need not be.)
The text was updated successfully, but these errors were encountered:
mdhaber
changed the title
Should vecdot have keepdims?
Should vecdot accept keepdims? axis tuples?
Mar 2, 2025
I'm working on a PR for SciPy that replaces the
sum(x * y)
pattern withvecdot(x, y)
, since there are pretty substantial performance advantages. There is at least one place where the code currently relies on thekeepdims
argument ofsum
. Should that be accepted byvecdot
?How about
axis
tuples? I understand this does not look ideal, and I would also be happy if axis tuples were never allowed. But the motivation is the same - there are existing functions that usesum(x * y)
and supportaxis
tuples. Ifvecdot
doesn't allow them, these functions all have to manually ravel the axes ofx
andy
separately. (This operation can be moved into a helper function if need be, but hopefully it need not be.)The text was updated successfully, but these errors were encountered: