Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should vecdot accept keepdims? axis tuples? #910

Open
mdhaber opened this issue Mar 2, 2025 · 0 comments
Open

Should vecdot accept keepdims? axis tuples? #910

mdhaber opened this issue Mar 2, 2025 · 0 comments

Comments

@mdhaber
Copy link
Contributor

mdhaber commented Mar 2, 2025

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.)

@mdhaber mdhaber changed the title Should vecdot have keepdims? Should vecdot accept keepdims? axis tuples? Mar 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant