Skip to content

Clarify broadcasting behavior in vecdot #473

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

Merged
merged 1 commit into from
Sep 5, 2022

Conversation

kgryte
Copy link
Contributor

@kgryte kgryte commented Aug 29, 2022

This PR resolves #471.

The existing spec provides conflicting guidance saying both that the axes over which to compute the dot product must be equal, while also saying that input arrays must be broadcast compatible without qualification, thus implying that the contracted axis could also broadcast.

This PR explicitly defines broadcast behavior for only the contracted axes, thus bringing vecdot inline with broadcasting behavior in tensordot.

This resolves data-apis#471.

The existing spec provides conflicting guidance saying both that the
axes over which to compute the dot product must be equal, while also
saying that input arrays must be broadcast compatible without
qualification, thus implying that the contracted axis could also
broadcast.

This commit explicitly defines broadcast behavior for only the
contracted axes, thus bringing vecdot inline with broadcasting
behavior in tensordot.
@kgryte kgryte added the topic: Linear Algebra Linear algebra. label Aug 29, 2022
@kgryte kgryte added this to the v2022 milestone Aug 29, 2022
@kgryte kgryte requested a review from asmeurer August 29, 2022 17:09
Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM and aligns with what @leofang and @asmeurer said in the issue. So in it goes, thanks @kgryte.

@rgommers rgommers merged commit 55b8fb0 into data-apis:main Sep 5, 2022
@kgryte kgryte deleted the fix-vecdot-broadcasting branch December 15, 2022 08:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: Linear Algebra Linear algebra.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should vecdot broadcast along the contracted axis?
2 participants