tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

commit 0affd6b001c609298d117d93f6ce1a5336d104f1
parent eed22c4811b7707549f69e629c1b89951b453c0f
Author: BruceDai <feng.dai@intel.com>
Date:   Fri,  7 Nov 2025 09:02:45 +0000

Bug 1998602 [wpt PR 55900] - webnnn: updated and added some conformance tests of non-constant tensors, a=testonly

Automatic update from web-platform-tests
webnnn: updated and added some conformance tests of non-constant tensors

This CL updates some tests of `dequantizeLinear` and `quantizeLinear`
operators to be of non-constant tensors, besides adding more tests of
non-constant tensors for reduction operations and tile operation to
improve test coverage.

Bug: 427523536
Change-Id: Ieb517a706f6da64ac585843ca5f5a3df096c047b
Cq-Include-Trybots: luci.chromium.try​:win11-blink-rel, mac14.arm64-blink-rel, mac14-blink-rel, mac15.arm64-blink-rel, mac15-blink-rel, linux-blink-rel
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7111740
Commit-Queue: Dai, Feng <feng.dai@intel.com>
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Reviewed-by: Hu, Ningxin <ningxin.hu@intel.com>
Auto-Submit: Dai, Feng <feng.dai@intel.com>
Cr-Commit-Position: refs/heads/main@{#1541028}

--

wpt-commits: 0258cbe3201406545134814475f5b89d4794b61c
wpt-pr: 55900

Diffstat:
Mtesting/web-platform/tests/webnn/conformance_tests/dequantizeLinear.https.any.js | 76++++++++++++++++++++++++++++++++++++++--------------------------------------
Mtesting/web-platform/tests/webnn/conformance_tests/quantizeLinear.https.any.js | 142+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++--------------------
Mtesting/web-platform/tests/webnn/conformance_tests/reduce_l1.https.any.js | 92+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mtesting/web-platform/tests/webnn/conformance_tests/reduce_l2.https.any.js | 88+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mtesting/web-platform/tests/webnn/conformance_tests/reduce_log_sum.https.any.js | 94+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mtesting/web-platform/tests/webnn/conformance_tests/reduce_log_sum_exp.https.any.js | 92+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mtesting/web-platform/tests/webnn/conformance_tests/reduce_max.https.any.js | 88+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mtesting/web-platform/tests/webnn/conformance_tests/reduce_mean.https.any.js | 88+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mtesting/web-platform/tests/webnn/conformance_tests/reduce_min.https.any.js | 88+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mtesting/web-platform/tests/webnn/conformance_tests/reduce_product.https.any.js | 90+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mtesting/web-platform/tests/webnn/conformance_tests/reduce_sum.https.any.js | 88+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mtesting/web-platform/tests/webnn/conformance_tests/reduce_sum_square.https.any.js | 90+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Mtesting/web-platform/tests/webnn/conformance_tests/tile.https.any.js | 33++++++++++++++++++++++++++++-----
13 files changed, 1070 insertions(+), 79 deletions(-)

diff --git a/testing/web-platform/tests/webnn/conformance_tests/dequantizeLinear.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/dequantizeLinear.https.any.js @@ -148,13 +148,13 @@ const dequantizeLinearTests = [ }, { 'name': - 'dequantizeLinear uint8 1D constant tensor with negative float32 1D scale', + 'dequantizeLinear uint8 1D tensor with negative float32 1D scale', 'graph': { 'inputs': { 'dequantizeLinearInput': { 'data': [12, 24, 35, 123], 'descriptor': {shape: [4], dataType: 'uint8'}, - 'constant': true + 'constant': false }, 'dequantizeLinearScale': { 'data': [ @@ -194,13 +194,13 @@ const dequantizeLinearTests = [ }, { 'name': - 'dequantizeLinear uint8 1D constant tensor with float32 1D scale, implicit block_size = 2', + 'dequantizeLinear uint8 1D tensor with float32 1D scale, implicit block_size = 2', 'graph': { 'inputs': { 'dequantizeLinearInput': { 'data': [12, 24, 35, 123], 'descriptor': {shape: [4], dataType: 'uint8'}, - 'constant': true + 'constant': false }, 'dequantizeLinearScale': { 'data': [ @@ -238,13 +238,13 @@ const dequantizeLinearTests = [ }, { 'name': - 'dequantizeLinear int8 4D constant tensor broadcasting float32 4D scale and int8 4D zeroPoint', + 'dequantizeLinear int8 4D tensor broadcasting float32 4D scale and int8 4D zeroPoint', 'graph': { 'inputs': { 'dequantizeLinearInput': { 'data': [-124, 0, 23, 122], 'descriptor': {shape: [1, 1, 2, 2], dataType: 'int8'}, - 'constant': true + 'constant': false }, 'dequantizeLinearScale': { 'data': [0.2800687253475189, -4.617084980010986], @@ -279,7 +279,7 @@ const dequantizeLinearTests = [ }, { 'name': - 'dequantizeLinear int8 2D constant tensor with float32 2D scale, block_size = [3, 2]', + 'dequantizeLinear int8 2D tensor with float32 2D scale, block_size = [3, 2]', 'graph': { 'inputs': { 'dequantizeLinearInput': { @@ -288,7 +288,7 @@ const dequantizeLinearTests = [ -34, -45, -56, -67, 89, 30, 12, 23, 56, 67, 56, -12 ], 'descriptor': {shape: [6, 4], dataType: 'int8'}, - 'constant': true + 'constant': false }, 'dequantizeLinearScale': { 'data': [ @@ -354,7 +354,7 @@ const dequantizeLinearTests = [ 'dequantizeLinearInput': { 'data': [15, 0], 'descriptor': {shape: [2], dataType: 'uint4'}, - 'constant': true + 'constant': false }, 'dequantizeLinearScale': { 'data': [1.1202747821807861, 1.1202747821807861], @@ -392,7 +392,7 @@ const dequantizeLinearTests = [ 'dequantizeLinearInput': { 'data': [10, 12, 14], 'descriptor': {shape: [3], dataType: 'uint4'}, - 'constant': true + 'constant': false }, 'dequantizeLinearScale': { 'data': [1.1202747821807861], @@ -424,13 +424,13 @@ const dequantizeLinearTests = [ }, { 'name': - 'dequantizeLinear uint4 4D constant tensor with broadcasting float32 4D scale and uint4 4D zeroPoint', + 'dequantizeLinear uint4 4D tensor with broadcasting float32 4D scale and uint4 4D zeroPoint', 'graph': { 'inputs': { 'dequantizeLinearInput': { 'data': [0, 1, 10, 15], 'descriptor': {shape: [1, 1, 2, 2], dataType: 'uint4'}, - 'constant': true + 'constant': false }, 'dequantizeLinearScale': { 'data': [ @@ -468,13 +468,13 @@ const dequantizeLinearTests = [ }, { 'name': - 'dequantizeLinear uint4 3D input with float32 3D scale, block_size = [1, 1, 2]', + 'dequantizeLinear uint4 3D tensor with float32 3D scale, block_size = [1, 1, 2]', 'graph': { 'inputs': { 'dequantizeLinearInput': { 'data': [0, 1, 10, 15], 'descriptor': {shape: [1, 1, 4], dataType: 'uint4'}, - 'constant': true + 'constant': false }, 'dequantizeLinearScale': { 'data': [ @@ -518,7 +518,7 @@ const dequantizeLinearTests = [ 'dequantizeLinearInput': { 'data': [-8, -3], 'descriptor': {shape: [2], dataType: 'int4'}, - 'constant': true + 'constant': false }, 'dequantizeLinearScale': { 'data': [1.1202747821807861, 1.1202747821807861], @@ -555,7 +555,7 @@ const dequantizeLinearTests = [ 'dequantizeLinearInput': { 'data': [-1, 7, 0], 'descriptor': {shape: [3], dataType: 'int4'}, - 'constant': true + 'constant': false }, 'dequantizeLinearScale': { 'data': [1.1202747821807861], @@ -587,13 +587,13 @@ const dequantizeLinearTests = [ }, { 'name': - 'per-tensor dequantizeLinear for int4 4D constant with float32 4D scale', + 'per-tensor dequantizeLinear for int4 4D tensor with float32 4D scale', 'graph': { 'inputs': { 'dequantizeLinearInput': { 'data': [0, -1, -6, 1], 'descriptor': {shape: [1, 1, 2, 2], dataType: 'int4'}, - 'constant': true + 'constant': false }, 'dequantizeLinearScale': { 'data': [ @@ -857,13 +857,13 @@ const dequantizeLinearTests = [ } }, { - 'name': 'dequantizeLinear uint8 1D constant tensor with float16 1D scale', + 'name': 'dequantizeLinear uint8 1D tensor with float16 1D scale', 'graph': { 'inputs': { 'dequantizeLinearInput': { 'data': [12, 24, 35, 123], 'descriptor': {'shape': [4], 'dataType': 'uint8'}, - 'constant': true + 'constant': false }, 'dequantizeLinearScale': { 'data': [9.34375, 0.280029296875, 4.6171875, 1.1201171875], @@ -895,13 +895,13 @@ const dequantizeLinearTests = [ }, { 'name': - 'dequantizeLinear uint8 1D constant tensor with negative float16 1D scale', + 'dequantizeLinear uint8 1D tensor with negative float16 1D scale', 'graph': { 'inputs': { 'dequantizeLinearInput': { 'data': [12, 24, 35, 123], 'descriptor': {'shape': [4], 'dataType': 'uint8'}, - 'constant': true + 'constant': false }, 'dequantizeLinearScale': { 'data': [9.34375, 0.280029296875, -4.6171875, 1.1201171875], @@ -933,13 +933,13 @@ const dequantizeLinearTests = [ }, { 'name': - 'dequantizeLinear uint8 1D constant tensor with float16 1D scale, implicit block_size = 2', + 'dequantizeLinear uint8 1D tensor with float16 1D scale, implicit block_size = 2', 'graph': { 'inputs': { 'dequantizeLinearInput': { 'data': [12, 24, 35, 123], 'descriptor': {'shape': [4], 'dataType': 'uint8'}, - 'constant': true + 'constant': false }, 'dequantizeLinearScale': { 'data': [9.34375, -4.6171875], @@ -971,13 +971,13 @@ const dequantizeLinearTests = [ }, { 'name': - 'dequantizeLinear int8 4D constant tensor broadcasting float16 4D scale and int8 4D zeroPoint', + 'dequantizeLinear int8 4D tensor broadcasting float16 4D scale and int8 4D zeroPoint', 'graph': { 'inputs': { 'dequantizeLinearInput': { 'data': [-124, 0, 23, 122], 'descriptor': {'shape': [1, 1, 2, 2], 'dataType': 'int8'}, - 'constant': true + 'constant': false }, 'dequantizeLinearScale': { 'data': [0.280029296875, -4.6171875], @@ -1009,7 +1009,7 @@ const dequantizeLinearTests = [ }, { 'name': - 'dequantizeLinear int8 2D constant tensor with float16 2D scale, block_size = [3, 2]', + 'dequantizeLinear int8 2D tensor with float16 2D scale, block_size = [3, 2]', 'graph': { 'inputs': { 'dequantizeLinearInput': { @@ -1018,7 +1018,7 @@ const dequantizeLinearTests = [ -34, -45, -56, -67, 89, 30, 12, 23, 56, 67, 56, -12 ], 'descriptor': {'shape': [6, 4], 'dataType': 'int8'}, - 'constant': true + 'constant': false }, 'dequantizeLinearScale': { 'data': [0.280029296875, -4.6171875, 1.2802734375, -3.6171875], @@ -1062,7 +1062,7 @@ const dequantizeLinearTests = [ 'dequantizeLinearInput': { 'data': [15, 0], 'descriptor': {'shape': [2], 'dataType': 'uint4'}, - 'constant': true + 'constant': false }, 'dequantizeLinearScale': { 'data': [1.1201171875, 1.1201171875], @@ -1100,7 +1100,7 @@ const dequantizeLinearTests = [ 'dequantizeLinearInput': { 'data': [10, 12, 14], 'descriptor': {'shape': [3], 'dataType': 'uint4'}, - 'constant': true + 'constant': false }, 'dequantizeLinearScale': { 'data': [1.1201171875], @@ -1132,13 +1132,13 @@ const dequantizeLinearTests = [ }, { 'name': - 'dequantizeLinear uint4 4D constant tensor with broadcasting float16 4D scale and uint4 4D zeroPoint', + 'dequantizeLinear uint4 4D tensor with broadcasting float16 4D scale and uint4 4D zeroPoint', 'graph': { 'inputs': { 'dequantizeLinearInput': { 'data': [0, 1, 10, 15], 'descriptor': {'shape': [1, 1, 2, 2], 'dataType': 'uint4'}, - 'constant': true + 'constant': false }, 'dequantizeLinearScale': { 'data': [9.34375, -4.6171875], @@ -1170,13 +1170,13 @@ const dequantizeLinearTests = [ }, { 'name': - 'dequantizeLinear uint4 3D input with float16 3D scale, block_size = [1, 1, 2]', + 'dequantizeLinear uint4 3D tensor with float16 3D scale, block_size = [1, 1, 2]', 'graph': { 'inputs': { 'dequantizeLinearInput': { 'data': [0, 1, 10, 15], 'descriptor': {'shape': [1, 1, 4], 'dataType': 'uint4'}, - 'constant': true + 'constant': false }, 'dequantizeLinearScale': { 'data': [9.34375, -4.6171875], @@ -1214,7 +1214,7 @@ const dequantizeLinearTests = [ 'dequantizeLinearInput': { 'data': [-8, -3], 'descriptor': {'shape': [2], 'dataType': 'int4'}, - 'constant': true + 'constant': false }, 'dequantizeLinearScale': { 'data': [1.1201171875, 1.1201171875], @@ -1251,7 +1251,7 @@ const dequantizeLinearTests = [ 'dequantizeLinearInput': { 'data': [-1, 7, 0], 'descriptor': {'shape': [3], 'dataType': 'int4'}, - 'constant': true + 'constant': false }, 'dequantizeLinearScale': { 'data': [1.1201171875], @@ -1283,13 +1283,13 @@ const dequantizeLinearTests = [ }, { 'name': - 'per-tensor dequantizeLinear for int4 4D constant with float16 4D scale', + 'per-tensor dequantizeLinear for int4 4D tensor with float16 4D scale', 'graph': { 'inputs': { 'dequantizeLinearInput': { 'data': [0, -1, -6, 1], 'descriptor': {'shape': [1, 1, 2, 2], 'dataType': 'int4'}, - 'constant': true + 'constant': false }, 'dequantizeLinearScale': { 'data': [1.1201171875, -4.6171875, 6.2421875, 3.841796875], diff --git a/testing/web-platform/tests/webnn/conformance_tests/quantizeLinear.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/quantizeLinear.https.any.js @@ -28,7 +28,7 @@ const quantizeLinearTests = [ // float32 tests { 'name': - 'quantizeLinear float32 0D tensor with int8 0D zeroPoint', + 'quantizeLinear float32 0D constant tensor with int8 0D zeroPoint', 'graph': { 'inputs': { 'quantizeLinearInput': { @@ -62,6 +62,41 @@ const quantizeLinearTests = [ } }, { + 'name': + 'quantizeLinear float32 0D tensor with int8 0D zeroPoint', + 'graph': { + 'inputs': { + 'quantizeLinearInput': { + 'data': [10.794857501983643], + 'descriptor': {shape: [], dataType: 'float32'}, + 'constant': false + }, + 'quantizeLinearScale': { + 'data': [1.1202747821807861], + 'descriptor': {shape: [], dataType: 'float32'}, + 'constant': true + }, + 'quantizeLinearZeroPoint': { + 'data': [1], + 'descriptor': {shape: [], dataType: 'int8'}, + 'constant': true + } + }, + 'operators': [{ + 'name': 'quantizeLinear', + 'arguments': [ + {'input': 'quantizeLinearInput'}, {'scale': 'quantizeLinearScale'}, + {'zeroPoint': 'quantizeLinearZeroPoint'} + ], + 'outputs': 'quantizeLinearOutput' + }], + 'expectedOutputs': { + 'quantizeLinearOutput': + {'data': [11], 'descriptor': {shape: [], dataType: 'int8'}} + } + } + }, + { 'name': 'quantizeLinear float32 1D constant tensor with uint8 1D zeroPoint', 'graph': { 'inputs': { @@ -151,7 +186,7 @@ const quantizeLinearTests = [ }, { 'name': - 'quantizeLinear float32 2D constant tensor broadcasting zeroPoint and scale', + 'quantizeLinear float32 2D tensor broadcasting zeroPoint and scale', 'graph': { 'inputs': { 'quantizeLinearInput': { @@ -160,7 +195,7 @@ const quantizeLinearTests = [ 6.108623504638672 ], 'descriptor': {shape: [2, 2], dataType: 'float32'}, - 'constant': true + 'constant': false }, 'quantizeLinearScale': { 'data': [9.343092918395996], @@ -191,7 +226,7 @@ const quantizeLinearTests = [ }, { 'name': - 'quantizeLinear float32 4D constant tensor broadcasting scale and zeroPoint', + 'quantizeLinear float32 4D tensor broadcasting scale and zeroPoint', 'graph': { 'inputs': { 'quantizeLinearInput': { @@ -200,7 +235,7 @@ const quantizeLinearTests = [ 6.108623504638672 ], 'descriptor': {shape: [1, 1, 2, 2], dataType: 'float32'}, - 'constant': true + 'constant': false }, 'quantizeLinearScale': { 'data': [0.2800687253475189, 4.617084980010986], @@ -230,7 +265,7 @@ const quantizeLinearTests = [ } }, { - 'name': 'per-tensor quantizeLinear for float32 4D constant', + 'name': 'per-tensor quantizeLinear for float32 4D tensor', 'graph': { 'inputs': { 'quantizeLinearInput': { @@ -239,7 +274,7 @@ const quantizeLinearTests = [ 6.108623504638672 ], 'descriptor': {shape: [1, 1, 2, 2], dataType: 'float32'}, - 'constant': true + 'constant': false }, 'quantizeLinearScale': { 'data': [ @@ -273,7 +308,7 @@ const quantizeLinearTests = [ }, { 'name': - 'quantizeLinear float32 3D input with implicit block_size = [1, 2, 1].', + 'quantizeLinear float32 3D tensor with implicit block_size = [1, 2, 1].', 'graph': { 'inputs': { 'quantizeLinearInput': { @@ -282,7 +317,7 @@ const quantizeLinearTests = [ 6.108623504638672 ], 'descriptor': {shape: [1, 4, 1], dataType: 'float32'}, - 'constant': true + 'constant': false }, 'quantizeLinearScale': { 'data': [0.2800687253475189, -4.617084980010986], @@ -319,7 +354,7 @@ const quantizeLinearTests = [ 'quantizeLinearInput': { 'data': [4.794857501983643], 'descriptor': {shape: [], dataType: 'float32'}, - 'constant': true + 'constant': false }, 'quantizeLinearScale': { 'data': [1.1202747821807861], @@ -354,7 +389,7 @@ const quantizeLinearTests = [ 'quantizeLinearInput': { 'data': [4.794857501983643, 3.23434354545], 'descriptor': {shape: [2], dataType: 'float32'}, - 'constant': true + 'constant': false }, 'quantizeLinearScale': { 'data': [1.1202747821807861, 1.1202747821807861], @@ -392,7 +427,7 @@ const quantizeLinearTests = [ 5.794857501983643, 0, 7.23434354545 ], 'descriptor': {shape: [3, 2], dataType: 'float32'}, - 'constant': true + 'constant': false }, 'quantizeLinearScale': { 'data': [1.1202747821807861, 2.1202747821807861], @@ -434,7 +469,7 @@ const quantizeLinearTests = [ 7.23434354545 ], 'descriptor': {shape: [3, 4], dataType: 'float32'}, - 'constant': true + 'constant': false }, 'quantizeLinearScale': { 'data': [1.1202747821807861, 2.1202747821807861], @@ -474,7 +509,7 @@ const quantizeLinearTests = [ 3.794857501983643 ], 'descriptor': {shape: [5], dataType: 'float32'}, - 'constant': true + 'constant': false }, 'quantizeLinearScale': { 'data': [1.1202747821807861], @@ -511,7 +546,7 @@ const quantizeLinearTests = [ 'quantizeLinearInput': { 'data': [4.794857501983643, 3.23434354545], 'descriptor': {shape: [2], dataType: 'float32'}, - 'constant': true + 'constant': false }, 'quantizeLinearScale': { 'data': [1.1202747821807861, 1.1202747821807861], @@ -549,7 +584,7 @@ const quantizeLinearTests = [ 4.794857501983643, 3.23434354545 ], 'descriptor': {shape: [6], dataType: 'float32'}, - 'constant': true + 'constant': false }, 'quantizeLinearScale': { 'data': [1.1202747821807861, 1.1202747821807861], @@ -619,7 +654,7 @@ const quantizeLinearTests = [ // float16 tests { 'name': - 'quantizeLinear float16 0D tensor with int8 0D zeroPoint', + 'quantizeLinear float16 0D constant tensor with int8 0D zeroPoint', 'graph': { 'inputs': { 'quantizeLinearInput': { @@ -653,13 +688,48 @@ const quantizeLinearTests = [ } }, { - 'name': 'quantizeLinear float16 1D constant tensor with uint8 1D zeroPoint', + 'name': + 'quantizeLinear float16 0D tensor with int8 0D zeroPoint', + 'graph': { + 'inputs': { + 'quantizeLinearInput': { + 'data': [10.796875], + 'descriptor': {'shape': [], 'dataType': 'float16'}, + 'constant': false + }, + 'quantizeLinearScale': { + 'data': [1.1201171875], + 'descriptor': {'shape': [], 'dataType': 'float16'}, + 'constant': true + }, + 'quantizeLinearZeroPoint': { + 'data': [1], + 'descriptor': {'shape': [], 'dataType': 'int8'}, + 'constant': true + } + }, + 'operators': [{ + 'name': 'quantizeLinear', + 'arguments': [ + {'input': 'quantizeLinearInput'}, {'scale': 'quantizeLinearScale'}, + {'zeroPoint': 'quantizeLinearZeroPoint'} + ], + 'outputs': 'quantizeLinearOutput' + }], + 'expectedOutputs': { + 'quantizeLinearOutput': + {'data': [11], 'descriptor': {'shape': [], 'dataType': 'int8'}} + } + } + }, + { + 'name': 'quantizeLinear float16 1D tensor with uint8 1D zeroPoint', 'graph': { 'inputs': { 'quantizeLinearInput': { 'data': [-2.548828125, -4.79296875, 8.4140625, 6.109375], 'descriptor': {'shape': [4], 'dataType': 'float16'}, - 'constant': true + 'constant': false }, 'quantizeLinearScale': { 'data': [9.34375, 0.280029296875, 4.6171875, 1.1201171875], @@ -689,13 +759,13 @@ const quantizeLinearTests = [ } }, { - 'name': 'quantizeLinear float16 1D constant tensor with negative scale', + 'name': 'quantizeLinear float16 1D tensor with negative scale', 'graph': { 'inputs': { 'quantizeLinearInput': { 'data': [-2.548828125, -4.79296875, 8.4140625, 6.109375], 'descriptor': {'shape': [4], 'dataType': 'float16'}, - 'constant': true + 'constant': false }, 'quantizeLinearScale': { 'data': [9.34375, 0.280029296875, -4.6171875, 1.1201171875], @@ -726,13 +796,13 @@ const quantizeLinearTests = [ }, { 'name': - 'quantizeLinear float16 2D constant tensor broadcasting zeroPoint and scale', + 'quantizeLinear float16 2D tensor broadcasting zeroPoint and scale', 'graph': { 'inputs': { 'quantizeLinearInput': { 'data': [-2.548828125, -4.79296875, 8.4140625, 6.109375], 'descriptor': {'shape': [2, 2], 'dataType': 'float16'}, - 'constant': true + 'constant': false }, 'quantizeLinearScale': { 'data': [9.34375], @@ -763,13 +833,13 @@ const quantizeLinearTests = [ }, { 'name': - 'quantizeLinear float16 4D constant tensor broadcasting scale and zeroPoint', + 'quantizeLinear float16 4D tensor broadcasting scale and zeroPoint', 'graph': { 'inputs': { 'quantizeLinearInput': { 'data': [-2.548828125, -4.79296875, 8.4140625, 6.109375], 'descriptor': {'shape': [1, 1, 2, 2], 'dataType': 'float16'}, - 'constant': true + 'constant': false }, 'quantizeLinearScale': { 'data': [0.280029296875, 4.6171875], @@ -799,13 +869,13 @@ const quantizeLinearTests = [ } }, { - 'name': 'per-tensor quantizeLinear for float16 4D constant', + 'name': 'per-tensor quantizeLinear for float16 4D tensor', 'graph': { 'inputs': { 'quantizeLinearInput': { 'data': [-2.548828125, -4.79296875, 8.4140625, 6.109375], 'descriptor': {'shape': [1, 1, 2, 2], 'dataType': 'float16'}, - 'constant': true + 'constant': false }, 'quantizeLinearScale': { 'data': [0.280029296875, -4.6171875, 0.280029296875, -4.6171875], @@ -836,13 +906,13 @@ const quantizeLinearTests = [ }, { 'name': - 'quantizeLinear float16 3D input with implicit block_size = [1, 2, 1].', + 'quantizeLinear float16 3D tensor with implicit block_size = [1, 2, 1].', 'graph': { 'inputs': { 'quantizeLinearInput': { 'data': [-2.548828125, -4.79296875, 8.4140625, 6.109375], 'descriptor': {'shape': [1, 4, 1], 'dataType': 'float16'}, - 'constant': true + 'constant': false }, 'quantizeLinearScale': { 'data': [0.280029296875, -4.6171875], @@ -879,7 +949,7 @@ const quantizeLinearTests = [ 'quantizeLinearInput': { 'data': [4.79296875], 'descriptor': {'shape': [], 'dataType': 'float16'}, - 'constant': true + 'constant': false }, 'quantizeLinearScale': { 'data': [1.1201171875], @@ -914,7 +984,7 @@ const quantizeLinearTests = [ 'quantizeLinearInput': { 'data': [4.79296875, 3.234375], 'descriptor': {'shape': [2], 'dataType': 'float16'}, - 'constant': true + 'constant': false }, 'quantizeLinearScale': { 'data': [1.1201171875, 1.1201171875], @@ -949,7 +1019,7 @@ const quantizeLinearTests = [ 'quantizeLinearInput': { 'data': [4.79296875, 3.234375, 2.794921875, 5.79296875, 0, 7.234375], 'descriptor': {'shape': [3, 2], 'dataType': 'float16'}, - 'constant': true + 'constant': false }, 'quantizeLinearScale': { 'data': [1.1201171875, 2.12109375], @@ -989,7 +1059,7 @@ const quantizeLinearTests = [ 4.79296875, 3.234375, 2.794921875, 5.79296875, 0, 7.234375 ], 'descriptor': {'shape': [3, 4], 'dataType': 'float16'}, - 'constant': true + 'constant': false }, 'quantizeLinearScale': { 'data': [1.1201171875, 2.12109375], @@ -1026,7 +1096,7 @@ const quantizeLinearTests = [ 'quantizeLinearInput': { 'data': [4.79296875, 2.794921875, 1.794921875, 0, 3.794921875], 'descriptor': {'shape': [5], 'dataType': 'float16'}, - 'constant': true + 'constant': false }, 'quantizeLinearScale': { 'data': [1.1201171875], @@ -1063,7 +1133,7 @@ const quantizeLinearTests = [ 'quantizeLinearInput': { 'data': [4.79296875, 3.234375], 'descriptor': {'shape': [2], 'dataType': 'float16'}, - 'constant': true + 'constant': false }, 'quantizeLinearScale': { 'data': [1.1201171875, 1.1201171875], @@ -1101,7 +1171,7 @@ const quantizeLinearTests = [ 4.794857501983643, 3.23434354545 ], 'descriptor': {'shape': [6], 'dataType': 'float16'}, - 'constant': true + 'constant': false }, 'quantizeLinearScale': { 'data': [1.1201171875, 1.1201171875], diff --git a/testing/web-platform/tests/webnn/conformance_tests/reduce_l1.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/reduce_l1.https.any.js @@ -44,6 +44,29 @@ const reduceL1Tests = [ } }, { + 'name': 'reduceL1 float32 0D tensor default options', + 'graph': { + 'inputs': { + 'reduceL1Input': { + 'data': [5.50882625579834], + 'descriptor': {shape: [], dataType: 'float32'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceL1', + 'arguments': [{'input': 'reduceL1Input'}], + 'outputs': 'reduceL1Output' + }], + 'expectedOutputs': { + 'reduceL1Output': { + 'data': 5.50882625579834, + 'descriptor': {shape: [], dataType: 'float32'} + } + } + } + }, + { 'name': 'reduceL1 float32 0D constant tensor empty axes', 'graph': { 'inputs': { @@ -67,6 +90,29 @@ const reduceL1Tests = [ } }, { + 'name': 'reduceL1 float32 0D tensor empty axes', + 'graph': { + 'inputs': { + 'reduceL1Input': { + 'data': [5.50882625579834], + 'descriptor': {shape: [], dataType: 'float32'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceL1', + 'arguments': [{'input': 'reduceL1Input'}, {'options': {'axes': []}}], + 'outputs': 'reduceL1Output' + }], + 'expectedOutputs': { + 'reduceL1Output': { + 'data': 5.50882625579834, + 'descriptor': {shape: [], dataType: 'float32'} + } + } + } + }, + { 'name': 'reduceL1 float32 1D constant tensor empty axes', 'graph': { 'inputs': { @@ -654,6 +700,29 @@ const reduceL1Tests = [ } }, { + 'name': 'reduceL1 float16 0D tensor default options', + 'graph': { + 'inputs': { + 'reduceL1Input': { + 'data': [5.5078125], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceL1', + 'arguments': [{'input': 'reduceL1Input'}], + 'outputs': 'reduceL1Output' + }], + 'expectedOutputs': { + 'reduceL1Output': { + 'data': [5.5078125], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { 'name': 'reduceL1 float16 0D constant tensor empty axes', 'graph': { 'inputs': { @@ -677,6 +746,29 @@ const reduceL1Tests = [ } }, { + 'name': 'reduceL1 float16 0D tensor empty axes', + 'graph': { + 'inputs': { + 'reduceL1Input': { + 'data': [5.5078125], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceL1', + 'arguments': [{'input': 'reduceL1Input'}, {'options': {'axes': []}}], + 'outputs': 'reduceL1Output' + }], + 'expectedOutputs': { + 'reduceL1Output': { + 'data': [5.5078125], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { 'name': 'reduceL1 float16 1D constant tensor all positive default options', 'graph': { 'inputs': { diff --git a/testing/web-platform/tests/webnn/conformance_tests/reduce_l2.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/reduce_l2.https.any.js @@ -45,6 +45,29 @@ const reduceL2Tests = [ } }, { + 'name': 'reduceL2 float32 0D tensor default options', + 'graph': { + 'inputs': { + 'reduceL2Input': { + 'data': [4.860228061676025], + 'descriptor': {shape: [], dataType: 'float32'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceL2', + 'arguments': [{'input': 'reduceL2Input'}], + 'outputs': 'reduceL2Output' + }], + 'expectedOutputs': { + 'reduceL2Output': { + 'data': 4.860228061676025, + 'descriptor': {shape: [], dataType: 'float32'} + } + } + } + }, + { 'name': 'reduceL2 float32 0D constant tensor empty axes', 'graph': { 'inputs': { @@ -68,6 +91,29 @@ const reduceL2Tests = [ } }, { + 'name': 'reduceL2 float32 0D tensor empty axes', + 'graph': { + 'inputs': { + 'reduceL2Input': { + 'data': [4.860228061676025], + 'descriptor': {shape: [], dataType: 'float32'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceL2', + 'arguments': [{'input': 'reduceL2Input'}, {'options': {'axes': []}}], + 'outputs': 'reduceL2Output' + }], + 'expectedOutputs': { + 'reduceL2Output': { + 'data': 4.860228061676025, + 'descriptor': {shape: [], dataType: 'float32'} + } + } + } + }, + { 'name': 'reduceL2 float32 1D constant tensor empty axes', 'graph': { 'inputs': { @@ -655,6 +701,27 @@ const reduceL2Tests = [ } }, { + 'name': 'reduceL2 float16 0D tensor default options', + 'graph': { + 'inputs': { + 'reduceL2Input': { + 'data': [4.859375], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceL2', + 'arguments': [{'input': 'reduceL2Input'}], + 'outputs': 'reduceL2Output' + }], + 'expectedOutputs': { + 'reduceL2Output': + {'data': [4.859375], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { 'name': 'reduceL2 float16 0D constant tensor empty axes', 'graph': { 'inputs': { @@ -676,6 +743,27 @@ const reduceL2Tests = [ } }, { + 'name': 'reduceL2 float16 0D tensor empty axes', + 'graph': { + 'inputs': { + 'reduceL2Input': { + 'data': [4.859375], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceL2', + 'arguments': [{'input': 'reduceL2Input'}, {'options': {'axes': []}}], + 'outputs': 'reduceL2Output' + }], + 'expectedOutputs': { + 'reduceL2Output': + {'data': [4.859375], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { 'name': 'reduceL2 float16 1D constant tensor all positive default options', 'graph': { 'inputs': { diff --git a/testing/web-platform/tests/webnn/conformance_tests/reduce_log_sum.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/reduce_log_sum.https.any.js @@ -45,6 +45,29 @@ const reduceLogSumTests = [ } }, { + 'name': 'reduceLogSum float32 0D tensor default options', + 'graph': { + 'inputs': { + 'reduceLogSumInput': { + 'data': [64.54827117919922], + 'descriptor': {shape: [], dataType: 'float32'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceLogSum', + 'arguments': [{'input': 'reduceLogSumInput'}], + 'outputs': 'reduceLogSumOutput' + }], + 'expectedOutputs': { + 'reduceLogSumOutput': { + 'data': 4.167413234710693, + 'descriptor': {shape: [], dataType: 'float32'} + } + } + } + }, + { 'name': 'reduceLogSum float32 0D constant tensor empty axes', 'graph': { 'inputs': { @@ -69,6 +92,30 @@ const reduceLogSumTests = [ } }, { + 'name': 'reduceLogSum float32 0D tensor empty axes', + 'graph': { + 'inputs': { + 'reduceLogSumInput': { + 'data': [64.54827117919922], + 'descriptor': {shape: [], dataType: 'float32'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceLogSum', + 'arguments': + [{'input': 'reduceLogSumInput'}, {'options': {'axes': []}}], + 'outputs': 'reduceLogSumOutput' + }], + 'expectedOutputs': { + 'reduceLogSumOutput': { + 'data': 4.167413234710693, + 'descriptor': {shape: [], dataType: 'float32'} + } + } + } + }, + { 'name': 'reduceLogSum float32 1D constant tensor empty axes', 'graph': { 'inputs': { @@ -610,6 +657,29 @@ const reduceLogSumTests = [ } }, { + 'name': 'reduceLogSum float16 0D tensor default options', + 'graph': { + 'inputs': { + 'reduceLogSumInput': { + 'data': [64.5625], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceLogSum', + 'arguments': [{'input': 'reduceLogSumInput'}], + 'outputs': 'reduceLogSumOutput' + }], + 'expectedOutputs': { + 'reduceLogSumOutput': { + 'data': [4.16796875], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { 'name': 'reduceLogSum float16 0D constant tensor empty axes', 'graph': { 'inputs': { @@ -634,6 +704,30 @@ const reduceLogSumTests = [ } }, { + 'name': 'reduceLogSum float16 0D tensor empty axes', + 'graph': { + 'inputs': { + 'reduceLogSumInput': { + 'data': [64.5625], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceLogSum', + 'arguments': + [{'input': 'reduceLogSumInput'}, {'options': {'axes': []}}], + 'outputs': 'reduceLogSumOutput' + }], + 'expectedOutputs': { + 'reduceLogSumOutput': { + 'data': [4.16796875], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { 'name': 'reduceLogSum float16 1D constant tensor all non-negative default options', 'graph': { diff --git a/testing/web-platform/tests/webnn/conformance_tests/reduce_log_sum_exp.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/reduce_log_sum_exp.https.any.js @@ -45,6 +45,29 @@ const reduceLogSumExpTests = [ } }, { + 'name': 'reduceLogSumExp float32 0D tensor default options', + 'graph': { + 'inputs': { + 'reduceLogSumExpInput': { + 'data': [0.7974132895469666], + 'descriptor': {shape: [], dataType: 'float32'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceLogSumExp', + 'arguments': [{'input': 'reduceLogSumExpInput'}], + 'outputs': 'reduceLogSumExpOutput' + }], + 'expectedOutputs': { + 'reduceLogSumExpOutput': { + 'data': 0.7974132895469666, + 'descriptor': {shape: [], dataType: 'float32'} + } + } + } + }, + { 'name': 'reduceLogSumExp float32 0D constant tensor empty axes', 'graph': { 'inputs': { @@ -69,6 +92,30 @@ const reduceLogSumExpTests = [ } }, { + 'name': 'reduceLogSumExp float32 0D tensor empty axes', + 'graph': { + 'inputs': { + 'reduceLogSumExpInput': { + 'data': [0.7974132895469666], + 'descriptor': {shape: [], dataType: 'float32'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceLogSumExp', + 'arguments': + [{'input': 'reduceLogSumExpInput'}, {'options': {'axes': []}}], + 'outputs': 'reduceLogSumExpOutput' + }], + 'expectedOutputs': { + 'reduceLogSumExpOutput': { + 'data': 0.7974132895469666, + 'descriptor': {shape: [], dataType: 'float32'} + } + } + } + }, + { 'name': 'reduceLogSumExp float32 1D constant tensor empty axes', 'graph': { 'inputs': { @@ -671,6 +718,28 @@ const reduceLogSumExpTests = [ } }, { + 'name': 'reduceLogSumExp float16 0D tensor default options', + 'graph': { + 'inputs': { + 'reduceLogSumExpInput': { + 'data': [0.79736328125], + 'descriptor': {shape: [], dataType: 'float16'} + } + }, + 'operators': [{ + 'name': 'reduceLogSumExp', + 'arguments': [{'input': 'reduceLogSumExpInput'}], + 'outputs': 'reduceLogSumExpOutput' + }], + 'expectedOutputs': { + 'reduceLogSumExpOutput': { + 'data': [0.79736328125], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { 'name': 'reduceLogSumExp float16 0D constant tensor empty axes', 'graph': { 'inputs': { @@ -695,6 +764,29 @@ const reduceLogSumExpTests = [ } }, { + 'name': 'reduceLogSumExp float16 0D tensor empty axes', + 'graph': { + 'inputs': { + 'reduceLogSumExpInput': { + 'data': [0.79736328125], + 'descriptor': {shape: [], dataType: 'float16'}, + } + }, + 'operators': [{ + 'name': 'reduceLogSumExp', + 'arguments': + [{'input': 'reduceLogSumExpInput'}, {'options': {'axes': []}}], + 'outputs': 'reduceLogSumExpOutput' + }], + 'expectedOutputs': { + 'reduceLogSumExpOutput': { + 'data': [0.79736328125], + 'descriptor': {shape: [], dataType: 'float16'} + } + } + } + }, + { 'name': 'reduceLogSumExp float16 1D constant tensor all positive default options', 'graph': { diff --git a/testing/web-platform/tests/webnn/conformance_tests/reduce_max.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/reduce_max.https.any.js @@ -44,6 +44,29 @@ const reduceMaxTests = [ } }, { + 'name': 'reduceMax float32 0D tensor default options', + 'graph': { + 'inputs': { + 'reduceMaxInput': { + 'data': [32.16658401489258], + 'descriptor': {shape: [], dataType: 'float32'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceMax', + 'arguments': [{'input': 'reduceMaxInput'}], + 'outputs': 'reduceMaxOutput' + }], + 'expectedOutputs': { + 'reduceMaxOutput': { + 'data': 32.16658401489258, + 'descriptor': {shape: [], dataType: 'float32'} + } + } + } + }, + { 'name': 'reduceMax float32 0D constant tensor empty axes', 'graph': { 'inputs': { @@ -67,6 +90,29 @@ const reduceMaxTests = [ } }, { + 'name': 'reduceMax float32 0D tensor empty axes', + 'graph': { + 'inputs': { + 'reduceMaxInput': { + 'data': [32.16658401489258], + 'descriptor': {shape: [], dataType: 'float32'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceMax', + 'arguments': [{'input': 'reduceMaxInput'}, {'options': {'axes': []}}], + 'outputs': 'reduceMaxOutput' + }], + 'expectedOutputs': { + 'reduceMaxOutput': { + 'data': 32.16658401489258, + 'descriptor': {shape: [], dataType: 'float32'} + } + } + } + }, + { 'name': 'reduceMax float32 1D constant tensor empty axes', 'graph': { 'inputs': { @@ -577,6 +623,27 @@ const reduceMaxTests = [ } }, { + 'name': 'reduceMax float16 0D tensor default options', + 'graph': { + 'inputs': { + 'reduceMaxInput': { + 'data': [32.15625], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceMax', + 'arguments': [{'input': 'reduceMaxInput'}], + 'outputs': 'reduceMaxOutput' + }], + 'expectedOutputs': { + 'reduceMaxOutput': + {'data': [32.15625], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { 'name': 'reduceMax float16 0D constant tensor empty axes', 'graph': { 'inputs': { @@ -598,6 +665,27 @@ const reduceMaxTests = [ } }, { + 'name': 'reduceMax float16 0D tensor empty axes', + 'graph': { + 'inputs': { + 'reduceMaxInput': { + 'data': [32.15625], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceMax', + 'arguments': [{'input': 'reduceMaxInput'}, {'options': {'axes': []}}], + 'outputs': 'reduceMaxOutput' + }], + 'expectedOutputs': { + 'reduceMaxOutput': + {'data': [32.15625], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { 'name': 'reduceMax float16 1D constant tensor default options', 'graph': { 'inputs': { diff --git a/testing/web-platform/tests/webnn/conformance_tests/reduce_mean.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/reduce_mean.https.any.js @@ -44,6 +44,29 @@ const reduceMeanTests = [ } }, { + 'name': 'reduceMean float32 0D tensor default options', + 'graph': { + 'inputs': { + 'reduceMeanInput': { + 'data': [95.84498596191406], + 'descriptor': {shape: [], dataType: 'float32'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceMean', + 'arguments': [{'input': 'reduceMeanInput'}], + 'outputs': 'reduceMeanOutput' + }], + 'expectedOutputs': { + 'reduceMeanOutput': { + 'data': 95.84498596191406, + 'descriptor': {shape: [], dataType: 'float32'} + } + } + } + }, + { 'name': 'reduceMean float32 0D constant tensor empty axes', 'graph': { 'inputs': { @@ -67,6 +90,29 @@ const reduceMeanTests = [ } }, { + 'name': 'reduceMean float32 0D tensor empty axes', + 'graph': { + 'inputs': { + 'reduceMeanInput': { + 'data': [95.84498596191406], + 'descriptor': {shape: [], dataType: 'float32'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceMean', + 'arguments': [{'input': 'reduceMeanInput'}, {'options': {'axes': []}}], + 'outputs': 'reduceMeanOutput' + }], + 'expectedOutputs': { + 'reduceMeanOutput': { + 'data': 95.84498596191406, + 'descriptor': {shape: [], dataType: 'float32'} + } + } + } + }, + { 'name': 'reduceMean float32 1D constant tensor empty axes', 'graph': { 'inputs': { @@ -661,6 +707,27 @@ const reduceMeanTests = [ } }, { + 'name': 'reduceMean float16 0D tensor default options', + 'graph': { + 'inputs': { + 'reduceMeanInput': { + 'data': [95.875], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceMean', + 'arguments': [{'input': 'reduceMeanInput'}], + 'outputs': 'reduceMeanOutput' + }], + 'expectedOutputs': { + 'reduceMeanOutput': + {'data': [95.875], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { 'name': 'reduceMean float16 0D constant tensor empty axes', 'graph': { 'inputs': { @@ -682,6 +749,27 @@ const reduceMeanTests = [ } }, { + 'name': 'reduceMean float16 0D tensor empty axes', + 'graph': { + 'inputs': { + 'reduceMeanInput': { + 'data': [95.875], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceMean', + 'arguments': [{'input': 'reduceMeanInput'}, {'options': {'axes': []}}], + 'outputs': 'reduceMeanOutput' + }], + 'expectedOutputs': { + 'reduceMeanOutput': + {'data': [95.875], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { 'name': 'reduceMean float16 1D constant tensor all positive default options', 'graph': { diff --git a/testing/web-platform/tests/webnn/conformance_tests/reduce_min.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/reduce_min.https.any.js @@ -44,6 +44,29 @@ const reduceMinTests = [ } }, { + 'name': 'reduceMin float32 0D tensor default options', + 'graph': { + 'inputs': { + 'reduceMinInput': { + 'data': [-58.76195526123047], + 'descriptor': {shape: [], dataType: 'float32'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceMin', + 'arguments': [{'input': 'reduceMinInput'}], + 'outputs': 'reduceMinOutput' + }], + 'expectedOutputs': { + 'reduceMinOutput': { + 'data': -58.76195526123047, + 'descriptor': {shape: [], dataType: 'float32'} + } + } + } + }, + { 'name': 'reduceMin float32 0D constant tensor empty axes', 'graph': { 'inputs': { @@ -67,6 +90,29 @@ const reduceMinTests = [ } }, { + 'name': 'reduceMin float32 0D tensor empty axes', + 'graph': { + 'inputs': { + 'reduceMinInput': { + 'data': [-58.76195526123047], + 'descriptor': {shape: [], dataType: 'float32'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceMin', + 'arguments': [{'input': 'reduceMinInput'}, {'options': {'axes': []}}], + 'outputs': 'reduceMinOutput' + }], + 'expectedOutputs': { + 'reduceMinOutput': { + 'data': -58.76195526123047, + 'descriptor': {shape: [], dataType: 'float32'} + } + } + } + }, + { 'name': 'reduceMin float32 1D constant tensor empty axes', 'graph': { 'inputs': { @@ -577,6 +623,27 @@ const reduceMinTests = [ } }, { + 'name': 'reduceMin float16 0D tensor default options', + 'graph': { + 'inputs': { + 'reduceMinInput': { + 'data': [-58.75], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceMin', + 'arguments': [{'input': 'reduceMinInput'}], + 'outputs': 'reduceMinOutput' + }], + 'expectedOutputs': { + 'reduceMinOutput': + {'data': [-58.75], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { 'name': 'reduceMin float16 0D constant tensor empty axes', 'graph': { 'inputs': { @@ -598,6 +665,27 @@ const reduceMinTests = [ } }, { + 'name': 'reduceMin float16 0D tensor empty axes', + 'graph': { + 'inputs': { + 'reduceMinInput': { + 'data': [-58.75], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceMin', + 'arguments': [{'input': 'reduceMinInput'}, {'options': {'axes': []}}], + 'outputs': 'reduceMinOutput' + }], + 'expectedOutputs': { + 'reduceMinOutput': + {'data': [-58.75], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { 'name': 'reduceMin float16 1D constant tensor default options', 'graph': { 'inputs': { diff --git a/testing/web-platform/tests/webnn/conformance_tests/reduce_product.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/reduce_product.https.any.js @@ -45,6 +45,29 @@ const reduceProductTests = [ } }, { + 'name': 'reduceProduct float32 0D tensor default options', + 'graph': { + 'inputs': { + 'reduceProductInput': { + 'data': [-68.75911712646484], + 'descriptor': {shape: [], dataType: 'float32'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceProduct', + 'arguments': [{'input': 'reduceProductInput'}], + 'outputs': 'reduceProductOutput' + }], + 'expectedOutputs': { + 'reduceProductOutput': { + 'data': -68.75911712646484, + 'descriptor': {shape: [], dataType: 'float32'} + } + } + } + }, + { 'name': 'reduceProduct float32 0D constant tensor empty axes', 'graph': { 'inputs': { @@ -69,6 +92,30 @@ const reduceProductTests = [ } }, { + 'name': 'reduceProduct float32 0D tensor empty axes', + 'graph': { + 'inputs': { + 'reduceProductInput': { + 'data': [-68.75911712646484], + 'descriptor': {shape: [], dataType: 'float32'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceProduct', + 'arguments': + [{'input': 'reduceProductInput'}, {'options': {'axes': []}}], + 'outputs': 'reduceProductOutput' + }], + 'expectedOutputs': { + 'reduceProductOutput': { + 'data': -68.75911712646484, + 'descriptor': {shape: [], dataType: 'float32'} + } + } + } + }, + { 'name': 'reduceProduct float32 1D constant tensor empty axes', 'graph': { 'inputs': { @@ -577,6 +624,27 @@ const reduceProductTests = [ } }, { + 'name': 'reduceProduct float16 0D tensor default options', + 'graph': { + 'inputs': { + 'reduceProductInput': { + 'data': [-68.75], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceProduct', + 'arguments': [{'input': 'reduceProductInput'}], + 'outputs': 'reduceProductOutput' + }], + 'expectedOutputs': { + 'reduceProductOutput': + {'data': [-68.75], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { 'name': 'reduceProduct float16 0D constant tensor empty axes', 'graph': { 'inputs': { @@ -599,6 +667,28 @@ const reduceProductTests = [ } }, { + 'name': 'reduceProduct float16 0D tensor empty axes', + 'graph': { + 'inputs': { + 'reduceProductInput': { + 'data': [-68.75], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceProduct', + 'arguments': + [{'input': 'reduceProductInput'}, {'options': {'axes': []}}], + 'outputs': 'reduceProductOutput' + }], + 'expectedOutputs': { + 'reduceProductOutput': + {'data': [-68.75], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { 'name': 'reduceProduct float16 1D constant tensor default options', 'graph': { 'inputs': { diff --git a/testing/web-platform/tests/webnn/conformance_tests/reduce_sum.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/reduce_sum.https.any.js @@ -44,6 +44,29 @@ const reduceSumTests = [ } }, { + 'name': 'reduceSum float32 0D tensor default options', + 'graph': { + 'inputs': { + 'reduceSumInput': { + 'data': [69.6038589477539], + 'descriptor': {shape: [], dataType: 'float32'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceSum', + 'arguments': [{'input': 'reduceSumInput'}], + 'outputs': 'reduceSumOutput' + }], + 'expectedOutputs': { + 'reduceSumOutput': { + 'data': 69.6038589477539, + 'descriptor': {shape: [], dataType: 'float32'} + } + } + } + }, + { 'name': 'reduceSum float32 0D constant tensor empty axes', 'graph': { 'inputs': { @@ -67,6 +90,29 @@ const reduceSumTests = [ } }, { + 'name': 'reduceSum float32 0D tensor empty axes', + 'graph': { + 'inputs': { + 'reduceSumInput': { + 'data': [69.6038589477539], + 'descriptor': {shape: [], dataType: 'float32'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceSum', + 'arguments': [{'input': 'reduceSumInput'}, {'options': {'axes': []}}], + 'outputs': 'reduceSumOutput' + }], + 'expectedOutputs': { + 'reduceSumOutput': { + 'data': 69.6038589477539, + 'descriptor': {shape: [], dataType: 'float32'} + } + } + } + }, + { 'name': 'reduceSum float32 1D constant tensor empty axes', 'graph': { 'inputs': { @@ -654,6 +700,27 @@ const reduceSumTests = [ } }, { + 'name': 'reduceSum float16 0D tensor default options', + 'graph': { + 'inputs': { + 'reduceSumInput': { + 'data': [69.625], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceSum', + 'arguments': [{'input': 'reduceSumInput'}], + 'outputs': 'reduceSumOutput' + }], + 'expectedOutputs': { + 'reduceSumOutput': + {'data': [69.625], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { 'name': 'reduceSum float16 0D constant tensor empty axes', 'graph': { 'inputs': { @@ -675,6 +742,27 @@ const reduceSumTests = [ } }, { + 'name': 'reduceSum float16 0D tensor empty axes', + 'graph': { + 'inputs': { + 'reduceSumInput': { + 'data': [69.625], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceSum', + 'arguments': [{'input': 'reduceSumInput'}, {'options': {'axes': []}}], + 'outputs': 'reduceSumOutput' + }], + 'expectedOutputs': { + 'reduceSumOutput': + {'data': [69.625], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { 'name': 'reduceSum float16 1D constant tensor all positive default options', 'graph': { 'inputs': { diff --git a/testing/web-platform/tests/webnn/conformance_tests/reduce_sum_square.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/reduce_sum_square.https.any.js @@ -45,6 +45,29 @@ const reduceSumSquareTests = [ } }, { + 'name': 'reduceSumSquare float32 0D tensor default options', + 'graph': { + 'inputs': { + 'reduceSumSquareInput': { + 'data': [52.5615348815918], + 'descriptor': {shape: [], dataType: 'float32'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceSumSquare', + 'arguments': [{'input': 'reduceSumSquareInput'}], + 'outputs': 'reduceSumSquareOutput' + }], + 'expectedOutputs': { + 'reduceSumSquareOutput': { + 'data': 2762.71484375, + 'descriptor': {shape: [], dataType: 'float32'} + } + } + } + }, + { 'name': 'reduceSumSquare float32 0D constant tensor empty axes', 'graph': { 'inputs': { @@ -69,6 +92,30 @@ const reduceSumSquareTests = [ } }, { + 'name': 'reduceSumSquare float32 0D tensor empty axes', + 'graph': { + 'inputs': { + 'reduceSumSquareInput': { + 'data': [52.5615348815918], + 'descriptor': {shape: [], dataType: 'float32'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceSumSquare', + 'arguments': + [{'input': 'reduceSumSquareInput'}, {'options': {'axes': []}}], + 'outputs': 'reduceSumSquareOutput' + }], + 'expectedOutputs': { + 'reduceSumSquareOutput': { + 'data': 2762.71484375, + 'descriptor': {shape: [], dataType: 'float32'} + } + } + } + }, + { 'name': 'reduceSumSquare float32 1D constant tensor all positive default options', 'graph': { @@ -658,6 +705,27 @@ const reduceSumSquareTests = [ } }, { + 'name': 'reduceSumSquare float16 0D tensor default options', + 'graph': { + 'inputs': { + 'reduceSumSquareInput': { + 'data': [52.5625], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceSumSquare', + 'arguments': [{'input': 'reduceSumSquareInput'}], + 'outputs': 'reduceSumSquareOutput' + }], + 'expectedOutputs': { + 'reduceSumSquareOutput': + {'data': [2762], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { 'name': 'reduceSumSquare float16 0D constant tensor empty axes', 'graph': { 'inputs': { @@ -680,6 +748,28 @@ const reduceSumSquareTests = [ } }, { + 'name': 'reduceSumSquare float16 0D tensor empty axes', + 'graph': { + 'inputs': { + 'reduceSumSquareInput': { + 'data': [52.5625], + 'descriptor': {shape: [], dataType: 'float16'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'reduceSumSquare', + 'arguments': + [{'input': 'reduceSumSquareInput'}, {'options': {'axes': []}}], + 'outputs': 'reduceSumSquareOutput' + }], + 'expectedOutputs': { + 'reduceSumSquareOutput': + {'data': [2762], 'descriptor': {shape: [], dataType: 'float16'}} + } + } + }, + { 'name': 'reduceSumSquare float16 1D constant tensor all positive default options', 'graph': { diff --git a/testing/web-platform/tests/webnn/conformance_tests/tile.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/tile.https.any.js @@ -63,13 +63,36 @@ const tileTests = [ } }, { - 'name': 'tile float16 1D constant tensor', + 'name': 'tile float32 1D tensor', + 'graph': { + 'inputs': { + 'tileInput': { + 'data': [1, 2, 3, 4], + 'descriptor': {shape: [4], dataType: 'float32'}, + 'constant': false + } + }, + 'operators': [{ + 'name': 'tile', + 'arguments': [{'input': 'tileInput'}, {'repetitions': [2]}], + 'outputs': 'tileOutput' + }], + 'expectedOutputs': { + 'tileOutput': { + 'data': [1, 2, 3, 4, 1, 2, 3, 4], + 'descriptor': {shape: [8], dataType: 'float32'} + } + } + } + }, + { + 'name': 'tile float16 1D tensor', 'graph': { 'inputs': { 'tileInput': { 'data': [1, 2, 3, 4], 'descriptor': {shape: [4], dataType: 'float16'}, - 'constant': true + 'constant': false } }, 'operators': [{ @@ -92,7 +115,7 @@ const tileTests = [ 'tileInput': { 'data': [1, 2, 3, 4], 'descriptor': {shape: [2, 2], dataType: 'float16'}, - 'constant': true + 'constant': false } }, 'operators': [{ @@ -118,7 +141,7 @@ const tileTests = [ 'tileInput': { 'data': [1, 2, 3, 4], 'descriptor': {shape: [2, 2], dataType: 'uint32'}, - 'constant': true + 'constant': false } }, 'operators': [{ @@ -144,7 +167,7 @@ const tileTests = [ 'tileInput': { 'data': [1, 2, 3, 4], 'descriptor': {shape: [1, 1, 2, 2], dataType: 'int32'}, - 'constant': true + 'constant': false } }, 'operators': [{