From 3061a367c01d74a0c6f1cf27601ac66bfb2c6a57 Mon Sep 17 00:00:00 2001 From: Austin Sullivan Date: Mon, 29 Apr 2024 07:44:17 +0000 Subject: [PATCH] Bug 1893558 [wpt PR 45922] - webnn: Enforce input data type constraints for conv2d, a=testonly Automatic update from web-platform-tests webnn: Enforce input data type constraints for conv2d As specified in https://github.com/webmachinelearning/webnn/pull/646 Bug: 328567884 Change-Id: I620653f574303e6f5b18d3b540b647f07e0cf64c Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5492307 Reviewed-by: ningxin hu Commit-Queue: Austin Sullivan Cr-Commit-Position: refs/heads/main@{#1293407} -- wpt-commits: 839bdcfea290fd869732772d922ed910efbf052c wpt-pr: 45922 --- .../tests/webnn/validation_tests/conv2d.https.any.js | 5 +++++ .../webnn/validation_tests/convTranspose2d.https.any.js | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/testing/web-platform/tests/webnn/validation_tests/conv2d.https.any.js b/testing/web-platform/tests/webnn/validation_tests/conv2d.https.any.js index c38174e6169fc..7dac654951b77 100644 --- a/testing/web-platform/tests/webnn/validation_tests/conv2d.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/conv2d.https.any.js @@ -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]}, diff --git a/testing/web-platform/tests/webnn/validation_tests/convTranspose2d.https.any.js b/testing/web-platform/tests/webnn/validation_tests/convTranspose2d.https.any.js index 3c3c49566439d..02822c52749e8 100644 --- a/testing/web-platform/tests/webnn/validation_tests/convTranspose2d.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/convTranspose2d.https.any.js @@ -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]},