-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[webnn] Add float32 test for more WebNN Reduction operations #39467
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
[webnn] Add float32 test for more WebNN Reduction operations #39467
Conversation
reduceL1 / reduceL2 / reduceLogSum / reduceLogSumExp / reduceSumSquare
fdwr
left a comment
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.
Minor naming proposal, but otherwise looks correct (and everything matches my spreadsheet :b). Thanks.
webnn/resources/utils.js
Outdated
| case 'reduceL1': | ||
| case 'reduceProduct': | ||
| case 'reduceSum': | ||
| // directly use above computed tolerance |
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.
This all looks correct, but rather than assign a tolerance above and then later replace that tolerance with a new value or keep it via switch fallthrough, I think it would be clearer to rename tolerance on line 233 to something like reducedElementCount, and then here say:
tolerance = reducedElementCount
...
tolerance = reducedElementCount * 2 + 18
Functionally it's the same, but semantically the relationship is more apparent.
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.
Done, thanks.
fdwr
left a comment
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.
👍
@fdwr @Honry @dontcallmedom PTAL, thanks.