Skip to content

Conversation

@BruceDai
Copy link
Contributor

*/
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]
Copy link

@fdwr fdwr Dec 3, 2022

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated, thanks @fdwr

Copy link

@fdwr fdwr left a 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.

@BruceDai BruceDai force-pushed the add_webnn_matmul_tests branch from fad8ca5 to 4904115 Compare December 5, 2022 07:45
@BruceDai BruceDai force-pushed the add_webnn_matmul_tests branch from 4904115 to 1d1c467 Compare January 9, 2023 07:05
@BruceDai
Copy link
Contributor Author

BruceDai commented Jan 9, 2023

@Honry All checks passed, PTAL, thanks.

Copy link
Contributor

@Honry Honry left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@Honry Honry merged commit 35c4c38 into web-platform-tests:master Jan 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants