Skip to content

Commit

Permalink
webnn: Enforce input data type constraints for conv2d
Browse files Browse the repository at this point in the history
As specified in webmachinelearning/webnn#646

Bug: 328567884
Change-Id: I620653f574303e6f5b18d3b540b647f07e0cf64c
  • Loading branch information
a-sully authored and chromium-wpt-export-bot committed Apr 26, 2024
1 parent 6ae7875 commit 79baf4c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
5 changes: 5 additions & 0 deletions webnn/validation_tests/conv2d.https.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,11 @@ const tests = [
input: {dataType: 'float32', dimensions: [1, 5, 5]},
filter: {dataType: 'float32', dimensions: [1, 2, 2, 1]},
},
{
name: '[conv2d] Throw if the input data type is not floating point.',
input: {dataType: 'int32', dimensions: [1, 1, 5, 5]},
filter: {dataType: 'int32', dimensions: [1, 1, 2, 2]},
},
{
name: '[conv2d] Throw if the filter is not a 4-D tensor.',
input: {dataType: 'float32', dimensions: [1, 1, 5, 5]},
Expand Down
6 changes: 6 additions & 0 deletions webnn/validation_tests/convTranspose2d.https.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,12 @@ const tests = [
input: {dataType: 'float32', dimensions: [1, 5, 5]},
filter: {dataType: 'float32', dimensions: [1, 1, 2, 2]},
},
{
name:
'[convTranspose2d] Throw if the input data type is not floating point.',
input: {dataType: 'int32', dimensions: [1, 1, 5, 5]},
filter: {dataType: 'int32', dimensions: [1, 1, 2, 2]},
},
{
name: '[convTranspose2d] Throw if the filter is not a 4-D tensor.',
input: {dataType: 'float32', dimensions: [1, 1, 5, 5]},
Expand Down

0 comments on commit 79baf4c

Please sign in to comment.