-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Add webnn matmul tests #37069
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 webnn matmul tests #37069
Conversation
520e485 to
fad8ca5
Compare
webnn/resources/utils.js
Outdated
| */ | ||
| const getMatmulPrecisionTolerance = (resources) => { | ||
| // Matmul : Compute the matrix product of two input tensors. | ||
| // If a is 1-D, it is converted to a 2-D tensor by prepending a 1 to its dimensions, [n] -> [1, n] |
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] Would revise comment, because currently it sounds like the comment is saying that the logic below converts the 1D tensor to 2D, but actually it's WebNN that does this conversion. How about:
// If a is 1-D, WebNN converts it to a 2-D tensor by prepending a 1 to its dimensions, [n] -> [1, n].
// So we can just always check the last dimension here.
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.
Updated, thanks @fdwr
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.
Looks like you covered the important cases, broadcasting 1D/2D, 2D/1D.
fad8ca5 to
4904115
Compare
4904115 to
1d1c467
Compare
|
@Honry All checks passed, PTAL, thanks. |
Honry
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.
LGTM, thanks!
@fdwr @Honry @huningxin @dontcallmedom PTAL, thanks.