WebNN: Allow 0-D (scalar) reductions #46209
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
crrev.com/c/5448942 added a restriction on the reduction ops
(including argMin/argMax) that the rank of the input tensor must be
greater than zero.
In webmachinelearning/webnn#681, @fdwr
points out that 0-D (scalar) reductions are fine, it's just a no-op.
Per that discussion, this removes a restriction. There are already
WPT cases for argMin/argMax (although they fail for other reasons);
cases are added for the plethora of reduction ops (which also fail
for other reasons).
Change-Id: Ib10a9b0bb3062f9d2b6001d9a4963b14e751d14f
Cq-Include-Trybots: luci.chromium.try:mac14-blink-rel,mac14.arm64-blink-rel,win11-blink-rel
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5529350
Reviewed-by: Phillis Tang <[email protected]>
Reviewed-by: ningxin hu <[email protected]>
Commit-Queue: Joshua Bell <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1301369}