Skip to content

Commit ad9d84d

Browse files
a-sullychromium-wpt-export-bot
authored andcommitted
webnn: Enforce input data type constraints for conv2d
As specified in webmachinelearning/webnn#646 Bug: 328567884 Change-Id: I620653f574303e6f5b18d3b540b647f07e0cf64c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5492307 Reviewed-by: ningxin hu <ningxin.hu@intel.com> Commit-Queue: Austin Sullivan <asully@chromium.org> Cr-Commit-Position: refs/heads/main@{#1293407}
1 parent 21b3e71 commit ad9d84d

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

webnn/validation_tests/conv2d.https.any.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,11 @@ const tests = [
210210
input: {dataType: 'float32', dimensions: [1, 5, 5]},
211211
filter: {dataType: 'float32', dimensions: [1, 2, 2, 1]},
212212
},
213+
{
214+
name: '[conv2d] Throw if the input data type is not floating point.',
215+
input: {dataType: 'int32', dimensions: [1, 1, 5, 5]},
216+
filter: {dataType: 'int32', dimensions: [1, 1, 2, 2]},
217+
},
213218
{
214219
name: '[conv2d] Throw if the filter is not a 4-D tensor.',
215220
input: {dataType: 'float32', dimensions: [1, 1, 5, 5]},

webnn/validation_tests/convTranspose2d.https.any.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,12 @@ const tests = [
195195
input: {dataType: 'float32', dimensions: [1, 5, 5]},
196196
filter: {dataType: 'float32', dimensions: [1, 1, 2, 2]},
197197
},
198+
{
199+
name:
200+
'[convTranspose2d] Throw if the input data type is not floating point.',
201+
input: {dataType: 'int32', dimensions: [1, 1, 5, 5]},
202+
filter: {dataType: 'int32', dimensions: [1, 1, 2, 2]},
203+
},
198204
{
199205
name: '[convTranspose2d] Throw if the filter is not a 4-D tensor.',
200206
input: {dataType: 'float32', dimensions: [1, 1, 5, 5]},

0 commit comments

Comments
 (0)