-
Notifications
You must be signed in to change notification settings - Fork 491
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
Add support for Any, All operations to Tensor #1342
Conversation
@louisfd The bug in WGPU about the boolean casting to float/int is no longer a blocker in the updated code. I noticed that I can get rid of that by just changing the logic a bit and adding another bool_not op which converts the weird large values of 1065353216 for (1.0 f / 1 ) to exact zeros. There's no overflow now since this op happens before the final sum, so it's all ok. TL;DR There's no blocker for this PR and it works for all backends. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1342 +/- ##
==========================================
+ Coverage 78.77% 78.93% +0.15%
==========================================
Files 551 563 +12
Lines 61836 62981 +1145
==========================================
+ Hits 48712 49714 +1002
- Misses 13124 13267 +143 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome! Thank you.
The logic is good everywhere. I do have some comments though, most of them minor but one is important, you must not do tensor.clone() if you're not obligated, this will augment reference count and may prevent operations to happen in-place. To make sure no occurrence of the clone is forgotten i commented them all 😄
@ashdtu While we're here, can you change this LSTM test line in lstm.rs (which was the original reason I needed the any op):
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks
Pull Request Template
Checklist
run-checks all
script has been executed.Related Issues/PRs
#1341
Changes
Testing
Test cases written for the implemented methods (any(), any_dim(), all(), all_dim()) with all tensor types(float, int, bool) in burn-tensor/src/tests/ops/any.rs or all.rs.