Skip to content

Commit

Permalink
Bug 1895442 [wpt PR 46129] - webnn: Enforce input data type constrain…
Browse files Browse the repository at this point in the history
…ts for gather indices, a=testonly

Automatic update from web-platform-tests
webnn: Enforce input data type constraints for gather indices

As specified in webmachinelearning/webnn#646

Bug: 328567884
Change-Id: I33eba7e1def430b1cb94e3e7a4868e82c5bbd9a3
Cq-Include-Trybots: luci.chromium.try​:mac14-blink-rel,mac14.arm64-blink-rel
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5520313
Reviewed-by: Austin Sullivan <asully@chromium.org>
Commit-Queue: Lisha Guo <lisha.guo@intel.com>
Reviewed-by: ningxin hu <ningxin.hu@intel.com>
Cr-Commit-Position: refs/heads/main@{#1298443}

--

wpt-commits: d32b68ce2a00a378db571901573b2ded4d8ab349
wpt-pr: 46129
  • Loading branch information
lisa0314 authored and moz-wptsync-bot committed May 21, 2024
1 parent 4507d14 commit 54e99d2
Showing 1 changed file with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const tests = [
{
name: '[gather] Test gather with default options and 0-D indices',
input: {dataType: 'int32', dimensions: [3]},
indices: {dataType: 'uint64', dimensions: []},
indices: {dataType: 'int64', dimensions: []},
output: {dataType: 'int32', dimensions: []}
},
{
Expand All @@ -24,15 +24,23 @@ const tests = [
indices: {dataType: 'int64', dimensions: [1]}
},
{
name: '[gather] TypeError is expected if the axis is greater than the rank of input',
name:
'[gather] TypeError is expected if the axis is greater than the rank of input',
input: {dataType: 'float16', dimensions: [1, 2, 3]},
indices: {dataType: 'int32', dimensions: [5, 6]},
indices: {dataType: 'uint32', dimensions: [5, 6]},
axis: 4
},
{
name: '[gather] TypeError is expected if the data type of indices is invalid',
name:
'[gather] TypeError is expected if the data type of indices is float32 which is invalid',
input: {dataType: 'float16', dimensions: [1, 2, 3, 4]},
indices: {dataType: 'float32', dimensions: [5, 6]}
},
{
name:
'[gather] TypeError is expected if the data type of indices is int32 which is invalid',
input: {dataType: 'float16', dimensions: [1, 2, 3, 4]},
indices: {dataType: 'int32', dimensions: [5, 6]}
}
];

Expand Down

0 comments on commit 54e99d2

Please sign in to comment.