-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
replace broadcast with map in sparse binary op definitions #19527
Conversation
Rebased with #19518 in. Should be in shape if CI approves. Best! |
Absent objections or requests for time, I plan to merge this PR Sunday morning PST. Best! |
are mismatched-shape cases covered by existing tests? |
The checks/throws in |
…rather than {broadcast + shape check}.
Now with tests of shape checks. Thanks! |
lgtm. the sparse broadcast tests have some loops that go through the special cases for 1-by-n and n-by-1, right? those might also be good places to throw in some test_throws to make sure we don't unintentionally change anything unexpected |
Do you mean adding tests along the lines of these tests for the generic code to e.g. these tests for the binary-specialized code? If so, absolutely, though in a separate PR? Thanks! |
sure, as long as it doesn't get forgotten. if these operations mistakenly went through the broadcast code path I don't think mismatched size square inputs would be enough to tell the difference between broadcast and map, since both would throw an error. |
Ah, I see your concern now. Will update with sharper tests. Thanks! |
The revised tests should differentiate between implementing these operations as Realization re. the more general sparse broadcast shape check testing discussion above: I condensed the entry points for sparse broadcast into two methods (in which lie the shape checks) in #19518. The tests for the generic code linked above exercise those methods' shape checks, thereby covering the shape check code for all sparse broadcast cases. Sufficient, or should we do more? Thanks! |
mac travis freeze unrelated, the added tests passed there |
Thanks for reviewing / merging! |
A few elementwise operations over pairs of sparse matrices (e.g.
+
,min
) are implemented as short children ofbroadcast
preceded by a (same-)shape check. This pull request reimplements those operations in terms ofmap
. Best!Note: This pull request should not pass CI prior to rebasing on #19518.