From 930c011b4c37cf7046db2ff94f38febf0a543640 Mon Sep 17 00:00:00 2001 From: Ningxin Hu Date: Mon, 20 Nov 2023 11:09:58 +0000 Subject: [PATCH] Bug 1864594 [wpt PR 43140] - WebNN: Support 0-D scalars, a=testonly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Automatic update from web-platform-tests WebNN: Support 0-D scalars This CL fixes the WebNN spec and implementation issue [1] and allows to present a 0-D scalar operand by empty dimensions. This CL also adds test cases for MLGraphBuilder, XNNPACK backend, WebNN service and DirectML backend for 0-D scalar operand. [1]: https://github.com/webmachinelearning/webnn/issues/390 Bug: 1498803, 1273291 Change-Id: Ic30602d6a1cdbe38ca3d384ffb7d8fe053b0a5a7 Cq-Include-Trybots: luci.chromium.try​:win11-blink-rel Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5029273 Reviewed-by: Jiewei Qian Reviewed-by: Rafael Cintron Commit-Queue: ningxin hu Reviewed-by: Weizhong Xia Cr-Commit-Position: refs/heads/main@{#1225264} -- wpt-commits: 9a15f9f5814ac064c27ec9089acda4028b2518f8 wpt-pr: 43140 --- .../web-platform/tests/webnn/resources/test_data/pow.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/testing/web-platform/tests/webnn/resources/test_data/pow.json b/testing/web-platform/tests/webnn/resources/test_data/pow.json index b35a96233d0a..a097c21d9ef2 100644 --- a/testing/web-platform/tests/webnn/resources/test_data/pow.json +++ b/testing/web-platform/tests/webnn/resources/test_data/pow.json @@ -481,7 +481,7 @@ } }, { - "name": "pow (square) float32 4D base tensor and broadcastable 1D integer exponent tensor", + "name": "pow (square) float32 4D base tensor and broadcastable 0D integer exponent scalar", "inputs": { "a": { "shape": [2, 2, 2, 3], @@ -514,7 +514,7 @@ "type": "float32" }, "b": { - "shape": [1], + "shape": [], "data": [2], // square "type": "float32", "constant": true @@ -553,7 +553,7 @@ } }, { - "name": "pow (sqrt) float32 4D positive base tensor and broadcastable 1D integer exponent tensor", + "name": "pow (sqrt) float32 4D positive base tensor and broadcastable 0D integer exponent scalar", "inputs": { "a": { "shape": [2, 2, 2, 3], @@ -586,7 +586,7 @@ "type": "float32" }, "b": { - "shape": [1], + "shape": [], "data": [0.5], // sqrt "type": "float32", "constant": true