Skip to content

Commit 1eef0a3

Browse files
lisa0314chromium-wpt-export-bot
authored andcommitted
webnn: Enforce input data type constraints for gather indices
As specified in webmachinelearning/webnn#646 Bug: 328567884 Change-Id: I33eba7e1def430b1cb94e3e7a4868e82c5bbd9a3
1 parent 602dae0 commit 1eef0a3

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

‎webnn/validation_tests/gather.https.any.js‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,23 @@ const tests = [
2424
indices: {dataType: 'int64', dimensions: [1]}
2525
},
2626
{
27-
name: '[gather] TypeError is expected if the axis is greater than the rank of input',
27+
name:
28+
'[gather] TypeError is expected if the axis is greater than the rank of input',
2829
input: {dataType: 'float16', dimensions: [1, 2, 3]},
2930
indices: {dataType: 'int32', dimensions: [5, 6]},
3031
axis: 4
3132
},
3233
{
33-
name: '[gather] TypeError is expected if the data type of indices is invalid',
34+
name:
35+
'[gather] TypeError is expected if the data type of indices is float32 which is invalid',
3436
input: {dataType: 'float16', dimensions: [1, 2, 3, 4]},
3537
indices: {dataType: 'float32', dimensions: [5, 6]}
38+
},
39+
{
40+
name:
41+
'[gather] TypeError is expected if the data type of indices is int32 which is invalid',
42+
input: {dataType: 'float16', dimensions: [1, 2, 3, 4]},
43+
indices: {dataType: 'int32', dimensions: [5, 6]}
3644
}
3745
];
3846

0 commit comments

Comments
 (0)