From bc114cc08a83d206d5f0ac42f725065937976b27 Mon Sep 17 00:00:00 2001 From: Austin Sullivan Date: Tue, 24 Sep 2024 16:35:50 +0000 Subject: [PATCH] Bug 1917957 [wpt PR 48086] - webnn: Add MLOperandDescriptor.shape and discourage use of dimensions, a=testonly MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Automatic update from web-platform-tests webnn: Add MLOperandDescriptor.shape and discourage use of dimensions Renaming MLOperandDescriptor.dimensions to MLOperandDescriptor.shape is proposed in this spec PR: https://github.com/webmachinelearning/webnn/pull/676 To avoid breaking all uses of WebNN, this CL adds support for specifying 'shape' without removing support for 'dimensions'. Callers which pass 'dimensions' will see a console warning suggesting they update their code to use 'shape'. This CL was created primarily using targeted find-and-replaces, followed by running git cl format. This CL has no behavioral changes, other than the aforementioned logging. Bug: 365813262 Cq-Include-Trybots: luci.chromium.try​:mac14-blink-rel,mac14.arm64-blink-rel,win11-blink-rel Change-Id: I6b37ebc505a37686709f006b3ecafcefd3e2016d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5502631 Reviewed-by: Reilly Grant Commit-Queue: Austin Sullivan Cr-Commit-Position: refs/heads/main@{#1356886} -- wpt-commits: 1aa1ed11f44b7d560d3debc4c16ba691da0aa594 wpt-pr: 48086 --- .../webnn/conformance_tests/abs.https.any.js | 32 +- .../webnn/conformance_tests/add.https.any.js | 72 +-- .../arg_min_max.https.any.js | 72 +-- .../batch_normalization.https.any.js | 104 ++-- .../byob_readtensor.https.any.js | 6 +- .../webnn/conformance_tests/cast.https.any.js | 188 ++++--- .../webnn/conformance_tests/ceil.https.any.js | 32 +- .../conformance_tests/clamp.https.any.js | 72 +-- ...rview-with-bigger-arraybuffer.https.any.js | 4 +- .../conformance_tests/concat.https.any.js | 350 ++++++------ .../conformance_tests/conv2d.https.any.js | 126 ++--- .../conv_transpose2d.https.any.js | 130 ++--- .../webnn/conformance_tests/cos.https.any.js | 28 +- .../dequantizeLinear.https.any.js | 24 +- .../webnn/conformance_tests/div.https.any.js | 60 +- .../webnn/conformance_tests/elu.https.any.js | 40 +- .../conformance_tests/equal.https.any.js | 73 ++- .../webnn/conformance_tests/erf.https.any.js | 28 +- .../webnn/conformance_tests/exp.https.any.js | 28 +- .../conformance_tests/expand.https.any.js | 88 +-- .../conformance_tests/floor.https.any.js | 32 +- .../conformance_tests/gather.https.any.js | 132 ++--- .../gatherElements.https.any.js | 18 +- .../webnn/conformance_tests/gelu.https.any.js | 52 +- .../webnn/conformance_tests/gemm.https.any.js | 172 +++--- .../conformance_tests/greater.https.any.js | 73 ++- .../greater_or_equal.https.any.js | 73 ++- .../webnn/conformance_tests/gru.https.any.js | 132 ++--- .../conformance_tests/gru_cell.https.any.js | 56 +- .../hard_sigmoid.https.any.js | 60 +- .../conformance_tests/hard_swish.https.any.js | 28 +- .../conformance_tests/identity.https.any.js | 28 +- .../inputs-are-not-modified.https.any.js | 14 +- .../instance_normalization.https.any.js | 36 +- .../layer_normalization.https.any.js | 56 +- .../conformance_tests/leaky_relu.https.any.js | 40 +- .../conformance_tests/lesser.https.any.js | 73 ++- .../lesser_or_equal.https.any.js | 73 ++- .../conformance_tests/linear.https.any.js | 52 +- .../webnn/conformance_tests/log.https.any.js | 28 +- .../logical_not.https.any.js | 28 +- .../webnn/conformance_tests/lstm.https.any.js | 192 +++---- .../conformance_tests/lstm_cell.https.any.js | 94 ++-- .../conformance_tests/matmul.https.any.js | 64 +-- .../webnn/conformance_tests/max.https.any.js | 60 +- .../webnn/conformance_tests/min.https.any.js | 60 +- .../webnn/conformance_tests/mul.https.any.js | 60 +- .../webnn/conformance_tests/neg.https.any.js | 32 +- .../webnn/conformance_tests/pad.https.any.js | 44 +- .../parallel-compute.https.any.js | 2 +- .../parallel-dispatch.https.any.js | 18 +- .../conformance_tests/pooling.https.any.js | 184 +++---- .../webnn/conformance_tests/pow.https.any.js | 67 ++- .../conformance_tests/prelu.https.any.js | 72 +-- .../quantizeLinear.https.any.js | 24 +- .../conformance_tests/reciprocal.https.any.js | 28 +- .../conformance_tests/reduce_l1.https.any.js | 84 ++- .../conformance_tests/reduce_l2.https.any.js | 76 +-- .../reduce_log_sum.https.any.js | 68 +-- .../reduce_log_sum_exp.https.any.js | 76 +-- .../conformance_tests/reduce_max.https.any.js | 64 +-- .../reduce_mean.https.any.js | 76 +-- .../conformance_tests/reduce_min.https.any.js | 64 +-- .../reduce_product.https.any.js | 64 +-- .../conformance_tests/reduce_sum.https.any.js | 84 ++- .../reduce_sum_square.https.any.js | 96 ++-- .../webnn/conformance_tests/relu.https.any.js | 28 +- .../conformance_tests/resample2d.https.any.js | 52 +- .../conformance_tests/reshape.https.any.js | 129 +++-- .../conformance_tests/sigmoid.https.any.js | 28 +- .../webnn/conformance_tests/sign.https.any.js | 28 +- .../webnn/conformance_tests/sin.https.any.js | 28 +- .../conformance_tests/slice.https.any.js | 24 +- .../conformance_tests/softmax.https.any.js | 24 +- .../conformance_tests/softplus.https.any.js | 28 +- .../conformance_tests/softsign.https.any.js | 36 +- .../conformance_tests/split.https.any.js | 74 +-- .../webnn/conformance_tests/sqrt.https.any.js | 28 +- .../webnn/conformance_tests/sub.https.any.js | 60 +- .../webnn/conformance_tests/tan.https.any.js | 28 +- .../webnn/conformance_tests/tanh.https.any.js | 24 +- .../conformance_tests/tensor.https.any.js | 89 ++- .../webnn/conformance_tests/tile.https.any.js | 12 +- .../conformance_tests/transpose.https.any.js | 44 +- .../conformance_tests/triangular.https.any.js | 64 +-- .../conformance_tests/where.https.any.js | 144 +++-- .../tests/webnn/idlharness.https.any.js | 6 +- .../tests/webnn/resources/utils.js | 26 +- .../tests/webnn/resources/utils_validation.js | 154 +++--- .../validation_tests/argMinMax.https.any.js | 28 +- .../batchNormalization.https.any.js | 141 +++-- .../build-more-than-once.https.any.js | 2 +- .../webnn/validation_tests/cast.https.any.js | 2 +- .../webnn/validation_tests/clamp.https.any.js | 10 +- ...iews-sharing-same-arraybuffer.https.any.js | 10 +- .../validation_tests/concat.https.any.js | 55 +- .../constant-changed-buffer.https.any.js | 10 +- .../validation_tests/constant.https.any.js | 54 +- .../validation_tests/conv2d.https.any.js | 259 +++++---- .../convTranspose2d.https.any.js | 253 +++++---- .../cumulativeSum.https.any.js | 24 +- .../dequantizeLinear.https.any.js | 79 ++- .../destroyContext.https.any.js | 18 +- .../destroyGraph.https.any.js | 18 +- .../elementwise-binary.https.any.js | 46 +- .../webnn/validation_tests/elu.https.any.js | 12 +- .../validation_tests/expand.https.any.js | 34 +- .../validation_tests/gather.https.any.js | 60 +- .../gatherElements.https.any.js | 53 +- .../webnn/validation_tests/gemm.https.any.js | 95 ++-- .../webnn/validation_tests/gru.https.any.js | 178 +++--- .../validation_tests/gruCell.https.any.js | 519 ++++++++---------- .../validation_tests/hardSigmoid.https.any.js | 7 +- .../webnn/validation_tests/input.https.any.js | 24 +- .../instanceNormalization.https.any.js | 84 ++- .../invalid-rank.https.any.js | 4 +- .../layerNormalization.https.any.js | 98 ++-- .../validation_tests/leakyRelu.https.any.js | 7 +- .../validation_tests/linear.https.any.js | 7 +- .../webnn/validation_tests/lstm.https.any.js | 181 +++--- .../validation_tests/lstmCell.https.any.js | 425 +++++++------- .../validation_tests/matmul.https.any.js | 66 +-- .../webnn/validation_tests/pad.https.any.js | 20 +- ...oling-and-reduction-keep-dims.https.any.js | 15 +- .../validation_tests/pooling.https.any.js | 103 ++-- .../webnn/validation_tests/prelu.https.any.js | 48 +- .../quantizeLinear.https.any.js | 79 ++- .../validation_tests/reduction.https.any.js | 20 +- .../validation_tests/resample2d.https.any.js | 78 ++- .../validation_tests/reshape.https.any.js | 34 +- .../validation_tests/scatterND.https.any.js | 63 +-- .../webnn/validation_tests/slice.https.any.js | 24 +- .../validation_tests/softmax.https.any.js | 111 ++-- .../webnn/validation_tests/split.https.any.js | 34 +- .../webnn/validation_tests/tile.https.any.js | 22 +- .../validation_tests/transpose.https.any.js | 22 +- .../validation_tests/triangular.https.any.js | 4 +- .../webnn/validation_tests/where.https.any.js | 82 ++- 138 files changed, 4478 insertions(+), 4868 deletions(-) diff --git a/testing/web-platform/tests/webnn/conformance_tests/abs.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/abs.https.any.js index ca9f3d3ca94f..0f8a6cd33099 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/abs.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/abs.https.any.js @@ -29,7 +29,7 @@ const absTests = [ 'inputs': { 'absInput': { 'data': [49.837242126464844], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -40,7 +40,7 @@ const absTests = [ 'expectedOutputs': { 'absOutput': { 'data': [49.837242126464844], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -51,7 +51,7 @@ const absTests = [ 'inputs': { 'absInput': { 'data': [-91.03521728515625], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -62,7 +62,7 @@ const absTests = [ 'expectedOutputs': { 'absOutput': { 'data': [91.03521728515625], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -82,7 +82,7 @@ const absTests = [ 30.097660064697266, -74.21503448486328, 95.60974884033203, 6.614287376403809, 31.2832088470459, -53.206058502197266 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -103,7 +103,7 @@ const absTests = [ 30.097660064697266, 74.21503448486328, 95.60974884033203, 6.614287376403809, 31.2832088470459, 53.206058502197266 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -123,7 +123,7 @@ const absTests = [ 30.097660064697266, -74.21503448486328, 95.60974884033203, 6.614287376403809, 31.2832088470459, -53.206058502197266 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -143,7 +143,7 @@ const absTests = [ 30.097660064697266, 74.21503448486328, 95.60974884033203, 6.614287376403809, 31.2832088470459, 53.206058502197266 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -163,7 +163,7 @@ const absTests = [ 30.097660064697266, -74.21503448486328, 95.60974884033203, 6.614287376403809, 31.2832088470459, -53.206058502197266 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -183,7 +183,7 @@ const absTests = [ 30.097660064697266, 74.21503448486328, 95.60974884033203, 6.614287376403809, 31.2832088470459, 53.206058502197266 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -203,7 +203,7 @@ const absTests = [ 30.097660064697266, -74.21503448486328, 95.60974884033203, 6.614287376403809, 31.2832088470459, -53.206058502197266 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -223,7 +223,7 @@ const absTests = [ 30.097660064697266, 74.21503448486328, 95.60974884033203, 6.614287376403809, 31.2832088470459, 53.206058502197266 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -243,7 +243,7 @@ const absTests = [ 30.097660064697266, -74.21503448486328, 95.60974884033203, 6.614287376403809, 31.2832088470459, -53.206058502197266 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -263,7 +263,7 @@ const absTests = [ 30.097660064697266, 74.21503448486328, 95.60974884033203, 6.614287376403809, 31.2832088470459, 53.206058502197266 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -283,7 +283,7 @@ const absTests = [ 30.097660064697266, -74.21503448486328, 95.60974884033203, 6.614287376403809, 31.2832088470459, -53.206058502197266 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } }, 'operators': [{ @@ -303,7 +303,7 @@ const absTests = [ 30.097660064697266, 74.21503448486328, 95.60974884033203, 6.614287376403809, 31.2832088470459, 53.206058502197266 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/add.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/add.https.any.js index 17c04d1d2c18..c084dd009e23 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/add.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/add.https.any.js @@ -36,7 +36,7 @@ const addTests = [ 27.719053268432617, -18.219209671020508, 52.653099060058594, -69.99455261230469, 39.8216552734375, -29.986528396606445 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true }, 'inputB': { @@ -50,7 +50,7 @@ const addTests = [ 89.3588638305664, 28.6798095703125, -29.72130584716797, -90.6352310180664, 28.2818546295166, 27.662540435791016 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -71,7 +71,7 @@ const addTests = [ 117.07791900634766, 10.460599899291992, 22.931793212890625, -160.62979125976562, 68.10350799560547, -2.3239879608154297 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -91,7 +91,7 @@ const addTests = [ 27.719053268432617, -18.219209671020508, 52.653099060058594, -69.99455261230469, 39.8216552734375, -29.986528396606445 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -104,7 +104,7 @@ const addTests = [ 89.3588638305664, 28.6798095703125, -29.72130584716797, -90.6352310180664, 28.2818546295166, 27.662540435791016 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -124,7 +124,7 @@ const addTests = [ 117.07791900634766, 10.460599899291992, 22.931793212890625, -160.62979125976562, 68.10350799560547, -2.3239879608154297 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -144,7 +144,7 @@ const addTests = [ 27.719053268432617, -18.219209671020508, 52.653099060058594, -69.99455261230469, 39.8216552734375, -29.986528396606445 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -157,7 +157,7 @@ const addTests = [ 89.3588638305664, 28.6798095703125, -29.72130584716797, -90.6352310180664, 28.2818546295166, 27.662540435791016 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -177,7 +177,7 @@ const addTests = [ 117.07791900634766, 10.460599899291992, 22.931793212890625, -160.62979125976562, 68.10350799560547, -2.3239879608154297 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -197,7 +197,7 @@ const addTests = [ 27.719053268432617, -18.219209671020508, 52.653099060058594, -69.99455261230469, 39.8216552734375, -29.986528396606445 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -210,7 +210,7 @@ const addTests = [ 89.3588638305664, 28.6798095703125, -29.72130584716797, -90.6352310180664, 28.2818546295166, 27.662540435791016 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -230,7 +230,7 @@ const addTests = [ 117.07791900634766, 10.460599899291992, 22.931793212890625, -160.62979125976562, 68.10350799560547, -2.3239879608154297 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -250,7 +250,7 @@ const addTests = [ 27.719053268432617, -18.219209671020508, 52.653099060058594, -69.99455261230469, 39.8216552734375, -29.986528396606445 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -263,7 +263,7 @@ const addTests = [ 89.3588638305664, 28.6798095703125, -29.72130584716797, -90.6352310180664, 28.2818546295166, 27.662540435791016 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -283,7 +283,7 @@ const addTests = [ 117.07791900634766, 10.460599899291992, 22.931793212890625, -160.62979125976562, 68.10350799560547, -2.3239879608154297 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -303,7 +303,7 @@ const addTests = [ 27.719053268432617, -18.219209671020508, 52.653099060058594, -69.99455261230469, 39.8216552734375, -29.986528396606445 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -316,7 +316,7 @@ const addTests = [ 89.3588638305664, 28.6798095703125, -29.72130584716797, -90.6352310180664, 28.2818546295166, 27.662540435791016 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -336,7 +336,7 @@ const addTests = [ 117.07791900634766, 10.460599899291992, 22.931793212890625, -160.62979125976562, 68.10350799560547, -2.3239879608154297 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} } } } @@ -347,7 +347,7 @@ const addTests = [ 'inputs': { 'inputA': { 'data': [-59.361572265625], - 'descriptor': {'dimensions': [1], 'dataType': 'float32'} + 'descriptor': {shape: [1], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -360,7 +360,7 @@ const addTests = [ 27.719053268432617, -18.219209671020508, 52.653099060058594, -69.99455261230469, 39.8216552734375, -29.986528396606445 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -380,7 +380,7 @@ const addTests = [ -31.642518997192383, -77.58078002929688, -6.708473205566406, -129.3561248779297, -19.5399169921875, -89.34809875488281 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -400,14 +400,14 @@ const addTests = [ 27.719053268432617, -18.219209671020508, 52.653099060058594, -69.99455261230469, 39.8216552734375, -29.986528396606445 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ -17.981124877929688, -70.45854187011719, -12.762019157409668, 24.254032135009766, -68.12599182128906, 30.62627410888672 ], - 'descriptor': {'dimensions': [2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -427,7 +427,7 @@ const addTests = [ 9.73792839050293, -88.67774963378906, 39.89107894897461, -45.74052047729492, -28.304336547851562, 0.6397457122802734 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -447,14 +447,14 @@ const addTests = [ 27.719053268432617, -18.219209671020508, 52.653099060058594, -69.99455261230469, 39.8216552734375, -29.986528396606445 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ -32.34067153930664, 43.12499237060547, 78.6887435913086, -54.49899673461914 ], - 'descriptor': {'dimensions': [2, 2, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1], dataType: 'float32'} } }, 'operators': [{ @@ -474,7 +474,7 @@ const addTests = [ 106.40779876708984, 60.46953582763672, 131.3418426513672, -124.49354553222656, -14.67734146118164, -84.48552703857422 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -485,7 +485,7 @@ const addTests = [ 'inputs': { 'inputA': { 'data': [-59.361572265625], - 'descriptor': {'dimensions': [1, 1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -498,7 +498,7 @@ const addTests = [ 27.719053268432617, -18.219209671020508, 52.653099060058594, -69.99455261230469, 39.8216552734375, -29.986528396606445 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -518,7 +518,7 @@ const addTests = [ -31.642518997192383, -77.58078002929688, -6.708473205566406, -129.3561248779297, -19.5399169921875, -89.34809875488281 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -529,12 +529,12 @@ const addTests = [ 'inputs': { 'inputA': { 'data': 89.32998657226562, - 'descriptor': {'dimensions': [6000, 6000], 'dataType': 'float32'}, + 'descriptor': {shape: [6000, 6000], dataType: 'float32'}, 'constant': true }, 'inputB': { 'data': 77.24720764160156, - 'descriptor': {'dimensions': [6000, 6000], 'dataType': 'float32'} + 'descriptor': {shape: [6000, 6000], dataType: 'float32'} } }, 'operators': [{ @@ -545,7 +545,7 @@ const addTests = [ 'expectedOutputs': { 'output': { 'data': 166.5771942138672, - 'descriptor': {'dimensions': [6000, 6000], 'dataType': 'float32'} + 'descriptor': {shape: [6000, 6000], dataType: 'float32'} } } } @@ -556,12 +556,12 @@ const addTests = [ 'inputs': { '12-L#!.☺': { 'data': [89.32998657226562], - 'descriptor': {'dimensions': [1], 'dataType': 'float32'}, + 'descriptor': {shape: [1], dataType: 'float32'}, 'constant': true }, '🤦🏼‍♂️124DS#!F': { 'data': [77.24720764160156], - 'descriptor': {'dimensions': [1], 'dataType': 'float32'} + 'descriptor': {shape: [1], dataType: 'float32'} } }, 'operators': [{ @@ -572,7 +572,7 @@ const addTests = [ 'expectedOutputs': { 'output': { 'data': [166.5771942138672], - 'descriptor': {'dimensions': [1], 'dataType': 'float32'} + 'descriptor': {shape: [1], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/arg_min_max.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/arg_min_max.https.any.js index e730f5135e8a..a3711d3ab81e 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/arg_min_max.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/arg_min_max.https.any.js @@ -46,7 +46,7 @@ const argMinMaxTests = [ -82.78385925292969, -96.50904083251953, 39.76872634887695, 42.1504020690918, 82.66864013671875, 85.45269012451172 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -57,7 +57,7 @@ const argMinMaxTests = [ }], 'expectedOutputs': { 'argminOutput': - {'data': [7], 'descriptor': {'dimensions': [], 'dataType': 'int32'}} + {'data': [7], 'descriptor': {shape: [], dataType: 'int32'}} } } }, @@ -76,7 +76,7 @@ const argMinMaxTests = [ -82.78385925292969, -96.50904083251953, 39.76872634887695, 42.1504020690918, 82.66864013671875, 85.45269012451172 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -86,7 +86,7 @@ const argMinMaxTests = [ }], 'expectedOutputs': { 'argminOutput': - {'data': [7], 'descriptor': {'dimensions': [], 'dataType': 'int32'}} + {'data': [7], 'descriptor': {shape: [], dataType: 'int32'}} } } }, @@ -105,7 +105,7 @@ const argMinMaxTests = [ -82.78385925292969, -96.50904083251953, 39.76872634887695, 42.1504020690918, 82.66864013671875, 85.45269012451172 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -116,7 +116,7 @@ const argMinMaxTests = [ 'expectedOutputs': { 'argminOutput': { 'data': [1, 1, 2, 0, 1, 1], - 'descriptor': {'dimensions': [6], 'dataType': 'int32'} + 'descriptor': {shape: [6], dataType: 'int32'} } } } @@ -136,7 +136,7 @@ const argMinMaxTests = [ -82.78385925292969, -96.50904083251953, 39.76872634887695, 42.1504020690918, 82.66864013671875, 85.45269012451172 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -147,7 +147,7 @@ const argMinMaxTests = [ 'expectedOutputs': { 'argminOutput': { 'data': [1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0], - 'descriptor': {'dimensions': [3, 4], 'dataType': 'int32'} + 'descriptor': {shape: [3, 4], dataType: 'int32'} } } } @@ -167,7 +167,7 @@ const argMinMaxTests = [ -82.78385925292969, -96.50904083251953, 39.76872634887695, 42.1504020690918, 82.66864013671875, 85.45269012451172 ], - 'descriptor': {'dimensions': [2, 1, 4, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 3], dataType: 'float32'} } }, 'operators': [{ @@ -178,7 +178,7 @@ const argMinMaxTests = [ 'expectedOutputs': { 'argminOutput': { 'data': [1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0], - 'descriptor': {'dimensions': [1, 4, 3], 'dataType': 'int32'} + 'descriptor': {shape: [1, 4, 3], dataType: 'int32'} } } } @@ -198,7 +198,7 @@ const argMinMaxTests = [ -82.78385925292969, -96.50904083251953, 39.76872634887695, 42.1504020690918, 82.66864013671875, 85.45269012451172 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } }, 'operators': [{ @@ -209,7 +209,7 @@ const argMinMaxTests = [ 'expectedOutputs': { 'argminOutput': { 'data': [1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0], - 'descriptor': {'dimensions': [1, 4, 1, 3], 'dataType': 'int32'} + 'descriptor': {shape: [1, 4, 1, 3], dataType: 'int32'} } } } @@ -229,7 +229,7 @@ const argMinMaxTests = [ -82.78385925292969, -96.50904083251953, 39.76872634887695, 42.1504020690918, 82.66864013671875, 85.45269012451172 ], - 'descriptor': {'dimensions': [2, 1, 4, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 3], dataType: 'float32'} } }, 'operators': [{ @@ -240,7 +240,7 @@ const argMinMaxTests = [ 'expectedOutputs': { 'argminOutput': { 'data': [2, 2, 0, 0, 0, 0], - 'descriptor': {'dimensions': [2, 1, 3], 'dataType': 'int32'} + 'descriptor': {shape: [2, 1, 3], dataType: 'int32'} } } } @@ -260,7 +260,7 @@ const argMinMaxTests = [ -82.78385925292969, -96.50904083251953, 39.76872634887695, 42.1504020690918, 82.66864013671875, 85.45269012451172 ], - 'descriptor': {'dimensions': [2, 1, 4, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 3], dataType: 'float32'} } }, 'operators': [{ @@ -274,7 +274,7 @@ const argMinMaxTests = [ 'expectedOutputs': { 'argminOutput': { 'data': [1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0], - 'descriptor': {'dimensions': [1, 1, 4, 3], 'dataType': 'int32'} + 'descriptor': {shape: [1, 1, 4, 3], dataType: 'int32'} } } } @@ -294,7 +294,7 @@ const argMinMaxTests = [ -82.78385925292969, -96.50904083251953, 39.76872634887695, 42.1504020690918, 82.66864013671875, 85.45269012451172 ], - 'descriptor': {'dimensions': [2, 1, 4, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 3], dataType: 'float32'} } }, 'operators': [{ @@ -308,7 +308,7 @@ const argMinMaxTests = [ 'expectedOutputs': { 'argminOutput': { 'data': [1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0], - 'descriptor': {'dimensions': [1, 4, 3], 'dataType': 'int32'} + 'descriptor': {shape: [1, 4, 3], dataType: 'int32'} } } } @@ -330,7 +330,7 @@ const argMinMaxTests = [ -41.70176696777344, 73.8133773803711, 88.46114349365234, -84.94000244140625, -61.48894119262695, -98.3387451171875 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -341,7 +341,7 @@ const argMinMaxTests = [ }], 'expectedOutputs': { 'argmaxOutput': - {'data': [3], 'descriptor': {'dimensions': [], 'dataType': 'int32'}} + {'data': [3], 'descriptor': {shape: [], dataType: 'int32'}} } } }, @@ -360,7 +360,7 @@ const argMinMaxTests = [ -41.70176696777344, 73.8133773803711, 88.46114349365234, -84.94000244140625, -61.48894119262695, -98.3387451171875 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -370,7 +370,7 @@ const argMinMaxTests = [ }], 'expectedOutputs': { 'argmaxOutput': - {'data': [3], 'descriptor': {'dimensions': [], 'dataType': 'int32'}} + {'data': [3], 'descriptor': {shape: [], dataType: 'int32'}} } } }, @@ -389,7 +389,7 @@ const argMinMaxTests = [ -41.70176696777344, 73.8133773803711, 88.46114349365234, -84.94000244140625, -61.48894119262695, -98.3387451171875 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -400,7 +400,7 @@ const argMinMaxTests = [ 'expectedOutputs': { 'argmaxOutput': { 'data': [1, 1, 1, 0, 0, 0], - 'descriptor': {'dimensions': [6], 'dataType': 'int32'} + 'descriptor': {shape: [6], dataType: 'int32'} } } } @@ -420,7 +420,7 @@ const argMinMaxTests = [ -41.70176696777344, 73.8133773803711, 88.46114349365234, -84.94000244140625, -61.48894119262695, -98.3387451171875 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -431,7 +431,7 @@ const argMinMaxTests = [ 'expectedOutputs': { 'argmaxOutput': { 'data': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - 'descriptor': {'dimensions': [3, 4], 'dataType': 'int32'} + 'descriptor': {shape: [3, 4], dataType: 'int32'} } } } @@ -451,7 +451,7 @@ const argMinMaxTests = [ -41.70176696777344, 73.8133773803711, 88.46114349365234, -84.94000244140625, -61.48894119262695, -98.3387451171875 ], - 'descriptor': {'dimensions': [2, 1, 4, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 3], dataType: 'float32'} } }, 'operators': [{ @@ -462,7 +462,7 @@ const argMinMaxTests = [ 'expectedOutputs': { 'argmaxOutput': { 'data': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - 'descriptor': {'dimensions': [1, 4, 3], 'dataType': 'int32'} + 'descriptor': {shape: [1, 4, 3], dataType: 'int32'} } } } @@ -482,7 +482,7 @@ const argMinMaxTests = [ -41.70176696777344, 73.8133773803711, 88.46114349365234, -84.94000244140625, -61.48894119262695, -98.3387451171875 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } }, 'operators': [{ @@ -493,7 +493,7 @@ const argMinMaxTests = [ 'expectedOutputs': { 'argmaxOutput': { 'data': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - 'descriptor': {'dimensions': [1, 4, 1, 3], 'dataType': 'int32'} + 'descriptor': {shape: [1, 4, 1, 3], dataType: 'int32'} } } } @@ -513,7 +513,7 @@ const argMinMaxTests = [ -41.70176696777344, 73.8133773803711, 88.46114349365234, -84.94000244140625, -61.48894119262695, -98.3387451171875 ], - 'descriptor': {'dimensions': [2, 1, 4, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 3], dataType: 'float32'} } }, 'operators': [{ @@ -524,7 +524,7 @@ const argMinMaxTests = [ 'expectedOutputs': { 'argmaxOutput': { 'data': [1, 2, 2, 1, 2, 2], - 'descriptor': {'dimensions': [2, 1, 3], 'dataType': 'int32'} + 'descriptor': {shape: [2, 1, 3], dataType: 'int32'} } } } @@ -544,7 +544,7 @@ const argMinMaxTests = [ -41.70176696777344, 73.8133773803711, 88.46114349365234, -84.94000244140625, -61.48894119262695, -98.3387451171875 ], - 'descriptor': {'dimensions': [2, 1, 4, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 3], dataType: 'float32'} } }, 'operators': [{ @@ -558,7 +558,7 @@ const argMinMaxTests = [ 'expectedOutputs': { 'argmaxOutput': { 'data': [2, 0, 2, 1, 2, 0, 2, 1], - 'descriptor': {'dimensions': [2, 1, 4, 1], 'dataType': 'int32'} + 'descriptor': {shape: [2, 1, 4, 1], dataType: 'int32'} } } } @@ -578,7 +578,7 @@ const argMinMaxTests = [ -41.70176696777344, 73.8133773803711, 88.46114349365234, -84.94000244140625, -61.48894119262695, -98.3387451171875 ], - 'descriptor': {'dimensions': [2, 1, 4, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 3], dataType: 'float32'} } }, 'operators': [{ @@ -592,7 +592,7 @@ const argMinMaxTests = [ 'expectedOutputs': { 'argmaxOutput': { 'data': [2, 0, 2, 1, 2, 0, 2, 1], - 'descriptor': {'dimensions': [2, 1, 4], 'dataType': 'int32'} + 'descriptor': {shape: [2, 1, 4], dataType: 'int32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/batch_normalization.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/batch_normalization.https.any.js index 08dda14db28e..4d87d01782f7 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/batch_normalization.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/batch_normalization.https.any.js @@ -47,21 +47,21 @@ const batchNormTests = [ -9.359310150146484, 80.20824432373047, -85.36802673339844, 62.35185241699219, -68.4724349975586, -12.10716724395752 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} }, 'bnMean': { 'data': [ -7.814267635345459, -95.64129638671875, 38.15440368652344, -55.95203399658203, -87.86500549316406, -41.63645553588867 ], - 'descriptor': {'dimensions': [6], 'dataType': 'float32'} + 'descriptor': {shape: [6], dataType: 'float32'} }, 'bnVariance': { 'data': [ 60.31186294555664, 26.43260383605957, 53.275634765625, 40.146121978759766, 59.41098403930664, 35.99981689453125 ], - 'descriptor': {'dimensions': [6], 'dataType': 'float32'} + 'descriptor': {shape: [6], dataType: 'float32'} } }, 'operators': [{ @@ -83,7 +83,7 @@ const batchNormTests = [ -0.1989477425813675, 34.203548431396484, -16.923160552978516, 18.671411514282227, 2.5159497261047363, 4.921559810638428 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -103,7 +103,7 @@ const batchNormTests = [ -9.359310150146484, 80.20824432373047, -85.36802673339844, 62.35185241699219, -68.4724349975586, -12.10716724395752 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'}, + 'descriptor': {shape: [4, 6], dataType: 'float32'}, 'constant': true }, 'bnMean': { @@ -111,7 +111,7 @@ const batchNormTests = [ -7.814267635345459, -95.64129638671875, 38.15440368652344, -55.95203399658203, -87.86500549316406, -41.63645553588867 ], - 'descriptor': {'dimensions': [6], 'dataType': 'float32'}, + 'descriptor': {shape: [6], dataType: 'float32'}, 'constant': true }, 'bnVariance': { @@ -119,7 +119,7 @@ const batchNormTests = [ 60.31186294555664, 26.43260383605957, 53.275634765625, 40.146121978759766, 59.41098403930664, 35.99981689453125 ], - 'descriptor': {'dimensions': [6], 'dataType': 'float32'}, + 'descriptor': {shape: [6], dataType: 'float32'}, 'constant': true } }, @@ -142,7 +142,7 @@ const batchNormTests = [ -0.1989477425813675, 34.203548431396484, -16.923160552978516, 18.671411514282227, 2.5159497261047363, 4.921559810638428 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -162,14 +162,14 @@ const batchNormTests = [ -9.359310150146484, 80.20824432373047, -85.36802673339844, 62.35185241699219, -68.4724349975586, -12.10716724395752 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} }, 'bnMean': { 'data': [ -7.814267635345459, -95.64129638671875, 38.15440368652344, -55.95203399658203, -87.86500549316406, -41.63645553588867 ], - 'descriptor': {'dimensions': [6], 'dataType': 'float32'}, + 'descriptor': {shape: [6], dataType: 'float32'}, 'constant': true }, 'bnVariance': { @@ -177,7 +177,7 @@ const batchNormTests = [ 60.31186294555664, 26.43260383605957, 53.275634765625, 40.146121978759766, 59.41098403930664, 35.99981689453125 ], - 'descriptor': {'dimensions': [6], 'dataType': 'float32'}, + 'descriptor': {shape: [6], dataType: 'float32'}, 'constant': true } }, @@ -200,7 +200,7 @@ const batchNormTests = [ -0.1989477425813675, 34.203548431396484, -16.923160552978516, 18.671411514282227, 2.5159497261047363, 4.921559810638428 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -220,16 +220,16 @@ const batchNormTests = [ -9.359310150146484, 80.20824432373047, -85.36802673339844, 62.35185241699219, -68.4724349975586, -12.10716724395752 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} }, 'bnMean': { 'data': [12.810380935668945, 63.13715362548828, -61.62983322143555], - 'descriptor': {'dimensions': [3], 'dataType': 'float32'}, + 'descriptor': {shape: [3], dataType: 'float32'}, 'constant': true }, 'bnVariance': { 'data': [18.358240127563477, 41.847232818603516, 16.12828254699707], - 'descriptor': {'dimensions': [3], 'dataType': 'float32'}, + 'descriptor': {shape: [3], dataType: 'float32'}, 'constant': true } }, @@ -252,7 +252,7 @@ const batchNormTests = [ -11.206846237182617, 2.638929843902588, -5.910898208618164, 30.871898651123047, -1.7038332223892212, 12.331327438354492 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -272,16 +272,16 @@ const batchNormTests = [ -9.359310150146484, 80.20824432373047, -85.36802673339844, 62.35185241699219, -68.4724349975586, -12.10716724395752 ], - 'descriptor': {'dimensions': [2, 3, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'} }, 'bnMean': { 'data': [51.629150390625, 99.36075592041016, -96.1473617553711], - 'descriptor': {'dimensions': [3], 'dataType': 'float32'}, + 'descriptor': {shape: [3], dataType: 'float32'}, 'constant': true }, 'bnVariance': { 'data': [30.448015213012695, 86.36219024658203, 73.88455200195312], - 'descriptor': {'dimensions': [3], 'dataType': 'float32'}, + 'descriptor': {shape: [3], dataType: 'float32'}, 'constant': true } }, @@ -304,7 +304,7 @@ const batchNormTests = [ -11.698976516723633, -2.0609331130981445, 1.2540507316589355, 18.43954849243164, 3.2196571826934814, 9.777103424072266 ], - 'descriptor': {'dimensions': [2, 3, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'} } } } @@ -324,16 +324,16 @@ const batchNormTests = [ -9.359310150146484, 80.20824432373047, -85.36802673339844, 62.35185241699219, -68.4724349975586, -12.10716724395752 ], - 'descriptor': {'dimensions': [6, 1, 1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [6, 1, 1, 2, 2], dataType: 'float32'} }, 'bnMean': { 'data': [35.4078254699707], - 'descriptor': {'dimensions': [1], 'dataType': 'float32'}, + 'descriptor': {shape: [1], dataType: 'float32'}, 'constant': true }, 'bnVariance': { 'data': [40.93109893798828], - 'descriptor': {'dimensions': [1], 'dataType': 'float32'}, + 'descriptor': {shape: [1], dataType: 'float32'}, 'constant': true } }, @@ -356,7 +356,7 @@ const batchNormTests = [ -6.99733304977417, 7.002535343170166, -18.877885818481445, 4.211489677429199, -16.237018585205078, -7.42683744430542 ], - 'descriptor': {'dimensions': [6, 1, 1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [6, 1, 1, 2, 2], dataType: 'float32'} } } } @@ -376,16 +376,16 @@ const batchNormTests = [ -9.359310150146484, 80.20824432373047, -85.36802673339844, 62.35185241699219, -68.4724349975586, -12.10716724395752 ], - 'descriptor': {'dimensions': [2, 3, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'} }, 'bnMean': { 'data': [51.629150390625, 99.36075592041016, -96.1473617553711], - 'descriptor': {'dimensions': [3], 'dataType': 'float32'}, + 'descriptor': {shape: [3], dataType: 'float32'}, 'constant': true }, 'bnVariance': { 'data': [30.448015213012695, 86.36219024658203, 73.88455200195312], - 'descriptor': {'dimensions': [3], 'dataType': 'float32'}, + 'descriptor': {shape: [3], dataType: 'float32'}, 'constant': true } }, @@ -409,7 +409,7 @@ const batchNormTests = [ -11.698976516723633, -2.0609331130981445, 1.2540507316589355, 18.43954849243164, 3.2196571826934814, 9.777103424072266 ], - 'descriptor': {'dimensions': [2, 3, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'} } } } @@ -429,16 +429,16 @@ const batchNormTests = [ 76.8831787109375, -9.359310150146484, -68.4724349975586, 97.03362274169922, 80.20824432373047, -12.10716724395752 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'bnMean': { 'data': [51.629150390625, 99.36075592041016, -96.1473617553711], - 'descriptor': {'dimensions': [3], 'dataType': 'float32'}, + 'descriptor': {shape: [3], dataType: 'float32'}, 'constant': true }, 'bnVariance': { 'data': [30.448015213012695, 86.36219024658203, 73.88455200195312], - 'descriptor': {'dimensions': [3], 'dataType': 'float32'}, + 'descriptor': {shape: [3], dataType: 'float32'}, 'constant': true } }, @@ -462,7 +462,7 @@ const batchNormTests = [ 4.576685905456543, -11.698976516723633, 3.2196571826934814, 8.228469848632812, -2.0609331130981445, 9.777103424072266 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -482,21 +482,21 @@ const batchNormTests = [ -9.359310150146484, 80.20824432373047, -85.36802673339844, 62.35185241699219, -68.4724349975586, -12.10716724395752 ], - 'descriptor': {'dimensions': [2, 3, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'} }, 'bnMean': { 'data': [51.629150390625, 99.36075592041016, -96.1473617553711], - 'descriptor': {'dimensions': [3], 'dataType': 'float32'}, + 'descriptor': {shape: [3], dataType: 'float32'}, 'constant': true }, 'bnVariance': { 'data': [30.448015213012695, 86.36219024658203, 73.88455200195312], - 'descriptor': {'dimensions': [3], 'dataType': 'float32'}, + 'descriptor': {shape: [3], dataType: 'float32'}, 'constant': true }, 'bnScale': { 'data': [65.50171661376953, -71.007568359375, -5.569730758666992], - 'descriptor': {'dimensions': [3], 'dataType': 'float32'}, + 'descriptor': {shape: [3], dataType: 'float32'}, 'constant': true } }, @@ -520,7 +520,7 @@ const batchNormTests = [ 830.7158813476562, 146.3418426513672, -6.984724998474121, -102.70331573486328, -17.9326229095459, -54.455833435058594 ], - 'descriptor': {'dimensions': [2, 3, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'} } } } @@ -540,21 +540,21 @@ const batchNormTests = [ -9.359310150146484, 80.20824432373047, -85.36802673339844, 62.35185241699219, -68.4724349975586, -12.10716724395752 ], - 'descriptor': {'dimensions': [2, 3, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'} }, 'bnMean': { 'data': [51.629150390625, 99.36075592041016, -96.1473617553711], - 'descriptor': {'dimensions': [3], 'dataType': 'float32'}, + 'descriptor': {shape: [3], dataType: 'float32'}, 'constant': true }, 'bnVariance': { 'data': [30.448015213012695, 86.36219024658203, 73.88455200195312], - 'descriptor': {'dimensions': [3], 'dataType': 'float32'}, + 'descriptor': {shape: [3], dataType: 'float32'}, 'constant': true }, 'bnBias': { 'data': [64.2044677734375, 75.28591918945312, -84.57243347167969], - 'descriptor': {'dimensions': [3], 'dataType': 'float32'}, + 'descriptor': {shape: [3], dataType: 'float32'}, 'constant': true } }, @@ -578,7 +578,7 @@ const batchNormTests = [ 63.586944580078125, 73.22498321533203, -83.3183822631836, -66.13288879394531, -81.35277557373047, -74.79533386230469 ], - 'descriptor': {'dimensions': [2, 3, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'} } } } @@ -598,16 +598,16 @@ const batchNormTests = [ -9.359310150146484, 80.20824432373047, -85.36802673339844, 62.35185241699219, -68.4724349975586, -12.10716724395752 ], - 'descriptor': {'dimensions': [2, 3, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'} }, 'bnMean': { 'data': [51.629150390625, 99.36075592041016, -96.1473617553711], - 'descriptor': {'dimensions': [3], 'dataType': 'float32'}, + 'descriptor': {shape: [3], dataType: 'float32'}, 'constant': true }, 'bnVariance': { 'data': [30.448015213012695, 86.36219024658203, 73.88455200195312], - 'descriptor': {'dimensions': [3], 'dataType': 'float32'}, + 'descriptor': {shape: [3], dataType: 'float32'}, 'constant': true } }, @@ -631,7 +631,7 @@ const batchNormTests = [ -11.698976516723633, -2.0609331130981445, 1.254050850868225, 18.43954849243164, 3.2196574211120605, 9.777103424072266 ], - 'descriptor': {'dimensions': [2, 3, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'} } } } @@ -651,26 +651,26 @@ const batchNormTests = [ 76.8831787109375, -9.359310150146484, -68.4724349975586, 97.03362274169922, 80.20824432373047, -12.10716724395752 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'bnMean': { 'data': [51.629150390625, 99.36075592041016, -96.1473617553711], - 'descriptor': {'dimensions': [3], 'dataType': 'float32'}, + 'descriptor': {shape: [3], dataType: 'float32'}, 'constant': true }, 'bnVariance': { 'data': [30.448015213012695, 86.36219024658203, 73.88455200195312], - 'descriptor': {'dimensions': [3], 'dataType': 'float32'}, + 'descriptor': {shape: [3], dataType: 'float32'}, 'constant': true }, 'bnScale': { 'data': [65.50171661376953, -71.007568359375, -5.569730758666992], - 'descriptor': {'dimensions': [3], 'dataType': 'float32'}, + 'descriptor': {shape: [3], dataType: 'float32'}, 'constant': true }, 'bnBias': { 'data': [64.2044677734375, 75.28591918945312, -84.57243347167969], - 'descriptor': {'dimensions': [3], 'dataType': 'float32'}, + 'descriptor': {shape: [3], dataType: 'float32'}, 'constant': true } }, @@ -701,7 +701,7 @@ const batchNormTests = [ 363.98524710447384, 906.0018322105, -102.5050592863526, 603.1834043179756, 221.6277675074517, -139.02827100419768 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/byob_readtensor.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/byob_readtensor.https.any.js index 9a12bf024399..b99c8704d236 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/byob_readtensor.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/byob_readtensor.https.any.js @@ -31,7 +31,7 @@ promise_setup(async () => { try { mlTensor = await mlContext.createTensor({ dataType: 'int32', - dimensions: [2, 4], + shape: [2, 4], usage: MLTensorUsage.WRITE | MLTensorUsage.READ, }); } catch (e) { @@ -140,7 +140,7 @@ promise_test(async () => { promise_test(async (t) => { const tensor = await mlContext.createTensor({ dataType: 'int32', - dimensions: [2, 2], + shape: [2, 2], usage: MLTensorUsage.READ, }); const arrayBufferView = new Int32Array(2 * 2); @@ -158,7 +158,7 @@ promise_test(async (t) => { promise_test(async (t) => { const tensor = await mlContext.createTensor({ dataType: 'int32', - dimensions: [2, 2], + shape: [2, 2], usage: MLTensorUsage.READ, }); const arrayBufferView = new Int32Array(2 * 2); diff --git a/testing/web-platform/tests/webnn/conformance_tests/cast.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/cast.https.any.js index a4223736f612..b73cf3c41bb0 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/cast.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/cast.https.any.js @@ -35,7 +35,7 @@ const castTests = [ 'inputs': { 'castInput': { 'data': [84.77753448486328], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -44,10 +44,8 @@ const castTests = [ 'outputs': 'castOutput' }], 'expectedOutputs': { - 'castOutput': { - 'data': [84], - 'descriptor': {'dimensions': [], 'dataType': 'int32'} - } + 'castOutput': + {'data': [84], 'descriptor': {shape: [], dataType: 'int32'}} } } }, @@ -70,7 +68,7 @@ const castTests = [ -27.49382972717285, -23.836687088012695, 70.77123260498047, 83.5 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -84,7 +82,7 @@ const castTests = [ 102, -43, 52, -99, 6, 92, -10, 106, -7, 91, -50, 83, 72, -31, 79, 41, 35, -2, -96, -86, -27, -23, 70, 83 ], - 'descriptor': {'dimensions': [24], 'dataType': 'int32'} + 'descriptor': {shape: [24], dataType: 'int32'} } } } @@ -108,7 +106,7 @@ const castTests = [ -27.49382972717285, -23.836687088012695, 70.77123260498047, 83.5 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -122,7 +120,7 @@ const castTests = [ 102, -43, 52, -99, 6, 92, -10, 106, -7, 91, -50, 83, 72, -31, 79, 41, 35, -2, -96, -86, -27, -23, 70, 83 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'int32'} + 'descriptor': {shape: [4, 6], dataType: 'int32'} } } } @@ -146,7 +144,7 @@ const castTests = [ -27.49382972717285, -23.836687088012695, 70.77123260498047, 83.5 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -160,7 +158,7 @@ const castTests = [ 102, -43, 52, -99, 6, 92, -10, 106, -7, 91, -50, 83, 72, -31, 79, 41, 35, -2, -96, -86, -27, -23, 70, 83 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'int32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'int32'} } } } @@ -184,7 +182,7 @@ const castTests = [ -27.49382972717285, -23.836687088012695, 70.77123260498047, 83.5 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -198,7 +196,7 @@ const castTests = [ 102, -43, 52, -99, 6, 92, -10, 106, -7, 91, -50, 83, 72, -31, 79, 41, 35, -2, -96, -86, -27, -23, 70, 83 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'int32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'int32'} } } } @@ -222,7 +220,7 @@ const castTests = [ -27.49382972717285, -23.836687088012695, 70.77123260498047, 83.5 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } }, 'operators': [{ @@ -236,7 +234,7 @@ const castTests = [ 102, -43, 52, -99, 6, 92, -10, 106, -7, 91, -50, 83, 72, -31, 79, 41, 35, -2, -96, -86, -27, -23, 70, 83 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'int32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'int32'} } } } @@ -256,7 +254,7 @@ const castTests = [ 96.05252838134766, 86.76212310791016, 27.49382972717285, 23.836687088012695, 70.77123260498047, 83.8347396850586 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -272,7 +270,7 @@ const castTests = [ 73, 31.015625, 79.9375, 41.84375, 35.71875, 2.61328125, 96.0625, 86.75, 27.5, 23.84375, 70.75, 83.8125 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float16'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} } } } @@ -292,7 +290,7 @@ const castTests = [ 96.05252838134766, 86.76212310791016, 27.49382972717285, 23.836687088012695, 70.77123260498047, 83.8347396850586 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -306,7 +304,7 @@ const castTests = [ 102, 43, 52, 99, 6, 92, 10, 106, 7, 91, 50, 83, 72, 31, 79, 41, 35, 2, 96, 86, 27, 23, 70, 83 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint32'} } } } @@ -326,7 +324,7 @@ const castTests = [ 96.05252838134766, 86.76212310791016, 27.49382972717285, 23.836687088012695, 70.77123260498047, 83.8347396850586 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -341,7 +339,7 @@ const castTests = [ '7', '91', '50', '83', '72', '31', '79', '41', '35', '2', '96', '86', '27', '23', '70', '83' ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'int64'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'int64'} } } } @@ -361,7 +359,7 @@ const castTests = [ 96.05252838134766, 86.76212310791016, 27.49382972717285, 23.836687088012695, 70.77123260498047, 83.8347396850586 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -375,7 +373,7 @@ const castTests = [ 102, 43, 52, 99, 6, 92, 10, 106, 7, 91, 50, 83, 72, 31, 79, 41, 35, 2, 96, 86, 27, 23, 70, 83 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'int8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'int8'} } } } @@ -395,7 +393,7 @@ const castTests = [ 96.05252838134766, 86.76212310791016, 27.49382972717285, 23.836687088012695, 70.77123260498047, 83.8347396850586 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -409,7 +407,7 @@ const castTests = [ 102, 43, 52, 99, 6, 92, 10, 106, 7, 91, 50, 83, 72, 31, 79, 41, 35, 2, 96, 86, 27, 23, 70, 83 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } @@ -425,7 +423,7 @@ const castTests = [ 99.75, 16.125, 115.625, 66, 49.375, 115.75, 77, 57.15625, 61.6875, 12.9296875, 101.25, 123.9375 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float16'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} } }, 'operators': [{ @@ -441,7 +439,7 @@ const castTests = [ 99.75, 16.125, 115.625, 66, 49.375, 115.75, 77, 57.15625, 61.6875, 12.9296875, 101.25, 123.9375 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -457,7 +455,7 @@ const castTests = [ 99.75, 16.125, 115.625, 66, 49.375, 115.75, 77, 57.15625, 61.6875, 12.9296875, 101.25, 123.9375 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float16'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} } }, 'operators': [{ @@ -471,7 +469,7 @@ const castTests = [ 3, 32, 62, 51, 87, 106, 125, 112, 70, 39, 10, 21, 99, 16, 115, 66, 49, 115, 77, 57, 61, 12, 101, 123 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'int32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'int32'} } } } @@ -487,7 +485,7 @@ const castTests = [ 99.75, 16.125, 115.625, 66, 49.375, 115.75, 77, 57.15625, 61.6875, 12.9296875, 101.25, 123.9375 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float16'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} } }, 'operators': [{ @@ -501,7 +499,7 @@ const castTests = [ 3, 32, 62, 51, 87, 106, 125, 112, 70, 39, 10, 21, 99, 16, 115, 66, 49, 115, 77, 57, 61, 12, 101, 123 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint32'} } } } @@ -517,7 +515,7 @@ const castTests = [ 99.75, 16.125, 115.625, 66, 49.375, 115.75, 77, 57.15625, 61.6875, 12.9296875, 101.25, 123.9375 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float16'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} } }, 'operators': [{ @@ -532,7 +530,7 @@ const castTests = [ '70', '39', '10', '21', '99', '16', '115', '66', '49', '115', '77', '57', '61', '12', '101', '123' ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'int64'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'int64'} } } } @@ -548,7 +546,7 @@ const castTests = [ 99.75, 16.125, 115.625, 66, 49.375, 115.75, 77, 57.15625, 61.6875, 12.9296875, 101.25, 123.9375 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float16'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} } }, 'operators': [{ @@ -562,7 +560,7 @@ const castTests = [ 3, 32, 62, 51, 87, 106, 125, 112, 70, 39, 10, 21, 99, 16, 115, 66, 49, 115, 77, 57, 61, 12, 101, 123 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'int8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'int8'} } } } @@ -578,7 +576,7 @@ const castTests = [ 99.75, 16.125, 115.625, 66, 49.375, 115.75, 77, 57.15625, 61.6875, 12.9296875, 101.25, 123.9375 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float16'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} } }, 'operators': [{ @@ -592,7 +590,7 @@ const castTests = [ 3, 32, 62, 51, 87, 106, 125, 112, 70, 39, 10, 21, 99, 16, 115, 66, 49, 115, 77, 57, 61, 12, 101, 123 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } @@ -606,7 +604,7 @@ const castTests = [ 45, 55, 11, 21, 78, 104, 102, 66, 41, 110, 92, 69, 48, 23, 58, 12, 33, 24, 101, 87, 49, 118, 1, 77 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'int32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'int32'} } }, 'operators': [{ @@ -620,7 +618,7 @@ const castTests = [ 45, 55, 11, 21, 78, 104, 102, 66, 41, 110, 92, 69, 48, 23, 58, 12, 33, 24, 101, 87, 49, 118, 1, 77 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -634,7 +632,7 @@ const castTests = [ 45, 55, 11, 21, 78, 104, 102, 66, 41, 110, 92, 69, 48, 23, 58, 12, 33, 24, 101, 87, 49, 118, 1, 77 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'int32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'int32'} } }, 'operators': [{ @@ -648,7 +646,7 @@ const castTests = [ 45, 55, 11, 21, 78, 104, 102, 66, 41, 110, 92, 69, 48, 23, 58, 12, 33, 24, 101, 87, 49, 118, 1, 77 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float16'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} } } } @@ -662,7 +660,7 @@ const castTests = [ 45, 55, 11, 21, 78, 104, 102, 66, 41, 110, 92, 69, 48, 23, 58, 12, 33, 24, 101, 87, 49, 118, 1, 77 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'int32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'int32'} } }, 'operators': [{ @@ -677,7 +675,7 @@ const castTests = [ '41', '110', '92', '69', '48', '23', '58', '12', '33', '24', '101', '87', '49', '118', '1', '77' ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'int64'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'int64'} } } } @@ -691,7 +689,7 @@ const castTests = [ 45, 55, 11, 21, 78, 104, 102, 66, 41, 110, 92, 69, 48, 23, 58, 12, 33, 24, 101, 87, 49, 118, 1, 77 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'int32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'int32'} } }, 'operators': [{ @@ -705,7 +703,7 @@ const castTests = [ 45, 55, 11, 21, 78, 104, 102, 66, 41, 110, 92, 69, 48, 23, 58, 12, 33, 24, 101, 87, 49, 118, 1, 77 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'int8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'int8'} } } } @@ -719,7 +717,7 @@ const castTests = [ 45, 55, 11, 21, 78, 104, 102, 66, 41, 110, 92, 69, 48, 23, 58, 12, 33, 24, 101, 87, 49, 118, 1, 77 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'int32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'int32'} } }, 'operators': [{ @@ -733,7 +731,7 @@ const castTests = [ 45, 55, 11, 21, 78, 104, 102, 66, 41, 110, 92, 69, 48, 23, 58, 12, 33, 24, 101, 87, 49, 118, 1, 77 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } @@ -747,7 +745,7 @@ const castTests = [ 34, 83, 113, 31, 62, 80, 8, 40, 104, 42, 6, 91, 93, 21, 40, 21, 51, 110, 115, 12, 122, 68, 57, 72 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint32'} } }, 'operators': [{ @@ -761,7 +759,7 @@ const castTests = [ 34, 83, 113, 31, 62, 80, 8, 40, 104, 42, 6, 91, 93, 21, 40, 21, 51, 110, 115, 12, 122, 68, 57, 72 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -775,7 +773,7 @@ const castTests = [ 34, 83, 113, 31, 62, 80, 8, 40, 104, 42, 6, 91, 93, 21, 40, 21, 51, 110, 115, 12, 122, 68, 57, 72 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint32'} } }, 'operators': [{ @@ -789,7 +787,7 @@ const castTests = [ 34, 83, 113, 31, 62, 80, 8, 40, 104, 42, 6, 91, 93, 21, 40, 21, 51, 110, 115, 12, 122, 68, 57, 72 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float16'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} } } } @@ -803,7 +801,7 @@ const castTests = [ 34, 83, 113, 31, 62, 80, 8, 40, 104, 42, 6, 91, 93, 21, 40, 21, 51, 110, 115, 12, 122, 68, 57, 72 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint32'} } }, 'operators': [{ @@ -817,7 +815,7 @@ const castTests = [ 34, 83, 113, 31, 62, 80, 8, 40, 104, 42, 6, 91, 93, 21, 40, 21, 51, 110, 115, 12, 122, 68, 57, 72 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'int32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'int32'} } } } @@ -831,7 +829,7 @@ const castTests = [ 34, 83, 113, 31, 62, 80, 8, 40, 104, 42, 6, 91, 93, 21, 40, 21, 51, 110, 115, 12, 122, 68, 57, 72 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint32'} } }, 'operators': [{ @@ -846,7 +844,7 @@ const castTests = [ '104', '42', '6', '91', '93', '21', '40', '21', '51', '110', '115', '12', '122', '68', '57', '72' ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'int64'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'int64'} } } } @@ -860,7 +858,7 @@ const castTests = [ 34, 83, 113, 31, 62, 80, 8, 40, 104, 42, 6, 91, 93, 21, 40, 21, 51, 110, 115, 12, 122, 68, 57, 72 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint32'} } }, 'operators': [{ @@ -874,7 +872,7 @@ const castTests = [ 34, 83, 113, 31, 62, 80, 8, 40, 104, 42, 6, 91, 93, 21, 40, 21, 51, 110, 115, 12, 122, 68, 57, 72 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'int8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'int8'} } } } @@ -888,7 +886,7 @@ const castTests = [ 34, 83, 113, 31, 62, 80, 8, 40, 104, 42, 6, 91, 93, 21, 40, 21, 51, 110, 115, 12, 122, 68, 57, 72 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint32'} } }, 'operators': [{ @@ -902,7 +900,7 @@ const castTests = [ 34, 83, 113, 31, 62, 80, 8, 40, 104, 42, 6, 91, 93, 21, 40, 21, 51, 110, 115, 12, 122, 68, 57, 72 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } @@ -916,7 +914,7 @@ const castTests = [ 50, 1, 28, 20, 102, 86, 70, 38, 50, 19, 11, 4, 56, 77, 40, 80, 45, 127, 4, 87, 125, 26, 63, 11 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'int64'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'int64'} } }, 'operators': [{ @@ -930,7 +928,7 @@ const castTests = [ 50, 1, 28, 20, 102, 86, 70, 38, 50, 19, 11, 4, 56, 77, 40, 80, 45, 127, 4, 87, 125, 26, 63, 11 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -944,7 +942,7 @@ const castTests = [ 50, 1, 28, 20, 102, 86, 70, 38, 50, 19, 11, 4, 56, 77, 40, 80, 45, 127, 4, 87, 125, 26, 63, 11 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'int64'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'int64'} } }, 'operators': [{ @@ -958,7 +956,7 @@ const castTests = [ 50, 1, 28, 20, 102, 86, 70, 38, 50, 19, 11, 4, 56, 77, 40, 80, 45, 127, 4, 87, 125, 26, 63, 11 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float16'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} } } } @@ -972,7 +970,7 @@ const castTests = [ 50, 1, 28, 20, 102, 86, 70, 38, 50, 19, 11, 4, 56, 77, 40, 80, 45, 127, 4, 87, 125, 26, 63, 11 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'int64'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'int64'} } }, 'operators': [{ @@ -986,7 +984,7 @@ const castTests = [ 50, 1, 28, 20, 102, 86, 70, 38, 50, 19, 11, 4, 56, 77, 40, 80, 45, 127, 4, 87, 125, 26, 63, 11 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'int32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'int32'} } } } @@ -1000,7 +998,7 @@ const castTests = [ 50, 1, 28, 20, 102, 86, 70, 38, 50, 19, 11, 4, 56, 77, 40, 80, 45, 127, 4, 87, 125, 26, 63, 11 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'int64'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'int64'} } }, 'operators': [{ @@ -1014,7 +1012,7 @@ const castTests = [ 50, 1, 28, 20, 102, 86, 70, 38, 50, 19, 11, 4, 56, 77, 40, 80, 45, 127, 4, 87, 125, 26, 63, 11 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint32'} } } } @@ -1028,7 +1026,7 @@ const castTests = [ 50, 1, 28, 20, 102, 86, 70, 38, 50, 19, 11, 4, 56, 77, 40, 80, 45, 127, 4, 87, 125, 26, 63, 11 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'int64'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'int64'} } }, 'operators': [{ @@ -1042,7 +1040,7 @@ const castTests = [ 50, 1, 28, 20, 102, 86, 70, 38, 50, 19, 11, 4, 56, 77, 40, 80, 45, 127, 4, 87, 125, 26, 63, 11 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'int8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'int8'} } } } @@ -1056,7 +1054,7 @@ const castTests = [ 50, 1, 28, 20, 102, 86, 70, 38, 50, 19, 11, 4, 56, 77, 40, 80, 45, 127, 4, 87, 125, 26, 63, 11 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'int64'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'int64'} } }, 'operators': [{ @@ -1070,7 +1068,7 @@ const castTests = [ 50, 1, 28, 20, 102, 86, 70, 38, 50, 19, 11, 4, 56, 77, 40, 80, 45, 127, 4, 87, 125, 26, 63, 11 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } @@ -1084,7 +1082,7 @@ const castTests = [ 123, 17, 31, 77, 88, 44, 84, 40, 14, 64, 109, 4, 2, 0, 45, 47, 72, 88, 82, 4, 73, 36, 65, 117 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'int8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'int8'} } }, 'operators': [{ @@ -1098,7 +1096,7 @@ const castTests = [ 123, 17, 31, 77, 88, 44, 84, 40, 14, 64, 109, 4, 2, 0, 45, 47, 72, 88, 82, 4, 73, 36, 65, 117 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -1112,7 +1110,7 @@ const castTests = [ 123, 17, 31, 77, 88, 44, 84, 40, 14, 64, 109, 4, 2, 0, 45, 47, 72, 88, 82, 4, 73, 36, 65, 117 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'int8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'int8'} } }, 'operators': [{ @@ -1126,7 +1124,7 @@ const castTests = [ 123, 17, 31, 77, 88, 44, 84, 40, 14, 64, 109, 4, 2, 0, 45, 47, 72, 88, 82, 4, 73, 36, 65, 117 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float16'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} } } } @@ -1140,7 +1138,7 @@ const castTests = [ 123, 17, 31, 77, 88, 44, 84, 40, 14, 64, 109, 4, 2, 0, 45, 47, 72, 88, 82, 4, 73, 36, 65, 117 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'int8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'int8'} } }, 'operators': [{ @@ -1154,7 +1152,7 @@ const castTests = [ 123, 17, 31, 77, 88, 44, 84, 40, 14, 64, 109, 4, 2, 0, 45, 47, 72, 88, 82, 4, 73, 36, 65, 117 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'int32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'int32'} } } } @@ -1168,7 +1166,7 @@ const castTests = [ 123, 17, 31, 77, 88, 44, 84, 40, 14, 64, 109, 4, 2, 0, 45, 47, 72, 88, 82, 4, 73, 36, 65, 117 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'int8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'int8'} } }, 'operators': [{ @@ -1182,7 +1180,7 @@ const castTests = [ 123, 17, 31, 77, 88, 44, 84, 40, 14, 64, 109, 4, 2, 0, 45, 47, 72, 88, 82, 4, 73, 36, 65, 117 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint32'} } } } @@ -1196,7 +1194,7 @@ const castTests = [ 123, 17, 31, 77, 88, 44, 84, 40, 14, 64, 109, 4, 2, 0, 45, 47, 72, 88, 82, 4, 73, 36, 65, 117 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'int8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'int8'} } }, 'operators': [{ @@ -1211,7 +1209,7 @@ const castTests = [ '14', '64', '109', '4', '2', '0', '45', '47', '72', '88', '82', '4', '73', '36', '65', '117' ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'int64'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'int64'} } } } @@ -1225,7 +1223,7 @@ const castTests = [ 123, 17, 31, 77, 88, 44, 84, 40, 14, 64, 109, 4, 2, 0, 45, 47, 72, 88, 82, 4, 73, 36, 65, 117 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'int8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'int8'} } }, 'operators': [{ @@ -1239,7 +1237,7 @@ const castTests = [ 123, 17, 31, 77, 88, 44, 84, 40, 14, 64, 109, 4, 2, 0, 45, 47, 72, 88, 82, 4, 73, 36, 65, 117 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } @@ -1253,7 +1251,7 @@ const castTests = [ 10, 112, 121, 120, 22, 105, 41, 30, 75, 121, 55, 47, 121, 24, 16, 33, 97, 24, 3, 37, 45, 6, 56, 57 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } }, 'operators': [{ @@ -1267,7 +1265,7 @@ const castTests = [ 10, 112, 121, 120, 22, 105, 41, 30, 75, 121, 55, 47, 121, 24, 16, 33, 97, 24, 3, 37, 45, 6, 56, 57 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -1281,7 +1279,7 @@ const castTests = [ 10, 112, 121, 120, 22, 105, 41, 30, 75, 121, 55, 47, 121, 24, 16, 33, 97, 24, 3, 37, 45, 6, 56, 57 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } }, 'operators': [{ @@ -1295,7 +1293,7 @@ const castTests = [ 10, 112, 121, 120, 22, 105, 41, 30, 75, 121, 55, 47, 121, 24, 16, 33, 97, 24, 3, 37, 45, 6, 56, 57 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float16'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} } } } @@ -1309,7 +1307,7 @@ const castTests = [ 10, 112, 121, 120, 22, 105, 41, 30, 75, 121, 55, 47, 121, 24, 16, 33, 97, 24, 3, 37, 45, 6, 56, 57 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } }, 'operators': [{ @@ -1323,7 +1321,7 @@ const castTests = [ 10, 112, 121, 120, 22, 105, 41, 30, 75, 121, 55, 47, 121, 24, 16, 33, 97, 24, 3, 37, 45, 6, 56, 57 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'int32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'int32'} } } } @@ -1337,7 +1335,7 @@ const castTests = [ 10, 112, 121, 120, 22, 105, 41, 30, 75, 121, 55, 47, 121, 24, 16, 33, 97, 24, 3, 37, 45, 6, 56, 57 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } }, 'operators': [{ @@ -1351,7 +1349,7 @@ const castTests = [ 10, 112, 121, 120, 22, 105, 41, 30, 75, 121, 55, 47, 121, 24, 16, 33, 97, 24, 3, 37, 45, 6, 56, 57 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint32'} } } } @@ -1365,7 +1363,7 @@ const castTests = [ 10, 112, 121, 120, 22, 105, 41, 30, 75, 121, 55, 47, 121, 24, 16, 33, 97, 24, 3, 37, 45, 6, 56, 57 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } }, 'operators': [{ @@ -1380,7 +1378,7 @@ const castTests = [ '75', '121', '55', '47', '121', '24', '16', '33', '97', '24', '3', '37', '45', '6', '56', '57' ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'int64'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'int64'} } } } @@ -1394,7 +1392,7 @@ const castTests = [ 10, 112, 121, 120, 22, 105, 41, 30, 75, 121, 55, 47, 121, 24, 16, 33, 97, 24, 3, 37, 45, 6, 56, 57 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } }, 'operators': [{ @@ -1408,7 +1406,7 @@ const castTests = [ 10, 112, 121, 120, 22, 105, 41, 30, 75, 121, 55, 47, 121, 24, 16, 33, 97, 24, 3, 37, 45, 6, 56, 57 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'int8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'int8'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/ceil.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/ceil.https.any.js index 2e490bd1ecb0..93549ad3cfed 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/ceil.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/ceil.https.any.js @@ -28,7 +28,7 @@ const ceilTests = [ 'inputs': { 'ceilInput': { 'data': [67.38941955566406], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -37,10 +37,8 @@ const ceilTests = [ 'outputs': 'ceilOutput' }], 'expectedOutputs': { - 'ceilOutput': { - 'data': [68], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} - } + 'ceilOutput': + {'data': [68], 'descriptor': {shape: [], dataType: 'float32'}} } } }, @@ -59,7 +57,7 @@ const ceilTests = [ 69.71428680419922, 5.0031023025512695, 84.36833953857422, -9.390542030334473, -27.856616973876953, -34.895931243896484 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -73,7 +71,7 @@ const ceilTests = [ 68, 37, 100, -22, 33, 18, 6, 13, 84, -29, 20, 66, 27, 25, -48, -5, 62, -87, 70, 6, 85, -9, -27, -34 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -93,7 +91,7 @@ const ceilTests = [ 69.71428680419922, 5.0031023025512695, 84.36833953857422, -9.390542030334473, -27.856616973876953, -34.895931243896484 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -107,7 +105,7 @@ const ceilTests = [ 68, 37, 100, -22, 33, 18, 6, 13, 84, -29, 20, 66, 27, 25, -48, -5, 62, -87, 70, 6, 85, -9, -27, -34 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -127,7 +125,7 @@ const ceilTests = [ 69.71428680419922, 5.0031023025512695, 84.36833953857422, -9.390542030334473, -27.856616973876953, -34.895931243896484 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -141,7 +139,7 @@ const ceilTests = [ 68, 37, 100, -22, 33, 18, 6, 13, 84, -29, 20, 66, 27, 25, -48, -5, 62, -87, 70, 6, 85, -9, -27, -34 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -161,7 +159,7 @@ const ceilTests = [ 69.71428680419922, 5.0031023025512695, 84.36833953857422, -9.390542030334473, -27.856616973876953, -34.895931243896484 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -175,7 +173,7 @@ const ceilTests = [ 68, 37, 100, -22, 33, 18, 6, 13, 84, -29, 20, 66, 27, 25, -48, -5, 62, -87, 70, 6, 85, -9, -27, -34 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -195,7 +193,7 @@ const ceilTests = [ 69.71428680419922, 5.0031023025512695, 84.36833953857422, -9.390542030334473, -27.856616973876953, -34.895931243896484 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -209,7 +207,7 @@ const ceilTests = [ 68, 37, 100, -22, 33, 18, 6, 13, 84, -29, 20, 66, 27, 25, -48, -5, 62, -87, 70, 6, 85, -9, -27, -34 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -229,7 +227,7 @@ const ceilTests = [ 69.71428680419922, 5.0031023025512695, 84.36833953857422, -9.390542030334473, -27.856616973876953, -34.895931243896484 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } }, 'operators': [{ @@ -243,7 +241,7 @@ const ceilTests = [ 68, 37, 100, -22, 33, 18, 6, 13, 84, -29, 20, 66, 27, 25, -48, -5, 62, -87, 70, 6, 85, -9, -27, -34 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/clamp.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/clamp.https.any.js index 115ddabc6d66..ea3ba9034c0d 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/clamp.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/clamp.https.any.js @@ -34,7 +34,7 @@ const clampTests = [ 'inputs': { 'clampInput': { 'data': [-9.817828178405762], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -45,7 +45,7 @@ const clampTests = [ 'expectedOutputs': { 'clampOutput': { 'data': [-9.817828178405762], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -65,7 +65,7 @@ const clampTests = [ -2.3130595684051514, 9.549695014953613, 5.788925647735596, 5.549378395080566, 7.409400463104248, -2.123614549636841 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -86,7 +86,7 @@ const clampTests = [ -2.3130595684051514, 9.549695014953613, 5.788925647735596, 5.549378395080566, 7.409400463104248, -2.123614549636841 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -106,7 +106,7 @@ const clampTests = [ -2.3130595684051514, 9.549695014953613, 5.788925647735596, 5.549378395080566, 7.409400463104248, -2.123614549636841 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -126,7 +126,7 @@ const clampTests = [ -2.3130595684051514, 9.549695014953613, 5.788925647735596, 5.549378395080566, 7.409400463104248, -2.123614549636841 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -146,7 +146,7 @@ const clampTests = [ -2.3130595684051514, 9.549695014953613, 5.788925647735596, 5.549378395080566, 7.409400463104248, -2.123614549636841 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -166,7 +166,7 @@ const clampTests = [ -2.3130595684051514, 9.549695014953613, 5.788925647735596, 5.549378395080566, 7.409400463104248, -2.123614549636841 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -186,7 +186,7 @@ const clampTests = [ -2.3130595684051514, 9.549695014953613, 5.788925647735596, 5.549378395080566, 7.409400463104248, -2.123614549636841 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -206,7 +206,7 @@ const clampTests = [ -2.3130595684051514, 9.549695014953613, 5.788925647735596, 5.549378395080566, 7.409400463104248, -2.123614549636841 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -226,7 +226,7 @@ const clampTests = [ -2.3130595684051514, 9.549695014953613, 5.788925647735596, 5.549378395080566, 7.409400463104248, -2.123614549636841 ], - 'descriptor': {'dimensions': [3, 2, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 2, 2, 2], dataType: 'float32'} } }, 'operators': [{ @@ -246,7 +246,7 @@ const clampTests = [ -2.3130595684051514, 9.549695014953613, 5.788925647735596, 5.549378395080566, 7.409400463104248, -2.123614549636841 ], - 'descriptor': {'dimensions': [3, 2, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 2, 2, 2], dataType: 'float32'} } } } @@ -266,7 +266,7 @@ const clampTests = [ -2.3130595684051514, 9.549695014953613, 5.788925647735596, 5.549378395080566, 7.409400463104248, -2.123614549636841 ], - 'descriptor': {'dimensions': [4, 1, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [4, 1, 1, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -286,7 +286,7 @@ const clampTests = [ -2.3130595684051514, 9.549695014953613, 5.788925647735596, 5.549378395080566, 7.409400463104248, -2.123614549636841 ], - 'descriptor': {'dimensions': [4, 1, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [4, 1, 1, 2, 3], dataType: 'float32'} } } } @@ -307,7 +307,7 @@ const clampTests = [ -2.3130595684051514, 9.549695014953613, 5.788925647735596, 5.549378395080566, 7.409400463104248, -2.123614549636841 ], - 'descriptor': {'dimensions': [2, 1, 4, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 3], dataType: 'float32'} } }, 'operators': [{ @@ -343,7 +343,7 @@ const clampTests = [ 7.409400463104248, -1 ], - 'descriptor': {'dimensions': [2, 1, 4, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 3], dataType: 'float32'} } } } @@ -364,7 +364,7 @@ const clampTests = [ -2.3130595684051514, 9.549695014953613, 5.788925647735596, 5.549378395080566, 7.409400463104248, -2.123614549636841 ], - 'descriptor': {'dimensions': [6, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [6, 2, 2], dataType: 'float32'} } }, 'operators': [{ @@ -400,7 +400,7 @@ const clampTests = [ 7.409400463104248, 0 ], - 'descriptor': {'dimensions': [6, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [6, 2, 2], dataType: 'float32'} } } } @@ -421,7 +421,7 @@ const clampTests = [ -2.3130595684051514, 9.549695014953613, 5.788925647735596, 5.549378395080566, 7.409400463104248, -2.123614549636841 ], - 'descriptor': {'dimensions': [3, 8], 'dataType': 'float32'} + 'descriptor': {shape: [3, 8], dataType: 'float32'} } }, 'operators': [{ @@ -457,7 +457,7 @@ const clampTests = [ 7.409400463104248, 1 ], - 'descriptor': {'dimensions': [3, 8], 'dataType': 'float32'} + 'descriptor': {shape: [3, 8], dataType: 'float32'} } } } @@ -478,7 +478,7 @@ const clampTests = [ -2.3130595684051514, 9.549695014953613, 5.788925647735596, 5.549378395080566, 7.409400463104248, -2.123614549636841 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -514,7 +514,7 @@ const clampTests = [ -2, -2.123614549636841 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} } } } @@ -535,7 +535,7 @@ const clampTests = [ -2.3130595684051514, 9.549695014953613, 5.788925647735596, 5.549378395080566, 7.409400463104248, -2.123614549636841 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -571,7 +571,7 @@ const clampTests = [ 0, -2.123614549636841 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -592,7 +592,7 @@ const clampTests = [ -2.3130595684051514, 9.549695014953613, 5.788925647735596, 5.549378395080566, 7.409400463104248, -2.123614549636841 ], - 'descriptor': {'dimensions': [3, 4, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4, 2], dataType: 'float32'} } }, 'operators': [{ @@ -628,7 +628,7 @@ const clampTests = [ 3, -2.123614549636841 ], - 'descriptor': {'dimensions': [3, 4, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4, 2], dataType: 'float32'} } } } @@ -649,7 +649,7 @@ const clampTests = [ -2.3130595684051514, 9.549695014953613, 5.788925647735596, 5.549378395080566, 7.409400463104248, -2.123614549636841 ], - 'descriptor': {'dimensions': [3, 2, 1, 1, 4], 'dataType': 'float32'} + 'descriptor': {shape: [3, 2, 1, 1, 4], dataType: 'float32'} } }, 'operators': [{ @@ -687,7 +687,7 @@ const clampTests = [ -1, -2.123614549636841 ], - 'descriptor': {'dimensions': [3, 2, 1, 1, 4], 'dataType': 'float32'} + 'descriptor': {shape: [3, 2, 1, 1, 4], dataType: 'float32'} } } } @@ -708,7 +708,7 @@ const clampTests = [ -2.3130595684051514, 9.549695014953613, 5.788925647735596, 5.549378395080566, 7.409400463104248, -2.123614549636841 ], - 'descriptor': {'dimensions': [1, 4, 3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 4, 3, 2], dataType: 'float32'} } }, 'operators': [{ @@ -746,7 +746,7 @@ const clampTests = [ 0, -2.123614549636841 ], - 'descriptor': {'dimensions': [1, 4, 3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 4, 3, 2], dataType: 'float32'} } } } @@ -767,7 +767,7 @@ const clampTests = [ -2.3130595684051514, 9.549695014953613, 5.788925647735596, 5.549378395080566, 7.409400463104248, -2.123614549636841 ], - 'descriptor': {'dimensions': [2, 6, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 6, 2], dataType: 'float32'} } }, 'operators': [{ @@ -805,7 +805,7 @@ const clampTests = [ 4, -2.123614549636841 ], - 'descriptor': {'dimensions': [2, 6, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 6, 2], dataType: 'float32'} } } } @@ -826,7 +826,7 @@ const clampTests = [ -2.3130595684051514, 9.549695014953613, 5.788925647735596, 5.549378395080566, 7.409400463104248, -2.123614549636841 ], - 'descriptor': {'dimensions': [6, 4], 'dataType': 'float32'} + 'descriptor': {shape: [6, 4], dataType: 'float32'} } }, 'operators': [{ @@ -864,7 +864,7 @@ const clampTests = [ 6, 0 ], - 'descriptor': {'dimensions': [6, 4], 'dataType': 'float32'} + 'descriptor': {shape: [6, 4], dataType: 'float32'} } } } @@ -885,7 +885,7 @@ const clampTests = [ -2.3130595684051514, 9.549695014953613, 5.788925647735596, 5.549378395080566, 7.409400463104248, -2.123614549636841 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -923,7 +923,7 @@ const clampTests = [ 7, 2 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/compute-arraybufferview-with-bigger-arraybuffer.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/compute-arraybufferview-with-bigger-arraybuffer.https.any.js index e1e647ee50cf..c150992ca64f 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/compute-arraybufferview-with-bigger-arraybuffer.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/compute-arraybufferview-with-bigger-arraybuffer.https.any.js @@ -27,7 +27,7 @@ if (navigator.ml) { promise_test(async t => { const builder = new MLGraphBuilder(context); - const a = builder.input('a', {dataType: 'float32', dimensions: [2]}); + const a = builder.input('a', {dataType: 'float32', shape: [2]}); const b = builder.relu(a); const graph = await builder.build({b}); const arraybuffer = new ArrayBuffer(100); @@ -43,7 +43,7 @@ if (navigator.ml) { promise_test(async t => { const builder = new MLGraphBuilder(context); - const a = builder.input('a', {dataType: 'float32', dimensions: [2]}); + const a = builder.input('a', {dataType: 'float32', shape: [2]}); const b = builder.relu(a); const graph = await builder.build({b}); const aBuffer = new Float32Array(2); diff --git a/testing/web-platform/tests/webnn/conformance_tests/concat.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/concat.https.any.js index 6beb089e84ef..45f88627493f 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/concat.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/concat.https.any.js @@ -82,7 +82,7 @@ const concatTests = [ -0.44735023379325867, 0.11028251051902771, -0.5945112705230713, -0.402848482131958, -0.9531654119491577, -0.6731740236282349 ], - 'descriptor': {'dimensions': [12], 'dataType': 'float32'}, + 'descriptor': {shape: [12], dataType: 'float32'}, 'constant': true }, 'concatInput2': { @@ -92,7 +92,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [12], 'dataType': 'float32'}, + 'descriptor': {shape: [12], dataType: 'float32'}, 'constant': true } }, @@ -114,7 +114,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -130,7 +130,7 @@ const concatTests = [ -0.44735023379325867, 0.11028251051902771, -0.5945112705230713, -0.402848482131958, -0.9531654119491577, -0.6731740236282349 ], - 'descriptor': {'dimensions': [12], 'dataType': 'float32'} + 'descriptor': {shape: [12], dataType: 'float32'} }, 'concatInput2': { 'data': [ @@ -139,7 +139,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [12], 'dataType': 'float32'} + 'descriptor': {shape: [12], dataType: 'float32'} } }, 'operators': [{ @@ -160,7 +160,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -176,7 +176,7 @@ const concatTests = [ -0.44735023379325867, 0.11028251051902771, -0.5945112705230713, -0.402848482131958, -0.9531654119491577, -0.6731740236282349 ], - 'descriptor': {'dimensions': [12], 'dataType': 'float16'} + 'descriptor': {shape: [12], dataType: 'float16'} }, 'concatInput2': { 'data': [ @@ -185,7 +185,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [12], 'dataType': 'float16'} + 'descriptor': {shape: [12], dataType: 'float16'} } }, 'operators': [{ @@ -204,7 +204,7 @@ const concatTests = [ -0.720703125, -0.79931640625, 0.66552734375, 0.038848876953125, 0.51806640625, -0.8740234375, -0.47900390625, 0.12115478515625 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float16'} + 'descriptor': {shape: [24], dataType: 'float16'} } } } @@ -219,7 +219,7 @@ const concatTests = [ -0.3944413363933563, 0.861982524394989, 0.337996244430542, -0.990639865398407 ], - 'descriptor': {'dimensions': [4], 'dataType': 'float32'} + 'descriptor': {shape: [4], dataType: 'float32'} }, 'concatInput2': { 'data': [ @@ -227,7 +227,7 @@ const concatTests = [ 0.11028251051902771, -0.5945112705230713, -0.402848482131958, -0.9531654119491577, -0.6731740236282349 ], - 'descriptor': {'dimensions': [8], 'dataType': 'float32'} + 'descriptor': {shape: [8], dataType: 'float32'} }, 'concatInput3': { 'data': [ @@ -236,7 +236,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [12], 'dataType': 'float32'} + 'descriptor': {shape: [12], dataType: 'float32'} } }, 'operators': [{ @@ -259,7 +259,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -274,7 +274,7 @@ const concatTests = [ -0.3944413363933563, 0.861982524394989, 0.337996244430542, -0.990639865398407 ], - 'descriptor': {'dimensions': [4], 'dataType': 'float16'} + 'descriptor': {shape: [4], dataType: 'float16'} }, 'concatInput2': { 'data': [ @@ -282,7 +282,7 @@ const concatTests = [ 0.11028251051902771, -0.5945112705230713, -0.402848482131958, -0.9531654119491577, -0.6731740236282349 ], - 'descriptor': {'dimensions': [8], 'dataType': 'float16'} + 'descriptor': {shape: [8], dataType: 'float16'} }, 'concatInput3': { 'data': [ @@ -291,7 +291,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [12], 'dataType': 'float16'} + 'descriptor': {shape: [12], dataType: 'float16'} } }, 'operators': [{ @@ -312,7 +312,7 @@ const concatTests = [ -0.720703125, -0.79931640625, 0.66552734375, 0.038848876953125, 0.51806640625, -0.8740234375, -0.47900390625, 0.12115478515625 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float16'} + 'descriptor': {shape: [24], dataType: 'float16'} } } } @@ -326,28 +326,28 @@ const concatTests = [ -0.3944413363933563, 0.861982524394989, 0.337996244430542, -0.990639865398407, 0.576785683631897, 0.32276400923728943 ], - 'descriptor': {'dimensions': [6], 'dataType': 'float32'} + 'descriptor': {shape: [6], dataType: 'float32'} }, 'concatInput2': { 'data': [ -0.44735023379325867, 0.11028251051902771, -0.5945112705230713, -0.402848482131958, -0.9531654119491577, -0.6731740236282349 ], - 'descriptor': {'dimensions': [6], 'dataType': 'float32'} + 'descriptor': {shape: [6], dataType: 'float32'} }, 'concatInput3': { 'data': [ 0.49189892411231995, -0.15864109992980957, -0.3418811559677124, -0.9158143401145935, -0.7206121683120728, -0.7993468642234802 ], - 'descriptor': {'dimensions': [6], 'dataType': 'float32'} + 'descriptor': {shape: [6], dataType: 'float32'} }, 'concatInput4': { 'data': [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [6], 'dataType': 'float32'} + 'descriptor': {shape: [6], dataType: 'float32'} } }, 'operators': [{ @@ -373,7 +373,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -387,28 +387,28 @@ const concatTests = [ -0.3944413363933563, 0.861982524394989, 0.337996244430542, -0.990639865398407, 0.576785683631897, 0.32276400923728943 ], - 'descriptor': {'dimensions': [6], 'dataType': 'float16'} + 'descriptor': {shape: [6], dataType: 'float16'} }, 'concatInput2': { 'data': [ -0.44735023379325867, 0.11028251051902771, -0.5945112705230713, -0.402848482131958, -0.9531654119491577, -0.6731740236282349 ], - 'descriptor': {'dimensions': [6], 'dataType': 'float16'} + 'descriptor': {shape: [6], dataType: 'float16'} }, 'concatInput3': { 'data': [ 0.49189892411231995, -0.15864109992980957, -0.3418811559677124, -0.9158143401145935, -0.7206121683120728, -0.7993468642234802 ], - 'descriptor': {'dimensions': [6], 'dataType': 'float16'} + 'descriptor': {shape: [6], dataType: 'float16'} }, 'concatInput4': { 'data': [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [6], 'dataType': 'float16'} + 'descriptor': {shape: [6], dataType: 'float16'} } }, 'operators': [{ @@ -432,7 +432,7 @@ const concatTests = [ -0.720703125, -0.79931640625, 0.66552734375, 0.038848876953125, 0.51806640625, -0.8740234375, -0.47900390625, 0.12115478515625 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float16'} + 'descriptor': {shape: [24], dataType: 'float16'} } } } @@ -444,14 +444,14 @@ const concatTests = [ 'inputs': { 'concatInput1': { 'data': [-0.3944413363933563, 0.861982524394989], - 'descriptor': {'dimensions': [2], 'dataType': 'float32'} + 'descriptor': {shape: [2], dataType: 'float32'} }, 'concatInput2': { 'data': [ 0.337996244430542, -0.990639865398407, 0.576785683631897, 0.32276400923728943 ], - 'descriptor': {'dimensions': [4], 'dataType': 'float32'} + 'descriptor': {shape: [4], dataType: 'float32'} }, 'concatInput3': { 'data': [ @@ -459,7 +459,7 @@ const concatTests = [ -0.402848482131958, -0.9531654119491577, -0.6731740236282349, 0.49189892411231995, -0.15864109992980957 ], - 'descriptor': {'dimensions': [8], 'dataType': 'float32'} + 'descriptor': {shape: [8], dataType: 'float32'} }, 'concatInput4': { 'data': [ @@ -468,7 +468,7 @@ const concatTests = [ 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [10], 'dataType': 'float32'} + 'descriptor': {shape: [10], dataType: 'float32'} } }, 'operators': [{ @@ -494,7 +494,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -506,14 +506,14 @@ const concatTests = [ 'inputs': { 'concatInput1': { 'data': [-0.3944413363933563, 0.861982524394989], - 'descriptor': {'dimensions': [2], 'dataType': 'float16'} + 'descriptor': {shape: [2], dataType: 'float16'} }, 'concatInput2': { 'data': [ 0.337996244430542, -0.990639865398407, 0.576785683631897, 0.32276400923728943 ], - 'descriptor': {'dimensions': [4], 'dataType': 'float16'} + 'descriptor': {shape: [4], dataType: 'float16'} }, 'concatInput3': { 'data': [ @@ -521,7 +521,7 @@ const concatTests = [ -0.402848482131958, -0.9531654119491577, -0.6731740236282349, 0.49189892411231995, -0.15864109992980957 ], - 'descriptor': {'dimensions': [8], 'dataType': 'float16'} + 'descriptor': {shape: [8], dataType: 'float16'} }, 'concatInput4': { 'data': [ @@ -530,7 +530,7 @@ const concatTests = [ 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [10], 'dataType': 'float16'} + 'descriptor': {shape: [10], dataType: 'float16'} } }, 'operators': [{ @@ -554,7 +554,7 @@ const concatTests = [ -0.720703125, -0.79931640625, 0.66552734375, 0.038848876953125, 0.51806640625, -0.8740234375, -0.47900390625, 0.12115478515625 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float16'} + 'descriptor': {shape: [24], dataType: 'float16'} } } } @@ -570,7 +570,7 @@ const concatTests = [ -0.44735023379325867, 0.11028251051902771, -0.5945112705230713, -0.402848482131958, -0.9531654119491577, -0.6731740236282349 ], - 'descriptor': {'dimensions': [2, 6], 'dataType': 'float32'} + 'descriptor': {shape: [2, 6], dataType: 'float32'} }, 'concatInput2': { 'data': [ @@ -579,7 +579,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [2, 6], 'dataType': 'float32'} + 'descriptor': {shape: [2, 6], dataType: 'float32'} } }, 'operators': [{ @@ -600,7 +600,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -616,7 +616,7 @@ const concatTests = [ -0.44735023379325867, 0.11028251051902771, -0.5945112705230713, -0.402848482131958, -0.9531654119491577, -0.6731740236282349 ], - 'descriptor': {'dimensions': [2, 6], 'dataType': 'float16'} + 'descriptor': {shape: [2, 6], dataType: 'float16'} }, 'concatInput2': { 'data': [ @@ -625,7 +625,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [2, 6], 'dataType': 'float16'} + 'descriptor': {shape: [2, 6], dataType: 'float16'} } }, 'operators': [{ @@ -644,7 +644,7 @@ const concatTests = [ -0.720703125, -0.79931640625, 0.66552734375, 0.038848876953125, 0.51806640625, -0.8740234375, -0.47900390625, 0.12115478515625 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float16'} + 'descriptor': {shape: [4, 6], dataType: 'float16'} } } } @@ -659,7 +659,7 @@ const concatTests = [ -0.3944413363933563, 0.861982524394989, 0.337996244430542, -0.990639865398407, 0.576785683631897, 0.32276400923728943 ], - 'descriptor': {'dimensions': [1, 6], 'dataType': 'float32'} + 'descriptor': {shape: [1, 6], dataType: 'float32'} }, 'concatInput2': { 'data': [ @@ -670,7 +670,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [3, 6], 'dataType': 'float32'} + 'descriptor': {shape: [3, 6], dataType: 'float32'} } }, 'operators': [{ @@ -691,7 +691,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -706,7 +706,7 @@ const concatTests = [ -0.3944413363933563, 0.861982524394989, 0.337996244430542, -0.990639865398407, 0.576785683631897, 0.32276400923728943 ], - 'descriptor': {'dimensions': [1, 6], 'dataType': 'float16'} + 'descriptor': {shape: [1, 6], dataType: 'float16'} }, 'concatInput2': { 'data': [ @@ -717,7 +717,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [3, 6], 'dataType': 'float16'} + 'descriptor': {shape: [3, 6], dataType: 'float16'} } }, 'operators': [{ @@ -736,7 +736,7 @@ const concatTests = [ -0.720703125, -0.79931640625, 0.66552734375, 0.038848876953125, 0.51806640625, -0.8740234375, -0.47900390625, 0.12115478515625 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float16'} + 'descriptor': {shape: [4, 6], dataType: 'float16'} } } } @@ -750,28 +750,28 @@ const concatTests = [ -0.3944413363933563, 0.861982524394989, 0.337996244430542, -0.990639865398407, 0.576785683631897, 0.32276400923728943 ], - 'descriptor': {'dimensions': [3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 2], dataType: 'float32'} }, 'concatInput2': { 'data': [ -0.44735023379325867, 0.11028251051902771, -0.5945112705230713, -0.402848482131958, -0.9531654119491577, -0.6731740236282349 ], - 'descriptor': {'dimensions': [3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 2], dataType: 'float32'} }, 'concatInput3': { 'data': [ 0.49189892411231995, -0.15864109992980957, -0.3418811559677124, -0.9158143401145935, -0.7206121683120728, -0.7993468642234802 ], - 'descriptor': {'dimensions': [3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 2], dataType: 'float32'} }, 'concatInput4': { 'data': [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 2], dataType: 'float32'} } }, 'operators': [{ @@ -797,7 +797,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [12, 2], 'dataType': 'float32'} + 'descriptor': {shape: [12, 2], dataType: 'float32'} } } } @@ -811,28 +811,28 @@ const concatTests = [ -0.3944413363933563, 0.861982524394989, 0.337996244430542, -0.990639865398407, 0.576785683631897, 0.32276400923728943 ], - 'descriptor': {'dimensions': [3, 2], 'dataType': 'float16'} + 'descriptor': {shape: [3, 2], dataType: 'float16'} }, 'concatInput2': { 'data': [ -0.44735023379325867, 0.11028251051902771, -0.5945112705230713, -0.402848482131958, -0.9531654119491577, -0.6731740236282349 ], - 'descriptor': {'dimensions': [3, 2], 'dataType': 'float16'} + 'descriptor': {shape: [3, 2], dataType: 'float16'} }, 'concatInput3': { 'data': [ 0.49189892411231995, -0.15864109992980957, -0.3418811559677124, -0.9158143401145935, -0.7206121683120728, -0.7993468642234802 ], - 'descriptor': {'dimensions': [3, 2], 'dataType': 'float16'} + 'descriptor': {shape: [3, 2], dataType: 'float16'} }, 'concatInput4': { 'data': [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [3, 2], 'dataType': 'float16'} + 'descriptor': {shape: [3, 2], dataType: 'float16'} } }, 'operators': [{ @@ -856,7 +856,7 @@ const concatTests = [ -0.720703125, -0.79931640625, 0.66552734375, 0.038848876953125, 0.51806640625, -0.8740234375, -0.47900390625, 0.12115478515625 ], - 'descriptor': {'dimensions': [12, 2], 'dataType': 'float16'} + 'descriptor': {shape: [12, 2], dataType: 'float16'} } } } @@ -876,14 +876,14 @@ const concatTests = [ -0.9158143401145935, -0.7206121683120728, -0.7993468642234802, 0.6653800010681152, 0.03886038810014725 ], - 'descriptor': {'dimensions': [2, 10], 'dataType': 'float32'} + 'descriptor': {shape: [2, 10], dataType: 'float32'} }, 'concatInput2': { 'data': [ 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} } }, 'operators': [{ @@ -904,7 +904,7 @@ const concatTests = [ -0.7206121683120728, -0.7993468642234802, 0.6653800010681152, 0.03886038810014725, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [2, 12], 'dataType': 'float32'} + 'descriptor': {shape: [2, 12], dataType: 'float32'} } } } @@ -924,14 +924,14 @@ const concatTests = [ -0.9158143401145935, -0.7206121683120728, -0.7993468642234802, 0.6653800010681152, 0.03886038810014725 ], - 'descriptor': {'dimensions': [2, 10], 'dataType': 'float16'} + 'descriptor': {shape: [2, 10], dataType: 'float16'} }, 'concatInput2': { 'data': [ 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float16'} + 'descriptor': {shape: [2, 2], dataType: 'float16'} } }, 'operators': [{ @@ -950,7 +950,7 @@ const concatTests = [ -0.341796875, -0.916015625, -0.720703125, -0.79931640625, 0.66552734375, 0.038848876953125, -0.47900390625, 0.12115478515625 ], - 'descriptor': {'dimensions': [2, 12], 'dataType': 'float16'} + 'descriptor': {shape: [2, 12], dataType: 'float16'} } } } @@ -965,7 +965,7 @@ const concatTests = [ -0.990639865398407, 0.576785683631897, 0.32276400923728943, -0.44735023379325867, 0.11028251051902771 ], - 'descriptor': {'dimensions': [4, 2], 'dataType': 'float32'} + 'descriptor': {shape: [4, 2], dataType: 'float32'} }, 'concatInput2': { 'data': [ @@ -973,7 +973,7 @@ const concatTests = [ -0.6731740236282349, 0.49189892411231995, -0.15864109992980957, -0.3418811559677124, -0.9158143401145935 ], - 'descriptor': {'dimensions': [4, 2], 'dataType': 'float32'} + 'descriptor': {shape: [4, 2], dataType: 'float32'} }, 'concatInput3': { 'data': [ @@ -981,7 +981,7 @@ const concatTests = [ 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [4, 2], 'dataType': 'float32'} + 'descriptor': {shape: [4, 2], dataType: 'float32'} } }, 'operators': [{ @@ -1004,7 +1004,7 @@ const concatTests = [ -0.44735023379325867, 0.11028251051902771, -0.3418811559677124, -0.9158143401145935, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -1019,7 +1019,7 @@ const concatTests = [ -0.990639865398407, 0.576785683631897, 0.32276400923728943, -0.44735023379325867, 0.11028251051902771 ], - 'descriptor': {'dimensions': [4, 2], 'dataType': 'float16'} + 'descriptor': {shape: [4, 2], dataType: 'float16'} }, 'concatInput2': { 'data': [ @@ -1027,7 +1027,7 @@ const concatTests = [ -0.6731740236282349, 0.49189892411231995, -0.15864109992980957, -0.3418811559677124, -0.9158143401145935 ], - 'descriptor': {'dimensions': [4, 2], 'dataType': 'float16'} + 'descriptor': {shape: [4, 2], dataType: 'float16'} }, 'concatInput3': { 'data': [ @@ -1035,7 +1035,7 @@ const concatTests = [ 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [4, 2], 'dataType': 'float16'} + 'descriptor': {shape: [4, 2], dataType: 'float16'} } }, 'operators': [{ @@ -1056,7 +1056,7 @@ const concatTests = [ 0.51806640625, -0.8740234375, -0.447265625, 0.11029052734375, -0.341796875, -0.916015625, -0.47900390625, 0.12115478515625 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float16'} + 'descriptor': {shape: [4, 6], dataType: 'float16'} } } } @@ -1068,21 +1068,21 @@ const concatTests = [ 'inputs': { 'concatInput1': { 'data': [-0.3944413363933563, 0.861982524394989, 0.337996244430542], - 'descriptor': {'dimensions': [3, 1], 'dataType': 'float32'} + 'descriptor': {shape: [3, 1], dataType: 'float32'} }, 'concatInput2': { 'data': [ -0.990639865398407, 0.576785683631897, 0.32276400923728943, -0.44735023379325867, 0.11028251051902771, -0.5945112705230713 ], - 'descriptor': {'dimensions': [3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 2], dataType: 'float32'} }, 'concatInput3': { 'data': [ -0.402848482131958, -0.9531654119491577, -0.6731740236282349, 0.49189892411231995, -0.15864109992980957, -0.3418811559677124 ], - 'descriptor': {'dimensions': [3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 2], dataType: 'float32'} }, 'concatInput4': { 'data': [ @@ -1090,7 +1090,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [3, 3], dataType: 'float32'} } }, 'operators': [{ @@ -1116,7 +1116,7 @@ const concatTests = [ -0.5945112705230713, -0.15864109992980957, -0.3418811559677124, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [3, 8], 'dataType': 'float32'} + 'descriptor': {shape: [3, 8], dataType: 'float32'} } } } @@ -1128,21 +1128,21 @@ const concatTests = [ 'inputs': { 'concatInput1': { 'data': [-0.3944413363933563, 0.861982524394989, 0.337996244430542], - 'descriptor': {'dimensions': [3, 1], 'dataType': 'float16'} + 'descriptor': {shape: [3, 1], dataType: 'float16'} }, 'concatInput2': { 'data': [ -0.990639865398407, 0.576785683631897, 0.32276400923728943, -0.44735023379325867, 0.11028251051902771, -0.5945112705230713 ], - 'descriptor': {'dimensions': [3, 2], 'dataType': 'float16'} + 'descriptor': {shape: [3, 2], dataType: 'float16'} }, 'concatInput3': { 'data': [ -0.402848482131958, -0.9531654119491577, -0.6731740236282349, 0.49189892411231995, -0.15864109992980957, -0.3418811559677124 ], - 'descriptor': {'dimensions': [3, 2], 'dataType': 'float16'} + 'descriptor': {shape: [3, 2], dataType: 'float16'} }, 'concatInput4': { 'data': [ @@ -1150,7 +1150,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [3, 3], 'dataType': 'float16'} + 'descriptor': {shape: [3, 3], dataType: 'float16'} } }, 'operators': [{ @@ -1176,7 +1176,7 @@ const concatTests = [ -0.5947265625, -0.15869140625, -0.341796875, -0.8740234375, -0.47900390625, 0.12115478515625 ], - 'descriptor': {'dimensions': [3, 8], 'dataType': 'float16'} + 'descriptor': {shape: [3, 8], dataType: 'float16'} } } } @@ -1191,7 +1191,7 @@ const concatTests = [ -0.3944413363933563, 0.861982524394989, 0.337996244430542, -0.990639865398407, 0.576785683631897, 0.32276400923728943 ], - 'descriptor': {'dimensions': [2, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 3], dataType: 'float32'} }, 'concatInput2': { 'data': [ @@ -1202,7 +1202,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [6, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [6, 1, 3], dataType: 'float32'} } }, 'operators': [{ @@ -1223,7 +1223,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [8, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [8, 1, 3], dataType: 'float32'} } } } @@ -1238,7 +1238,7 @@ const concatTests = [ -0.3944413363933563, 0.861982524394989, 0.337996244430542, -0.990639865398407, 0.576785683631897, 0.32276400923728943 ], - 'descriptor': {'dimensions': [2, 1, 3], 'dataType': 'float16'} + 'descriptor': {shape: [2, 1, 3], dataType: 'float16'} }, 'concatInput2': { 'data': [ @@ -1249,7 +1249,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [6, 1, 3], 'dataType': 'float16'} + 'descriptor': {shape: [6, 1, 3], dataType: 'float16'} } }, 'operators': [{ @@ -1268,7 +1268,7 @@ const concatTests = [ -0.720703125, -0.79931640625, 0.66552734375, 0.038848876953125, 0.51806640625, -0.8740234375, -0.47900390625, 0.12115478515625 ], - 'descriptor': {'dimensions': [8, 1, 3], 'dataType': 'float16'} + 'descriptor': {shape: [8, 1, 3], dataType: 'float16'} } } } @@ -1280,21 +1280,21 @@ const concatTests = [ 'inputs': { 'concatInput1': { 'data': [-0.3944413363933563, 0.861982524394989, 0.337996244430542], - 'descriptor': {'dimensions': [3, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [3, 1, 1], dataType: 'float32'} }, 'concatInput2': { 'data': [ -0.990639865398407, 0.576785683631897, 0.32276400923728943, -0.44735023379325867, 0.11028251051902771, -0.5945112705230713 ], - 'descriptor': {'dimensions': [3, 2, 1], 'dataType': 'float32'} + 'descriptor': {shape: [3, 2, 1], dataType: 'float32'} }, 'concatInput3': { 'data': [ -0.402848482131958, -0.9531654119491577, -0.6731740236282349, 0.49189892411231995, -0.15864109992980957, -0.3418811559677124 ], - 'descriptor': {'dimensions': [3, 2, 1], 'dataType': 'float32'} + 'descriptor': {shape: [3, 2, 1], dataType: 'float32'} }, 'concatInput4': { 'data': [ @@ -1302,7 +1302,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [3, 3, 1], 'dataType': 'float32'} + 'descriptor': {shape: [3, 3, 1], dataType: 'float32'} } }, 'operators': [{ @@ -1328,7 +1328,7 @@ const concatTests = [ -0.5945112705230713, -0.15864109992980957, -0.3418811559677124, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [3, 8, 1], 'dataType': 'float32'} + 'descriptor': {shape: [3, 8, 1], dataType: 'float32'} } } } @@ -1340,21 +1340,21 @@ const concatTests = [ 'inputs': { 'concatInput1': { 'data': [-0.3944413363933563, 0.861982524394989, 0.337996244430542], - 'descriptor': {'dimensions': [3, 1, 1], 'dataType': 'float16'} + 'descriptor': {shape: [3, 1, 1], dataType: 'float16'} }, 'concatInput2': { 'data': [ -0.990639865398407, 0.576785683631897, 0.32276400923728943, -0.44735023379325867, 0.11028251051902771, -0.5945112705230713 ], - 'descriptor': {'dimensions': [3, 2, 1], 'dataType': 'float16'} + 'descriptor': {shape: [3, 2, 1], dataType: 'float16'} }, 'concatInput3': { 'data': [ -0.402848482131958, -0.9531654119491577, -0.6731740236282349, 0.49189892411231995, -0.15864109992980957, -0.3418811559677124 ], - 'descriptor': {'dimensions': [3, 2, 1], 'dataType': 'float16'} + 'descriptor': {shape: [3, 2, 1], dataType: 'float16'} }, 'concatInput4': { 'data': [ @@ -1362,7 +1362,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [3, 3, 1], 'dataType': 'float16'} + 'descriptor': {shape: [3, 3, 1], dataType: 'float16'} } }, 'operators': [{ @@ -1388,7 +1388,7 @@ const concatTests = [ -0.5947265625, -0.15869140625, -0.341796875, -0.8740234375, -0.47900390625, 0.12115478515625 ], - 'descriptor': {'dimensions': [3, 8, 1], 'dataType': 'float16'} + 'descriptor': {shape: [3, 8, 1], dataType: 'float16'} } } } @@ -1403,7 +1403,7 @@ const concatTests = [ -0.990639865398407, 0.576785683631897, 0.32276400923728943, -0.44735023379325867, 0.11028251051902771 ], - 'descriptor': {'dimensions': [2, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2], dataType: 'float32'} }, 'concatInput2': { 'data': [ @@ -1411,7 +1411,7 @@ const concatTests = [ -0.6731740236282349, 0.49189892411231995, -0.15864109992980957, -0.3418811559677124, -0.9158143401145935 ], - 'descriptor': {'dimensions': [2, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2], dataType: 'float32'} }, 'concatInput3': { 'data': [ @@ -1419,7 +1419,7 @@ const concatTests = [ 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [2, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2], dataType: 'float32'} } }, 'operators': [{ @@ -1442,7 +1442,7 @@ const concatTests = [ -0.44735023379325867, 0.11028251051902771, -0.3418811559677124, -0.9158143401145935, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [2, 2, 6], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 6], dataType: 'float32'} } } } @@ -1457,7 +1457,7 @@ const concatTests = [ -0.990639865398407, 0.576785683631897, 0.32276400923728943, -0.44735023379325867, 0.11028251051902771 ], - 'descriptor': {'dimensions': [2, 2, 2], 'dataType': 'float16'} + 'descriptor': {shape: [2, 2, 2], dataType: 'float16'} }, 'concatInput2': { 'data': [ @@ -1465,7 +1465,7 @@ const concatTests = [ -0.6731740236282349, 0.49189892411231995, -0.15864109992980957, -0.3418811559677124, -0.9158143401145935 ], - 'descriptor': {'dimensions': [2, 2, 2], 'dataType': 'float16'} + 'descriptor': {shape: [2, 2, 2], dataType: 'float16'} }, 'concatInput3': { 'data': [ @@ -1473,7 +1473,7 @@ const concatTests = [ 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [2, 2, 2], 'dataType': 'float16'} + 'descriptor': {shape: [2, 2, 2], dataType: 'float16'} } }, 'operators': [{ @@ -1494,7 +1494,7 @@ const concatTests = [ 0.51806640625, -0.8740234375, -0.447265625, 0.11029052734375, -0.341796875, -0.916015625, -0.47900390625, 0.12115478515625 ], - 'descriptor': {'dimensions': [2, 2, 6], 'dataType': 'float16'} + 'descriptor': {shape: [2, 2, 6], dataType: 'float16'} } } } @@ -1509,7 +1509,7 @@ const concatTests = [ -0.3944413363933563, 0.861982524394989, 0.337996244430542, -0.990639865398407, 0.576785683631897, 0.32276400923728943 ], - 'descriptor': {'dimensions': [1, 3, 1, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 1, 2], dataType: 'float32'} }, 'concatInput2': { 'data': [ @@ -1520,7 +1520,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [3, 3, 1, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 3, 1, 2], dataType: 'float32'} } }, 'operators': [{ @@ -1541,7 +1541,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [4, 3, 1, 2], 'dataType': 'float32'} + 'descriptor': {shape: [4, 3, 1, 2], dataType: 'float32'} } } } @@ -1556,7 +1556,7 @@ const concatTests = [ -0.3944413363933563, 0.861982524394989, 0.337996244430542, -0.990639865398407, 0.576785683631897, 0.32276400923728943 ], - 'descriptor': {'dimensions': [1, 3, 1, 2], 'dataType': 'float16'} + 'descriptor': {shape: [1, 3, 1, 2], dataType: 'float16'} }, 'concatInput2': { 'data': [ @@ -1567,7 +1567,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [3, 3, 1, 2], 'dataType': 'float16'} + 'descriptor': {shape: [3, 3, 1, 2], dataType: 'float16'} } }, 'operators': [{ @@ -1586,7 +1586,7 @@ const concatTests = [ -0.720703125, -0.79931640625, 0.66552734375, 0.038848876953125, 0.51806640625, -0.8740234375, -0.47900390625, 0.12115478515625 ], - 'descriptor': {'dimensions': [4, 3, 1, 2], 'dataType': 'float16'} + 'descriptor': {shape: [4, 3, 1, 2], dataType: 'float16'} } } } @@ -1601,7 +1601,7 @@ const concatTests = [ -0.990639865398407, 0.576785683631897, 0.32276400923728943, -0.44735023379325867, 0.11028251051902771 ], - 'descriptor': {'dimensions': [2, 2, 1, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2], dataType: 'float32'} }, 'concatInput2': { 'data': [ @@ -1609,7 +1609,7 @@ const concatTests = [ -0.6731740236282349, 0.49189892411231995, -0.15864109992980957, -0.3418811559677124, -0.9158143401145935 ], - 'descriptor': {'dimensions': [2, 2, 1, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2], dataType: 'float32'} }, 'concatInput3': { 'data': [ @@ -1617,7 +1617,7 @@ const concatTests = [ 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [2, 2, 1, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2], dataType: 'float32'} } }, 'operators': [{ @@ -1640,7 +1640,7 @@ const concatTests = [ -0.3418811559677124, -0.9158143401145935, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [2, 6, 1, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 6, 1, 2], dataType: 'float32'} } } } @@ -1655,7 +1655,7 @@ const concatTests = [ -0.990639865398407, 0.576785683631897, 0.32276400923728943, -0.44735023379325867, 0.11028251051902771 ], - 'descriptor': {'dimensions': [2, 2, 1, 2], 'dataType': 'float16'} + 'descriptor': {shape: [2, 2, 1, 2], dataType: 'float16'} }, 'concatInput2': { 'data': [ @@ -1663,7 +1663,7 @@ const concatTests = [ -0.6731740236282349, 0.49189892411231995, -0.15864109992980957, -0.3418811559677124, -0.9158143401145935 ], - 'descriptor': {'dimensions': [2, 2, 1, 2], 'dataType': 'float16'} + 'descriptor': {shape: [2, 2, 1, 2], dataType: 'float16'} }, 'concatInput3': { 'data': [ @@ -1671,7 +1671,7 @@ const concatTests = [ 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [2, 2, 1, 2], 'dataType': 'float16'} + 'descriptor': {shape: [2, 2, 1, 2], dataType: 'float16'} } }, 'operators': [{ @@ -1692,7 +1692,7 @@ const concatTests = [ 0.491943359375, -0.15869140625, -0.341796875, -0.916015625, 0.51806640625, -0.8740234375, -0.47900390625, 0.12115478515625 ], - 'descriptor': {'dimensions': [2, 6, 1, 2], 'dataType': 'float16'} + 'descriptor': {shape: [2, 6, 1, 2], dataType: 'float16'} } } } @@ -1707,7 +1707,7 @@ const concatTests = [ -0.3944413363933563, 0.861982524394989, 0.337996244430542, -0.990639865398407 ], - 'descriptor': {'dimensions': [1, 2, 2, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2, 1], dataType: 'float32'} }, 'concatInput2': { 'data': [ @@ -1718,14 +1718,14 @@ const concatTests = [ -0.7206121683120728, -0.7993468642234802, 0.6653800010681152, 0.03886038810014725 ], - 'descriptor': {'dimensions': [1, 2, 8, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 8, 1], dataType: 'float32'} }, 'concatInput3': { 'data': [ 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [1, 2, 2, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2, 1], dataType: 'float32'} } }, 'operators': [{ @@ -1748,7 +1748,7 @@ const concatTests = [ -0.7206121683120728, -0.7993468642234802, 0.6653800010681152, 0.03886038810014725, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [1, 2, 12, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 12, 1], dataType: 'float32'} } } } @@ -1763,7 +1763,7 @@ const concatTests = [ -0.3944413363933563, 0.861982524394989, 0.337996244430542, -0.990639865398407 ], - 'descriptor': {'dimensions': [1, 2, 2, 1], 'dataType': 'float16'} + 'descriptor': {shape: [1, 2, 2, 1], dataType: 'float16'} }, 'concatInput2': { 'data': [ @@ -1774,14 +1774,14 @@ const concatTests = [ -0.7206121683120728, -0.7993468642234802, 0.6653800010681152, 0.03886038810014725 ], - 'descriptor': {'dimensions': [1, 2, 8, 1], 'dataType': 'float16'} + 'descriptor': {shape: [1, 2, 8, 1], dataType: 'float16'} }, 'concatInput3': { 'data': [ 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [1, 2, 2, 1], 'dataType': 'float16'} + 'descriptor': {shape: [1, 2, 2, 1], dataType: 'float16'} } }, 'operators': [{ @@ -1802,7 +1802,7 @@ const concatTests = [ -0.341796875, -0.916015625, -0.720703125, -0.79931640625, 0.66552734375, 0.038848876953125, -0.47900390625, 0.12115478515625 ], - 'descriptor': {'dimensions': [1, 2, 12, 1], 'dataType': 'float16'} + 'descriptor': {shape: [1, 2, 12, 1], dataType: 'float16'} } } } @@ -1814,18 +1814,18 @@ const concatTests = [ 'inputs': { 'concatInput1': { 'data': [-0.3944413363933563, 0.861982524394989, 0.337996244430542], - 'descriptor': {'dimensions': [1, 3, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 1, 1], dataType: 'float32'} }, 'concatInput2': { 'data': [-0.990639865398407, 0.576785683631897, 0.32276400923728943], - 'descriptor': {'dimensions': [1, 3, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 1, 1], dataType: 'float32'} }, 'concatInput3': { 'data': [ -0.44735023379325867, 0.11028251051902771, -0.5945112705230713, -0.402848482131958, -0.9531654119491577, -0.6731740236282349 ], - 'descriptor': {'dimensions': [1, 3, 1, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 1, 2], dataType: 'float32'} }, 'concatInput4': { 'data': [ @@ -1834,7 +1834,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [1, 3, 1, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 1, 4], dataType: 'float32'} } }, 'operators': [{ @@ -1860,7 +1860,7 @@ const concatTests = [ -0.9531654119491577, -0.6731740236282349, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [1, 3, 1, 8], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 1, 8], dataType: 'float32'} } } } @@ -1872,18 +1872,18 @@ const concatTests = [ 'inputs': { 'concatInput1': { 'data': [-0.3944413363933563, 0.861982524394989, 0.337996244430542], - 'descriptor': {'dimensions': [1, 3, 1, 1], 'dataType': 'float16'} + 'descriptor': {shape: [1, 3, 1, 1], dataType: 'float16'} }, 'concatInput2': { 'data': [-0.990639865398407, 0.576785683631897, 0.32276400923728943], - 'descriptor': {'dimensions': [1, 3, 1, 1], 'dataType': 'float16'} + 'descriptor': {shape: [1, 3, 1, 1], dataType: 'float16'} }, 'concatInput3': { 'data': [ -0.44735023379325867, 0.11028251051902771, -0.5945112705230713, -0.402848482131958, -0.9531654119491577, -0.6731740236282349 ], - 'descriptor': {'dimensions': [1, 3, 1, 2], 'dataType': 'float16'} + 'descriptor': {shape: [1, 3, 1, 2], dataType: 'float16'} }, 'concatInput4': { 'data': [ @@ -1892,7 +1892,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [1, 3, 1, 4], 'dataType': 'float16'} + 'descriptor': {shape: [1, 3, 1, 4], dataType: 'float16'} } }, 'operators': [{ @@ -1916,7 +1916,7 @@ const concatTests = [ 0.337890625, 0.32275390625, -0.953125, -0.67333984375, 0.51806640625, -0.8740234375, -0.47900390625, 0.12115478515625 ], - 'descriptor': {'dimensions': [1, 3, 1, 8], 'dataType': 'float16'} + 'descriptor': {shape: [1, 3, 1, 8], dataType: 'float16'} } } } @@ -1930,28 +1930,28 @@ const concatTests = [ -0.3944413363933563, 0.861982524394989, 0.337996244430542, -0.990639865398407, 0.576785683631897, 0.32276400923728943 ], - 'descriptor': {'dimensions': [1, 2, 1, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 1, 3], dataType: 'float32'} }, 'concatInput2': { 'data': [ -0.44735023379325867, 0.11028251051902771, -0.5945112705230713, -0.402848482131958, -0.9531654119491577, -0.6731740236282349 ], - 'descriptor': {'dimensions': [1, 2, 1, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 1, 3], dataType: 'float32'} }, 'concatInput3': { 'data': [ 0.49189892411231995, -0.15864109992980957, -0.3418811559677124, -0.9158143401145935, -0.7206121683120728, -0.7993468642234802 ], - 'descriptor': {'dimensions': [1, 2, 1, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 1, 3], dataType: 'float32'} }, 'concatInput4': { 'data': [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [1, 2, 1, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 1, 3], dataType: 'float32'} } }, 'operators': [{ @@ -1977,7 +1977,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [4, 2, 1, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [4, 2, 1, 1, 3], dataType: 'float32'} } } } @@ -1991,28 +1991,28 @@ const concatTests = [ -0.3944413363933563, 0.861982524394989, 0.337996244430542, -0.990639865398407, 0.576785683631897, 0.32276400923728943 ], - 'descriptor': {'dimensions': [1, 2, 1, 1, 3], 'dataType': 'float16'} + 'descriptor': {shape: [1, 2, 1, 1, 3], dataType: 'float16'} }, 'concatInput2': { 'data': [ -0.44735023379325867, 0.11028251051902771, -0.5945112705230713, -0.402848482131958, -0.9531654119491577, -0.6731740236282349 ], - 'descriptor': {'dimensions': [1, 2, 1, 1, 3], 'dataType': 'float16'} + 'descriptor': {shape: [1, 2, 1, 1, 3], dataType: 'float16'} }, 'concatInput3': { 'data': [ 0.49189892411231995, -0.15864109992980957, -0.3418811559677124, -0.9158143401145935, -0.7206121683120728, -0.7993468642234802 ], - 'descriptor': {'dimensions': [1, 2, 1, 1, 3], 'dataType': 'float16'} + 'descriptor': {shape: [1, 2, 1, 1, 3], dataType: 'float16'} }, 'concatInput4': { 'data': [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [1, 2, 1, 1, 3], 'dataType': 'float16'} + 'descriptor': {shape: [1, 2, 1, 1, 3], dataType: 'float16'} } }, 'operators': [{ @@ -2036,7 +2036,7 @@ const concatTests = [ -0.720703125, -0.79931640625, 0.66552734375, 0.038848876953125, 0.51806640625, -0.8740234375, -0.47900390625, 0.12115478515625 ], - 'descriptor': {'dimensions': [4, 2, 1, 1, 3], 'dataType': 'float16'} + 'descriptor': {shape: [4, 2, 1, 1, 3], dataType: 'float16'} } } } @@ -2051,7 +2051,7 @@ const concatTests = [ -0.3944413363933563, 0.861982524394989, 0.337996244430542, -0.990639865398407, 0.576785683631897, 0.32276400923728943 ], - 'descriptor': {'dimensions': [1, 2, 3, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 1, 1], dataType: 'float32'} }, 'concatInput2': { 'data': [ @@ -2062,7 +2062,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [1, 6, 3, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 6, 3, 1, 1], dataType: 'float32'} } }, 'operators': [{ @@ -2083,7 +2083,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [1, 8, 3, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8, 3, 1, 1], dataType: 'float32'} } } } @@ -2098,7 +2098,7 @@ const concatTests = [ -0.3944413363933563, 0.861982524394989, 0.337996244430542, -0.990639865398407, 0.576785683631897, 0.32276400923728943 ], - 'descriptor': {'dimensions': [1, 2, 3, 1, 1], 'dataType': 'float16'} + 'descriptor': {shape: [1, 2, 3, 1, 1], dataType: 'float16'} }, 'concatInput2': { 'data': [ @@ -2109,7 +2109,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [1, 6, 3, 1, 1], 'dataType': 'float16'} + 'descriptor': {shape: [1, 6, 3, 1, 1], dataType: 'float16'} } }, 'operators': [{ @@ -2128,7 +2128,7 @@ const concatTests = [ -0.720703125, -0.79931640625, 0.66552734375, 0.038848876953125, 0.51806640625, -0.8740234375, -0.47900390625, 0.12115478515625 ], - 'descriptor': {'dimensions': [1, 8, 3, 1, 1], 'dataType': 'float16'} + 'descriptor': {shape: [1, 8, 3, 1, 1], dataType: 'float16'} } } } @@ -2143,7 +2143,7 @@ const concatTests = [ -0.3944413363933563, 0.861982524394989, 0.337996244430542, -0.990639865398407 ], - 'descriptor': {'dimensions': [1, 2, 1, 1, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 1, 2], dataType: 'float32'} }, 'concatInput2': { 'data': [ @@ -2151,7 +2151,7 @@ const concatTests = [ 0.11028251051902771, -0.5945112705230713, -0.402848482131958, -0.9531654119491577, -0.6731740236282349 ], - 'descriptor': {'dimensions': [1, 2, 2, 1, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2, 1, 2], dataType: 'float32'} }, 'concatInput3': { 'data': [ @@ -2160,7 +2160,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [1, 2, 3, 1, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 1, 2], dataType: 'float32'} } }, 'operators': [{ @@ -2183,7 +2183,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [1, 2, 6, 1, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 6, 1, 2], dataType: 'float32'} } } } @@ -2198,7 +2198,7 @@ const concatTests = [ -0.3944413363933563, 0.861982524394989, 0.337996244430542, -0.990639865398407 ], - 'descriptor': {'dimensions': [1, 2, 1, 1, 2], 'dataType': 'float16'} + 'descriptor': {shape: [1, 2, 1, 1, 2], dataType: 'float16'} }, 'concatInput2': { 'data': [ @@ -2206,7 +2206,7 @@ const concatTests = [ 0.11028251051902771, -0.5945112705230713, -0.402848482131958, -0.9531654119491577, -0.6731740236282349 ], - 'descriptor': {'dimensions': [1, 2, 2, 1, 2], 'dataType': 'float16'} + 'descriptor': {shape: [1, 2, 2, 1, 2], dataType: 'float16'} }, 'concatInput3': { 'data': [ @@ -2215,7 +2215,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [1, 2, 3, 1, 2], 'dataType': 'float16'} + 'descriptor': {shape: [1, 2, 3, 1, 2], dataType: 'float16'} } }, 'operators': [{ @@ -2236,7 +2236,7 @@ const concatTests = [ -0.953125, -0.67333984375, 0.66552734375, 0.038848876953125, 0.51806640625, -0.8740234375, -0.47900390625, 0.12115478515625 ], - 'descriptor': {'dimensions': [1, 2, 6, 1, 2], 'dataType': 'float16'} + 'descriptor': {shape: [1, 2, 6, 1, 2], dataType: 'float16'} } } } @@ -2251,7 +2251,7 @@ const concatTests = [ -0.3944413363933563, 0.861982524394989, 0.337996244430542, -0.990639865398407, 0.576785683631897, 0.32276400923728943 ], - 'descriptor': {'dimensions': [3, 1, 1, 1, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 1, 1, 1, 2], dataType: 'float32'} }, 'concatInput2': { 'data': [ @@ -2262,7 +2262,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [3, 1, 1, 3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 1, 1, 3, 2], dataType: 'float32'} } }, 'operators': [{ @@ -2283,7 +2283,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [3, 1, 1, 4, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 1, 1, 4, 2], dataType: 'float32'} } } } @@ -2298,7 +2298,7 @@ const concatTests = [ -0.3944413363933563, 0.861982524394989, 0.337996244430542, -0.990639865398407, 0.576785683631897, 0.32276400923728943 ], - 'descriptor': {'dimensions': [3, 1, 1, 1, 2], 'dataType': 'float16'} + 'descriptor': {shape: [3, 1, 1, 1, 2], dataType: 'float16'} }, 'concatInput2': { 'data': [ @@ -2309,7 +2309,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [3, 1, 1, 3, 2], 'dataType': 'float16'} + 'descriptor': {shape: [3, 1, 1, 3, 2], dataType: 'float16'} } }, 'operators': [{ @@ -2328,7 +2328,7 @@ const concatTests = [ 0.57666015625, 0.32275390625, 0.66552734375, 0.038848876953125, 0.51806640625, -0.8740234375, -0.47900390625, 0.12115478515625 ], - 'descriptor': {'dimensions': [3, 1, 1, 4, 2], 'dataType': 'float16'} + 'descriptor': {shape: [3, 1, 1, 4, 2], dataType: 'float16'} } } } @@ -2344,7 +2344,7 @@ const concatTests = [ -0.990639865398407, 0.576785683631897, 0.32276400923728943, -0.44735023379325867, 0.11028251051902771 ], - 'descriptor': {'dimensions': [1, 2, 1, 1, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 1, 4], dataType: 'float32'} }, 'concatInput2': { 'data': [ @@ -2355,7 +2355,7 @@ const concatTests = [ 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [1, 2, 1, 1, 8], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 1, 8], dataType: 'float32'} } }, 'operators': [{ @@ -2376,7 +2376,7 @@ const concatTests = [ 0.6653800010681152, 0.03886038810014725, 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [1, 2, 1, 1, 12], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 1, 12], dataType: 'float32'} } } } @@ -2392,7 +2392,7 @@ const concatTests = [ -0.990639865398407, 0.576785683631897, 0.32276400923728943, -0.44735023379325867, 0.11028251051902771 ], - 'descriptor': {'dimensions': [1, 2, 1, 1, 4], 'dataType': 'float16'} + 'descriptor': {shape: [1, 2, 1, 1, 4], dataType: 'float16'} }, 'concatInput2': { 'data': [ @@ -2403,7 +2403,7 @@ const concatTests = [ 0.5182055234909058, -0.8742017149925232, -0.4790218770503998, 0.1211843192577362 ], - 'descriptor': {'dimensions': [1, 2, 1, 1, 8], 'dataType': 'float16'} + 'descriptor': {shape: [1, 2, 1, 1, 8], dataType: 'float16'} } }, 'operators': [{ @@ -2422,7 +2422,7 @@ const concatTests = [ -0.720703125, -0.79931640625, 0.66552734375, 0.038848876953125, 0.51806640625, -0.8740234375, -0.47900390625, 0.12115478515625 ], - 'descriptor': {'dimensions': [1, 2, 1, 1, 12], 'dataType': 'float16'} + 'descriptor': {shape: [1, 2, 1, 1, 12], dataType: 'float16'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/conv2d.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/conv2d.https.any.js index b3354728634a..59ed70376ba3 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/conv2d.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/conv2d.https.any.js @@ -51,7 +51,7 @@ const conv2dTests = [ 0.12204372137784958, 0.8422137498855591, 0.4537501037120819, 0.21529443562030792 ], - 'descriptor': {'dimensions': [1, 1, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 5, 5], dataType: 'float32'} }, 'conv2dFilter': { 'data': [ @@ -59,7 +59,7 @@ const conv2dTests = [ 0.36689770221710205, 0.33974137902259827, 0.4200059771537781, 0.3805030882358551, 0.19443586468696594, 0.5686976909637451 ], - 'descriptor': {'dimensions': [1, 1, 3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float32'} } }, 'operators': [{ @@ -74,7 +74,7 @@ const conv2dTests = [ 1.071682333946228, 1.1259644031524658, 1.4713115692138672, 1.078782320022583, 1.155018925666809, 1.656954288482666 ], - 'descriptor': {'dimensions': [1, 1, 3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float32'} } } } @@ -96,7 +96,7 @@ const conv2dTests = [ 0.12204372137784958, 0.8422137498855591, 0.4537501037120819, 0.21529443562030792 ], - 'descriptor': {'dimensions': [1, 1, 5, 5], 'dataType': 'float32'}, + 'descriptor': {shape: [1, 1, 5, 5], dataType: 'float32'}, 'constant': true }, 'conv2dFilter': { @@ -105,7 +105,7 @@ const conv2dTests = [ 0.36689770221710205, 0.33974137902259827, 0.4200059771537781, 0.3805030882358551, 0.19443586468696594, 0.5686976909637451 ], - 'descriptor': {'dimensions': [1, 1, 3, 3], 'dataType': 'float32'}, + 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float32'}, 'constant': true } }, @@ -121,7 +121,7 @@ const conv2dTests = [ 1.071682333946228, 1.1259644031524658, 1.4713115692138672, 1.078782320022583, 1.155018925666809, 1.656954288482666 ], - 'descriptor': {'dimensions': [1, 1, 3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float32'} } } } @@ -142,7 +142,7 @@ const conv2dTests = [ 0.12204372137784958, 0.8422137498855591, 0.4537501037120819, 0.21529443562030792 ], - 'descriptor': {'dimensions': [1, 1, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 5, 5], dataType: 'float32'} }, 'conv2dFilter': { 'data': [ @@ -150,7 +150,7 @@ const conv2dTests = [ 0.36689770221710205, 0.33974137902259827, 0.4200059771537781, 0.3805030882358551, 0.19443586468696594, 0.5686976909637451 ], - 'descriptor': {'dimensions': [1, 1, 3, 3], 'dataType': 'float32'}, + 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float32'}, 'constant': true } }, @@ -166,7 +166,7 @@ const conv2dTests = [ 1.071682333946228, 1.1259644031524658, 1.4713115692138672, 1.078782320022583, 1.155018925666809, 1.656954288482666 ], - 'descriptor': {'dimensions': [1, 1, 3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float32'} } } } @@ -187,7 +187,7 @@ const conv2dTests = [ 0.12204372137784958, 0.8422137498855591, 0.4537501037120819, 0.21529443562030792 ], - 'descriptor': {'dimensions': [1, 1, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 5, 5], dataType: 'float32'} }, 'conv2dFilter': { 'data': [ @@ -195,7 +195,7 @@ const conv2dTests = [ 0.36689770221710205, 0.33974137902259827, 0.4200059771537781, 0.3805030882358551, 0.19443586468696594, 0.5686976909637451 ], - 'descriptor': {'dimensions': [1, 1, 3, 3], 'dataType': 'float32'}, + 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float32'}, 'constant': true } }, @@ -220,7 +220,7 @@ const conv2dTests = [ 0.7545653581619263, 0.7729666829109192, 0.9733180403709412, 0.9025675058364868 ], - 'descriptor': {'dimensions': [1, 1, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 5, 5], dataType: 'float32'} } } } @@ -241,7 +241,7 @@ const conv2dTests = [ 0.12204372137784958, 0.8422137498855591, 0.4537501037120819, 0.21529443562030792 ], - 'descriptor': {'dimensions': [1, 1, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 5, 5], dataType: 'float32'} }, 'conv2dFilter': { 'data': [ @@ -249,7 +249,7 @@ const conv2dTests = [ 0.36689770221710205, 0.33974137902259827, 0.4200059771537781, 0.3805030882358551, 0.19443586468696594, 0.5686976909637451 ], - 'descriptor': {'dimensions': [1, 1, 3, 3], 'dataType': 'float32'}, + 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float32'}, 'constant': true } }, @@ -267,7 +267,7 @@ const conv2dTests = [ 1.5323282480239868, 1.3641656637191772, 1.078782320022583, 1.656954288482666 ], - 'descriptor': {'dimensions': [1, 1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 2, 2], dataType: 'float32'} } } } @@ -288,7 +288,7 @@ const conv2dTests = [ 0.12204372137784958, 0.8422137498855591, 0.4537501037120819, 0.21529443562030792 ], - 'descriptor': {'dimensions': [1, 1, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 5, 5], dataType: 'float32'} }, 'conv2dFilter': { 'data': [ @@ -296,7 +296,7 @@ const conv2dTests = [ 0.36689770221710205, 0.33974137902259827, 0.4200059771537781, 0.3805030882358551, 0.19443586468696594, 0.5686976909637451 ], - 'descriptor': {'dimensions': [1, 1, 3, 3], 'dataType': 'float32'}, + 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float32'}, 'constant': true } }, @@ -311,7 +311,7 @@ const conv2dTests = [ 'expectedOutputs': { 'conv2dOutput': { 'data': [1.3599307537078857], - 'descriptor': {'dimensions': [1, 1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float32'} } } } @@ -330,7 +330,7 @@ const conv2dTests = [ 0.25327208638191223, 0.5780375599861145, 0.5414554476737976, 0.37846308946609497 ], - 'descriptor': {'dimensions': [1, 4, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 4, 2, 2], dataType: 'float32'} }, 'conv2dFilter': { 'data': [ @@ -341,7 +341,7 @@ const conv2dTests = [ 0.5900803804397583, 0.9690897464752197, 0.23175589740276337, 0.14805112779140472 ], - 'descriptor': {'dimensions': [4, 1, 2, 2], 'dataType': 'float32'}, + 'descriptor': {shape: [4, 1, 2, 2], dataType: 'float32'}, 'constant': true } }, @@ -359,7 +359,7 @@ const conv2dTests = [ 1.1808103322982788, 1.165167212486267, 1.311646819114685, 0.8911385536193848 ], - 'descriptor': {'dimensions': [1, 4, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 4, 1, 1], dataType: 'float32'} } } } @@ -378,7 +378,7 @@ const conv2dTests = [ 0.22727376222610474, 0.5414124131202698, 0.08445341885089874, 0.6765284538269043, 0.6193256378173828, 0.3929215967655182 ], - 'descriptor': {'dimensions': [2, 1, 3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 3, 3], dataType: 'float32'} }, 'conv2dFilter': { 'data': [ @@ -387,7 +387,7 @@ const conv2dTests = [ 0.08139707148075104, 0.5303338766098022, 0.3072136342525482, 0.43241235613822937, 0.9849002361297607, 0.4281076192855835 ], - 'descriptor': {'dimensions': [3, 1, 2, 2], 'dataType': 'float32'}, + 'descriptor': {shape: [3, 1, 2, 2], dataType: 'float32'}, 'constant': true } }, @@ -411,7 +411,7 @@ const conv2dTests = [ 0.816078782081604, 0.6780439019203186, 0.9170808792114258, 1.082636833190918, 1.2353861331939697, 0.9810346961021423 ], - 'descriptor': {'dimensions': [2, 3, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'} } } } @@ -430,7 +430,7 @@ const conv2dTests = [ 0.22727376222610474, 0.5414124131202698, 0.08445341885089874, 0.6765284538269043, 0.6193256378173828, 0.3929215967655182 ], - 'descriptor': {'dimensions': [2, 3, 3, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 3, 1], dataType: 'float32'} }, 'conv2dFilter': { 'data': [ @@ -439,7 +439,7 @@ const conv2dTests = [ 0.08139707148075104, 0.5303338766098022, 0.3072136342525482, 0.43241235613822937, 0.9849002361297607, 0.4281076192855835 ], - 'descriptor': {'dimensions': [3, 1, 2, 2], 'dataType': 'float32'}, + 'descriptor': {shape: [3, 1, 2, 2], dataType: 'float32'}, 'constant': true } }, @@ -463,7 +463,7 @@ const conv2dTests = [ 0.8282973766326904, 0.816078782081604, 1.2353861331939697, 0.35335418581962585, 0.6780439019203186, 0.9810346961021423 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -482,7 +482,7 @@ const conv2dTests = [ 0.22727376222610474, 0.5414124131202698, 0.08445341885089874, 0.6765284538269043, 0.6193256378173828, 0.3929215967655182 ], - 'descriptor': {'dimensions': [2, 1, 3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 3, 3], dataType: 'float32'} }, 'conv2dFilter': { 'data': [ @@ -491,7 +491,7 @@ const conv2dTests = [ 0.08139707148075104, 0.5303338766098022, 0.3072136342525482, 0.43241235613822937, 0.9849002361297607, 0.4281076192855835 ], - 'descriptor': {'dimensions': [3, 1, 2, 2], 'dataType': 'float32'}, + 'descriptor': {shape: [3, 1, 2, 2], dataType: 'float32'}, 'constant': true } }, @@ -515,7 +515,7 @@ const conv2dTests = [ 0.816078782081604, 0.6780439019203186, 0.9170808792114258, 1.082636833190918, 1.2353861331939697, 0.9810346961021423 ], - 'descriptor': {'dimensions': [2, 3, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'} } } } @@ -534,7 +534,7 @@ const conv2dTests = [ 0.22727376222610474, 0.5414124131202698, 0.08445341885089874, 0.6765284538269043, 0.6193256378173828, 0.3929215967655182 ], - 'descriptor': {'dimensions': [2, 1, 3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 3, 3], dataType: 'float32'} }, 'conv2dFilter': { 'data': [ @@ -543,7 +543,7 @@ const conv2dTests = [ 0.10836050659418106, 0.08139707148075104, 0.9849002361297607, 0.3202308118343353, 0.5303338766098022, 0.4281076192855835 ], - 'descriptor': {'dimensions': [2, 2, 1, 3], 'dataType': 'float32'}, + 'descriptor': {shape: [2, 2, 1, 3], dataType: 'float32'}, 'constant': true } }, @@ -567,7 +567,7 @@ const conv2dTests = [ 0.816078782081604, 0.6780439019203186, 0.9170808792114258, 1.082636833190918, 1.2353861331939697, 0.9810346961021423 ], - 'descriptor': {'dimensions': [2, 3, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'} } } } @@ -586,7 +586,7 @@ const conv2dTests = [ 0.22727376222610474, 0.5414124131202698, 0.08445341885089874, 0.6765284538269043, 0.6193256378173828, 0.3929215967655182 ], - 'descriptor': {'dimensions': [2, 1, 3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 3, 3], dataType: 'float32'} }, 'conv2dFilter': { 'data': [ @@ -595,7 +595,7 @@ const conv2dTests = [ 0.08139707148075104, 0.5303338766098022, 0.3072136342525482, 0.43241235613822937, 0.9849002361297607, 0.4281076192855835 ], - 'descriptor': {'dimensions': [3, 2, 2, 1], 'dataType': 'float32'}, + 'descriptor': {shape: [3, 2, 2, 1], dataType: 'float32'}, 'constant': true } }, @@ -619,7 +619,7 @@ const conv2dTests = [ 0.816078782081604, 0.6780439019203186, 0.9170808792114258, 1.082636833190918, 1.2353861331939697, 0.9810346961021423 ], - 'descriptor': {'dimensions': [2, 3, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'} } } } @@ -638,7 +638,7 @@ const conv2dTests = [ 0.22727376222610474, 0.5414124131202698, 0.08445341885089874, 0.6765284538269043, 0.6193256378173828, 0.3929215967655182 ], - 'descriptor': {'dimensions': [2, 1, 3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 3, 3], dataType: 'float32'} }, 'conv2dFilter': { 'data': [ @@ -647,7 +647,7 @@ const conv2dTests = [ 0.10836050659418106, 0.08139707148075104, 0.9849002361297607, 0.3202308118343353, 0.5303338766098022, 0.4281076192855835 ], - 'descriptor': {'dimensions': [1, 2, 2, 3], 'dataType': 'float32'}, + 'descriptor': {shape: [1, 2, 2, 3], dataType: 'float32'}, 'constant': true } }, @@ -671,7 +671,7 @@ const conv2dTests = [ 0.816078782081604, 0.6780439019203186, 0.9170808792114258, 1.082636833190918, 1.2353861331939697, 0.9810346961021423 ], - 'descriptor': {'dimensions': [2, 3, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'} } } } @@ -690,7 +690,7 @@ const conv2dTests = [ 0.22727376222610474, 0.5414124131202698, 0.08445341885089874, 0.6765284538269043, 0.6193256378173828, 0.3929215967655182 ], - 'descriptor': {'dimensions': [2, 3, 3, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 3, 1], dataType: 'float32'} }, 'conv2dFilter': { 'data': [ @@ -699,7 +699,7 @@ const conv2dTests = [ 0.08139707148075104, 0.5303338766098022, 0.3072136342525482, 0.43241235613822937, 0.9849002361297607, 0.4281076192855835 ], - 'descriptor': {'dimensions': [3, 1, 2, 2], 'dataType': 'float32'}, + 'descriptor': {shape: [3, 1, 2, 2], dataType: 'float32'}, 'constant': true } }, @@ -723,7 +723,7 @@ const conv2dTests = [ 0.8282973766326904, 0.816078782081604, 1.2353861331939697, 0.35335418581962585, 0.6780439019203186, 0.9810346961021423 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -742,7 +742,7 @@ const conv2dTests = [ 0.22727376222610474, 0.5414124131202698, 0.08445341885089874, 0.6765284538269043, 0.6193256378173828, 0.3929215967655182 ], - 'descriptor': {'dimensions': [2, 3, 3, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 3, 1], dataType: 'float32'} }, 'conv2dFilter': { 'data': [ @@ -751,7 +751,7 @@ const conv2dTests = [ 0.10836050659418106, 0.08139707148075104, 0.9849002361297607, 0.3202308118343353, 0.5303338766098022, 0.4281076192855835 ], - 'descriptor': {'dimensions': [2, 2, 1, 3], 'dataType': 'float32'}, + 'descriptor': {shape: [2, 2, 1, 3], dataType: 'float32'}, 'constant': true } }, @@ -775,7 +775,7 @@ const conv2dTests = [ 0.8282973766326904, 0.816078782081604, 1.2353861331939697, 0.35335418581962585, 0.6780439019203186, 0.9810346961021423 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -794,7 +794,7 @@ const conv2dTests = [ 0.22727376222610474, 0.5414124131202698, 0.08445341885089874, 0.6765284538269043, 0.6193256378173828, 0.3929215967655182 ], - 'descriptor': {'dimensions': [2, 3, 3, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 3, 1], dataType: 'float32'} }, 'conv2dFilter': { 'data': [ @@ -803,7 +803,7 @@ const conv2dTests = [ 0.08139707148075104, 0.5303338766098022, 0.3072136342525482, 0.43241235613822937, 0.9849002361297607, 0.4281076192855835 ], - 'descriptor': {'dimensions': [3, 2, 2, 1], 'dataType': 'float32'}, + 'descriptor': {shape: [3, 2, 2, 1], dataType: 'float32'}, 'constant': true } }, @@ -827,7 +827,7 @@ const conv2dTests = [ 0.8282973766326904, 0.816078782081604, 1.2353861331939697, 0.35335418581962585, 0.6780439019203186, 0.9810346961021423 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -846,7 +846,7 @@ const conv2dTests = [ 0.22727376222610474, 0.5414124131202698, 0.08445341885089874, 0.6765284538269043, 0.6193256378173828, 0.3929215967655182 ], - 'descriptor': {'dimensions': [2, 3, 3, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 3, 1], dataType: 'float32'} }, 'conv2dFilter': { 'data': [ @@ -855,7 +855,7 @@ const conv2dTests = [ 0.10836050659418106, 0.08139707148075104, 0.9849002361297607, 0.3202308118343353, 0.5303338766098022, 0.4281076192855835 ], - 'descriptor': {'dimensions': [1, 2, 2, 3], 'dataType': 'float32'}, + 'descriptor': {shape: [1, 2, 2, 3], dataType: 'float32'}, 'constant': true } }, @@ -879,7 +879,7 @@ const conv2dTests = [ 0.8282973766326904, 0.816078782081604, 1.2353861331939697, 0.35335418581962585, 0.6780439019203186, 0.9810346961021423 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -897,7 +897,7 @@ const conv2dTests = [ 0.22727376222610474, 0.5414124131202698, 0.08445341885089874, 0.6765284538269043, 0.6193256378173828, 0.3929215967655182 ], - 'descriptor': {'dimensions': [2, 1, 3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 3, 3], dataType: 'float32'} }, 'conv2dFilter': { 'data': [ @@ -906,12 +906,12 @@ const conv2dTests = [ 0.08139707148075104, 0.5303338766098022, 0.3072136342525482, 0.43241235613822937, 0.9849002361297607, 0.4281076192855835 ], - 'descriptor': {'dimensions': [3, 1, 2, 2], 'dataType': 'float32'}, + 'descriptor': {shape: [3, 1, 2, 2], dataType: 'float32'}, 'constant': true }, 'conv2dBias': { 'data': [0.8135762214660645, 0.8394582867622375, 0.49444812536239624], - 'descriptor': {'dimensions': [3], 'dataType': 'float32'}, + 'descriptor': {shape: [3], dataType: 'float32'}, 'constant': true } }, @@ -935,7 +935,7 @@ const conv2dTests = [ 1.6555371284484863, 1.5175021886825562, 1.4115289449691772, 1.577085018157959, 1.7298341989517212, 1.4754828214645386 ], - 'descriptor': {'dimensions': [2, 3, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'} } } } @@ -964,7 +964,7 @@ const conv2dTests = [ 0.2968284785747528, 0.7524365782737732, 0.029636209830641747, 0.09028015285730362, 0.77818763256073 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} }, 'conv2dFilter': { 'data': [ @@ -972,12 +972,12 @@ const conv2dTests = [ 0.45633891224861145, 0.40438535809516907, 0.5943626761436462, 0.14241264760494232, 0.9036700129508972 ], - 'descriptor': {'dimensions': [2, 2, 1, 2], 'dataType': 'float32'}, + 'descriptor': {shape: [2, 2, 1, 2], dataType: 'float32'}, 'constant': true }, 'conv2dBias': { 'data': [0.542375385761261, 0.8406118750572205], - 'descriptor': {'dimensions': [2], 'dataType': 'float32'}, + 'descriptor': {shape: [2], dataType: 'float32'}, 'constant': true } }, @@ -1019,7 +1019,7 @@ const conv2dTests = [ 2.0131523609161377, 1.4835525751113892, 1.1790242195129395, 2.0776233673095703, 1.378482699394226 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } } } @@ -1049,7 +1049,7 @@ const conv2dTests = [ -0.3751019835472107, -0.7108227610588074, -0.36050301790237427, -0.5468712449073792, -0.032261595129966736 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} }, 'conv2dFilter': { 'data': [ @@ -1057,12 +1057,12 @@ const conv2dTests = [ 0.45633891224861145, 0.40438535809516907, 0.5943626761436462, 0.14241264760494232, 0.9036700129508972 ], - 'descriptor': {'dimensions': [2, 2, 1, 2], 'dataType': 'float32'}, + 'descriptor': {shape: [2, 2, 1, 2], dataType: 'float32'}, 'constant': true }, 'conv2dBias': { 'data': [-0.37496936321258545, -0.4363507032394409], - 'descriptor': {'dimensions': [2], 'dataType': 'float32'}, + 'descriptor': {shape: [2], dataType: 'float32'}, 'constant': true } }, @@ -1101,7 +1101,7 @@ const conv2dTests = [ -1.5352842807769775, -1.303133249282837, -1.3232042789459229, -1.1430623531341553, -0.5107623338699341 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/conv_transpose2d.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/conv_transpose2d.https.any.js index a76f180b5566..25006ba1264a 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/conv_transpose2d.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/conv_transpose2d.https.any.js @@ -45,14 +45,14 @@ const convTranspose2dTests = [ 0.5872158408164978, 0.6077792048454285, 0.017289165407419205, 0.2614607512950897 ], - 'descriptor': {'dimensions': [1, 1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 2, 2], dataType: 'float32'} }, 'convTranspose2dFilter': { 'data': [ 0.3292713165283203, 0.5866857171058655, 0.29701370000839233, 0.0033378428779542446 ], - 'descriptor': {'dimensions': [1, 1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 2, 2], dataType: 'float32'} } }, 'operators': [{ @@ -69,7 +69,7 @@ const convTranspose2dTests = [ 0.18010397255420685, 0.2787136137485504, 0.15542395412921906, 0.0051351189613342285, 0.07771513611078262, 0.0008727149106562138 ], - 'descriptor': {'dimensions': [1, 1, 3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float32'} } } } @@ -84,7 +84,7 @@ const convTranspose2dTests = [ 0.5872158408164978, 0.6077792048454285, 0.017289165407419205, 0.2614607512950897 ], - 'descriptor': {'dimensions': [1, 1, 2, 2], 'dataType': 'float32'}, + 'descriptor': {shape: [1, 1, 2, 2], dataType: 'float32'}, 'constant': true }, 'convTranspose2dFilter': { @@ -92,7 +92,7 @@ const convTranspose2dTests = [ 0.3292713165283203, 0.5866857171058655, 0.29701370000839233, 0.0033378428779542446 ], - 'descriptor': {'dimensions': [1, 1, 2, 2], 'dataType': 'float32'}, + 'descriptor': {shape: [1, 1, 2, 2], dataType: 'float32'}, 'constant': true } }, @@ -110,7 +110,7 @@ const convTranspose2dTests = [ 0.18010397255420685, 0.2787136137485504, 0.15542395412921906, 0.0051351189613342285, 0.07771513611078262, 0.0008727149106562138 ], - 'descriptor': {'dimensions': [1, 1, 3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float32'} } } } @@ -125,14 +125,14 @@ const convTranspose2dTests = [ 0.5872158408164978, 0.6077792048454285, 0.017289165407419205, 0.2614607512950897 ], - 'descriptor': {'dimensions': [1, 1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 2, 2], dataType: 'float32'} }, 'convTranspose2dFilter': { 'data': [ 0.3292713165283203, 0.5866857171058655, 0.29701370000839233, 0.0033378428779542446 ], - 'descriptor': {'dimensions': [1, 1, 2, 2], 'dataType': 'float32'}, + 'descriptor': {shape: [1, 1, 2, 2], dataType: 'float32'}, 'constant': true } }, @@ -150,7 +150,7 @@ const convTranspose2dTests = [ 0.18010397255420685, 0.2787136137485504, 0.15542395412921906, 0.0051351189613342285, 0.07771513611078262, 0.0008727149106562138 ], - 'descriptor': {'dimensions': [1, 1, 3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float32'} } } } @@ -166,7 +166,7 @@ const convTranspose2dTests = [ 0.36564111709594727, 0.25429198145866394, 0.20815767347812653, 0.7023073434829712, 0.5734469890594482 ], - 'descriptor': {'dimensions': [1, 2, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2, 2], dataType: 'float32'} }, 'convTranspose2dFilter': { 'data': [ @@ -174,7 +174,7 @@ const convTranspose2dTests = [ 0.6582807898521423, 0.9634373188018799, 0.012118860147893429, 0.9230011701583862, 0.4781944155693054 ], - 'descriptor': {'dimensions': [2, 1, 2, 2], 'dataType': 'float32'}, + 'descriptor': {shape: [2, 1, 2, 2], dataType: 'float32'}, 'constant': true } }, @@ -196,7 +196,7 @@ const convTranspose2dTests = [ 0.9113409519195557, 0.8747221827507019, 0.10648936033248901, 0.6482304930686951, 0.865131676197052, 0.2742191553115845 ], - 'descriptor': {'dimensions': [1, 2, 3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 3], dataType: 'float32'} } } } @@ -212,7 +212,7 @@ const convTranspose2dTests = [ 0.36564111709594727, 0.25429198145866394, 0.20815767347812653, 0.7023073434829712, 0.5734469890594482 ], - 'descriptor': {'dimensions': [1, 2, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2, 2], dataType: 'float32'} }, 'convTranspose2dFilter': { 'data': [ @@ -220,7 +220,7 @@ const convTranspose2dTests = [ 0.6582807898521423, 0.9634373188018799, 0.012118860147893429, 0.9230011701583862, 0.4781944155693054 ], - 'descriptor': {'dimensions': [2, 1, 2, 2], 'dataType': 'float32'}, + 'descriptor': {shape: [2, 1, 2, 2], dataType: 'float32'}, 'constant': true } }, @@ -248,7 +248,7 @@ const convTranspose2dTests = [ 0.00694952392950654, 0.6482304930686951, 0.3358394503593445, 0.5292922258377075, 0.2742191553115845 ], - 'descriptor': {'dimensions': [1, 2, 4, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 4, 4], dataType: 'float32'} } } } @@ -263,14 +263,14 @@ const convTranspose2dTests = [ 0.5872158408164978, 0.6077792048454285, 0.017289165407419205, 0.2614607512950897 ], - 'descriptor': {'dimensions': [1, 1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 2, 2], dataType: 'float32'} }, 'convTranspose2dFilter': { 'data': [ 0.3292713165283203, 0.5866857171058655, 0.29701370000839233, 0.0033378428779542446 ], - 'descriptor': {'dimensions': [1, 1, 2, 2], 'dataType': 'float32'}, + 'descriptor': {shape: [1, 1, 2, 2], dataType: 'float32'}, 'constant': true } }, @@ -286,7 +286,7 @@ const convTranspose2dTests = [ 'expectedOutputs': { 'convTranspose2dOutput': { 'data': [0.2787136137485504], - 'descriptor': {'dimensions': [1, 1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float32'} } } } @@ -297,11 +297,11 @@ const convTranspose2dTests = [ 'inputs': { 'convTranspose2dInput': { 'data': [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5], - 'descriptor': {'dimensions': [1, 3, 3, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 3, 1], dataType: 'float32'} }, 'convTranspose2dFilter': { 'data': [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1], - 'descriptor': {'dimensions': [2, 3, 3, 1], 'dataType': 'float32'}, + 'descriptor': {shape: [2, 3, 3, 1], dataType: 'float32'}, 'constant': true } }, @@ -333,7 +333,7 @@ const convTranspose2dTests = [ 1, 1, 1, 1, 2, 2, 1, 1, 2, 2, 1, 1, 0.5, 0.5, 0.5, 0.5, 1, 1, 0.5, 0.5, 1, 1, 0.5, 0.5 ], - 'descriptor': {'dimensions': [1, 6, 6, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 6, 6, 2], dataType: 'float32'} } } } @@ -349,7 +349,7 @@ const convTranspose2dTests = [ 0.38622909784317017, 0.3870837390422821, 0.9461629390716553, 0.09573192149400711, 0.9234652519226074, 0.636277973651886 ], - 'descriptor': {'dimensions': [1, 1, 3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float32'} }, 'convTranspose2dFilter': { 'data': [ @@ -360,7 +360,7 @@ const convTranspose2dTests = [ 0.7498031854629517, 0.3930714726448059, 0.13811933994293213, 0.28385090827941895, 0.4235861301422119, 0.1448512077331543 ], - 'descriptor': {'dimensions': [1, 2, 3, 3], 'dataType': 'float32'}, + 'descriptor': {shape: [1, 2, 3, 3], dataType: 'float32'}, 'constant': true } }, @@ -418,7 +418,7 @@ const convTranspose2dTests = [ 0.04055071249604225, 0.27599334716796875, 0.3911670744419098, 0.3143731355667114, 0.26951852440834045, 0.09216563403606415 ], - 'descriptor': {'dimensions': [1, 2, 9, 7], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 9, 7], dataType: 'float32'} } } } @@ -434,14 +434,14 @@ const convTranspose2dTests = [ 0.47982943058013916, 0.76741623878479, 0.9083173871040344, 0.6205142140388489, 0.6580719947814941, 0.6553052067756653 ], - 'descriptor': {'dimensions': [1, 1, 3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float32'} }, 'convTranspose2dFilter': { 'data': [ 0.6835425496101379, 0.9641214609146118, 0.8272836804389954, 0.5771222710609436 ], - 'descriptor': {'dimensions': [1, 1, 2, 2], 'dataType': 'float32'}, + 'descriptor': {shape: [1, 1, 2, 2], dataType: 'float32'}, 'constant': true } }, @@ -467,7 +467,7 @@ const convTranspose2dTests = [ 0.5444121956825256, 0.9002358913421631, 0.37978801131248474, 0.3781912326812744 ], - 'descriptor': {'dimensions': [1, 1, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 5, 5], dataType: 'float32'} } } } @@ -483,7 +483,7 @@ const convTranspose2dTests = [ 0.38622909784317017, 0.3870837390422821, 0.9461629390716553, 0.09573192149400711, 0.9234652519226074, 0.636277973651886 ], - 'descriptor': {'dimensions': [1, 1, 3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float32'} }, 'convTranspose2dFilter': { 'data': [ @@ -494,7 +494,7 @@ const convTranspose2dTests = [ 0.7498031854629517, 0.3930714726448059, 0.13811933994293213, 0.28385090827941895, 0.4235861301422119, 0.1448512077331543 ], - 'descriptor': {'dimensions': [1, 2, 3, 3], 'dataType': 'float32'}, + 'descriptor': {shape: [1, 2, 3, 3], dataType: 'float32'}, 'constant': true } }, @@ -671,7 +671,7 @@ const convTranspose2dTests = [ 0, 0 ], - 'descriptor': {'dimensions': [1, 2, 10, 8], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 10, 8], dataType: 'float32'} } } } @@ -687,7 +687,7 @@ const convTranspose2dTests = [ 0.38622909784317017, 0.3870837390422821, 0.9461629390716553, 0.09573192149400711, 0.9234652519226074, 0.636277973651886 ], - 'descriptor': {'dimensions': [1, 1, 3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float32'} }, 'convTranspose2dFilter': { 'data': [ @@ -698,7 +698,7 @@ const convTranspose2dTests = [ 0.7498031854629517, 0.3930714726448059, 0.13811933994293213, 0.28385090827941895, 0.4235861301422119, 0.1448512077331543 ], - 'descriptor': {'dimensions': [1, 2, 3, 3], 'dataType': 'float32'}, + 'descriptor': {shape: [1, 2, 3, 3], dataType: 'float32'}, 'constant': true } }, @@ -875,7 +875,7 @@ const convTranspose2dTests = [ 0, 0 ], - 'descriptor': {'dimensions': [1, 2, 10, 8], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 10, 8], dataType: 'float32'} } } } @@ -891,7 +891,7 @@ const convTranspose2dTests = [ 0.38622909784317017, 0.3870837390422821, 0.9461629390716553, 0.09573192149400711, 0.9234652519226074, 0.636277973651886 ], - 'descriptor': {'dimensions': [1, 1, 3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float32'} }, 'convTranspose2dFilter': { 'data': [ @@ -902,7 +902,7 @@ const convTranspose2dTests = [ 0.7498031854629517, 0.3930714726448059, 0.13811933994293213, 0.28385090827941895, 0.4235861301422119, 0.1448512077331543 ], - 'descriptor': {'dimensions': [1, 2, 3, 3], 'dataType': 'float32'}, + 'descriptor': {shape: [1, 2, 3, 3], dataType: 'float32'}, 'constant': true } }, @@ -936,7 +936,7 @@ const convTranspose2dTests = [ 0.027173593640327454, 0.3026771545410156, 0.5856420397758484, 0.40328359603881836, 0.09216563403606415 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } } } @@ -952,7 +952,7 @@ const convTranspose2dTests = [ 0.38622909784317017, 0.3870837390422821, 0.9461629390716553, 0.09573192149400711, 0.9234652519226074, 0.636277973651886 ], - 'descriptor': {'dimensions': [1, 3, 3, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 3, 1], dataType: 'float32'} }, 'convTranspose2dFilter': { 'data': [ @@ -963,7 +963,7 @@ const convTranspose2dTests = [ 0.7498031854629517, 0.3930714726448059, 0.13811933994293213, 0.28385090827941895, 0.4235861301422119, 0.1448512077331543 ], - 'descriptor': {'dimensions': [1, 2, 3, 3], 'dataType': 'float32'}, + 'descriptor': {shape: [1, 2, 3, 3], dataType: 'float32'}, 'constant': true } }, @@ -997,7 +997,7 @@ const convTranspose2dTests = [ 0.5856420397758484, 1.2216601371765137, 0.40328359603881836, 0.45846959948539734, 0.09216563403606415 ], - 'descriptor': {'dimensions': [1, 5, 5, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 5, 5, 2], dataType: 'float32'} } } } @@ -1013,7 +1013,7 @@ const convTranspose2dTests = [ 0.38622909784317017, 0.3870837390422821, 0.9461629390716553, 0.09573192149400711, 0.9234652519226074, 0.636277973651886 ], - 'descriptor': {'dimensions': [1, 1, 3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float32'} }, 'convTranspose2dFilter': { 'data': [ @@ -1024,7 +1024,7 @@ const convTranspose2dTests = [ 0.7498031854629517, 0.3930714726448059, 0.13811933994293213, 0.28385090827941895, 0.4235861301422119, 0.1448512077331543 ], - 'descriptor': {'dimensions': [1, 2, 3, 3], 'dataType': 'float32'}, + 'descriptor': {shape: [1, 2, 3, 3], dataType: 'float32'}, 'constant': true } }, @@ -1058,7 +1058,7 @@ const convTranspose2dTests = [ 0.027173593640327454, 0.3026771545410156, 0.5856420397758484, 0.40328359603881836, 0.09216563403606415 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } } } @@ -1074,7 +1074,7 @@ const convTranspose2dTests = [ 0.38622909784317017, 0.3870837390422821, 0.9461629390716553, 0.09573192149400711, 0.9234652519226074, 0.636277973651886 ], - 'descriptor': {'dimensions': [1, 1, 3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float32'} }, 'convTranspose2dFilter': { 'data': [ @@ -1085,7 +1085,7 @@ const convTranspose2dTests = [ 0.3285411298274994, 0.28385090827941895, 0.8742373585700989, 0.4235861301422119, 0.7205492258071899, 0.1448512077331543 ], - 'descriptor': {'dimensions': [3, 3, 2, 1], 'dataType': 'float32'}, + 'descriptor': {shape: [3, 3, 2, 1], dataType: 'float32'}, 'constant': true } }, @@ -1119,7 +1119,7 @@ const convTranspose2dTests = [ 0.027173593640327454, 0.3026771545410156, 0.5856420397758484, 0.40328359603881836, 0.09216563403606415 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } } } @@ -1135,7 +1135,7 @@ const convTranspose2dTests = [ 0.38622909784317017, 0.3870837390422821, 0.9461629390716553, 0.09573192149400711, 0.9234652519226074, 0.636277973651886 ], - 'descriptor': {'dimensions': [1, 1, 3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float32'} }, 'convTranspose2dFilter': { 'data': [ @@ -1146,7 +1146,7 @@ const convTranspose2dTests = [ 0.7498031854629517, 0.3930714726448059, 0.13811933994293213, 0.28385090827941895, 0.4235861301422119, 0.1448512077331543 ], - 'descriptor': {'dimensions': [2, 3, 3, 1], 'dataType': 'float32'}, + 'descriptor': {shape: [2, 3, 3, 1], dataType: 'float32'}, 'constant': true } }, @@ -1180,7 +1180,7 @@ const convTranspose2dTests = [ 0.027173593640327454, 0.3026771545410156, 0.5856420397758484, 0.40328359603881836, 0.09216563403606415 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } } } @@ -1196,7 +1196,7 @@ const convTranspose2dTests = [ 0.38622909784317017, 0.3870837390422821, 0.9461629390716553, 0.09573192149400711, 0.9234652519226074, 0.636277973651886 ], - 'descriptor': {'dimensions': [1, 3, 3, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 3, 1], dataType: 'float32'} }, 'convTranspose2dFilter': { 'data': [ @@ -1207,7 +1207,7 @@ const convTranspose2dTests = [ 0.7498031854629517, 0.3930714726448059, 0.13811933994293213, 0.28385090827941895, 0.4235861301422119, 0.1448512077331543 ], - 'descriptor': {'dimensions': [1, 2, 3, 3], 'dataType': 'float32'}, + 'descriptor': {shape: [1, 2, 3, 3], dataType: 'float32'}, 'constant': true } }, @@ -1241,7 +1241,7 @@ const convTranspose2dTests = [ 0.5856420397758484, 1.2216601371765137, 0.40328359603881836, 0.45846959948539734, 0.09216563403606415 ], - 'descriptor': {'dimensions': [1, 5, 5, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 5, 5, 2], dataType: 'float32'} } } } @@ -1257,7 +1257,7 @@ const convTranspose2dTests = [ 0.38622909784317017, 0.3870837390422821, 0.9461629390716553, 0.09573192149400711, 0.9234652519226074, 0.636277973651886 ], - 'descriptor': {'dimensions': [1, 3, 3, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 3, 1], dataType: 'float32'} }, 'convTranspose2dFilter': { 'data': [ @@ -1268,7 +1268,7 @@ const convTranspose2dTests = [ 0.3285411298274994, 0.28385090827941895, 0.8742373585700989, 0.4235861301422119, 0.7205492258071899, 0.1448512077331543 ], - 'descriptor': {'dimensions': [3, 3, 2, 1], 'dataType': 'float32'}, + 'descriptor': {shape: [3, 3, 2, 1], dataType: 'float32'}, 'constant': true } }, @@ -1302,7 +1302,7 @@ const convTranspose2dTests = [ 0.5856420397758484, 1.2216601371765137, 0.40328359603881836, 0.45846959948539734, 0.09216563403606415 ], - 'descriptor': {'dimensions': [1, 5, 5, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 5, 5, 2], dataType: 'float32'} } } } @@ -1318,7 +1318,7 @@ const convTranspose2dTests = [ 0.38622909784317017, 0.3870837390422821, 0.9461629390716553, 0.09573192149400711, 0.9234652519226074, 0.636277973651886 ], - 'descriptor': {'dimensions': [1, 3, 3, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 3, 1], dataType: 'float32'} }, 'convTranspose2dFilter': { 'data': [ @@ -1329,7 +1329,7 @@ const convTranspose2dTests = [ 0.7498031854629517, 0.3930714726448059, 0.13811933994293213, 0.28385090827941895, 0.4235861301422119, 0.1448512077331543 ], - 'descriptor': {'dimensions': [2, 3, 3, 1], 'dataType': 'float32'}, + 'descriptor': {shape: [2, 3, 3, 1], dataType: 'float32'}, 'constant': true } }, @@ -1363,7 +1363,7 @@ const convTranspose2dTests = [ 0.5856420397758484, 1.2216601371765137, 0.40328359603881836, 0.45846959948539734, 0.09216563403606415 ], - 'descriptor': {'dimensions': [1, 5, 5, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 5, 5, 2], dataType: 'float32'} } } } @@ -1378,7 +1378,7 @@ const convTranspose2dTests = [ 0.43077003955841064, 0.5981627106666565, 0.12321650236845016, 0.1610974818468094, 0.0884026437997818, 0.29100972414016724 ], - 'descriptor': {'dimensions': [1, 1, 3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float32'} }, 'convTranspose2dFilter': { 'data': [ @@ -1386,12 +1386,12 @@ const convTranspose2dTests = [ 0.8730561137199402, 0.8309102058410645, 0.854960560798645, 0.5552039742469788, 0.840092122554779, 0.85308438539505 ], - 'descriptor': {'dimensions': [1, 1, 3, 3], 'dataType': 'float32'}, + 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float32'}, 'constant': true }, 'convTranspose2dBias': { 'data': [0.451673686504364], - 'descriptor': {'dimensions': [1], 'dataType': 'float32'}, + 'descriptor': {shape: [1], dataType: 'float32'}, 'constant': true } }, @@ -1417,7 +1417,7 @@ const convTranspose2dTests = [ 0.6360918879508972, 0.8249395489692688, 0.7715635895729065, 0.6999295353889465 ], - 'descriptor': {'dimensions': [1, 1, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 5, 5], dataType: 'float32'} } } } @@ -1433,7 +1433,7 @@ const convTranspose2dTests = [ -0.5624061226844788, -0.7322093844413757, -0.8421320915222168, -0.30598655343055725, -0.976659893989563, -0.014158561825752258 ], - 'descriptor': {'dimensions': [1, 1, 3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float32'} }, 'convTranspose2dFilter': { 'data': [ @@ -1441,12 +1441,12 @@ const convTranspose2dTests = [ 0.8730561137199402, 0.8309102058410645, 0.854960560798645, 0.5552039742469788, 0.840092122554779, 0.85308438539505 ], - 'descriptor': {'dimensions': [1, 1, 3, 3], 'dataType': 'float32'}, + 'descriptor': {shape: [1, 1, 3, 3], dataType: 'float32'}, 'constant': true }, 'convTranspose2dBias': { 'data': [-0.8457866311073303], - 'descriptor': {'dimensions': [1], 'dataType': 'float32'}, + 'descriptor': {shape: [1], dataType: 'float32'}, 'constant': true } }, @@ -1472,7 +1472,7 @@ const convTranspose2dTests = [ -1.645089030265808, -1.935164213180542, -1.6908544301986694, -0.8578650951385498 ], - 'descriptor': {'dimensions': [1, 1, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 5, 5], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/cos.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/cos.https.any.js index 5ad92e7014a8..4a50dff594b5 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/cos.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/cos.https.any.js @@ -28,7 +28,7 @@ const cosTests = [ 'inputs': { 'cosInput': { 'data': [85.56369018554688], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -39,7 +39,7 @@ const cosTests = [ 'expectedOutputs': { 'cosOutput': { 'data': [-0.7380040884017944], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -59,7 +59,7 @@ const cosTests = [ -98.67289733886719, -63.6115608215332, 26.85724639892578, 83.70417022705078, 76.56607055664062, -47.83436584472656 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -80,7 +80,7 @@ const cosTests = [ -0.283336341381073, 0.7111190557479858, -0.1531042903661728, -0.43673399090766907, 0.39213326573371887, -0.7580515146255493 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -100,7 +100,7 @@ const cosTests = [ -98.67289733886719, -63.6115608215332, 26.85724639892578, 83.70417022705078, 76.56607055664062, -47.83436584472656 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -120,7 +120,7 @@ const cosTests = [ -0.283336341381073, 0.7111190557479858, -0.1531042903661728, -0.43673399090766907, 0.39213326573371887, -0.7580515146255493 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -140,7 +140,7 @@ const cosTests = [ -98.67289733886719, -63.6115608215332, 26.85724639892578, 83.70417022705078, 76.56607055664062, -47.83436584472656 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -160,7 +160,7 @@ const cosTests = [ -0.283336341381073, 0.7111190557479858, -0.1531042903661728, -0.43673399090766907, 0.39213326573371887, -0.7580515146255493 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -180,7 +180,7 @@ const cosTests = [ -98.67289733886719, -63.6115608215332, 26.85724639892578, 83.70417022705078, 76.56607055664062, -47.83436584472656 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -200,7 +200,7 @@ const cosTests = [ -0.283336341381073, 0.7111190557479858, -0.1531042903661728, -0.43673399090766907, 0.39213326573371887, -0.7580515146255493 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -220,7 +220,7 @@ const cosTests = [ -98.67289733886719, -63.6115608215332, 26.85724639892578, 83.70417022705078, 76.56607055664062, -47.83436584472656 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -240,7 +240,7 @@ const cosTests = [ -0.283336341381073, 0.7111190557479858, -0.1531042903661728, -0.43673399090766907, 0.39213326573371887, -0.7580515146255493 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -260,7 +260,7 @@ const cosTests = [ -98.67289733886719, -63.6115608215332, 26.85724639892578, 83.70417022705078, 76.56607055664062, -47.83436584472656 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } }, 'operators': [{ @@ -280,7 +280,7 @@ const cosTests = [ -0.283336341381073, 0.7111190557479858, -0.1531042903661728, -0.43673399090766907, 0.39213326573371887, -0.7580515146255493 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } } } 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 index 2939121c2418..c6acb042a246 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/dequantizeLinear.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/dequantizeLinear.https.any.js @@ -31,17 +31,17 @@ const dequantizeLinearTests = [ 'inputs': { 'dequantizeLinearInput': { 'data': [123], - 'descriptor': {'dimensions': [], 'dataType': 'int8'}, + 'descriptor': {shape: [], dataType: 'int8'}, 'constant': true }, 'dequantizeLinearScale': { 'data': [1.1202747821807861], - 'descriptor': {'dimensions': [], 'dataType': 'float32'}, + 'descriptor': {shape: [], dataType: 'float32'}, 'constant': true }, 'dequantizeLinearZeroPoint': { 'data': [3], - 'descriptor': {'dimensions': [], 'dataType': 'int8'}, + 'descriptor': {shape: [], dataType: 'int8'}, 'constant': true } }, @@ -57,7 +57,7 @@ const dequantizeLinearTests = [ 'expectedOutputs': { 'dequantizeLinearOutput': { 'data': [134.43296813964844], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -68,7 +68,7 @@ const dequantizeLinearTests = [ 'inputs': { 'dequantizeLinearInput': { 'data': [12, 24, 35, 123], - 'descriptor': {'dimensions': [4], 'dataType': 'uint8'}, + 'descriptor': {shape: [4], dataType: 'uint8'}, 'constant': true }, 'dequantizeLinearScale': { @@ -78,12 +78,12 @@ const dequantizeLinearTests = [ -4.617084980010986, 1.1202747821807861, ], - 'descriptor': {'dimensions': [4], 'dataType': 'float32'}, + 'descriptor': {shape: [4], dataType: 'float32'}, 'constant': true }, 'dequantizeLinearZeroPoint': { 'data': [128], - 'descriptor': {'dimensions': [], 'dataType': 'uint8'}, + 'descriptor': {shape: [], dataType: 'uint8'}, 'constant': true } }, @@ -102,7 +102,7 @@ const dequantizeLinearTests = [ -1083.798828125, -29.127147674560547, 429.388916015625, -5.601373672485352 ], - 'descriptor': {'dimensions': [4], 'dataType': 'float32'} + 'descriptor': {shape: [4], dataType: 'float32'} } } } @@ -114,17 +114,17 @@ const dequantizeLinearTests = [ 'inputs': { 'dequantizeLinearInput': { 'data': [-124, 0, 23, 122], - 'descriptor': {'dimensions': [1, 1, 2, 2], 'dataType': 'int8'}, + 'descriptor': {shape: [1, 1, 2, 2], dataType: 'int8'}, 'constant': true }, 'dequantizeLinearScale': { 'data': [0.2800687253475189, -4.617084980010986], - 'descriptor': {'dimensions': [2, 1], 'dataType': 'float32'}, + 'descriptor': {shape: [2, 1], dataType: 'float32'}, 'constant': true }, 'dequantizeLinearZeroPoint': { 'data': [12], - 'descriptor': {'dimensions': [], 'dataType': 'int8'}, + 'descriptor': {shape: [], dataType: 'int8'}, 'constant': true } }, @@ -143,7 +143,7 @@ const dequantizeLinearTests = [ -38.08934783935547, -3.3608245849609375, -50.787933349609375, -507.87933349609375 ], - 'descriptor': {'dimensions': [1, 1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 2, 2], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/div.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/div.https.any.js index 69183ee1097b..2c36884ce91f 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/div.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/div.https.any.js @@ -36,7 +36,7 @@ const divTests = [ 4.816806316375732, 44.15916442871094, -13.083211898803711, 44.56599807739258, -34.892784118652344, -74.09375 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true }, 'inputB': { @@ -50,7 +50,7 @@ const divTests = [ 81.65287017822266, 48.2148323059082, 63.370121002197266, 10.626384735107422, 46.126625061035156, 77.22327423095703 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -71,7 +71,7 @@ const divTests = [ 0.058991268277168274, 0.9158834218978882, -0.20645710825920105, 4.193900108337402, -0.7564564943313599, -0.9594743251800537 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -91,7 +91,7 @@ const divTests = [ 4.816806316375732, 44.15916442871094, -13.083211898803711, 44.56599807739258, -34.892784118652344, -74.09375 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -104,7 +104,7 @@ const divTests = [ 81.65287017822266, 48.2148323059082, 63.370121002197266, 10.626384735107422, 46.126625061035156, 77.22327423095703 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -124,7 +124,7 @@ const divTests = [ 0.058991268277168274, 0.9158834218978882, -0.20645710825920105, 4.193900108337402, -0.7564564943313599, -0.9594743251800537 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -144,7 +144,7 @@ const divTests = [ 4.816806316375732, 44.15916442871094, -13.083211898803711, 44.56599807739258, -34.892784118652344, -74.09375 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -157,7 +157,7 @@ const divTests = [ 81.65287017822266, 48.2148323059082, 63.370121002197266, 10.626384735107422, 46.126625061035156, 77.22327423095703 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -177,7 +177,7 @@ const divTests = [ 0.058991268277168274, 0.9158834218978882, -0.20645710825920105, 4.193900108337402, -0.7564564943313599, -0.9594743251800537 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -197,7 +197,7 @@ const divTests = [ 4.816806316375732, 44.15916442871094, -13.083211898803711, 44.56599807739258, -34.892784118652344, -74.09375 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -210,7 +210,7 @@ const divTests = [ 81.65287017822266, 48.2148323059082, 63.370121002197266, 10.626384735107422, 46.126625061035156, 77.22327423095703 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -230,7 +230,7 @@ const divTests = [ 0.058991268277168274, 0.9158834218978882, -0.20645710825920105, 4.193900108337402, -0.7564564943313599, -0.9594743251800537 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -250,7 +250,7 @@ const divTests = [ 4.816806316375732, 44.15916442871094, -13.083211898803711, 44.56599807739258, -34.892784118652344, -74.09375 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -263,7 +263,7 @@ const divTests = [ 81.65287017822266, 48.2148323059082, 63.370121002197266, 10.626384735107422, 46.126625061035156, 77.22327423095703 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -283,7 +283,7 @@ const divTests = [ 0.058991268277168274, 0.9158834218978882, -0.20645710825920105, 4.193900108337402, -0.7564564943313599, -0.9594743251800537 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -303,7 +303,7 @@ const divTests = [ 4.816806316375732, 44.15916442871094, -13.083211898803711, 44.56599807739258, -34.892784118652344, -74.09375 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -316,7 +316,7 @@ const divTests = [ 81.65287017822266, 48.2148323059082, 63.370121002197266, 10.626384735107422, 46.126625061035156, 77.22327423095703 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -336,7 +336,7 @@ const divTests = [ 0.058991268277168274, 0.9158834218978882, -0.20645710825920105, 4.193900108337402, -0.7564564943313599, -0.9594743251800537 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} } } } @@ -347,7 +347,7 @@ const divTests = [ 'inputs': { 'inputA': { 'data': [-41.827415466308594], - 'descriptor': {'dimensions': [1], 'dataType': 'float32'} + 'descriptor': {shape: [1], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -360,7 +360,7 @@ const divTests = [ 4.816806316375732, 44.15916442871094, -13.083211898803711, 44.56599807739258, -34.892784118652344, -74.09375 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -380,7 +380,7 @@ const divTests = [ -8.683640480041504, -0.9471967220306396, 3.1970295906066895, -0.9385499358177185, 1.19874107837677, 0.5645201802253723 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -400,14 +400,14 @@ const divTests = [ 4.816806316375732, 44.15916442871094, -13.083211898803711, 44.56599807739258, -34.892784118652344, -74.09375 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ 97.32406616210938, 36.325218200683594, 26.037858963012695, 99.47166442871094, 10.395523071289062, -30.788942337036133 ], - 'descriptor': {'dimensions': [2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -427,7 +427,7 @@ const divTests = [ 0.049492448568344116, 1.2156614065170288, -0.5024688243865967, 0.4480270743370056, -3.356520175933838, 2.4065051078796387 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -447,14 +447,14 @@ const divTests = [ 4.816806316375732, 44.15916442871094, -13.083211898803711, 44.56599807739258, -34.892784118652344, -74.09375 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ 75.08295440673828, -46.22666931152344, 15.761880874633789, 8.9222993850708 ], - 'descriptor': {'dimensions': [2, 2, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1], dataType: 'float32'} } }, 'operators': [{ @@ -474,7 +474,7 @@ const divTests = [ 0.3055984377861023, 2.801643133163452, -0.830053985118866, 4.994900703430176, -3.910738945007324, -8.304333686828613 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -485,7 +485,7 @@ const divTests = [ 'inputs': { 'inputA': { 'data': [-41.827415466308594], - 'descriptor': {'dimensions': [1, 1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -498,7 +498,7 @@ const divTests = [ 4.816806316375732, 44.15916442871094, -13.083211898803711, 44.56599807739258, -34.892784118652344, -74.09375 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -518,7 +518,7 @@ const divTests = [ -8.683640480041504, -0.9471967220306396, 3.1970295906066895, -0.9385499358177185, 1.19874107837677, 0.5645201802253723 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/elu.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/elu.https.any.js index 75b982944ba9..d1cbf744a403 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/elu.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/elu.https.any.js @@ -34,7 +34,7 @@ const eluTests = [ 'inputs': { 'eluInput': { 'data': [4.721739768981934], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -45,7 +45,7 @@ const eluTests = [ 'expectedOutputs': { 'eluOutput': { 'data': [4.721739768981934], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -56,7 +56,7 @@ const eluTests = [ 'inputs': { 'eluInput': { 'data': [-3.8663666248321533], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -67,7 +67,7 @@ const eluTests = [ 'expectedOutputs': { 'eluOutput': { 'data': [-0.9790657162666321], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -87,7 +87,7 @@ const eluTests = [ -4.01986026763916, 7.114678382873535, -0.11212847381830215, -3.688840866088867, 6.135150909423828, -9.895182609558105 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -108,7 +108,7 @@ const eluTests = [ -0.982044517993927, 7.114678382873535, -0.10607059299945831, -0.9749990105628967, 6.135150909423828, -0.99994957447052 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -128,7 +128,7 @@ const eluTests = [ -4.01986026763916, 7.114678382873535, -0.11212847381830215, -3.688840866088867, 6.135150909423828, -9.895182609558105 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -148,7 +148,7 @@ const eluTests = [ -0.982044517993927, 7.114678382873535, -0.10607059299945831, -0.9749990105628967, 6.135150909423828, -0.99994957447052 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -168,7 +168,7 @@ const eluTests = [ -4.01986026763916, 7.114678382873535, -0.11212847381830215, -3.688840866088867, 6.135150909423828, -9.895182609558105 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -188,7 +188,7 @@ const eluTests = [ -0.982044517993927, 7.114678382873535, -0.10607059299945831, -0.9749990105628967, 6.135150909423828, -0.99994957447052 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -208,7 +208,7 @@ const eluTests = [ -4.01986026763916, 7.114678382873535, -0.11212847381830215, -3.688840866088867, 6.135150909423828, -9.895182609558105 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -228,7 +228,7 @@ const eluTests = [ -0.982044517993927, 7.114678382873535, -0.10607059299945831, -0.9749990105628967, 6.135150909423828, -0.99994957447052 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -248,7 +248,7 @@ const eluTests = [ -4.01986026763916, 7.114678382873535, -0.11212847381830215, -3.688840866088867, 6.135150909423828, -9.895182609558105 ], - 'descriptor': {'dimensions': [1, 2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -268,7 +268,7 @@ const eluTests = [ -0.982044517993927, 7.114678382873535, -0.10607059299945831, -0.9749990105628967, 6.135150909423828, -0.99994957447052 ], - 'descriptor': {'dimensions': [1, 2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} } } } @@ -288,7 +288,7 @@ const eluTests = [ -4.01986026763916, 7.114678382873535, -0.11212847381830215, -3.688840866088867, 6.135150909423828, -9.895182609558105 ], - 'descriptor': {'dimensions': [1, 2, 1, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -308,7 +308,7 @@ const eluTests = [ -0.982044517993927, 7.114678382873535, -0.10607059299945831, -0.9749990105628967, 6.135150909423828, -0.99994957447052 ], - 'descriptor': {'dimensions': [1, 2, 1, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 3, 4], dataType: 'float32'} } } } @@ -328,7 +328,7 @@ const eluTests = [ -4.01986026763916, 7.114678382873535, -0.11212847381830215, -3.688840866088867, 6.135150909423828, -9.895182609558105 ], - 'descriptor': {'dimensions': [1, 2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -349,7 +349,7 @@ const eluTests = [ -0.3542475700378418, 7.114678382873535, -0.0382622666656971, -0.3517060875892639, 6.135150909423828, -0.3607063591480255 ], - 'descriptor': {'dimensions': [1, 2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} } } } @@ -369,7 +369,7 @@ const eluTests = [ -4.01986026763916, 7.114678382873535, -0.11212847381830215, -3.688840866088867, 6.135150909423828, -9.895182609558105 ], - 'descriptor': {'dimensions': [1, 2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -390,7 +390,7 @@ const eluTests = [ 3.40590763092041, 7.114678382873535, 0.3678719699382782, 3.381472587585449, 6.135150909423828, 3.468005657196045 ], - 'descriptor': {'dimensions': [1, 2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/equal.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/equal.https.any.js index c763786d4aff..37cd0ca97dc2 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/equal.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/equal.https.any.js @@ -28,11 +28,11 @@ const equalTests = [ 'inputs': { 'inputA': { 'data': [-0.6285496950149536], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} }, 'inputB': { 'data': [-4.4166412353515625], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -41,8 +41,7 @@ const equalTests = [ 'outputs': 'output' }], 'expectedOutputs': { - 'output': - {'data': [0], 'descriptor': {'dimensions': [], 'dataType': 'uint8'}} + 'output': {'data': [0], 'descriptor': {shape: [], dataType: 'uint8'}} } } }, @@ -61,7 +60,7 @@ const equalTests = [ 2.80570650100708, 5.588105201721191, -6.245251178741455, -2.8490731716156006, -2.6951117515563965, 5.817563056945801 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true }, 'inputB': { @@ -75,7 +74,7 @@ const equalTests = [ 2.80570650100708, 5.588105201721191, -9.041799545288086, -1.9728281497955322, -3.011512279510498, 3.6268343925476074 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -90,7 +89,7 @@ const equalTests = [ 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 ], - 'descriptor': {'dimensions': [24], 'dataType': 'uint8'} + 'descriptor': {shape: [24], dataType: 'uint8'} } } } @@ -110,7 +109,7 @@ const equalTests = [ 2.80570650100708, 5.588105201721191, -6.245251178741455, -2.8490731716156006, -2.6951117515563965, 5.817563056945801 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -123,7 +122,7 @@ const equalTests = [ 2.80570650100708, 5.588105201721191, -9.041799545288086, -1.9728281497955322, -3.011512279510498, 3.6268343925476074 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -137,7 +136,7 @@ const equalTests = [ 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 ], - 'descriptor': {'dimensions': [24], 'dataType': 'uint8'} + 'descriptor': {shape: [24], dataType: 'uint8'} } } } @@ -157,7 +156,7 @@ const equalTests = [ 2.80570650100708, 5.588105201721191, -6.245251178741455, -2.8490731716156006, -2.6951117515563965, 5.817563056945801 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -170,7 +169,7 @@ const equalTests = [ 2.80570650100708, 5.588105201721191, -9.041799545288086, -1.9728281497955322, -3.011512279510498, 3.6268343925476074 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -184,7 +183,7 @@ const equalTests = [ 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'uint8'} + 'descriptor': {shape: [4, 6], dataType: 'uint8'} } } } @@ -204,7 +203,7 @@ const equalTests = [ 2.80570650100708, 5.588105201721191, -6.245251178741455, -2.8490731716156006, -2.6951117515563965, 5.817563056945801 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -217,7 +216,7 @@ const equalTests = [ 2.80570650100708, 5.588105201721191, -9.041799545288086, -1.9728281497955322, -3.011512279510498, 3.6268343925476074 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -231,7 +230,7 @@ const equalTests = [ 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 3, 4], dataType: 'uint8'} } } } @@ -251,7 +250,7 @@ const equalTests = [ 2.80570650100708, 5.588105201721191, -6.245251178741455, -2.8490731716156006, -2.6951117515563965, 5.817563056945801 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -264,7 +263,7 @@ const equalTests = [ 2.80570650100708, 5.588105201721191, -9.041799545288086, -1.9728281497955322, -3.011512279510498, 3.6268343925476074 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -278,7 +277,7 @@ const equalTests = [ 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } @@ -298,7 +297,7 @@ const equalTests = [ 2.80570650100708, 5.588105201721191, -6.245251178741455, -2.8490731716156006, -2.6951117515563965, 5.817563056945801 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -311,7 +310,7 @@ const equalTests = [ 2.80570650100708, 5.588105201721191, -9.041799545288086, -1.9728281497955322, -3.011512279510498, 3.6268343925476074 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -325,7 +324,7 @@ const equalTests = [ 1, 1, 0, 1, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'uint8'} } } } @@ -336,7 +335,7 @@ const equalTests = [ 'inputs': { 'inputA': { 'data': [2.80570650100708], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -349,7 +348,7 @@ const equalTests = [ 2.80570650100708, 5.588105201721191, -6.245251178741455, -2.8490731716156006, -2.6951117515563965, 5.817563056945801 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -363,7 +362,7 @@ const equalTests = [ 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } @@ -374,7 +373,7 @@ const equalTests = [ 'inputs': { 'inputA': { 'data': [2.80570650100708], - 'descriptor': {'dimensions': [1], 'dataType': 'float32'} + 'descriptor': {shape: [1], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -387,7 +386,7 @@ const equalTests = [ 2.80570650100708, 5.588105201721191, -6.245251178741455, -2.8490731716156006, -2.6951117515563965, 5.817563056945801 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -401,7 +400,7 @@ const equalTests = [ 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } @@ -421,14 +420,14 @@ const equalTests = [ 2.80570650100708, 5.588105201721191, -6.245251178741455, -2.8490731716156006, -2.6951117515563965, 5.817563056945801 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ 2.80570650100708, 5.588105201721191, -4.9622955322265625, -2.863192081451416, -3.011512279510498, 3.6268343925476074 ], - 'descriptor': {'dimensions': [2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -442,7 +441,7 @@ const equalTests = [ 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } @@ -462,14 +461,14 @@ const equalTests = [ 2.80570650100708, 5.588105201721191, -6.245251178741455, -2.8490731716156006, -2.6951117515563965, 5.817563056945801 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ 2.80570650100708, 5.588105201721191, -9.041799545288086, 3.6268343925476074 ], - 'descriptor': {'dimensions': [2, 2, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1], dataType: 'float32'} } }, 'operators': [{ @@ -483,7 +482,7 @@ const equalTests = [ 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } @@ -494,7 +493,7 @@ const equalTests = [ 'inputs': { 'inputA': { 'data': [2.80570650100708], - 'descriptor': {'dimensions': [1, 1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -507,7 +506,7 @@ const equalTests = [ 2.80570650100708, 5.588105201721191, -6.245251178741455, -2.8490731716156006, -2.6951117515563965, 5.817563056945801 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -521,7 +520,7 @@ const equalTests = [ 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/erf.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/erf.https.any.js index 78fc81ea74a6..7e8a8e0c739c 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/erf.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/erf.https.any.js @@ -28,7 +28,7 @@ const erfTests = [ 'inputs': { 'erfInput': { 'data': [-0.004352752584964037], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -39,7 +39,7 @@ const erfTests = [ 'expectedOutputs': { 'erfOutput': { 'data': [-0.004911554511636496], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -59,7 +59,7 @@ const erfTests = [ -0.8946002721786499, -0.3920256197452545, 0.6854220628738403, -0.6744900345802307, -0.439808189868927, 0.2709762454032898 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -80,7 +80,7 @@ const erfTests = [ -0.7941843867301941, -0.4207003712654114, 0.6676210165023804, -0.6598520874977112, -0.46604686975479126, 0.29844197630882263 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -100,7 +100,7 @@ const erfTests = [ -0.8946002721786499, -0.3920256197452545, 0.6854220628738403, -0.6744900345802307, -0.439808189868927, 0.2709762454032898 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -120,7 +120,7 @@ const erfTests = [ -0.7941843867301941, -0.4207003712654114, 0.6676210165023804, -0.6598520874977112, -0.46604686975479126, 0.29844197630882263 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -140,7 +140,7 @@ const erfTests = [ -0.8946002721786499, -0.3920256197452545, 0.6854220628738403, -0.6744900345802307, -0.439808189868927, 0.2709762454032898 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -160,7 +160,7 @@ const erfTests = [ -0.7941843867301941, -0.4207003712654114, 0.6676210165023804, -0.6598520874977112, -0.46604686975479126, 0.29844197630882263 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -180,7 +180,7 @@ const erfTests = [ -0.8946002721786499, -0.3920256197452545, 0.6854220628738403, -0.6744900345802307, -0.439808189868927, 0.2709762454032898 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -200,7 +200,7 @@ const erfTests = [ -0.7941843867301941, -0.4207003712654114, 0.6676210165023804, -0.6598520874977112, -0.46604686975479126, 0.29844197630882263 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -220,7 +220,7 @@ const erfTests = [ -0.8946002721786499, -0.3920256197452545, 0.6854220628738403, -0.6744900345802307, -0.439808189868927, 0.2709762454032898 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -240,7 +240,7 @@ const erfTests = [ -0.7941843867301941, -0.4207003712654114, 0.6676210165023804, -0.6598520874977112, -0.46604686975479126, 0.29844197630882263 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -260,7 +260,7 @@ const erfTests = [ -0.8946002721786499, -0.3920256197452545, 0.6854220628738403, -0.6744900345802307, -0.439808189868927, 0.2709762454032898 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } }, 'operators': [{ @@ -280,7 +280,7 @@ const erfTests = [ -0.7941843867301941, -0.4207003712654114, 0.6676210165023804, -0.6598520874977112, -0.46604686975479126, 0.29844197630882263 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/exp.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/exp.https.any.js index 9d67712ee60c..7b1dae9ac8b9 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/exp.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/exp.https.any.js @@ -28,7 +28,7 @@ const expTests = [ 'inputs': { 'expInput': { 'data': [0.3421436548233032], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -39,7 +39,7 @@ const expTests = [ 'expectedOutputs': { 'expOutput': { 'data': [1.4079625606536865], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -59,7 +59,7 @@ const expTests = [ -1.7085379362106323, -9.73737907409668, -1.9747875928878784, 8.203149795532227, -7.267597675323486, -3.5890684127807617 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -80,7 +80,7 @@ const expTests = [ 0.18113042414188385, 0.0000590350573475007, 0.1387907862663269, 3652.4365234375, 0.0006977862794883549, 0.02762405201792717 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -100,7 +100,7 @@ const expTests = [ -1.7085379362106323, -9.73737907409668, -1.9747875928878784, 8.203149795532227, -7.267597675323486, -3.5890684127807617 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -120,7 +120,7 @@ const expTests = [ 0.18113042414188385, 0.0000590350573475007, 0.1387907862663269, 3652.4365234375, 0.0006977862794883549, 0.02762405201792717 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -140,7 +140,7 @@ const expTests = [ -1.7085379362106323, -9.73737907409668, -1.9747875928878784, 8.203149795532227, -7.267597675323486, -3.5890684127807617 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -160,7 +160,7 @@ const expTests = [ 0.18113042414188385, 0.0000590350573475007, 0.1387907862663269, 3652.4365234375, 0.0006977862794883549, 0.02762405201792717 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -180,7 +180,7 @@ const expTests = [ -1.7085379362106323, -9.73737907409668, -1.9747875928878784, 8.203149795532227, -7.267597675323486, -3.5890684127807617 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -200,7 +200,7 @@ const expTests = [ 0.18113042414188385, 0.0000590350573475007, 0.1387907862663269, 3652.4365234375, 0.0006977862794883549, 0.02762405201792717 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -220,7 +220,7 @@ const expTests = [ -1.7085379362106323, -9.73737907409668, -1.9747875928878784, 8.203149795532227, -7.267597675323486, -3.5890684127807617 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -240,7 +240,7 @@ const expTests = [ 0.18113042414188385, 0.0000590350573475007, 0.1387907862663269, 3652.4365234375, 0.0006977862794883549, 0.02762405201792717 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -260,7 +260,7 @@ const expTests = [ -1.7085379362106323, -9.73737907409668, -1.9747875928878784, 8.203149795532227, -7.267597675323486, -3.5890684127807617 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } }, 'operators': [{ @@ -280,7 +280,7 @@ const expTests = [ 0.18113042414188385, 0.0000590350573475007, 0.1387907862663269, 3652.4365234375, 0.0006977862794883549, 0.02762405201792717 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/expand.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/expand.https.any.js index 6f94795370fa..6668a5cc216e 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/expand.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/expand.https.any.js @@ -30,7 +30,7 @@ const expandTests = [ 'inputs': { 'expandInput': { 'data': [-6.461850643157959], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -50,7 +50,7 @@ const expandTests = [ -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -61,7 +61,7 @@ const expandTests = [ 'inputs': { 'expandInput': { 'data': [-6.461850643157959], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -81,7 +81,7 @@ const expandTests = [ -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -92,7 +92,7 @@ const expandTests = [ 'inputs': { 'expandInput': { 'data': [-6.461850643157959], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -112,7 +112,7 @@ const expandTests = [ -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -123,7 +123,7 @@ const expandTests = [ 'inputs': { 'expandInput': { 'data': [-6.461850643157959], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -143,7 +143,7 @@ const expandTests = [ -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -154,7 +154,7 @@ const expandTests = [ 'inputs': { 'expandInput': { 'data': [-6.461850643157959], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -174,7 +174,7 @@ const expandTests = [ -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959 ], - 'descriptor': {'dimensions': [2, 2, 3, 1, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 3, 1, 2], dataType: 'float32'} } } } @@ -185,7 +185,7 @@ const expandTests = [ 'inputs': { 'expandInput': { 'data': [-6.461850643157959], - 'descriptor': {'dimensions': [1], 'dataType': 'float32'}, + 'descriptor': {shape: [1], dataType: 'float32'}, 'constant': true } }, @@ -206,7 +206,7 @@ const expandTests = [ -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -217,7 +217,7 @@ const expandTests = [ 'inputs': { 'expandInput': { 'data': [-6.461850643157959], - 'descriptor': {'dimensions': [1], 'dataType': 'float32'} + 'descriptor': {shape: [1], dataType: 'float32'} } }, 'operators': [{ @@ -237,7 +237,7 @@ const expandTests = [ -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -248,7 +248,7 @@ const expandTests = [ 'inputs': { 'expandInput': { 'data': [-6.461850643157959], - 'descriptor': {'dimensions': [1], 'dataType': 'float32'} + 'descriptor': {shape: [1], dataType: 'float32'} } }, 'operators': [{ @@ -268,7 +268,7 @@ const expandTests = [ -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -279,7 +279,7 @@ const expandTests = [ 'inputs': { 'expandInput': { 'data': [-6.461850643157959], - 'descriptor': {'dimensions': [1], 'dataType': 'float32'} + 'descriptor': {shape: [1], dataType: 'float32'} } }, 'operators': [{ @@ -299,7 +299,7 @@ const expandTests = [ -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -310,7 +310,7 @@ const expandTests = [ 'inputs': { 'expandInput': { 'data': [-6.461850643157959], - 'descriptor': {'dimensions': [1], 'dataType': 'float32'} + 'descriptor': {shape: [1], dataType: 'float32'} } }, 'operators': [{ @@ -330,7 +330,7 @@ const expandTests = [ -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -341,7 +341,7 @@ const expandTests = [ 'inputs': { 'expandInput': { 'data': [-6.461850643157959], - 'descriptor': {'dimensions': [1], 'dataType': 'float32'} + 'descriptor': {shape: [1], dataType: 'float32'} } }, 'operators': [{ @@ -361,7 +361,7 @@ const expandTests = [ -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959 ], - 'descriptor': {'dimensions': [2, 2, 3, 1, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 3, 1, 2], dataType: 'float32'} } } } @@ -375,7 +375,7 @@ const expandTests = [ 10.898762702941895, -29.391416549682617, -73.74250793457031, 22.456905364990234, -97.5792465209961, -76.95013427734375 ], - 'descriptor': {'dimensions': [1, 6], 'dataType': 'float32'} + 'descriptor': {shape: [1, 6], dataType: 'float32'} } }, 'operators': [{ @@ -395,7 +395,7 @@ const expandTests = [ 10.898762702941895, -29.391416549682617, -73.74250793457031, 22.456905364990234, -97.5792465209961, -76.95013427734375 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -409,7 +409,7 @@ const expandTests = [ 4.965915679931641, 66.14382934570312, 75.28175354003906, 49.998130798339844 ], - 'descriptor': {'dimensions': [4, 1], 'dataType': 'float32'} + 'descriptor': {shape: [4, 1], dataType: 'float32'} } }, 'operators': [{ @@ -429,7 +429,7 @@ const expandTests = [ 49.998130798339844, 49.998130798339844, 49.998130798339844, 49.998130798339844, 49.998130798339844, 49.998130798339844 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -440,7 +440,7 @@ const expandTests = [ 'inputs': { 'expandInput': { 'data': [-6.461850643157959], - 'descriptor': {'dimensions': [1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1], dataType: 'float32'} } }, 'operators': [{ @@ -460,7 +460,7 @@ const expandTests = [ -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -474,7 +474,7 @@ const expandTests = [ 4.965915679931641, 66.14382934570312, 75.28175354003906, 49.998130798339844 ], - 'descriptor': {'dimensions': [4, 1], 'dataType': 'float32'} + 'descriptor': {shape: [4, 1], dataType: 'float32'} } }, 'operators': [{ @@ -494,7 +494,7 @@ const expandTests = [ 75.28175354003906, 75.28175354003906, 75.28175354003906, 49.998130798339844, 49.998130798339844, 49.998130798339844 ], - 'descriptor': {'dimensions': [2, 4, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 4, 3], dataType: 'float32'} } } } @@ -508,7 +508,7 @@ const expandTests = [ 10.898762702941895, -29.391416549682617, -73.74250793457031, 22.456905364990234, -97.5792465209961, -76.95013427734375 ], - 'descriptor': {'dimensions': [1, 6], 'dataType': 'float32'} + 'descriptor': {shape: [1, 6], dataType: 'float32'} } }, 'operators': [{ @@ -528,7 +528,7 @@ const expandTests = [ 10.898762702941895, -29.391416549682617, -73.74250793457031, 22.456905364990234, -97.5792465209961, -76.95013427734375 ], - 'descriptor': {'dimensions': [2, 1, 2, 6], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 2, 6], dataType: 'float32'} } } } @@ -539,7 +539,7 @@ const expandTests = [ 'inputs': { 'expandInput': { 'data': [-6.461850643157959], - 'descriptor': {'dimensions': [1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1], dataType: 'float32'} } }, 'operators': [{ @@ -559,7 +559,7 @@ const expandTests = [ -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959, -6.461850643157959 ], - 'descriptor': {'dimensions': [2, 1, 3, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 3, 2, 2], dataType: 'float32'} } } } @@ -570,7 +570,7 @@ const expandTests = [ 'inputs': { 'expandInput': { 'data': [21.694129943847656, -72.82571411132812], - 'descriptor': {'dimensions': [1, 2, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1], dataType: 'float32'} } }, 'operators': [{ @@ -590,7 +590,7 @@ const expandTests = [ -72.82571411132812, -72.82571411132812, -72.82571411132812, -72.82571411132812, -72.82571411132812, -72.82571411132812 ], - 'descriptor': {'dimensions': [2, 2, 6], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 6], dataType: 'float32'} } } } @@ -601,7 +601,7 @@ const expandTests = [ 'inputs': { 'expandInput': { 'data': [21.694129943847656, -72.82571411132812], - 'descriptor': {'dimensions': [1, 2, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1], dataType: 'float32'} } }, 'operators': [{ @@ -621,7 +621,7 @@ const expandTests = [ 21.694129943847656, 21.694129943847656, 21.694129943847656, -72.82571411132812, -72.82571411132812, -72.82571411132812 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -632,7 +632,7 @@ const expandTests = [ 'inputs': { 'expandInput': { 'data': [21.694129943847656, -72.82571411132812], - 'descriptor': {'dimensions': [1, 2, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1], dataType: 'float32'} } }, 'operators': [{ @@ -652,7 +652,7 @@ const expandTests = [ 21.694129943847656, 21.694129943847656, 21.694129943847656, -72.82571411132812, -72.82571411132812, -72.82571411132812 ], - 'descriptor': {'dimensions': [2, 1, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 2, 2, 3], dataType: 'float32'} } } } @@ -663,7 +663,7 @@ const expandTests = [ 'inputs': { 'expandInput': { 'data': [12.799123764038086, -26.550199508666992], - 'descriptor': {'dimensions': [2, 1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 1, 1], dataType: 'float32'} } }, 'operators': [{ @@ -683,7 +683,7 @@ const expandTests = [ -26.550199508666992, -26.550199508666992, -26.550199508666992, -26.550199508666992, -26.550199508666992, -26.550199508666992 ], - 'descriptor': {'dimensions': [2, 3, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'} } } } @@ -694,7 +694,7 @@ const expandTests = [ 'inputs': { 'expandInput': { 'data': [12.799123764038086, -26.550199508666992], - 'descriptor': {'dimensions': [2, 1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 1, 1], dataType: 'float32'} } }, 'operators': [{ @@ -714,7 +714,7 @@ const expandTests = [ -26.550199508666992, -26.550199508666992, -26.550199508666992, -26.550199508666992, -26.550199508666992, -26.550199508666992 ], - 'descriptor': {'dimensions': [2, 2, 3, 1, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 3, 1, 2], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/floor.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/floor.https.any.js index 4cca407cd4c3..e59f220f4eb3 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/floor.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/floor.https.any.js @@ -28,7 +28,7 @@ const floorTests = [ 'inputs': { 'floorInput': { 'data': [89.69458770751953], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -37,10 +37,8 @@ const floorTests = [ 'outputs': 'floorOutput' }], 'expectedOutputs': { - 'floorOutput': { - 'data': [89], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} - } + 'floorOutput': + {'data': [89], 'descriptor': {shape: [], dataType: 'float32'}} } } }, @@ -59,7 +57,7 @@ const floorTests = [ -39.83677673339844, 32.5257568359375, -21.213542938232422, -80.30911254882812, 16.674850463867188, -72.88893127441406 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -74,7 +72,7 @@ const floorTests = [ 89, -80, -67, -72, 86, 6, 24, 0, 19, 0, -25, 77, -34, 80, 44, -38, -84, 65, -40, 32, -22, -81, 16, -73 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -94,7 +92,7 @@ const floorTests = [ -39.83677673339844, 32.5257568359375, -21.213542938232422, -80.30911254882812, 16.674850463867188, -72.88893127441406 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -108,7 +106,7 @@ const floorTests = [ 89, -80, -67, -72, 86, 6, 24, 0, 19, 0, -25, 77, -34, 80, 44, -38, -84, 65, -40, 32, -22, -81, 16, -73 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -128,7 +126,7 @@ const floorTests = [ -39.83677673339844, 32.5257568359375, -21.213542938232422, -80.30911254882812, 16.674850463867188, -72.88893127441406 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -142,7 +140,7 @@ const floorTests = [ 89, -80, -67, -72, 86, 6, 24, 0, 19, 0, -25, 77, -34, 80, 44, -38, -84, 65, -40, 32, -22, -81, 16, -73 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -162,7 +160,7 @@ const floorTests = [ -39.83677673339844, 32.5257568359375, -21.213542938232422, -80.30911254882812, 16.674850463867188, -72.88893127441406 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -176,7 +174,7 @@ const floorTests = [ 89, -80, -67, -72, 86, 6, 24, 0, 19, 0, -25, 77, -34, 80, 44, -38, -84, 65, -40, 32, -22, -81, 16, -73 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -196,7 +194,7 @@ const floorTests = [ -39.83677673339844, 32.5257568359375, -21.213542938232422, -80.30911254882812, 16.674850463867188, -72.88893127441406 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -210,7 +208,7 @@ const floorTests = [ 89, -80, -67, -72, 86, 6, 24, 0, 19, 0, -25, 77, -34, 80, 44, -38, -84, 65, -40, 32, -22, -81, 16, -73 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -230,7 +228,7 @@ const floorTests = [ -39.83677673339844, 32.5257568359375, -21.213542938232422, -80.30911254882812, 16.674850463867188, -72.88893127441406 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } }, 'operators': [{ @@ -244,7 +242,7 @@ const floorTests = [ 89, -80, -67, -72, 86, 6, 24, 0, 19, 0, -25, 77, -34, 80, 44, -38, -84, 65, -40, 32, -22, -81, 16, -73 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/gather.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gather.https.any.js index 3befa3818fce..3cdd411ecb3f 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/gather.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/gather.https.any.js @@ -44,11 +44,11 @@ const gatherTests = [ -37.696800231933594, 43.11057662963867, 0.9129875898361206, -7.699817180633545, 25.76774024963379, 73.60064697265625 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} }, 'gatherIndices': { 'data': [4], - 'descriptor': {'dimensions': [], 'dataType': 'uint32'}, + 'descriptor': {shape: [], dataType: 'uint32'}, 'constant': true } }, @@ -60,7 +60,7 @@ const gatherTests = [ 'expectedOutputs': { 'gatherOutput': { 'data': [89.0337142944336], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -81,11 +81,11 @@ const gatherTests = [ -37.696800231933594, 43.11057662963867, 0.9129875898361206, -7.699817180633545, 25.76774024963379, 73.60064697265625 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} }, 'gatherIndices': { 'data': [4], - 'descriptor': {'dimensions': [], 'dataType': 'int32'}, + 'descriptor': {shape: [], dataType: 'int32'}, 'constant': true } }, @@ -97,7 +97,7 @@ const gatherTests = [ 'expectedOutputs': { 'gatherOutput': { 'data': [89.0337142944336], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -118,11 +118,11 @@ const gatherTests = [ -37.696800231933594, 43.11057662963867, 0.9129875898361206, -7.699817180633545, 25.76774024963379, 73.60064697265625 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} }, 'gatherIndices': { 'data': [0], - 'descriptor': {'dimensions': [], 'dataType': 'int64'}, + 'descriptor': {shape: [], dataType: 'int64'}, 'constant': true } }, @@ -134,7 +134,7 @@ const gatherTests = [ 'expectedOutputs': { 'gatherOutput': { 'data': [-66.05901336669922], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -154,11 +154,11 @@ const gatherTests = [ -37.696800231933594, 43.11057662963867, 0.9129875898361206, -7.699817180633545, 25.76774024963379, 73.60064697265625 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} }, 'gatherIndices': { 'data': [16, 20, 6, 11, 17, 19, 13, 17], - 'descriptor': {'dimensions': [8], 'dataType': 'int64'}, + 'descriptor': {shape: [8], dataType: 'int64'}, 'constant': true } }, @@ -174,7 +174,7 @@ const gatherTests = [ -50.42131042480469, -19.693084716796875, 43.11057662963867, 55.620765686035156, -19.693084716796875 ], - 'descriptor': {'dimensions': [8], 'dataType': 'float32'} + 'descriptor': {shape: [8], dataType: 'float32'} } } } @@ -194,11 +194,11 @@ const gatherTests = [ -37.696800231933594, 43.11057662963867, 0.9129875898361206, -7.699817180633545, 25.76774024963379, 73.60064697265625 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} }, 'gatherIndices': { 'data': [14, 9, 21, 17], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'int64'}, + 'descriptor': {shape: [2, 2], dataType: 'int64'}, 'constant': true } }, @@ -213,7 +213,7 @@ const gatherTests = [ 44.92119598388672, 41.94132614135742, -7.699817180633545, -19.693084716796875 ], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} } } } @@ -233,12 +233,12 @@ const gatherTests = [ -37.696800231933594, 43.11057662963867, 0.9129875898361206, -7.699817180633545, 25.76774024963379, 73.60064697265625 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} }, 'gatherIndices': { 'data': [17, 19, 14, 16, 13, 0, 5, 15, 18, 18, 6, 20, 7, 22, 5, 1, 4, 19], - 'descriptor': {'dimensions': [2, 3, 3], 'dataType': 'int64'}, + 'descriptor': {shape: [2, 3, 3], dataType: 'int64'}, 'constant': true } }, @@ -257,7 +257,7 @@ const gatherTests = [ 48.81806945800781, 25.76774024963379, -45.89653396606445, -68.9197006225586, 89.0337142944336, 43.11057662963867 ], - 'descriptor': {'dimensions': [2, 3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 3], dataType: 'float32'} } } } @@ -277,11 +277,11 @@ const gatherTests = [ -37.696800231933594, 43.11057662963867, 0.9129875898361206, -7.699817180633545, 25.76774024963379, 73.60064697265625 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} }, 'gatherIndices': { 'data': [18, 18, 22, 11, 8, 15, 12, 11, 7, 13, 7, 7], - 'descriptor': {'dimensions': [1, 2, 2, 3], 'dataType': 'int64'}, + 'descriptor': {shape: [1, 2, 2, 3], dataType: 'int64'}, 'constant': true } }, @@ -298,7 +298,7 @@ const gatherTests = [ 90.2870101928711, -50.42131042480469, 48.81806945800781, 55.620765686035156, 48.81806945800781, 48.81806945800781 ], - 'descriptor': {'dimensions': [1, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2, 3], dataType: 'float32'} } } } @@ -318,11 +318,11 @@ const gatherTests = [ -37.696800231933594, 43.11057662963867, 0.9129875898361206, -7.699817180633545, 25.76774024963379, 73.60064697265625 ], - 'descriptor': {'dimensions': [12, 2], 'dataType': 'float32'} + 'descriptor': {shape: [12, 2], dataType: 'float32'} }, 'gatherIndices': { 'data': [11], - 'descriptor': {'dimensions': [], 'dataType': 'int64'}, + 'descriptor': {shape: [], dataType: 'int64'}, 'constant': true } }, @@ -334,7 +334,7 @@ const gatherTests = [ 'expectedOutputs': { 'gatherOutput': { 'data': [25.76774024963379, 73.60064697265625], - 'descriptor': {'dimensions': [2], 'dataType': 'float32'} + 'descriptor': {shape: [2], dataType: 'float32'} } } } @@ -354,11 +354,11 @@ const gatherTests = [ -37.696800231933594, 43.11057662963867, 0.9129875898361206, -7.699817180633545, 25.76774024963379, 73.60064697265625 ], - 'descriptor': {'dimensions': [12, 2], 'dataType': 'float32'} + 'descriptor': {shape: [12, 2], dataType: 'float32'} }, 'gatherIndices': { 'data': [1, 10, 9, 0, 3, 5, 3, 8], - 'descriptor': {'dimensions': [8], 'dataType': 'int64'}, + 'descriptor': {shape: [8], dataType: 'int64'}, 'constant': true } }, @@ -377,7 +377,7 @@ const gatherTests = [ 43.84803771972656, 48.81806945800781, 10.829925537109375, -19.693084716796875 ], - 'descriptor': {'dimensions': [8, 2], 'dataType': 'float32'} + 'descriptor': {shape: [8, 2], dataType: 'float32'} } } } @@ -397,11 +397,11 @@ const gatherTests = [ -37.696800231933594, 43.11057662963867, 0.9129875898361206, -7.699817180633545, 25.76774024963379, 73.60064697265625 ], - 'descriptor': {'dimensions': [12, 2], 'dataType': 'float32'} + 'descriptor': {shape: [12, 2], dataType: 'float32'} }, 'gatherIndices': { 'data': [4, 8, 9, 10], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'int64'}, + 'descriptor': {shape: [2, 2], dataType: 'int64'}, 'constant': true } }, @@ -417,7 +417,7 @@ const gatherTests = [ -19.693084716796875, -37.696800231933594, 43.11057662963867, 0.9129875898361206, -7.699817180633545 ], - 'descriptor': {'dimensions': [2, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2], dataType: 'float32'} } } } @@ -437,11 +437,11 @@ const gatherTests = [ -37.696800231933594, 43.11057662963867, 0.9129875898361206, -7.699817180633545, 25.76774024963379, 73.60064697265625 ], - 'descriptor': {'dimensions': [12, 2], 'dataType': 'float32'} + 'descriptor': {shape: [12, 2], dataType: 'float32'} }, 'gatherIndices': { 'data': [8, 2, 2, 3, 4, 1, 2, 2, 7, 11, 4, 11, 6, 6, 7, 3, 11, 10], - 'descriptor': {'dimensions': [2, 3, 3], 'dataType': 'int64'}, + 'descriptor': {shape: [2, 3, 3], dataType: 'int64'}, 'constant': true } }, @@ -466,7 +466,7 @@ const gatherTests = [ 43.84803771972656, 48.81806945800781, 25.76774024963379, 73.60064697265625, 0.9129875898361206, -7.699817180633545 ], - 'descriptor': {'dimensions': [2, 3, 3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 3, 2], dataType: 'float32'} } } } @@ -486,11 +486,11 @@ const gatherTests = [ -37.696800231933594, 43.11057662963867, 0.9129875898361206, -7.699817180633545, 25.76774024963379, 73.60064697265625 ], - 'descriptor': {'dimensions': [12, 2], 'dataType': 'float32'} + 'descriptor': {shape: [12, 2], dataType: 'float32'} }, 'gatherIndices': { 'data': [6, 9, 7, 3, 4, 7, 4, 3, 7, 7, 6, 0], - 'descriptor': {'dimensions': [1, 2, 2, 3], 'dataType': 'int64'}, + 'descriptor': {shape: [1, 2, 2, 3], dataType: 'int64'}, 'constant': true } }, @@ -511,7 +511,7 @@ const gatherTests = [ 44.92119598388672, 56.828636169433594, 90.2870101928711, 55.620765686035156, -66.05901336669922, -68.9197006225586 ], - 'descriptor': {'dimensions': [1, 2, 2, 3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2, 3, 2], dataType: 'float32'} } } } @@ -531,11 +531,11 @@ const gatherTests = [ -37.696800231933594, 43.11057662963867, 0.9129875898361206, -7.699817180633545, 25.76774024963379, 73.60064697265625 ], - 'descriptor': {'dimensions': [3, 4, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4, 2], dataType: 'float32'} }, 'gatherIndices': { 'data': [2, 1, 1, 1], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'int64'}, + 'descriptor': {shape: [2, 2], dataType: 'int64'}, 'constant': true } }, @@ -559,7 +559,7 @@ const gatherTests = [ -50.42131042480469, 90.2870101928711, 55.620765686035156, 44.92119598388672, 56.828636169433594 ], - 'descriptor': {'dimensions': [2, 2, 4, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 4, 2], dataType: 'float32'} } } } @@ -579,11 +579,11 @@ const gatherTests = [ -37.696800231933594, 43.11057662963867, 0.9129875898361206, -7.699817180633545, 25.76774024963379, 73.60064697265625 ], - 'descriptor': {'dimensions': [8, 1, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [8, 1, 1, 3], dataType: 'float32'} }, 'gatherIndices': { 'data': [0, 0, 7, 4], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'int64'}, + 'descriptor': {shape: [2, 2], dataType: 'int64'}, 'constant': true } }, @@ -600,7 +600,7 @@ const gatherTests = [ -7.699817180633545, 25.76774024963379, 73.60064697265625, 90.2870101928711, 55.620765686035156, 44.92119598388672 ], - 'descriptor': {'dimensions': [2, 2, 1, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 1, 3], dataType: 'float32'} } } } @@ -620,11 +620,11 @@ const gatherTests = [ -37.696800231933594, 43.11057662963867, 0.9129875898361206, -7.699817180633545, 25.76774024963379, 73.60064697265625 ], - 'descriptor': {'dimensions': [4, 2, 1, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [4, 2, 1, 1, 3], dataType: 'float32'} }, 'gatherIndices': { 'data': [3, 2, 2], - 'descriptor': {'dimensions': [3], 'dataType': 'int64'}, + 'descriptor': {shape: [3], dataType: 'int64'}, 'constant': true } }, @@ -643,7 +643,7 @@ const gatherTests = [ 90.2870101928711, 55.620765686035156, 44.92119598388672, 56.828636169433594, 10.829925537109375, -19.693084716796875 ], - 'descriptor': {'dimensions': [3, 2, 1, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [3, 2, 1, 1, 3], dataType: 'float32'} } } } @@ -663,11 +663,11 @@ const gatherTests = [ -37.696800231933594, 43.11057662963867, 0.9129875898361206, -7.699817180633545, 25.76774024963379, 73.60064697265625 ], - 'descriptor': {'dimensions': [3, 4, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4, 2], dataType: 'float32'} }, 'gatherIndices': { 'data': [1, 1, 2], - 'descriptor': {'dimensions': [3], 'dataType': 'int64'}, + 'descriptor': {shape: [3], dataType: 'int64'}, 'constant': true } }, @@ -689,7 +689,7 @@ const gatherTests = [ -37.696800231933594, 43.11057662963867, -37.696800231933594, 43.11057662963867, 0.9129875898361206, -7.699817180633545 ], - 'descriptor': {'dimensions': [3, 3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 3, 2], dataType: 'float32'} } } } @@ -709,11 +709,11 @@ const gatherTests = [ -37.696800231933594, 43.11057662963867, 0.9129875898361206, -7.699817180633545, 25.76774024963379, 73.60064697265625 ], - 'descriptor': {'dimensions': [3, 4, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4, 2], dataType: 'float32'} }, 'gatherIndices': { 'data': [0, 0, 0, 1], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'int64'}, + 'descriptor': {shape: [2, 2], dataType: 'int64'}, 'constant': true } }, @@ -745,7 +745,7 @@ const gatherTests = [ 0.9129875898361206, -7.699817180633545, 25.76774024963379, 25.76774024963379, 25.76774024963379, 73.60064697265625 ], - 'descriptor': {'dimensions': [3, 4, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4, 2, 2], dataType: 'float32'} } } } @@ -765,11 +765,11 @@ const gatherTests = [ -37.696800231933594, 43.11057662963867, 0.9129875898361206, -7.699817180633545, 25.76774024963379, 73.60064697265625 ], - 'descriptor': {'dimensions': [8, 1, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [8, 1, 1, 3], dataType: 'float32'} }, 'gatherIndices': { 'data': [0, 0, 7, 4], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'int64'}, + 'descriptor': {shape: [2, 2], dataType: 'int64'}, 'constant': true } }, @@ -789,7 +789,7 @@ const gatherTests = [ -7.699817180633545, 25.76774024963379, 73.60064697265625, 90.2870101928711, 55.620765686035156, 44.92119598388672 ], - 'descriptor': {'dimensions': [2, 2, 1, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 1, 3], dataType: 'float32'} } } } @@ -809,11 +809,11 @@ const gatherTests = [ -37.696800231933594, 43.11057662963867, 0.9129875898361206, -7.699817180633545, 25.76774024963379, 73.60064697265625 ], - 'descriptor': {'dimensions': [4, 2, 1, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [4, 2, 1, 1, 3], dataType: 'float32'} }, 'gatherIndices': { 'data': [1], - 'descriptor': {'dimensions': [], 'dataType': 'int64'}, + 'descriptor': {shape: [], dataType: 'int64'}, 'constant': true } }, @@ -832,7 +832,7 @@ const gatherTests = [ -1.1303654909133911, 55.620765686035156, 10.829925537109375, 43.11057662963867, 25.76774024963379 ], - 'descriptor': {'dimensions': [4, 2, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [4, 2, 1, 1], dataType: 'float32'} } } } @@ -853,11 +853,11 @@ const gatherTests = [ -37.696800231933594, 43.11057662963867, 0.9129875898361206, -7.699817180633545, 25.76774024963379, 73.60064697265625 ], - 'descriptor': {'dimensions': [2, 12], 'dataType': 'float32'} + 'descriptor': {shape: [2, 12], dataType: 'float32'} }, 'gatherIndices': { 'data': [-2], - 'descriptor': {'dimensions': [], 'dataType': 'int32'}, + 'descriptor': {shape: [], dataType: 'int32'}, 'constant': true } }, @@ -874,7 +874,7 @@ const gatherTests = [ 43.84803771972656, 48.81806945800781, 51.79948425292969, 41.94132614135742, -1.1303654909133911, -50.42131042480469 ], - 'descriptor': {'dimensions': [12], 'dataType': 'float32'} + 'descriptor': {shape: [12], dataType: 'float32'} } } } @@ -895,11 +895,11 @@ const gatherTests = [ -37.696800231933594, 43.11057662963867, 0.9129875898361206, -7.699817180633545, 25.76774024963379, 73.60064697265625 ], - 'descriptor': {'dimensions': [2, 12], 'dataType': 'float32'} + 'descriptor': {shape: [2, 12], dataType: 'float32'} }, 'gatherIndices': { 'data': [10], - 'descriptor': {'dimensions': [], 'dataType': 'int32'}, + 'descriptor': {shape: [], dataType: 'int32'}, 'constant': true } }, @@ -916,7 +916,7 @@ const gatherTests = [ -37.696800231933594, 43.11057662963867, 0.9129875898361206, -7.699817180633545, 25.76774024963379, 73.60064697265625 ], - 'descriptor': {'dimensions': [12], 'dataType': 'float32'} + 'descriptor': {shape: [12], dataType: 'float32'} } } } @@ -937,11 +937,11 @@ const gatherTests = [ -37.696800231933594, 43.11057662963867, 0.9129875898361206, -7.699817180633545, 25.76774024963379, 73.60064697265625 ], - 'descriptor': {'dimensions': [2, 12], 'dataType': 'float32'} + 'descriptor': {shape: [2, 12], dataType: 'float32'} }, 'gatherIndices': { 'data': [-10], - 'descriptor': {'dimensions': [], 'dataType': 'int32'}, + 'descriptor': {shape: [], dataType: 'int32'}, 'constant': true } }, @@ -958,7 +958,7 @@ const gatherTests = [ 43.84803771972656, 48.81806945800781, 51.79948425292969, 41.94132614135742, -1.1303654909133911, -50.42131042480469 ], - 'descriptor': {'dimensions': [12], 'dataType': 'float32'} + 'descriptor': {shape: [12], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/gatherElements.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gatherElements.https.any.js index 6545375bf2be..ed08346e392c 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/gatherElements.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/gatherElements.https.any.js @@ -35,11 +35,11 @@ const gatherElementsTests = [ -26.158037185668945, 89.0337142944336, -45.89653396606445, 43.84803771972656, 48.81806945800781, 51.79948425292969 ], - 'descriptor': {'dimensions': [3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [3, 3], dataType: 'float32'} }, 'gatherElementsIndices': { 'data': [1, 0, 2, 2, 1, 0], - 'descriptor': {'dimensions': [3, 2], 'dataType': 'uint32'}, + 'descriptor': {shape: [3, 2], dataType: 'uint32'}, 'constant': true } }, @@ -57,7 +57,7 @@ const gatherElementsTests = [ -68.9197006225586, -66.05901336669922, -45.89653396606445, -45.89653396606445, 48.81806945800781, 43.84803771972656 ], - 'descriptor': {'dimensions': [3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 2], dataType: 'float32'} } } } @@ -72,11 +72,11 @@ const gatherElementsTests = [ -26.158037185668945, 89.0337142944336, -45.89653396606445, 43.84803771972656, 48.81806945800781 ], - 'descriptor': {'dimensions': [2, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2], dataType: 'float32'} }, 'gatherElementsIndices': { 'data': [-1, 0, 0, -1], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'int32'}, + 'descriptor': {shape: [1, 2, 2], dataType: 'int32'}, 'constant': true } }, @@ -93,7 +93,7 @@ const gatherElementsTests = [ 89.0337142944336, -68.9197006225586, -77.02045440673828, 48.81806945800781 ], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} } } } @@ -107,11 +107,11 @@ const gatherElementsTests = [ -26.158037185668945, 89.0337142944336, -45.89653396606445, 43.84803771972656, 48.81806945800781, 51.79948425292969 ], - 'descriptor': {'dimensions': [6], 'dataType': 'float32'} + 'descriptor': {shape: [6], dataType: 'float32'} }, 'gatherElementsIndices': { 'data': [7], - 'descriptor': {'dimensions': [1], 'dataType': 'uint32'}, + 'descriptor': {shape: [1], dataType: 'uint32'}, 'constant': true } }, @@ -125,7 +125,7 @@ const gatherElementsTests = [ 'expectedOutputs': { 'gatherElementsOutput': { 'data': [51.79948425292969], - 'descriptor': {'dimensions': [1], 'dataType': 'float32'} + 'descriptor': {shape: [1], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/gelu.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gelu.https.any.js index 446c5bc4effb..4fa078ea1447 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/gelu.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/gelu.https.any.js @@ -29,7 +29,7 @@ const geluTests = [ 'inputs': { 'geluInput': { 'data': [-0.044885843992233276], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -40,7 +40,7 @@ const geluTests = [ 'expectedOutputs': { 'geluOutput': { 'data': [-0.021639423444867134], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -51,7 +51,7 @@ const geluTests = [ 'inputs': { 'geluInput': { 'data': [-0.044891357421875], - 'descriptor': {'dimensions': [], 'dataType': 'float16'} + 'descriptor': {shape: [], dataType: 'float16'} } }, 'operators': [{ @@ -62,7 +62,7 @@ const geluTests = [ 'expectedOutputs': { 'geluOutput': { 'data': [-0.021636962890625], - 'descriptor': {'dimensions': [], 'dataType': 'float16'} + 'descriptor': {shape: [], dataType: 'float16'} } } } @@ -82,7 +82,7 @@ const geluTests = [ -0.09901237487792969, -0.8838679790496826, -0.596120297908783, 0.31863871216773987, 0.4794037640094757, -0.06489315629005432 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -102,7 +102,7 @@ const geluTests = [ -0.04560155048966408, -0.1665063202381134, -0.1642593890428543, 0.19914908707141876, 0.3279957175254822, -0.030767757445573807 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -122,7 +122,7 @@ const geluTests = [ -0.09901237487792969, -0.8838679790496826, -0.596120297908783, 0.31863871216773987, 0.4794037640094757, -0.06489315629005432 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -143,7 +143,7 @@ const geluTests = [ -0.04560155048966408, -0.1665063202381134, -0.1642593890428543, 0.19914908707141876, 0.3279957175254822, -0.030767757445573807 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -163,7 +163,7 @@ const geluTests = [ -0.0989990234375, -0.8837890625, -0.59619140625, 0.318603515625, 0.4794921875, -0.06488037109375 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float16'} + 'descriptor': {shape: [24], dataType: 'float16'} } }, 'operators': [{ @@ -183,7 +183,7 @@ const geluTests = [ -0.04559326171875, -0.16650390625, -0.164306640625, 0.1990966796875, 0.328125, -0.03076171875 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float16'} + 'descriptor': {shape: [24], dataType: 'float16'} } } } @@ -203,7 +203,7 @@ const geluTests = [ -0.09901237487792969, -0.8838679790496826, -0.596120297908783, 0.31863871216773987, 0.4794037640094757, -0.06489315629005432 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -223,7 +223,7 @@ const geluTests = [ -0.04560155048966408, -0.1665063202381134, -0.1642593890428543, 0.19914908707141876, 0.3279957175254822, -0.030767757445573807 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -243,7 +243,7 @@ const geluTests = [ -0.0989990234375, -0.8837890625, -0.59619140625, 0.318603515625, 0.4794921875, -0.06488037109375 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float16'} + 'descriptor': {shape: [4, 6], dataType: 'float16'} } }, 'operators': [{ @@ -263,7 +263,7 @@ const geluTests = [ -0.04559326171875, -0.16650390625, -0.164306640625, 0.1990966796875, 0.328125, -0.03076171875 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float16'} + 'descriptor': {shape: [4, 6], dataType: 'float16'} } } } @@ -283,7 +283,7 @@ const geluTests = [ -0.09901237487792969, -0.8838679790496826, -0.596120297908783, 0.31863871216773987, 0.4794037640094757, -0.06489315629005432 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -303,7 +303,7 @@ const geluTests = [ -0.04560155048966408, -0.1665063202381134, -0.1642593890428543, 0.19914908707141876, 0.3279957175254822, -0.030767757445573807 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -323,7 +323,7 @@ const geluTests = [ -0.0989990234375, -0.8837890625, -0.59619140625, 0.318603515625, 0.4794921875, -0.06488037109375 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float16'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} } }, 'operators': [{ @@ -343,7 +343,7 @@ const geluTests = [ -0.04559326171875, -0.16650390625, -0.164306640625, 0.1990966796875, 0.328125, -0.03076171875 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float16'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} } } } @@ -363,7 +363,7 @@ const geluTests = [ -0.09901237487792969, -0.8838679790496826, -0.596120297908783, 0.31863871216773987, 0.4794037640094757, -0.06489315629005432 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -383,7 +383,7 @@ const geluTests = [ -0.04560155048966408, -0.1665063202381134, -0.1642593890428543, 0.19914908707141876, 0.3279957175254822, -0.030767757445573807 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -403,7 +403,7 @@ const geluTests = [ -0.0989990234375, -0.8837890625, -0.59619140625, 0.318603515625, 0.4794921875, -0.06488037109375 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float16'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} } }, 'operators': [{ @@ -423,7 +423,7 @@ const geluTests = [ -0.04559326171875, -0.16650390625, -0.164306640625, 0.1990966796875, 0.328125, -0.03076171875 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float16'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} } } } @@ -443,7 +443,7 @@ const geluTests = [ -0.09901237487792969, -0.8838679790496826, -0.596120297908783, 0.31863871216773987, 0.4794037640094757, -0.06489315629005432 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } }, 'operators': [{ @@ -463,7 +463,7 @@ const geluTests = [ -0.04560155048966408, -0.1665063202381134, -0.1642593890428543, 0.19914908707141876, 0.3279957175254822, -0.030767757445573807 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } } } @@ -483,7 +483,7 @@ const geluTests = [ -0.0989990234375, -0.8837890625, -0.59619140625, 0.318603515625, 0.4794921875, -0.06488037109375 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float16'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float16'} } }, 'operators': [{ @@ -503,7 +503,7 @@ const geluTests = [ -0.04559326171875, -0.16650390625, -0.164306640625, 0.1990966796875, 0.328125, -0.03076171875 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float16'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float16'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/gemm.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gemm.https.any.js index 70b2ecb5e1e7..1ee98d643cac 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/gemm.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/gemm.https.any.js @@ -31,8 +31,8 @@ const getGemmPrecisionTolerance = (graphResources) => { // is a dot product (mul and add times the number of elements) // plus bias operations. const args = graphResources.operators[0].arguments; - const shapeA = graphResources.inputs[args[0][Object.keys(args[0])[0]]] - .descriptor.dimensions; + const shapeA = + graphResources.inputs[args[0][Object.keys(args[0])[0]]].descriptor.shape; const options = args.length === 3 ? {...args[2][Object.keys(args[2])[0]]} : {}; const width = options.aTranspose ? shapeA[0] : shapeA[1]; @@ -67,7 +67,7 @@ const gemmTests = [ 98.89488220214844, 91.46013641357422, 50.51683807373047, 40.45679473876953, 50.76741409301758, 9.336554527282715 ], - 'descriptor': {'dimensions': [3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -79,7 +79,7 @@ const gemmTests = [ 42.90679168701172, 34.08055114746094, 87.37654876708984, 92.34209442138672, 60.32209014892578 ], - 'descriptor': {'dimensions': [4, 5], 'dataType': 'float32'} + 'descriptor': {shape: [4, 5], dataType: 'float32'} } }, 'operators': [{ @@ -96,7 +96,7 @@ const gemmTests = [ 5516.6904296875, 9259.267578125, 9167.3916015625, 6347.330078125, 10868.6025390625 ], - 'descriptor': {'dimensions': [3, 5], 'dataType': 'float32'} + 'descriptor': {shape: [3, 5], dataType: 'float32'} } } } @@ -112,7 +112,7 @@ const gemmTests = [ 98.89488220214844, 91.46013641357422, 50.51683807373047, 40.45679473876953, 50.76741409301758, 9.336554527282715 ], - 'descriptor': {'dimensions': [3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -124,7 +124,7 @@ const gemmTests = [ 42.90679168701172, 34.08055114746094, 87.37654876708984, 92.34209442138672, 60.32209014892578 ], - 'descriptor': {'dimensions': [4, 5], 'dataType': 'float32'}, + 'descriptor': {shape: [4, 5], dataType: 'float32'}, 'constant': true } }, @@ -142,7 +142,7 @@ const gemmTests = [ 5516.6904296875, 9259.267578125, 9167.3916015625, 6347.330078125, 10868.6025390625 ], - 'descriptor': {'dimensions': [3, 5], 'dataType': 'float32'} + 'descriptor': {shape: [3, 5], dataType: 'float32'} } } } @@ -158,7 +158,7 @@ const gemmTests = [ 98.89488220214844, 91.46013641357422, 50.51683807373047, 40.45679473876953, 50.76741409301758, 9.336554527282715 ], - 'descriptor': {'dimensions': [3, 4], 'dataType': 'float32'}, + 'descriptor': {shape: [3, 4], dataType: 'float32'}, 'constant': true }, 'inputB': { @@ -171,7 +171,7 @@ const gemmTests = [ 42.90679168701172, 34.08055114746094, 87.37654876708984, 92.34209442138672, 60.32209014892578 ], - 'descriptor': {'dimensions': [4, 5], 'dataType': 'float32'}, + 'descriptor': {shape: [4, 5], dataType: 'float32'}, 'constant': true }, 'inputC': { @@ -182,7 +182,7 @@ const gemmTests = [ 30.577470779418945, 69.47061920166016, 7.166217803955078, 28.337108612060547, 90.69412231445312, 71.23025512695312 ], - 'descriptor': {'dimensions': [3, 5], 'dataType': 'float32'}, + 'descriptor': {shape: [3, 5], dataType: 'float32'}, 'constant': true } }, @@ -200,7 +200,7 @@ const gemmTests = [ 15122.8896484375, 18303.658203125, 5586.16064453125, 9266.43359375, 9195.7294921875, 6438.0244140625, 10939.8330078125 ], - 'descriptor': {'dimensions': [3, 5], 'dataType': 'float32'} + 'descriptor': {shape: [3, 5], dataType: 'float32'} } } } @@ -216,7 +216,7 @@ const gemmTests = [ 98.89488220214844, 91.46013641357422, 50.51683807373047, 40.45679473876953, 50.76741409301758, 9.336554527282715 ], - 'descriptor': {'dimensions': [3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -228,7 +228,7 @@ const gemmTests = [ 42.90679168701172, 34.08055114746094, 87.37654876708984, 92.34209442138672, 60.32209014892578 ], - 'descriptor': {'dimensions': [4, 5], 'dataType': 'float32'}, + 'descriptor': {shape: [4, 5], dataType: 'float32'}, 'constant': true }, 'inputC': { @@ -239,7 +239,7 @@ const gemmTests = [ 30.577470779418945, 69.47061920166016, 7.166217803955078, 28.337108612060547, 90.69412231445312, 71.23025512695312 ], - 'descriptor': {'dimensions': [3, 5], 'dataType': 'float32'}, + 'descriptor': {shape: [3, 5], dataType: 'float32'}, 'constant': true } }, @@ -257,7 +257,7 @@ const gemmTests = [ 15122.8896484375, 18303.658203125, 5586.16064453125, 9266.43359375, 9195.7294921875, 6438.0244140625, 10939.8330078125 ], - 'descriptor': {'dimensions': [3, 5], 'dataType': 'float32'} + 'descriptor': {shape: [3, 5], dataType: 'float32'} } } } @@ -273,7 +273,7 @@ const gemmTests = [ 98.89488220214844, 91.46013641357422, 50.51683807373047, 40.45679473876953, 50.76741409301758, 9.336554527282715 ], - 'descriptor': {'dimensions': [3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -285,7 +285,7 @@ const gemmTests = [ 42.90679168701172, 34.08055114746094, 87.37654876708984, 92.34209442138672, 60.32209014892578 ], - 'descriptor': {'dimensions': [4, 5], 'dataType': 'float32'}, + 'descriptor': {shape: [4, 5], dataType: 'float32'}, 'constant': true }, 'inputC': { @@ -293,7 +293,7 @@ const gemmTests = [ 85.90813446044922, 39.3753547668457, 50.942604064941406, 31.87430763244629, 31.210525512695312 ], - 'descriptor': {'dimensions': [1, 5], 'dataType': 'float32'}, + 'descriptor': {shape: [1, 5], dataType: 'float32'}, 'constant': true } }, @@ -311,7 +311,7 @@ const gemmTests = [ 15066.1513671875, 18304.291015625, 5602.5986328125, 9298.642578125, 9218.3349609375, 6379.20458984375, 10899.8125 ], - 'descriptor': {'dimensions': [3, 5], 'dataType': 'float32'} + 'descriptor': {shape: [3, 5], dataType: 'float32'} } } } @@ -327,7 +327,7 @@ const gemmTests = [ 98.89488220214844, 91.46013641357422, 50.51683807373047, 40.45679473876953, 50.76741409301758, 9.336554527282715 ], - 'descriptor': {'dimensions': [3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -339,12 +339,12 @@ const gemmTests = [ 42.90679168701172, 34.08055114746094, 87.37654876708984, 92.34209442138672, 60.32209014892578 ], - 'descriptor': {'dimensions': [4, 5], 'dataType': 'float32'}, + 'descriptor': {shape: [4, 5], dataType: 'float32'}, 'constant': true }, 'inputC': { 'data': [6.20251989364624, 81.40641784667969, 73.00516510009766], - 'descriptor': {'dimensions': [3, 1], 'dataType': 'float32'}, + 'descriptor': {shape: [3, 1], dataType: 'float32'}, 'constant': true } }, @@ -362,7 +362,7 @@ const gemmTests = [ 15115.68359375, 18354.486328125, 5589.6953125, 9332.2724609375, 9240.3974609375, 6420.33544921875, 10941.607421875 ], - 'descriptor': {'dimensions': [3, 5], 'dataType': 'float32'} + 'descriptor': {shape: [3, 5], dataType: 'float32'} } } } @@ -378,7 +378,7 @@ const gemmTests = [ 98.89488220214844, 91.46013641357422, 50.51683807373047, 40.45679473876953, 50.76741409301758, 9.336554527282715 ], - 'descriptor': {'dimensions': [3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -390,12 +390,12 @@ const gemmTests = [ 42.90679168701172, 34.08055114746094, 87.37654876708984, 92.34209442138672, 60.32209014892578 ], - 'descriptor': {'dimensions': [4, 5], 'dataType': 'float32'}, + 'descriptor': {shape: [4, 5], dataType: 'float32'}, 'constant': true }, 'inputC': { 'data': [18.78192901611328], - 'descriptor': {'dimensions': [1, 1], 'dataType': 'float32'}, + 'descriptor': {shape: [1, 1], dataType: 'float32'}, 'constant': true } }, @@ -413,7 +413,7 @@ const gemmTests = [ 19144.529296875, 15053.0595703125, 18291.86328125, 5535.47216796875, 9278.048828125, 9186.173828125, 6366.1123046875, 10887.384765625 ], - 'descriptor': {'dimensions': [3, 5], 'dataType': 'float32'} + 'descriptor': {shape: [3, 5], dataType: 'float32'} } } } @@ -429,7 +429,7 @@ const gemmTests = [ 98.89488220214844, 91.46013641357422, 50.51683807373047, 40.45679473876953, 50.76741409301758, 9.336554527282715 ], - 'descriptor': {'dimensions': [3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -441,7 +441,7 @@ const gemmTests = [ 42.90679168701172, 34.08055114746094, 87.37654876708984, 92.34209442138672, 60.32209014892578 ], - 'descriptor': {'dimensions': [4, 5], 'dataType': 'float32'}, + 'descriptor': {shape: [4, 5], dataType: 'float32'}, 'constant': true }, 'inputC': { @@ -449,7 +449,7 @@ const gemmTests = [ 85.90813446044922, 39.3753547668457, 50.942604064941406, 31.87430763244629, 31.210525512695312 ], - 'descriptor': {'dimensions': [5], 'dataType': 'float32'}, + 'descriptor': {shape: [5], dataType: 'float32'}, 'constant': true } }, @@ -467,7 +467,7 @@ const gemmTests = [ 15066.1513671875, 18304.291015625, 5602.5986328125, 9298.642578125, 9218.3349609375, 6379.20458984375, 10899.8125 ], - 'descriptor': {'dimensions': [3, 5], 'dataType': 'float32'} + 'descriptor': {shape: [3, 5], dataType: 'float32'} } } } @@ -483,7 +483,7 @@ const gemmTests = [ 98.89488220214844, 91.46013641357422, 50.51683807373047, 40.45679473876953, 50.76741409301758, 9.336554527282715 ], - 'descriptor': {'dimensions': [3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -495,12 +495,12 @@ const gemmTests = [ 42.90679168701172, 34.08055114746094, 87.37654876708984, 92.34209442138672, 60.32209014892578 ], - 'descriptor': {'dimensions': [4, 5], 'dataType': 'float32'}, + 'descriptor': {shape: [4, 5], dataType: 'float32'}, 'constant': true }, 'inputC': { 'data': [18.78192901611328], - 'descriptor': {'dimensions': [1], 'dataType': 'float32'}, + 'descriptor': {shape: [1], dataType: 'float32'}, 'constant': true } }, @@ -518,7 +518,7 @@ const gemmTests = [ 19144.529296875, 15053.0595703125, 18291.86328125, 5535.47216796875, 9278.048828125, 9186.173828125, 6366.1123046875, 10887.384765625 ], - 'descriptor': {'dimensions': [3, 5], 'dataType': 'float32'} + 'descriptor': {shape: [3, 5], dataType: 'float32'} } } } @@ -534,7 +534,7 @@ const gemmTests = [ 98.89488220214844, 91.46013641357422, 50.51683807373047, 40.45679473876953, 50.76741409301758, 9.336554527282715 ], - 'descriptor': {'dimensions': [3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -546,12 +546,12 @@ const gemmTests = [ 42.90679168701172, 34.08055114746094, 87.37654876708984, 92.34209442138672, 60.32209014892578 ], - 'descriptor': {'dimensions': [4, 5], 'dataType': 'float32'}, + 'descriptor': {shape: [4, 5], dataType: 'float32'}, 'constant': true }, 'inputC': { 'data': [18.78192901611328], - 'descriptor': {'dimensions': [], 'dataType': 'float32'}, + 'descriptor': {shape: [], dataType: 'float32'}, 'constant': true } }, @@ -569,7 +569,7 @@ const gemmTests = [ 19144.529296875, 15053.0595703125, 18291.86328125, 5535.47216796875, 9278.048828125, 9186.173828125, 6366.1123046875, 10887.384765625 ], - 'descriptor': {'dimensions': [3, 5], 'dataType': 'float32'} + 'descriptor': {shape: [3, 5], dataType: 'float32'} } } } @@ -585,7 +585,7 @@ const gemmTests = [ 98.89488220214844, 91.46013641357422, 50.51683807373047, 40.45679473876953, 50.76741409301758, 9.336554527282715 ], - 'descriptor': {'dimensions': [3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -597,7 +597,7 @@ const gemmTests = [ 42.90679168701172, 34.08055114746094, 87.37654876708984, 92.34209442138672, 60.32209014892578 ], - 'descriptor': {'dimensions': [4, 5], 'dataType': 'float32'}, + 'descriptor': {shape: [4, 5], dataType: 'float32'}, 'constant': true } }, @@ -616,7 +616,7 @@ const gemmTests = [ 885183.875, 1091172, 1423568.5, 1119032, 1360102.75, 410618.53125, 689186.1875, 682347.75, 472444.78125, 808972.3125 ], - 'descriptor': {'dimensions': [3, 5], 'dataType': 'float32'} + 'descriptor': {shape: [3, 5], dataType: 'float32'} } } } @@ -632,7 +632,7 @@ const gemmTests = [ 98.89488220214844, 91.46013641357422, 50.51683807373047, 40.45679473876953, 50.76741409301758, 9.336554527282715 ], - 'descriptor': {'dimensions': [3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -644,7 +644,7 @@ const gemmTests = [ 42.90679168701172, 34.08055114746094, 87.37654876708984, 92.34209442138672, 60.32209014892578 ], - 'descriptor': {'dimensions': [4, 5], 'dataType': 'float32'}, + 'descriptor': {shape: [4, 5], dataType: 'float32'}, 'constant': true } }, @@ -665,7 +665,7 @@ const gemmTests = [ 5516.6904296875, 9259.267578125, 9167.3916015625, 6347.330078125, 10868.6025390625 ], - 'descriptor': {'dimensions': [3, 5], 'dataType': 'float32'} + 'descriptor': {shape: [3, 5], dataType: 'float32'} } } } @@ -681,7 +681,7 @@ const gemmTests = [ 98.89488220214844, 91.46013641357422, 50.51683807373047, 40.45679473876953, 50.76741409301758, 9.336554527282715 ], - 'descriptor': {'dimensions': [3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -693,7 +693,7 @@ const gemmTests = [ 42.90679168701172, 34.08055114746094, 87.37654876708984, 92.34209442138672, 60.32209014892578 ], - 'descriptor': {'dimensions': [4, 5], 'dataType': 'float32'}, + 'descriptor': {shape: [4, 5], dataType: 'float32'}, 'constant': true }, 'inputC': { @@ -704,7 +704,7 @@ const gemmTests = [ 30.577470779418945, 69.47061920166016, 7.166217803955078, 28.337108612060547, 90.69412231445312, 71.23025512695312 ], - 'descriptor': {'dimensions': [3, 5], 'dataType': 'float32'}, + 'descriptor': {shape: [3, 5], dataType: 'float32'}, 'constant': true } }, @@ -724,7 +724,7 @@ const gemmTests = [ 20529.83984375, 20169.443359375, 9825.138671875, 9703.7041015625, 10924.810546875, 11972.0244140625, 15286.1806640625 ], - 'descriptor': {'dimensions': [3, 5], 'dataType': 'float32'} + 'descriptor': {shape: [3, 5], dataType: 'float32'} } } } @@ -740,7 +740,7 @@ const gemmTests = [ 59.638519287109375, 98.89488220214844, 50.76741409301758, 36.271873474121094, 91.46013641357422, 9.336554527282715 ], - 'descriptor': {'dimensions': [4, 3], 'dataType': 'float32'} + 'descriptor': {shape: [4, 3], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -752,7 +752,7 @@ const gemmTests = [ 42.90679168701172, 34.08055114746094, 87.37654876708984, 92.34209442138672, 60.32209014892578 ], - 'descriptor': {'dimensions': [4, 5], 'dataType': 'float32'}, + 'descriptor': {shape: [4, 5], dataType: 'float32'}, 'constant': true } }, @@ -772,7 +772,7 @@ const gemmTests = [ 5516.6904296875, 9259.267578125, 9167.3916015625, 6347.330078125, 10868.6025390625 ], - 'descriptor': {'dimensions': [3, 5], 'dataType': 'float32'} + 'descriptor': {shape: [3, 5], dataType: 'float32'} } } } @@ -789,7 +789,7 @@ const gemmTests = [ 98.89488220214844, 91.46013641357422, 50.51683807373047, 40.45679473876953, 50.76741409301758, 9.336554527282715 ], - 'descriptor': {'dimensions': [3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -801,7 +801,7 @@ const gemmTests = [ 42.90679168701172, 34.08055114746094, 87.37654876708984, 92.34209442138672, 60.32209014892578 ], - 'descriptor': {'dimensions': [4, 5], 'dataType': 'float32'}, + 'descriptor': {shape: [4, 5], dataType: 'float32'}, 'constant': true } }, @@ -821,7 +821,7 @@ const gemmTests = [ 5516.6904296875, 9259.267578125, 9167.3916015625, 6347.330078125, 10868.6025390625 ], - 'descriptor': {'dimensions': [3, 5], 'dataType': 'float32'} + 'descriptor': {shape: [3, 5], dataType: 'float32'} } } } @@ -837,7 +837,7 @@ const gemmTests = [ 98.89488220214844, 91.46013641357422, 50.51683807373047, 40.45679473876953, 50.76741409301758, 9.336554527282715 ], - 'descriptor': {'dimensions': [3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -849,7 +849,7 @@ const gemmTests = [ 92.34209442138672, 61.32737731933594, 70.08265686035156, 86.11856842041016, 60.32209014892578 ], - 'descriptor': {'dimensions': [5, 4], 'dataType': 'float32'}, + 'descriptor': {shape: [5, 4], dataType: 'float32'}, 'constant': true } }, @@ -869,7 +869,7 @@ const gemmTests = [ 5516.6904296875, 9259.267578125, 9167.3916015625, 6347.330078125, 10868.6025390625 ], - 'descriptor': {'dimensions': [3, 5], 'dataType': 'float32'} + 'descriptor': {shape: [3, 5], dataType: 'float32'} } } } @@ -886,7 +886,7 @@ const gemmTests = [ 98.89488220214844, 91.46013641357422, 50.51683807373047, 40.45679473876953, 50.76741409301758, 9.336554527282715 ], - 'descriptor': {'dimensions': [3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -898,7 +898,7 @@ const gemmTests = [ 42.90679168701172, 34.08055114746094, 87.37654876708984, 92.34209442138672, 60.32209014892578 ], - 'descriptor': {'dimensions': [4, 5], 'dataType': 'float32'}, + 'descriptor': {shape: [4, 5], dataType: 'float32'}, 'constant': true } }, @@ -918,7 +918,7 @@ const gemmTests = [ 5516.6904296875, 9259.267578125, 9167.3916015625, 6347.330078125, 10868.6025390625 ], - 'descriptor': {'dimensions': [3, 5], 'dataType': 'float32'} + 'descriptor': {shape: [3, 5], dataType: 'float32'} } } } @@ -934,7 +934,7 @@ const gemmTests = [ 59.638519287109375, 98.89488220214844, 50.76741409301758, 36.271873474121094, 91.46013641357422, 9.336554527282715 ], - 'descriptor': {'dimensions': [4, 3], 'dataType': 'float32'} + 'descriptor': {shape: [4, 3], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -946,7 +946,7 @@ const gemmTests = [ 92.34209442138672, 61.32737731933594, 70.08265686035156, 86.11856842041016, 60.32209014892578 ], - 'descriptor': {'dimensions': [5, 4], 'dataType': 'float32'}, + 'descriptor': {shape: [5, 4], dataType: 'float32'}, 'constant': true }, 'inputC': { @@ -957,7 +957,7 @@ const gemmTests = [ 30.577470779418945, 69.47061920166016, 7.166217803955078, 28.337108612060547, 90.69412231445312, 71.23025512695312 ], - 'descriptor': {'dimensions': [3, 5], 'dataType': 'float32'}, + 'descriptor': {shape: [3, 5], dataType: 'float32'}, 'constant': true } }, @@ -983,7 +983,7 @@ const gemmTests = [ 887367.0625, 1091999, 1426718.125, 1124527.625, 1361999.125, 414927, 689630.625, 684105.1875, 478069.46875, 813389.875 ], - 'descriptor': {'dimensions': [3, 5], 'dataType': 'float32'} + 'descriptor': {shape: [3, 5], dataType: 'float32'} } } } @@ -999,7 +999,7 @@ const gemmTests = [ -76.046630859375, -83.94807434082031, -95.02689361572266, -47.89733123779297, -69.0116195678711, -86.66899108886719 ], - 'descriptor': {'dimensions': [3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -1011,7 +1011,7 @@ const gemmTests = [ 42.90679168701172, 34.08055114746094, 87.37654876708984, 92.34209442138672, 60.32209014892578 ], - 'descriptor': {'dimensions': [4, 5], 'dataType': 'float32'}, + 'descriptor': {shape: [4, 5], dataType: 'float32'}, 'constant': true }, 'inputC': { @@ -1022,7 +1022,7 @@ const gemmTests = [ 30.577470779418945, 69.47061920166016, 7.166217803955078, 28.337108612060547, 90.69412231445312, 71.23025512695312 ], - 'descriptor': {'dimensions': [3, 5], 'dataType': 'float32'}, + 'descriptor': {shape: [3, 5], dataType: 'float32'}, 'constant': true } }, @@ -1041,7 +1041,7 @@ const gemmTests = [ 228076.8125, 277543.625, 378076, 241282.15625, 316800.71875, 256391.5625, 378711.34375, 465195.8125, 341034.875, 460338.3125 ], - 'descriptor': {'dimensions': [3, 5], 'dataType': 'float32'} + 'descriptor': {shape: [3, 5], dataType: 'float32'} } } } @@ -1057,7 +1057,7 @@ const gemmTests = [ 98.89488220214844, 91.46013641357422, 50.51683807373047, 40.45679473876953, 50.76741409301758, 9.336554527282715 ], - 'descriptor': {'dimensions': [3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -1069,7 +1069,7 @@ const gemmTests = [ -26.2825927734375, -56.237979888916016, -46.47404861450195, -89.20684051513672, -53.495323181152344 ], - 'descriptor': {'dimensions': [4, 5], 'dataType': 'float32'}, + 'descriptor': {shape: [4, 5], dataType: 'float32'}, 'constant': true }, 'inputC': { @@ -1080,7 +1080,7 @@ const gemmTests = [ 30.577470779418945, 69.47061920166016, 7.166217803955078, 28.337108612060547, 90.69412231445312, 71.23025512695312 ], - 'descriptor': {'dimensions': [3, 5], 'dataType': 'float32'}, + 'descriptor': {shape: [3, 5], dataType: 'float32'}, 'constant': true } }, @@ -1100,7 +1100,7 @@ const gemmTests = [ 235557.03125, 245540.5625, 170154.125, 309239.4375, 163583.015625, 120958.7578125 ], - 'descriptor': {'dimensions': [3, 5], 'dataType': 'float32'} + 'descriptor': {shape: [3, 5], dataType: 'float32'} } } } @@ -1117,7 +1117,7 @@ const gemmTests = [ 98.89488220214844, 91.46013641357422, 50.51683807373047, 40.45679473876953, 50.76741409301758, 9.336554527282715 ], - 'descriptor': {'dimensions': [3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -1129,7 +1129,7 @@ const gemmTests = [ 42.90679168701172, 34.08055114746094, 87.37654876708984, 92.34209442138672, 60.32209014892578 ], - 'descriptor': {'dimensions': [4, 5], 'dataType': 'float32'}, + 'descriptor': {shape: [4, 5], dataType: 'float32'}, 'constant': true }, 'inputC': { @@ -1140,7 +1140,7 @@ const gemmTests = [ -66.76168060302734, -25.392492294311523, -65.62987518310547, -40.50155258178711, -81.5303955078125, -41.39629364013672 ], - 'descriptor': {'dimensions': [3, 5], 'dataType': 'float32'}, + 'descriptor': {shape: [3, 5], dataType: 'float32'}, 'constant': true } }, @@ -1161,7 +1161,7 @@ const gemmTests = [ 10026.1669921875, 9640.6611328125, 7300.03076171875, 11352.3271484375 ], - 'descriptor': {'dimensions': [3, 5], 'dataType': 'float32'} + 'descriptor': {shape: [3, 5], dataType: 'float32'} } } } @@ -1177,7 +1177,7 @@ const gemmTests = [ 98.89488220214844, 91.46013641357422, 50.51683807373047, 40.45679473876953, 50.76741409301758, 9.336554527282715 ], - 'descriptor': {'dimensions': [3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -1189,7 +1189,7 @@ const gemmTests = [ 42.90679168701172, 34.08055114746094, 87.37654876708984, 92.34209442138672, 60.32209014892578 ], - 'descriptor': {'dimensions': [4, 5], 'dataType': 'float32'}, + 'descriptor': {shape: [4, 5], dataType: 'float32'}, 'constant': true }, 'inputC': { @@ -1200,7 +1200,7 @@ const gemmTests = [ 30.577470779418945, 69.47061920166016, 7.166217803955078, 28.337108612060547, 90.69412231445312, 71.23025512695312 ], - 'descriptor': {'dimensions': [3, 5], 'dataType': 'float32'}, + 'descriptor': {shape: [3, 5], dataType: 'float32'}, 'constant': true } }, @@ -1225,7 +1225,7 @@ const gemmTests = [ -340977.71875, -413532.65625, -125550.484375, -209446.40625, -207616.390625, -144580.21875, -246583.921875 ], - 'descriptor': {'dimensions': [3, 5], 'dataType': 'float32'} + 'descriptor': {shape: [3, 5], dataType: 'float32'} } } } @@ -1242,7 +1242,7 @@ const gemmTests = [ 98.89488220214844, 91.46013641357422, 50.51683807373047, 40.45679473876953, 50.76741409301758, 9.336554527282715 ], - 'descriptor': {'dimensions': [3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -1254,7 +1254,7 @@ const gemmTests = [ 42.90679168701172, 34.08055114746094, 87.37654876708984, 92.34209442138672, 60.32209014892578 ], - 'descriptor': {'dimensions': [4, 5], 'dataType': 'float32'}, + 'descriptor': {shape: [4, 5], dataType: 'float32'}, 'constant': true }, 'inputC': { @@ -1265,7 +1265,7 @@ const gemmTests = [ -66.76168060302734, -25.392492294311523, -65.62987518310547, -40.50155258178711, -81.5303955078125, -41.39629364013672 ], - 'descriptor': {'dimensions': [3, 5], 'dataType': 'float32'}, + 'descriptor': {shape: [3, 5], dataType: 'float32'}, 'constant': true } }, @@ -1285,7 +1285,7 @@ const gemmTests = [ -124764.09375, -209428.296875, -207325.765625, -143601.96875, -245792.984375 ], - 'descriptor': {'dimensions': [3, 5], 'dataType': 'float32'} + 'descriptor': {shape: [3, 5], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/greater.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/greater.https.any.js index e9a63b1682a6..7017d0860d5b 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/greater.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/greater.https.any.js @@ -28,11 +28,11 @@ const greaterTests = [ 'inputs': { 'inputA': { 'data': [3.6851015090942383], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} }, 'inputB': { 'data': [1.723199725151062], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -41,8 +41,7 @@ const greaterTests = [ 'outputs': 'output' }], 'expectedOutputs': { - 'output': - {'data': [1], 'descriptor': {'dimensions': [], 'dataType': 'uint8'}} + 'output': {'data': [1], 'descriptor': {shape: [], dataType: 'uint8'}} } } }, @@ -61,7 +60,7 @@ const greaterTests = [ 0.7069857120513916, 2.7764203548431396, 0.978833794593811, -6.254901885986328, 4.409034729003906, -6.775286674499512 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true }, 'inputB': { @@ -75,7 +74,7 @@ const greaterTests = [ 4.982365131378174, -2.507319211959839, -4.518013954162598, 8.351094245910645, -6.161073207855225, 0.7364829182624817 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -90,7 +89,7 @@ const greaterTests = [ 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0 ], - 'descriptor': {'dimensions': [24], 'dataType': 'uint8'} + 'descriptor': {shape: [24], dataType: 'uint8'} } } } @@ -110,7 +109,7 @@ const greaterTests = [ 0.7069857120513916, 2.7764203548431396, 0.978833794593811, -6.254901885986328, 4.409034729003906, -6.775286674499512 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -123,7 +122,7 @@ const greaterTests = [ 4.982365131378174, -2.507319211959839, -4.518013954162598, 8.351094245910645, -6.161073207855225, 0.7364829182624817 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -137,7 +136,7 @@ const greaterTests = [ 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0 ], - 'descriptor': {'dimensions': [24], 'dataType': 'uint8'} + 'descriptor': {shape: [24], dataType: 'uint8'} } } } @@ -157,7 +156,7 @@ const greaterTests = [ 0.7069857120513916, 2.7764203548431396, 0.978833794593811, -6.254901885986328, 4.409034729003906, -6.775286674499512 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -170,7 +169,7 @@ const greaterTests = [ 4.982365131378174, -2.507319211959839, -4.518013954162598, 8.351094245910645, -6.161073207855225, 0.7364829182624817 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -184,7 +183,7 @@ const greaterTests = [ 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'uint8'} + 'descriptor': {shape: [4, 6], dataType: 'uint8'} } } } @@ -204,7 +203,7 @@ const greaterTests = [ 0.7069857120513916, 2.7764203548431396, 0.978833794593811, -6.254901885986328, 4.409034729003906, -6.775286674499512 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -217,7 +216,7 @@ const greaterTests = [ 4.982365131378174, -2.507319211959839, -4.518013954162598, 8.351094245910645, -6.161073207855225, 0.7364829182624817 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -231,7 +230,7 @@ const greaterTests = [ 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 3, 4], dataType: 'uint8'} } } } @@ -251,7 +250,7 @@ const greaterTests = [ 0.7069857120513916, 2.7764203548431396, 0.978833794593811, -6.254901885986328, 4.409034729003906, -6.775286674499512 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -264,7 +263,7 @@ const greaterTests = [ 4.982365131378174, -2.507319211959839, -4.518013954162598, 8.351094245910645, -6.161073207855225, 0.7364829182624817 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -278,7 +277,7 @@ const greaterTests = [ 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } @@ -298,7 +297,7 @@ const greaterTests = [ 0.7069857120513916, 2.7764203548431396, 0.978833794593811, -6.254901885986328, 4.409034729003906, -6.775286674499512 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -311,7 +310,7 @@ const greaterTests = [ 4.982365131378174, -2.507319211959839, -4.518013954162598, 8.351094245910645, -6.161073207855225, 0.7364829182624817 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -325,7 +324,7 @@ const greaterTests = [ 1, 0, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'uint8'} } } } @@ -336,7 +335,7 @@ const greaterTests = [ 'inputs': { 'inputA': { 'data': [6.2216410636901855], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -349,7 +348,7 @@ const greaterTests = [ 0.7069857120513916, 2.7764203548431396, 0.978833794593811, -6.254901885986328, 4.409034729003906, -6.775286674499512 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -363,7 +362,7 @@ const greaterTests = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } @@ -374,7 +373,7 @@ const greaterTests = [ 'inputs': { 'inputA': { 'data': [6.2216410636901855], - 'descriptor': {'dimensions': [1], 'dataType': 'float32'} + 'descriptor': {shape: [1], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -387,7 +386,7 @@ const greaterTests = [ 0.7069857120513916, 2.7764203548431396, 0.978833794593811, -6.254901885986328, 4.409034729003906, -6.775286674499512 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -401,7 +400,7 @@ const greaterTests = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } @@ -421,14 +420,14 @@ const greaterTests = [ 0.7069857120513916, 2.7764203548431396, 0.978833794593811, -6.254901885986328, 4.409034729003906, -6.775286674499512 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ -2.684664487838745, 6.170023441314697, 9.487744331359863, -2.5556411743164062, -2.0436434745788574, 8.533930778503418 ], - 'descriptor': {'dimensions': [2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -442,7 +441,7 @@ const greaterTests = [ 0, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 1, 0, 0, 0, 1, 0 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } @@ -462,14 +461,14 @@ const greaterTests = [ 0.7069857120513916, 2.7764203548431396, 0.978833794593811, -6.254901885986328, 4.409034729003906, -6.775286674499512 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ -7.099076271057129, -7.781408309936523, 8.782817840576172, -8.948624610900879 ], - 'descriptor': {'dimensions': [2, 2, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1], dataType: 'float32'} } }, 'operators': [{ @@ -483,7 +482,7 @@ const greaterTests = [ 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } @@ -494,7 +493,7 @@ const greaterTests = [ 'inputs': { 'inputA': { 'data': [6.2216410636901855], - 'descriptor': {'dimensions': [1, 1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -507,7 +506,7 @@ const greaterTests = [ 0.7069857120513916, 2.7764203548431396, 0.978833794593811, -6.254901885986328, 4.409034729003906, -6.775286674499512 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -521,7 +520,7 @@ const greaterTests = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/greater_or_equal.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/greater_or_equal.https.any.js index 2f2f572eba3b..36cb9900ae48 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/greater_or_equal.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/greater_or_equal.https.any.js @@ -29,11 +29,11 @@ const greaterOrEqualTests = [ 'inputs': { 'inputA': { 'data': [0.2829853594303131], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} }, 'inputB': { 'data': [6.156983375549316], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -42,8 +42,7 @@ const greaterOrEqualTests = [ 'outputs': 'output' }], 'expectedOutputs': { - 'output': - {'data': [0], 'descriptor': {'dimensions': [], 'dataType': 'uint8'}} + 'output': {'data': [0], 'descriptor': {shape: [], dataType: 'uint8'}} } } }, @@ -62,7 +61,7 @@ const greaterOrEqualTests = [ 5.782289028167725, 1.8712012767791748, -0.5233999490737915, 0.43433287739753723, 8.93836498260498, 1.6568396091461182 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true }, 'inputB': { @@ -76,7 +75,7 @@ const greaterOrEqualTests = [ 8.678308486938477, -9.449530601501465, 0.7702168822288513, -1.5186073780059814, -9.153943061828613, -4.991735935211182 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -91,7 +90,7 @@ const greaterOrEqualTests = [ 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1 ], - 'descriptor': {'dimensions': [24], 'dataType': 'uint8'} + 'descriptor': {shape: [24], dataType: 'uint8'} } } } @@ -111,7 +110,7 @@ const greaterOrEqualTests = [ 5.782289028167725, 1.8712012767791748, -0.5233999490737915, 0.43433287739753723, 8.93836498260498, 1.6568396091461182 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -124,7 +123,7 @@ const greaterOrEqualTests = [ 8.678308486938477, -9.449530601501465, 0.7702168822288513, -1.5186073780059814, -9.153943061828613, -4.991735935211182 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -138,7 +137,7 @@ const greaterOrEqualTests = [ 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1 ], - 'descriptor': {'dimensions': [24], 'dataType': 'uint8'} + 'descriptor': {shape: [24], dataType: 'uint8'} } } } @@ -158,7 +157,7 @@ const greaterOrEqualTests = [ 5.782289028167725, 1.8712012767791748, -0.5233999490737915, 0.43433287739753723, 8.93836498260498, 1.6568396091461182 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -171,7 +170,7 @@ const greaterOrEqualTests = [ 8.678308486938477, -9.449530601501465, 0.7702168822288513, -1.5186073780059814, -9.153943061828613, -4.991735935211182 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -185,7 +184,7 @@ const greaterOrEqualTests = [ 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'uint8'} + 'descriptor': {shape: [4, 6], dataType: 'uint8'} } } } @@ -205,7 +204,7 @@ const greaterOrEqualTests = [ 5.782289028167725, 1.8712012767791748, -0.5233999490737915, 0.43433287739753723, 8.93836498260498, 1.6568396091461182 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -218,7 +217,7 @@ const greaterOrEqualTests = [ 8.678308486938477, -9.449530601501465, 0.7702168822288513, -1.5186073780059814, -9.153943061828613, -4.991735935211182 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -232,7 +231,7 @@ const greaterOrEqualTests = [ 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 3, 4], dataType: 'uint8'} } } } @@ -252,7 +251,7 @@ const greaterOrEqualTests = [ 5.782289028167725, 1.8712012767791748, -0.5233999490737915, 0.43433287739753723, 8.93836498260498, 1.6568396091461182 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -265,7 +264,7 @@ const greaterOrEqualTests = [ 8.678308486938477, -9.449530601501465, 0.7702168822288513, -1.5186073780059814, -9.153943061828613, -4.991735935211182 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -279,7 +278,7 @@ const greaterOrEqualTests = [ 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } @@ -299,7 +298,7 @@ const greaterOrEqualTests = [ 5.782289028167725, 1.8712012767791748, -0.5233999490737915, 0.43433287739753723, 8.93836498260498, 1.6568396091461182 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -312,7 +311,7 @@ const greaterOrEqualTests = [ 8.678308486938477, -9.449530601501465, 0.7702168822288513, -1.5186073780059814, -9.153943061828613, -4.991735935211182 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -326,7 +325,7 @@ const greaterOrEqualTests = [ 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 1, 0, 1, 0, 1, 1, 1 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'uint8'} } } } @@ -337,7 +336,7 @@ const greaterOrEqualTests = [ 'inputs': { 'inputA': { 'data': [-1.0187573432922363], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -350,7 +349,7 @@ const greaterOrEqualTests = [ 5.782289028167725, 1.8712012767791748, -0.5233999490737915, 0.43433287739753723, 8.93836498260498, 1.6568396091461182 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -364,7 +363,7 @@ const greaterOrEqualTests = [ 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } @@ -375,7 +374,7 @@ const greaterOrEqualTests = [ 'inputs': { 'inputA': { 'data': [-1.0187573432922363], - 'descriptor': {'dimensions': [1], 'dataType': 'float32'} + 'descriptor': {shape: [1], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -388,7 +387,7 @@ const greaterOrEqualTests = [ 5.782289028167725, 1.8712012767791748, -0.5233999490737915, 0.43433287739753723, 8.93836498260498, 1.6568396091461182 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -402,7 +401,7 @@ const greaterOrEqualTests = [ 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } @@ -422,14 +421,14 @@ const greaterOrEqualTests = [ 5.782289028167725, 1.8712012767791748, -0.5233999490737915, 0.43433287739753723, 8.93836498260498, 1.6568396091461182 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ -4.19451379776001, 3.8917839527130127, -3.5139973163604736, 6.279316425323486, 0.001788170775398612, -0.7928582429885864 ], - 'descriptor': {'dimensions': [2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -443,7 +442,7 @@ const greaterOrEqualTests = [ 0, 0, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 1, 0, 0, 0, 1, 1, 1, 0, 1, 0, 1, 1 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } @@ -463,14 +462,14 @@ const greaterOrEqualTests = [ 5.782289028167725, 1.8712012767791748, -0.5233999490737915, 0.43433287739753723, 8.93836498260498, 1.6568396091461182 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ -3.2823047637939453, -1.3975636959075928, 0.49053606390953064, -6.882648944854736 ], - 'descriptor': {'dimensions': [2, 2, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1], dataType: 'float32'} } }, 'operators': [{ @@ -484,7 +483,7 @@ const greaterOrEqualTests = [ 0, 0, 1, 0, 0, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } @@ -495,7 +494,7 @@ const greaterOrEqualTests = [ 'inputs': { 'inputA': { 'data': [-1.0187573432922363], - 'descriptor': {'dimensions': [1, 1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -508,7 +507,7 @@ const greaterOrEqualTests = [ 5.782289028167725, 1.8712012767791748, -0.5233999490737915, 0.43433287739753723, 8.93836498260498, 1.6568396091461182 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -522,7 +521,7 @@ const greaterOrEqualTests = [ 1, 1, 1, 1, 1, 0, 1, 0, 1, 0, 0, 1, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/gru.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gru.https.any.js index 15f585ba9144..4a144cce8484 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/gru.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/gru.https.any.js @@ -66,14 +66,14 @@ const gruTests = [ 'inputs': { 'gruInput': { 'data': [1, 2, 2, 1, 1, 1], - 'descriptor': {'dimensions': [1, 3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 2], dataType: 'float32'} }, 'gruWeight': { 'data': [ 1, -1, 2, -2, 0.5, -0.5, 0, 0.1, 1, -1, 2, -2, 0.5, -0.5, 0, 0.1, 1, -1, 2, -2, 0.5, -0.5, 0, 0.1 ], - 'descriptor': {'dimensions': [1, 12, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12, 2], dataType: 'float32'} }, 'gruRecurrentWeight': { 'data': [ @@ -82,15 +82,15 @@ const gruTests = [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 ], - 'descriptor': {'dimensions': [1, 12, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12, 4], dataType: 'float32'} }, 'gruBias': { 'data': [1, 2, 1, 2, 1, 1, 1, 1, 0.5, 0.5, 0.5, 0.5], - 'descriptor': {'dimensions': [1, 12], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12], dataType: 'float32'} }, 'gruRecurrentBias': { 'data': [1, 2, 1, 2, 1, 1, 1, 1, 0.5, 0.5, 0.5, 0.5], - 'descriptor': {'dimensions': [1, 12], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12], dataType: 'float32'} }, }, 'operators': [{ @@ -113,7 +113,7 @@ const gruTests = [ 'gruOutput': { 'data': [0, 0, -0.25, -3.84, -4, -15, -2.25, -3.41, -1, -3, -1, -3.41], - 'descriptor': {'dimensions': [1, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 4], dataType: 'float32'} } } } @@ -125,14 +125,14 @@ const gruTests = [ 'inputs': { 'gruInput': { 'data': [1, 2, 2, 1, 1, 1], - 'descriptor': {'dimensions': [1, 3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 2], dataType: 'float32'} }, 'gruWeight': { 'data': [ 1, -1, 2, -2, 0.5, -0.5, 0, 0.1, 1, -1, 2, -2, 0.5, -0.5, 0, 0.1, 1, -1, 2, -2, 0.5, -0.5, 0, 0.1 ], - 'descriptor': {'dimensions': [1, 12, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12, 2], dataType: 'float32'} }, 'gruRecurrentWeight': { 'data': [ @@ -141,15 +141,15 @@ const gruTests = [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 ], - 'descriptor': {'dimensions': [1, 12, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12, 4], dataType: 'float32'} }, 'gruBias': { 'data': [1, 2, 1, 2, 1, 1, 1, 1, 0.5, 0.5, 0.5, 0.5], - 'descriptor': {'dimensions': [1, 12], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12], dataType: 'float32'} }, 'gruRecurrentBias': { 'data': [1, 2, 1, 2, 1, 1, 1, 1, 0.5, 0.5, 0.5, 0.5], - 'descriptor': {'dimensions': [1, 12], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12], dataType: 'float32'} }, }, 'operators': [{ @@ -173,7 +173,7 @@ const gruTests = [ 'gruOutput': { 'data': [0, 0, -0.25, -3.84, -4, -15, -2.25, -3.41, -1, -3, -1, -3.41], - 'descriptor': {'dimensions': [1, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 4], dataType: 'float32'} } } } @@ -185,14 +185,14 @@ const gruTests = [ 'inputs': { 'gruInput': { 'data': [1, 2, 2, 1, 1, 1], - 'descriptor': {'dimensions': [1, 3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 2], dataType: 'float32'} }, 'gruWeight': { 'data': [ 1, -1, 2, -2, 0.5, -0.5, 0, 0.1, 1, -1, 2, -2, 0.5, -0.5, 0, 0.1, 1, -1, 2, -2, 0.5, -0.5, 0, 0.1 ], - 'descriptor': {'dimensions': [1, 12, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12, 2], dataType: 'float32'} }, 'gruRecurrentWeight': { 'data': [ @@ -201,15 +201,15 @@ const gruTests = [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 ], - 'descriptor': {'dimensions': [1, 12, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12, 4], dataType: 'float32'} }, 'gruBias': { 'data': [1, 2, 1, 2, 1, 1, 1, 1, 0.5, 0.5, 0.5, 0.5], - 'descriptor': {'dimensions': [1, 12], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12], dataType: 'float32'} }, 'gruRecurrentBias': { 'data': [1, 2, 1, 2, 1, 1, 1, 1, 0.5, 0.5, 0.5, 0.5], - 'descriptor': {'dimensions': [1, 12], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12], dataType: 'float32'} }, }, 'operators': [{ @@ -233,7 +233,7 @@ const gruTests = [ 'gruOutput': { 'data': [0, 0, -0.25, -3.84, -4, -15, -2.25, -3.41, -1, -3, -1, -3.41], - 'descriptor': {'dimensions': [1, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 4], dataType: 'float32'} } } } @@ -245,14 +245,14 @@ const gruTests = [ 'inputs': { 'gruInput': { 'data': [1, 2, 2, 1, 1, 1], - 'descriptor': {'dimensions': [1, 3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 2], dataType: 'float32'} }, 'gruWeight': { 'data': [ 1, -1, 2, -2, 0.5, -0.5, 0, 0.1, 1, -1, 2, -2, 0.5, -0.5, 0, 0.1, 1, -1, 2, -2, 0.5, -0.5, 0, 0.1 ], - 'descriptor': {'dimensions': [1, 12, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12, 2], dataType: 'float32'} }, 'gruRecurrentWeight': { 'data': [ @@ -261,15 +261,15 @@ const gruTests = [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 ], - 'descriptor': {'dimensions': [1, 12, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12, 4], dataType: 'float32'} }, 'gruBias': { 'data': [1, 1, 1, 1, 1, 2, 1, 2, 0.5, 0.5, 0.5, 0.5], - 'descriptor': {'dimensions': [1, 12], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12], dataType: 'float32'} }, 'gruRecurrentBias': { 'data': [1, 1, 1, 1, 1, 2, 1, 2, 0.5, 0.5, 0.5, 0.5], - 'descriptor': {'dimensions': [1, 12], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12], dataType: 'float32'} }, }, 'operators': [{ @@ -293,7 +293,7 @@ const gruTests = [ 'gruOutput': { 'data': [0, 0, -0.25, -3.84, -4, -15, -2.25, -3.41, -1, -3, -1, -3.41], - 'descriptor': {'dimensions': [1, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 4], dataType: 'float32'} } } } @@ -305,14 +305,14 @@ const gruTests = [ 'inputs': { 'gruInput': { 'data': [1, 2, 2, 1, 1, 1], - 'descriptor': {'dimensions': [1, 3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 2], dataType: 'float32'} }, 'gruWeight': { 'data': [ 1, -1, 2, -2, 0.5, -0.5, 0, 0.1, 1, -1, 2, -2, 0.5, -0.5, 0, 0.1, 1, -1, 2, -2, 0.5, -0.5, 0, 0.1 ], - 'descriptor': {'dimensions': [1, 12, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12, 2], dataType: 'float32'} }, 'gruRecurrentWeight': { 'data': [ @@ -321,19 +321,19 @@ const gruTests = [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 ], - 'descriptor': {'dimensions': [1, 12, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12, 4], dataType: 'float32'} }, 'gruBias': { 'data': [1, 2, 1, 2, 1, 1, 1, 1, 0.5, 0.5, 0.5, 0.5], - 'descriptor': {'dimensions': [1, 12], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12], dataType: 'float32'} }, 'gruRecurrentBias': { 'data': [1, 2, 1, 2, 1, 1, 1, 1, 0.5, 0.5, 0.5, 0.5], - 'descriptor': {'dimensions': [1, 12], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12], dataType: 'float32'} }, 'gruInitialHiddenState': { 'data': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - 'descriptor': {'dimensions': [1, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -357,7 +357,7 @@ const gruTests = [ 'gruOutput': { 'data': [0, 0, -0.25, -3.84, -4, -15, -2.25, -3.41, -1, -3, -1, -3.41], - 'descriptor': {'dimensions': [1, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 4], dataType: 'float32'} } } } @@ -368,14 +368,14 @@ const gruTests = [ 'inputs': { 'gruInput': { 'data': [1, 2, 2, 1, 1, 1], - 'descriptor': {'dimensions': [1, 3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 2], dataType: 'float32'} }, 'gruWeight': { 'data': [ 1, -1, 2, -2, 0.5, -0.5, 0, 0.1, 1, -1, 2, -2, 0.5, -0.5, 0, 0.1, 1, -1, 2, -2, 0.5, -0.5, 0, 0.1 ], - 'descriptor': {'dimensions': [1, 12, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12, 2], dataType: 'float32'} }, 'gruRecurrentWeight': { 'data': [ @@ -384,19 +384,19 @@ const gruTests = [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 ], - 'descriptor': {'dimensions': [1, 12, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12, 4], dataType: 'float32'} }, 'gruBias': { 'data': [1, 2, 1, 2, 1, 1, 1, 1, 0.5, 0.5, 0.5, 0.5], - 'descriptor': {'dimensions': [1, 12], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12], dataType: 'float32'} }, 'gruRecurrentBias': { 'data': [1, 2, 1, 2, 1, 1, 1, 1, 0.5, 0.5, 0.5, 0.5], - 'descriptor': {'dimensions': [1, 12], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12], dataType: 'float32'} }, 'gruInitialHiddenState': { 'data': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - 'descriptor': {'dimensions': [1, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -423,12 +423,12 @@ const gruTests = [ 'gruOutput1': { 'data': [0, 0, -0.25, -3.84, -4, -15, -2.25, -3.41, -1, -3, -1, -3.41], - 'descriptor': {'dimensions': [1, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 4], dataType: 'float32'} }, 'gruOutput2': { 'data': [0, 0, -0.25, -3.84, -4, -15, -2.25, -3.41, -1, -3, -1, -3.41], - 'descriptor': {'dimensions': [1, 1, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 3, 4], dataType: 'float32'} } } } @@ -440,14 +440,14 @@ const gruTests = [ 'inputs': { 'gruInput': { 'data': [1, 2, 2, 1, 1, 1, 3, 4, 1, 2, 1, 1], - 'descriptor': {'dimensions': [2, 3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 2], dataType: 'float32'} }, 'gruWeight': { 'data': [ 1, -1, 2, -2, 0.5, -0.5, 0, 0.1, 1, -1, 2, -2, 0.5, -0.5, 0, 0.1, 1, -1, 2, -2, 0.5, -0.5, 0, 0.1 ], - 'descriptor': {'dimensions': [1, 12, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12, 2], dataType: 'float32'} }, 'gruRecurrentWeight': { 'data': [ @@ -456,15 +456,15 @@ const gruTests = [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 ], - 'descriptor': {'dimensions': [1, 12, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12, 4], dataType: 'float32'} }, 'gruBias': { 'data': [1, 2, 1, 2, 1, 1, 1, 1, 0.5, 0.5, 0.5, 0.5], - 'descriptor': {'dimensions': [1, 12], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12], dataType: 'float32'} }, 'gruRecurrentBias': { 'data': [1, 2, 1, 2, 1, 1, 1, 1, 0.5, 0.5, 0.5, 0.5], - 'descriptor': {'dimensions': [1, 12], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12], dataType: 'float32'} }, }, 'operators': [{ @@ -492,7 +492,7 @@ const gruTests = [ -1.1589999198913575, -9.476999282836914, -1.1589999198913575, -11.319169044494629 ], - 'descriptor': {'dimensions': [1, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 4], dataType: 'float32'} } } } @@ -504,14 +504,14 @@ const gruTests = [ 'inputs': { 'gruInput': { 'data': [1, 2, 2, 1, 1, 1, 3, 4, 1, 2, 1, 1], - 'descriptor': {'dimensions': [2, 3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 2], dataType: 'float32'} }, 'gruWeight': { 'data': [ 1, -1, 2, -2, 0.5, -0.5, 0, 0.1, 1, -1, 2, -2, 0.5, -0.5, 0, 0.1, 1, -1, 2, -2, 0.5, -0.5, 0, 0.1 ], - 'descriptor': {'dimensions': [1, 12, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12, 2], dataType: 'float32'} }, 'gruRecurrentWeight': { 'data': [ @@ -520,15 +520,15 @@ const gruTests = [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 ], - 'descriptor': {'dimensions': [1, 12, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12, 4], dataType: 'float32'} }, 'gruBias': { 'data': [1, 2, 1, 2, 1, 1, 1, 1, 0.5, 0.5, 0.5, 0.5], - 'descriptor': {'dimensions': [1, 12], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12], dataType: 'float32'} }, 'gruRecurrentBias': { 'data': [1, 2, 1, 2, 1, 1, 1, 1, 0.5, 0.5, 0.5, 0.5], - 'descriptor': {'dimensions': [1, 12], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12], dataType: 'float32'} }, }, 'operators': [{ @@ -557,7 +557,7 @@ const gruTests = [ -1.1589999198913575, -9.476999282836914, -1.1589999198913575, -11.319169044494629 ], - 'descriptor': {'dimensions': [1, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 4], dataType: 'float32'} } } } @@ -569,14 +569,14 @@ const gruTests = [ 'inputs': { 'gruInput': { 'data': [1, 2, 2, 1, 1, 1, 3, 4, 1, 2, 1, 1], - 'descriptor': {'dimensions': [2, 3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 2], dataType: 'float32'} }, 'gruWeight': { 'data': [ 1, -1, 2, -2, 0.5, -0.5, 0, 0.1, 1, -1, 2, -2, 0.5, -0.5, 0, 0.1, 1, -1, 2, -2, 0.5, -0.5, 0, 0.1 ], - 'descriptor': {'dimensions': [1, 12, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12, 2], dataType: 'float32'} }, 'gruRecurrentWeight': { 'data': [ @@ -585,15 +585,15 @@ const gruTests = [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 ], - 'descriptor': {'dimensions': [1, 12, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12, 4], dataType: 'float32'} }, 'gruBias': { 'data': [1, 2, 1, 2, 1, 1, 1, 1, 0.5, 0.5, 0.5, 0.5], - 'descriptor': {'dimensions': [1, 12], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12], dataType: 'float32'} }, 'gruRecurrentBias': { 'data': [1, 2, 1, 2, 1, 1, 1, 1, 0.5, 0.5, 0.5, 0.5], - 'descriptor': {'dimensions': [1, 12], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12], dataType: 'float32'} }, }, 'operators': [{ @@ -622,7 +622,7 @@ const gruTests = [ -1.1589999198913575, -9.476999282836914, -1.1589999198913575, -11.319169044494629 ], - 'descriptor': {'dimensions': [1, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 4], dataType: 'float32'} }, 'gruOutput2': { 'data': [ @@ -651,7 +651,7 @@ const gruTests = [ -1, -3.4100000858306886 ], - 'descriptor': {'dimensions': [2, 1, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 3, 4], dataType: 'float32'} } } } @@ -662,14 +662,14 @@ const gruTests = [ 'inputs': { 'gruInput': { 'data': [1, 2, 2, 1, 1, 1, 3, 4, 1, 2, 1, 1], - 'descriptor': {'dimensions': [2, 3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 2], dataType: 'float32'} }, 'gruWeight': { 'data': [ 1, -1, 2, -2, 0.5, -0.5, 0, 0.1, 1, -1, 2, -2, 0.5, -0.5, 0, 0.1, 1, -1, 2, -2, 0.5, -0.5, 0, 0.1 ], - 'descriptor': {'dimensions': [1, 12, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12, 2], dataType: 'float32'} }, 'gruRecurrentWeight': { 'data': [ @@ -678,19 +678,19 @@ const gruTests = [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 ], - 'descriptor': {'dimensions': [1, 12, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12, 4], dataType: 'float32'} }, 'gruBias': { 'data': [1, 2, 1, 2, 1, 1, 1, 1, 0.5, 0.5, 0.5, 0.5], - 'descriptor': {'dimensions': [1, 12], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12], dataType: 'float32'} }, 'gruRecurrentBias': { 'data': [1, 2, 1, 2, 1, 1, 1, 1, 0.5, 0.5, 0.5, 0.5], - 'descriptor': {'dimensions': [1, 12], 'dataType': 'float32'} + 'descriptor': {shape: [1, 12], dataType: 'float32'} }, 'gruInitialHiddenState': { 'data': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - 'descriptor': {'dimensions': [1, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -721,7 +721,7 @@ const gruTests = [ -1.1589999198913575, -9.476999282836914, -1.1589999198913575, -11.319169044494629 ], - 'descriptor': {'dimensions': [1, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 4], dataType: 'float32'} }, 'gruOutput2': { 'data': [ @@ -750,7 +750,7 @@ const gruTests = [ -1, -3.4100000858306886 ], - 'descriptor': {'dimensions': [2, 1, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 3, 4], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/gru_cell.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/gru_cell.https.any.js index 3d7e69fb9fb3..6155a37490da 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/gru_cell.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/gru_cell.https.any.js @@ -57,14 +57,14 @@ const gruCellTests = [ 'inputs': { 'gruCellInput': { 'data': [1, 2, 2, 1, 1, 1], - 'descriptor': {'dimensions': [3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 2], dataType: 'float32'} }, 'gruCellWeight': { 'data': [ 1, -1, 2, -2, 0.5, -0.5, 0, 0.1, 1, -1, 2, -2, 0.5, -0.5, 0, 0.1, 1, -1, 2, -2, 0.5, -0.5, 0, 0.1 ], - 'descriptor': {'dimensions': [12, 2], 'dataType': 'float32'} + 'descriptor': {shape: [12, 2], dataType: 'float32'} }, 'gruCellRecurrentWeight': { 'data': [ @@ -73,19 +73,19 @@ const gruCellTests = [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 ], - 'descriptor': {'dimensions': [12, 4], 'dataType': 'float32'} + 'descriptor': {shape: [12, 4], dataType: 'float32'} }, 'gruCellHiddenState': { 'data': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - 'descriptor': {'dimensions': [3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4], dataType: 'float32'} }, 'gruCellBias': { 'data': [1, 2, 1, 2, 1, 1, 1, 1, 0.5, 0.5, 0.5, 0.5], - 'descriptor': {'dimensions': [12], 'dataType': 'float32'} + 'descriptor': {shape: [12], dataType: 'float32'} }, 'gruCellRecurrentBias': { 'data': [1, 2, 1, 2, 1, 1, 1, 1, 0.5, 0.5, 0.5, 0.5], - 'descriptor': {'dimensions': [12], 'dataType': 'float32'} + 'descriptor': {shape: [12], dataType: 'float32'} } }, 'operators': [{ @@ -108,7 +108,7 @@ const gruCellTests = [ 'gruCellOutput': { 'data': [0, 0, -0.25, -3.84, -4, -15, -2.25, -3.41, -1, -3, -1, -3.41], - 'descriptor': {'dimensions': [3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4], dataType: 'float32'} } } } @@ -120,14 +120,14 @@ const gruCellTests = [ 'inputs': { 'gruCellInput': { 'data': [1, 2, 2, 1, 1, 1], - 'descriptor': {'dimensions': [3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 2], dataType: 'float32'} }, 'gruCellWeight': { 'data': [ 1, -1, 2, -2, 0.5, -0.5, 0, 0.1, 1, -1, 2, -2, 0.5, -0.5, 0, 0.1, 1, -1, 2, -2, 0.5, -0.5, 0, 0.1 ], - 'descriptor': {'dimensions': [12, 2], 'dataType': 'float32'} + 'descriptor': {shape: [12, 2], dataType: 'float32'} }, 'gruCellRecurrentWeight': { 'data': [ @@ -136,19 +136,19 @@ const gruCellTests = [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 ], - 'descriptor': {'dimensions': [12, 4], 'dataType': 'float32'} + 'descriptor': {shape: [12, 4], dataType: 'float32'} }, 'gruCellHiddenState': { 'data': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - 'descriptor': {'dimensions': [3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4], dataType: 'float32'} }, 'gruCellBias': { 'data': [1, 2, 1, 2, 1, 1, 1, 1, 0.5, 0.5, 0.5, 0.5], - 'descriptor': {'dimensions': [12], 'dataType': 'float32'} + 'descriptor': {shape: [12], dataType: 'float32'} }, 'gruCellRecurrentBias': { 'data': [1, 2, 1, 2, 1, 1, 1, 1, 0.5, 0.5, 0.5, 0.5], - 'descriptor': {'dimensions': [12], 'dataType': 'float32'} + 'descriptor': {shape: [12], dataType: 'float32'} } }, 'operators': [{ @@ -172,7 +172,7 @@ const gruCellTests = [ 'gruCellOutput': { 'data': [0, 0, -0.25, -3.84, -4, -15, -2.25, -3.41, -1, -3, -1, -3.41], - 'descriptor': {'dimensions': [3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4], dataType: 'float32'} } } } @@ -184,14 +184,14 @@ const gruCellTests = [ 'inputs': { 'gruCellInput': { 'data': [1, 2, 2, 1, 1, 1], - 'descriptor': {'dimensions': [3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 2], dataType: 'float32'} }, 'gruCellWeight': { 'data': [ 1, -1, 2, -2, 0.5, -0.5, 0, 0.1, 1, -1, 2, -2, 0.5, -0.5, 0, 0.1, 1, -1, 2, -2, 0.5, -0.5, 0, 0.1 ], - 'descriptor': {'dimensions': [12, 2], 'dataType': 'float32'} + 'descriptor': {shape: [12, 2], dataType: 'float32'} }, 'gruCellRecurrentWeight': { 'data': [ @@ -200,19 +200,19 @@ const gruCellTests = [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, ], - 'descriptor': {'dimensions': [12, 4], 'dataType': 'float32'} + 'descriptor': {shape: [12, 4], dataType: 'float32'} }, 'gruCellHiddenState': { 'data': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - 'descriptor': {'dimensions': [3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4], dataType: 'float32'} }, 'gruCellBias': { 'data': [1, 1, 1, 1, 1, 2, 1, 2, 0.5, 0.5, 0.5, 0.5], - 'descriptor': {'dimensions': [12], 'dataType': 'float32'} + 'descriptor': {shape: [12], dataType: 'float32'} }, 'gruCellRecurrentBias': { 'data': [1, 1, 1, 1, 1, 2, 1, 2, 0.5, 0.5, 0.5, 0.5], - 'descriptor': {'dimensions': [12], 'dataType': 'float32'} + 'descriptor': {shape: [12], dataType: 'float32'} } }, 'operators': [{ @@ -236,7 +236,7 @@ const gruCellTests = [ 'gruCellOutput': { 'data': [0, 0, -0.25, -3.84, -4, -15, -2.25, -3.41, -1, -3, -1, -3.41], - 'descriptor': {'dimensions': [3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4], dataType: 'float32'} } } } @@ -247,14 +247,14 @@ const gruCellTests = [ 'inputs': { 'gruCellInput': { 'data': [1, 2, 2, 1, 1, 1], - 'descriptor': {'dimensions': [3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 2], dataType: 'float32'} }, 'gruCellWeight': { 'data': [ 1, -1, 2, -2, 0.5, -0.5, 0, 0.1, 1, -1, 2, -2, 0.5, -0.5, 0, 0.1, 1, -1, 2, -2, 0.5, -0.5, 0, 0.1 ], - 'descriptor': {'dimensions': [12, 2], 'dataType': 'float32'} + 'descriptor': {shape: [12, 2], dataType: 'float32'} }, 'gruCellRecurrentWeight': { 'data': [ @@ -263,19 +263,19 @@ const gruCellTests = [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, ], - 'descriptor': {'dimensions': [12, 4], 'dataType': 'float32'} + 'descriptor': {shape: [12, 4], dataType: 'float32'} }, 'gruCellHiddenState': { 'data': [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], - 'descriptor': {'dimensions': [3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4], dataType: 'float32'} }, 'gruCellBias': { 'data': [1, 2, 1, 2, 1, 1, 1, 1, 0.5, 0.5, 0.5, 0.5], - 'descriptor': {'dimensions': [12], 'dataType': 'float32'} + 'descriptor': {shape: [12], dataType: 'float32'} }, 'gruCellRecurrentBias': { 'data': [1, 2, 1, 2, 1, 1, 1, 1, 0.5, 0.5, 0.5, 0.5], - 'descriptor': {'dimensions': [12], 'dataType': 'float32'} + 'descriptor': {shape: [12], dataType: 'float32'} } }, 'operators': [{ @@ -299,7 +299,7 @@ const gruCellTests = [ 'gruCellOutput': { 'data': [0, 0, -0.25, -3.84, -4, -15, -2.25, -3.41, -1, -3, -1, -3.41], - 'descriptor': {'dimensions': [3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/hard_sigmoid.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/hard_sigmoid.https.any.js index 4ab915958e1d..7d2f778ec113 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/hard_sigmoid.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/hard_sigmoid.https.any.js @@ -35,7 +35,7 @@ const hardSigmoidTests = [ 'inputs': { 'hardSigmoidInput': { 'data': [0.05907066911458969], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -46,7 +46,7 @@ const hardSigmoidTests = [ 'expectedOutputs': { 'hardSigmoidOutput': { 'data': [0.5118141174316406], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -66,7 +66,7 @@ const hardSigmoidTests = [ 0.7311381697654724, 0.4880960285663605, 0.7766845226287842, 0.8455570340156555, 0.555302083492279, 0.5603444576263428 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -86,7 +86,7 @@ const hardSigmoidTests = [ 0.6462276577949524, 0.5976191759109497, 0.6553369164466858, 0.669111430644989, 0.6110604405403137, 0.6120688915252686 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -106,7 +106,7 @@ const hardSigmoidTests = [ 0.7311381697654724, 0.4880960285663605, 0.7766845226287842, 0.8455570340156555, 0.555302083492279, 0.5603444576263428 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -126,7 +126,7 @@ const hardSigmoidTests = [ 0.6462276577949524, 0.5976191759109497, 0.6553369164466858, 0.669111430644989, 0.6110604405403137, 0.6120688915252686 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -146,7 +146,7 @@ const hardSigmoidTests = [ 0.7311381697654724, 0.4880960285663605, 0.7766845226287842, 0.8455570340156555, 0.555302083492279, 0.5603444576263428 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -166,7 +166,7 @@ const hardSigmoidTests = [ 0.6462276577949524, 0.5976191759109497, 0.6553369164466858, 0.669111430644989, 0.6110604405403137, 0.6120688915252686 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -186,7 +186,7 @@ const hardSigmoidTests = [ 0.7311381697654724, 0.4880960285663605, 0.7766845226287842, 0.8455570340156555, 0.555302083492279, 0.5603444576263428 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -206,7 +206,7 @@ const hardSigmoidTests = [ 0.6462276577949524, 0.5976191759109497, 0.6553369164466858, 0.669111430644989, 0.6110604405403137, 0.6120688915252686 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -226,7 +226,7 @@ const hardSigmoidTests = [ 0.7311381697654724, 0.4880960285663605, 0.7766845226287842, 0.8455570340156555, 0.555302083492279, 0.5603444576263428 ], - 'descriptor': {'dimensions': [1, 2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -246,7 +246,7 @@ const hardSigmoidTests = [ 0.6462276577949524, 0.5976191759109497, 0.6553369164466858, 0.669111430644989, 0.6110604405403137, 0.6120688915252686 ], - 'descriptor': {'dimensions': [1, 2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} } } } @@ -266,7 +266,7 @@ const hardSigmoidTests = [ 0.7311381697654724, 0.4880960285663605, 0.7766845226287842, 0.8455570340156555, 0.555302083492279, 0.5603444576263428 ], - 'descriptor': {'dimensions': [1, 2, 1, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -286,7 +286,7 @@ const hardSigmoidTests = [ 0.6462276577949524, 0.5976191759109497, 0.6553369164466858, 0.669111430644989, 0.6110604405403137, 0.6120688915252686 ], - 'descriptor': {'dimensions': [1, 2, 1, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 3, 4], dataType: 'float32'} } } } @@ -307,7 +307,7 @@ const hardSigmoidTests = [ 0.7311381697654724, 0.4880960285663605, 0.7766845226287842, 0.8455570340156555, 0.555302083492279, 0.5603444576263428 ], - 'descriptor': {'dimensions': [1, 2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -346,7 +346,7 @@ const hardSigmoidTests = [ 0.936147153377533, 0.9401075839996338 ], - 'descriptor': {'dimensions': [1, 2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} } } } @@ -367,7 +367,7 @@ const hardSigmoidTests = [ -0.7311381697654724, -0.4880960285663605, -0.7766845226287842, -0.8455570340156555, -0.555302083492279, -0.5603444576263428 ], - 'descriptor': {'dimensions': [1, 2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -406,7 +406,7 @@ const hardSigmoidTests = [ 0.936147153377533, 0.9401075839996338 ], - 'descriptor': {'dimensions': [1, 2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} } } } @@ -427,7 +427,7 @@ const hardSigmoidTests = [ 0.7311381697654724, 0.4880960285663605, 0.7766845226287842, 0.8455570340156555, 0.555302083492279, 0.5603444576263428 ], - 'descriptor': {'dimensions': [1, 2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -450,7 +450,7 @@ const hardSigmoidTests = [ 0.5824136734008789, 0.533805251121521, 0.5915229320526123, 0.6052974462509155, 0.5472464561462402, 0.5482549667358398 ], - 'descriptor': {'dimensions': [1, 2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} } } } @@ -471,7 +471,7 @@ const hardSigmoidTests = [ -0.7311381697654724, -0.4880960285663605, -0.7766845226287842, -0.8455570340156555, -0.555302083492279, -0.5603444576263428 ], - 'descriptor': {'dimensions': [1, 2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -488,7 +488,7 @@ const hardSigmoidTests = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], - 'descriptor': {'dimensions': [1, 2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} } } } @@ -509,7 +509,7 @@ const hardSigmoidTests = [ 0.7311381697654724, 0.4880960285663605, 0.7766845226287842, 0.8455570340156555, 0.555302083492279, 0.5603444576263428 ], - 'descriptor': {'dimensions': [1, 2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -548,7 +548,7 @@ const hardSigmoidTests = [ 0.8723332285881042, 0.8762935996055603 ], - 'descriptor': {'dimensions': [1, 2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} } } } @@ -569,7 +569,7 @@ const hardSigmoidTests = [ 0.7311381697654724, 0.4880960285663605, 0.7766845226287842, 0.8455570340156555, 0.555302083492279, 0.5603444576263428 ], - 'descriptor': {'dimensions': [1, 2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -588,7 +588,7 @@ const hardSigmoidTests = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], - 'descriptor': {'dimensions': [1, 2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} } } } @@ -609,7 +609,7 @@ const hardSigmoidTests = [ -0.7311381697654724, -0.4880960285663605, -0.7766845226287842, -0.8455570340156555, -0.555302083492279, -0.5603444576263428 ], - 'descriptor': {'dimensions': [1, 2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -628,7 +628,7 @@ const hardSigmoidTests = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], - 'descriptor': {'dimensions': [1, 2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} } } } @@ -649,7 +649,7 @@ const hardSigmoidTests = [ -0.7311381697654724, -0.4880960285663605, -0.7766845226287842, -0.8455570340156555, -0.555302083492279, -0.5603444576263428 ], - 'descriptor': {'dimensions': [1, 2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -690,7 +690,7 @@ const hardSigmoidTests = [ 0.8723332285881042, 0.8762935996055603 ], - 'descriptor': {'dimensions': [1, 2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/hard_swish.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/hard_swish.https.any.js index 480b696d77fa..899904c9e533 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/hard_swish.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/hard_swish.https.any.js @@ -29,7 +29,7 @@ const hardSwishTests = [ 'inputs': { 'hardSwishInput': { 'data': [0.7341583371162415], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -40,7 +40,7 @@ const hardSwishTests = [ 'expectedOutputs': { 'hardSwishOutput': { 'data': [0.4569105803966522], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -60,7 +60,7 @@ const hardSwishTests = [ 3.7802627086639404, -6.071240425109863, -9.909919738769531, -7.744259357452393, -8.286120414733887, 8.083491325378418 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -97,7 +97,7 @@ const hardSwishTests = [ 0, 8.083491325378418 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -117,7 +117,7 @@ const hardSwishTests = [ 3.7802627086639404, -6.071240425109863, -9.909919738769531, -7.744259357452393, -8.286120414733887, 8.083491325378418 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -153,7 +153,7 @@ const hardSwishTests = [ 0, 8.083491325378418 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -173,7 +173,7 @@ const hardSwishTests = [ 3.7802627086639404, -6.071240425109863, -9.909919738769531, -7.744259357452393, -8.286120414733887, 8.083491325378418 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -209,7 +209,7 @@ const hardSwishTests = [ 0, 8.083491325378418 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -229,7 +229,7 @@ const hardSwishTests = [ 3.7802627086639404, -6.071240425109863, -9.909919738769531, -7.744259357452393, -8.286120414733887, 8.083491325378418 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -265,7 +265,7 @@ const hardSwishTests = [ 0, 8.083491325378418 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -285,7 +285,7 @@ const hardSwishTests = [ 3.7802627086639404, -6.071240425109863, -9.909919738769531, -7.744259357452393, -8.286120414733887, 8.083491325378418 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -321,7 +321,7 @@ const hardSwishTests = [ 0, 8.083491325378418 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -341,7 +341,7 @@ const hardSwishTests = [ 3.7802627086639404, -6.071240425109863, -9.909919738769531, -7.744259357452393, -8.286120414733887, 8.083491325378418 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } }, 'operators': [{ @@ -377,7 +377,7 @@ const hardSwishTests = [ 0, 8.083491325378418 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/identity.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/identity.https.any.js index ca4239145b14..6e1b1e7f6db7 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/identity.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/identity.https.any.js @@ -28,7 +28,7 @@ const identityTests = [ 'inputs': { 'identityInput': { 'data': [-4.273642539978027], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -39,7 +39,7 @@ const identityTests = [ 'expectedOutputs': { 'identityOutput': { 'data': [-4.273642539978027], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -59,7 +59,7 @@ const identityTests = [ -9.782458305358887, 5.496699810028076, -9.967339515686035, -6.901016712188721, -2.8501904010772705, 3.279616355895996 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -80,7 +80,7 @@ const identityTests = [ -9.782458305358887, 5.496699810028076, -9.967339515686035, -6.901016712188721, -2.8501904010772705, 3.279616355895996 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -100,7 +100,7 @@ const identityTests = [ -9.782458305358887, 5.496699810028076, -9.967339515686035, -6.901016712188721, -2.8501904010772705, 3.279616355895996 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -120,7 +120,7 @@ const identityTests = [ -9.782458305358887, 5.496699810028076, -9.967339515686035, -6.901016712188721, -2.8501904010772705, 3.279616355895996 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -140,7 +140,7 @@ const identityTests = [ -9.782458305358887, 5.496699810028076, -9.967339515686035, -6.901016712188721, -2.8501904010772705, 3.279616355895996 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -160,7 +160,7 @@ const identityTests = [ -9.782458305358887, 5.496699810028076, -9.967339515686035, -6.901016712188721, -2.8501904010772705, 3.279616355895996 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -180,7 +180,7 @@ const identityTests = [ -9.782458305358887, 5.496699810028076, -9.967339515686035, -6.901016712188721, -2.8501904010772705, 3.279616355895996 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -200,7 +200,7 @@ const identityTests = [ -9.782458305358887, 5.496699810028076, -9.967339515686035, -6.901016712188721, -2.8501904010772705, 3.279616355895996 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -220,7 +220,7 @@ const identityTests = [ -9.782458305358887, 5.496699810028076, -9.967339515686035, -6.901016712188721, -2.8501904010772705, 3.279616355895996 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -240,7 +240,7 @@ const identityTests = [ -9.782458305358887, 5.496699810028076, -9.967339515686035, -6.901016712188721, -2.8501904010772705, 3.279616355895996 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -260,7 +260,7 @@ const identityTests = [ -9.782458305358887, 5.496699810028076, -9.967339515686035, -6.901016712188721, -2.8501904010772705, 3.279616355895996 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } }, 'operators': [{ @@ -280,7 +280,7 @@ const identityTests = [ -9.782458305358887, 5.496699810028076, -9.967339515686035, -6.901016712188721, -2.8501904010772705, 3.279616355895996 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/inputs-are-not-modified.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/inputs-are-not-modified.https.any.js index f3a1d14fd530..ffd2d93a557f 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/inputs-are-not-modified.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/inputs-are-not-modified.https.any.js @@ -21,7 +21,7 @@ promise_setup(async () => { promise_test(async () => { const builder = new MLGraphBuilder(mlContext); const inputOperand = - builder.input('input', {dataType: 'float32', dimensions: [4]}); + builder.input('input', {dataType: 'float32', shape: [4]}); const hardSwishOperand = builder.hardSwish(inputOperand); // Add some other operator for the output tensor to bind to; otherwise there // is no reason to implement hardSwish "in-place". @@ -30,11 +30,11 @@ promise_test(async () => { const [inputTensor, outputTensor, mlGraph] = await Promise.all([ mlContext.createTensor({ dataType: 'float32', - dimensions: [4], + shape: [4], usage: MLTensorUsage.WRITE | MLTensorUsage.READ }), mlContext.createTensor( - {dataType: 'float32', dimensions: [4], usage: MLTensorUsage.READ}), + {dataType: 'float32', shape: [4], usage: MLTensorUsage.READ}), builder.build({'output': outputOperand}) ]); @@ -54,9 +54,9 @@ promise_test(async () => { promise_test(async () => { const builder = new MLGraphBuilder(mlContext); const inputOperand = - builder.input('input', {dataType: 'float32', dimensions: [4]}); + builder.input('input', {dataType: 'float32', shape: [4]}); const constantOperand = builder.constant( - {dataType: 'float32', dimensions: [4]}, Float32Array.from([-2, 0, 3, 4])); + {dataType: 'float32', shape: [4]}, Float32Array.from([-2, 0, 3, 4])); const mulOperand = builder.mul(inputOperand, constantOperand); // Add some other operator for the output tensor to bind to; otherwise there // is no reason to implement mul "in-place". @@ -65,11 +65,11 @@ promise_test(async () => { const [inputTensor, outputTensor, mlGraph] = await Promise.all([ mlContext.createTensor({ dataType: 'float32', - dimensions: [4], + shape: [4], usage: MLTensorUsage.WRITE | MLTensorUsage.READ }), mlContext.createTensor( - {dataType: 'float32', dimensions: [4], usage: MLTensorUsage.READ}), + {dataType: 'float32', shape: [4], usage: MLTensorUsage.READ}), builder.build({'output': outputOperand}) ]); diff --git a/testing/web-platform/tests/webnn/conformance_tests/instance_normalization.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/instance_normalization.https.any.js index 5790b20d8e80..46f434bd245d 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/instance_normalization.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/instance_normalization.https.any.js @@ -47,7 +47,7 @@ const instanceNormTests = [ -16.574905395507812, 42.949893951416016, 73.8739242553711, -99.00035095214844, -33.11322784423828, -17.380685806274414 ], - 'descriptor': {'dimensions': [2, 3, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'} } }, 'operators': [{ @@ -67,7 +67,7 @@ const instanceNormTests = [ -1.6783342361450195, 0.46660327911376953, 1.5037200450897217, -1.2981476783752441, -0.2302791178226471, 0.024706769734621048 ], - 'descriptor': {'dimensions': [2, 3, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'} } } } @@ -87,11 +87,11 @@ const instanceNormTests = [ -16.574905395507812, 42.949893951416016, 73.8739242553711, -99.00035095214844, -33.11322784423828, -17.380685806274414 ], - 'descriptor': {'dimensions': [2, 3, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'} }, 'instanceNormScale': { 'data': [-94.42772674560547, 66.69620513916016, -98.56572723388672], - 'descriptor': {'dimensions': [3], 'dataType': 'float32'}, + 'descriptor': {shape: [3], dataType: 'float32'}, 'constant': true } }, @@ -115,7 +115,7 @@ const instanceNormTests = [ -111.93852233886719, 31.120668411254883, -148.2152557373047, 127.95286560058594, 22.697628021240234, -2.4352407455444336 ], - 'descriptor': {'dimensions': [2, 3, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'} } } } @@ -135,11 +135,11 @@ const instanceNormTests = [ -16.574905395507812, 42.949893951416016, 73.8739242553711, -99.00035095214844, -33.11322784423828, -17.380685806274414 ], - 'descriptor': {'dimensions': [2, 3, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'} }, 'instanceNormBias': { 'data': [-33.048641204833984, 4.511423587799072, -37.93617248535156], - 'descriptor': {'dimensions': [3], 'dataType': 'float32'}, + 'descriptor': {shape: [3], dataType: 'float32'}, 'constant': true } }, @@ -163,7 +163,7 @@ const instanceNormTests = [ 2.8330893516540527, 4.978026866912842, -36.43245315551758, -39.23432159423828, -38.16645050048828, -37.91146469116211 ], - 'descriptor': {'dimensions': [2, 3, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'} } } } @@ -183,7 +183,7 @@ const instanceNormTests = [ -16.574905395507812, 42.949893951416016, 73.8739242553711, -99.00035095214844, -33.11322784423828, -17.380685806274414 ], - 'descriptor': {'dimensions': [2, 3, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'} } }, 'operators': [{ @@ -205,7 +205,7 @@ const instanceNormTests = [ -1.6783342361450195, 0.46660327911376953, 1.5037200450897217, -1.2981476783752441, -0.2302791178226471, 0.024706769734621048 ], - 'descriptor': {'dimensions': [2, 3, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'} } } } @@ -226,7 +226,7 @@ const instanceNormTests = [ -16.574905395507812, 42.949893951416016, 73.8739242553711, -99.00035095214844, -33.11322784423828, -17.380685806274414 ], - 'descriptor': {'dimensions': [2, 3, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'} } }, 'operators': [{ @@ -247,7 +247,7 @@ const instanceNormTests = [ -1.6783342361450195, 0.46660327911376953, 1.5037200450897217, -1.2981476783752441, -0.2302791178226471, 0.024706769734621048 ], - 'descriptor': {'dimensions': [2, 3, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 2, 2], dataType: 'float32'} } } } @@ -267,7 +267,7 @@ const instanceNormTests = [ 5.6758809089660645, -16.574905395507812, -33.11322784423828, 25.68659210205078, 42.949893951416016, -17.380685806274414 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -288,7 +288,7 @@ const instanceNormTests = [ -1.3059037923812866, -1.6783342361450195, -0.2302791178226471, -0.6197298169136047, 0.46660327911376953, 0.024706769734621048 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -308,16 +308,16 @@ const instanceNormTests = [ 5.6758809089660645, -16.574905395507812, -33.11322784423828, 25.68659210205078, 42.949893951416016, -17.380685806274414 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'instanceNormScale': { 'data': [-94.42772674560547, 66.69620513916016, -98.56572723388672], - 'descriptor': {'dimensions': [3], 'dataType': 'float32'}, + 'descriptor': {shape: [3], dataType: 'float32'}, 'constant': true }, 'instanceNormBias': { 'data': [-33.048641204833984, 4.511423587799072, -37.93617248535156], - 'descriptor': {'dimensions': [3], 'dataType': 'float32'}, + 'descriptor': {shape: [3], dataType: 'float32'}, 'constant': true } }, @@ -347,7 +347,7 @@ const instanceNormTests = [ 90.26488494873047, -107.4271011352539, -15.238543510437012, 25.471038818359375, 35.6320915222168, -40.37141418457031 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/layer_normalization.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/layer_normalization.https.any.js index 84b90ca2779e..23ba642e2426 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/layer_normalization.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/layer_normalization.https.any.js @@ -45,7 +45,7 @@ const layerNormTests = [ -88.03730773925781, -26.5667724609375, 70.81292724609375, 9.105611801147461, 56.66746139526367, 21.78444480895996 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -65,7 +65,7 @@ const layerNormTests = [ -1.795186161994934, -0.6376377940177917, 1.1961140632629395, 0.034106940031051636, 0.9297415614128113, 0.2728613615036011 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -85,7 +85,7 @@ const layerNormTests = [ -88.03730773925781, -26.5667724609375, 70.81292724609375, 9.105611801147461, 56.66746139526367, 21.78444480895996 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -105,7 +105,7 @@ const layerNormTests = [ -1.7796510457992554, -0.5852779150009155, 1.3068104982376099, 0.10783683508634567, 1.0319640636444092, 0.35418668389320374 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -125,7 +125,7 @@ const layerNormTests = [ -88.03730773925781, -26.5667724609375, 70.81292724609375, 9.105611801147461, 56.66746139526367, 21.78444480895996 ], - 'descriptor': {'dimensions': [2, 1, 4, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 3], dataType: 'float32'} } }, 'operators': [{ @@ -145,7 +145,7 @@ const layerNormTests = [ -1.7796510457992554, -0.5852779150009155, 1.3068104982376099, 0.10783683508634567, 1.0319640636444092, 0.35418668389320374 ], - 'descriptor': {'dimensions': [2, 1, 4, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 3], dataType: 'float32'} } } } @@ -165,7 +165,7 @@ const layerNormTests = [ -88.03730773925781, -26.5667724609375, 70.81292724609375, 9.105611801147461, 56.66746139526367, 21.78444480895996 ], - 'descriptor': {'dimensions': [2, 1, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -185,7 +185,7 @@ const layerNormTests = [ -1.7796510457992554, -0.5852779150009155, 1.3068104982376099, 0.10783683508634567, 1.0319640636444092, 0.35418668389320374 ], - 'descriptor': {'dimensions': [2, 1, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 2, 2, 3], dataType: 'float32'} } } } @@ -205,7 +205,7 @@ const layerNormTests = [ -88.03730773925781, -26.5667724609375, 70.81292724609375, 9.105611801147461, 56.66746139526367, 21.78444480895996 ], - 'descriptor': {'dimensions': [2, 1, 4, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 3], dataType: 'float32'} }, 'layerNormScale': { 'data': [ @@ -214,7 +214,7 @@ const layerNormTests = [ 7.1816911697387695, 1.5054303407669067, 3.120894193649292, 0.5214731693267822, 2.6719748973846436, -3.571370840072632 ], - 'descriptor': {'dimensions': [1, 4, 3], 'dataType': 'float32'}, + 'descriptor': {shape: [1, 4, 3], dataType: 'float32'}, 'constant': true } }, @@ -237,7 +237,7 @@ const layerNormTests = [ -12.780903816223145, -0.8810951709747314, 4.0784173011779785, 0.05623401328921318, 2.7573819160461426, -1.2649319171905518 ], - 'descriptor': {'dimensions': [2, 1, 4, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 3], dataType: 'float32'} } } } @@ -257,7 +257,7 @@ const layerNormTests = [ -88.03730773925781, -26.5667724609375, 70.81292724609375, 9.105611801147461, 56.66746139526367, 21.78444480895996 ], - 'descriptor': {'dimensions': [2, 1, 4, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 3], dataType: 'float32'} }, 'layerNormBias': { 'data': [ @@ -266,7 +266,7 @@ const layerNormTests = [ -4.080942153930664, -7.137991905212402, 8.465653419494629, 2.762545108795166, 0.8230442404747009, -3.827561378479004 ], - 'descriptor': {'dimensions': [1, 4, 3], 'dataType': 'float32'}, + 'descriptor': {shape: [1, 4, 3], dataType: 'float32'}, 'constant': true } }, @@ -289,7 +289,7 @@ const layerNormTests = [ -5.860593318939209, -7.723269939422607, 9.77246379852295, 2.8703818321228027, 1.8550082445144653, -3.473374605178833 ], - 'descriptor': {'dimensions': [2, 1, 4, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 3], dataType: 'float32'} } } } @@ -309,7 +309,7 @@ const layerNormTests = [ -88.03730773925781, -26.5667724609375, 70.81292724609375, 9.105611801147461, 56.66746139526367, 21.78444480895996 ], - 'descriptor': {'dimensions': [2, 1, 4, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 3], dataType: 'float32'} } }, 'operators': [{ @@ -329,7 +329,7 @@ const layerNormTests = [ -1.0618212223052979, -0.5766634941101074, 1.7181260585784912, 0.539446234703064, 1.2323321104049683, -0.5902572274208069 ], - 'descriptor': {'dimensions': [2, 1, 4, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 3], dataType: 'float32'} } } } @@ -349,7 +349,7 @@ const layerNormTests = [ -88.03730773925781, -26.5667724609375, 70.81292724609375, 9.105611801147461, 56.66746139526367, 21.78444480895996 ], - 'descriptor': {'dimensions': [2, 1, 4, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 3], dataType: 'float32'} } }, 'operators': [{ @@ -370,7 +370,7 @@ const layerNormTests = [ -1.7796509265899658, -0.5852779150009155, 1.3068104982376099, 0.10783682763576508, 1.0319639444351196, 0.35418668389320374 ], - 'descriptor': {'dimensions': [2, 1, 4, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 3], dataType: 'float32'} } } } @@ -391,7 +391,7 @@ const layerNormTests = [ -88.03730773925781, -26.5667724609375, 70.81292724609375, 9.105611801147461, 56.66746139526367, 21.78444480895996 ], - 'descriptor': {'dimensions': [2, 1, 4, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 3], dataType: 'float32'} }, 'layerNormScale': { 'data': [ @@ -399,7 +399,7 @@ const layerNormTests = [ 4.707905292510986, -4.705780029296875, -5.143046855926514, -1.1115549802780151, 5.250569820404053 ], - 'descriptor': {'dimensions': [2, 4], 'dataType': 'float32'}, + 'descriptor': {shape: [2, 4], dataType: 'float32'}, 'constant': true } }, @@ -423,7 +423,7 @@ const layerNormTests = [ 1.3962621688842773, 1.185346245765686, -1.959165334701538, 1.8479242324829102, 3.3530402183532715, -3.986907958984375 ], - 'descriptor': {'dimensions': [2, 1, 4, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 3], dataType: 'float32'} } } } @@ -444,7 +444,7 @@ const layerNormTests = [ -88.03730773925781, -26.5667724609375, 70.81292724609375, 9.105611801147461, 56.66746139526367, 21.78444480895996 ], - 'descriptor': {'dimensions': [2, 1, 4, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 3], dataType: 'float32'} }, 'layerNormBias': { 'data': [ @@ -453,7 +453,7 @@ const layerNormTests = [ 9.744950294494629, -0.3958968222141266, -8.497353553771973, 6.172536849975586, -2.8930461406707764, 1.7220044136047363 ], - 'descriptor': {'dimensions': [3, 1, 4], 'dataType': 'float32'}, + 'descriptor': {shape: [3, 1, 4], dataType: 'float32'}, 'constant': true } }, @@ -477,7 +477,7 @@ const layerNormTests = [ 2.5836451053619385, 9.159672737121582, -1.5862356424331665, 8.967641830444336, 0.6360672116279602, 2.0761911869049072 ], - 'descriptor': {'dimensions': [2, 1, 4, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 3], dataType: 'float32'} } } } @@ -497,14 +497,14 @@ const layerNormTests = [ -88.03730773925781, -26.5667724609375, 70.81292724609375, 9.105611801147461, 56.66746139526367, 21.78444480895996 ], - 'descriptor': {'dimensions': [2, 1, 4, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 3], dataType: 'float32'} }, 'layerNormScale': { 'data': [ 7.715926647186279, 1.7371079921722412, 9.13965129852295, 5.758823394775391, -2.8198351860046387, -0.6866958141326904 ], - 'descriptor': {'dimensions': [2, 3, 1], 'dataType': 'float32'}, + 'descriptor': {shape: [2, 3, 1], dataType: 'float32'}, 'constant': true }, 'layerNormBias': { @@ -512,7 +512,7 @@ const layerNormTests = [ -8.710672378540039, -7.642981052398682, 4.937538146972656, -2.1876745223999023, -4.067612648010254, -6.836254596710205 ], - 'descriptor': {'dimensions': [2, 3, 1], 'dataType': 'float32'}, + 'descriptor': {shape: [2, 3, 1], dataType: 'float32'}, 'constant': true } }, @@ -542,7 +542,7 @@ const layerNormTests = [ -11.648612976074219, -2.117840528488159, -7.396423816680908, -4.869131088256836, -5.8111701011657715, -6.714934349060059 ], - 'descriptor': {'dimensions': [2, 1, 4, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 3], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/leaky_relu.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/leaky_relu.https.any.js index f14489b1295a..38b88dc5c8b0 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/leaky_relu.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/leaky_relu.https.any.js @@ -44,7 +44,7 @@ const leakyReluTests = [ -61.47925567626953, 64.26514434814453, 21.469341278076172, -31.514690399169922, -41.27694320678711, -65.59529113769531 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -65,7 +65,7 @@ const leakyReluTests = [ -0.6147925853729248, 64.26514434814453, 21.469341278076172, -0.31514689326286316, -0.4127694368362427, -0.6559529304504395 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -76,7 +76,7 @@ const leakyReluTests = [ 'inputs': { 'leakyReluInput': { 'data': [-19.053640365600586], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -87,7 +87,7 @@ const leakyReluTests = [ 'expectedOutputs': { 'leakyReluOutput': { 'data': [-0.19053640961647034], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -107,7 +107,7 @@ const leakyReluTests = [ -61.47925567626953, 64.26514434814453, 21.469341278076172, -31.514690399169922, -41.27694320678711, -65.59529113769531 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -127,7 +127,7 @@ const leakyReluTests = [ -0.6147925853729248, 64.26514434814453, 21.469341278076172, -0.31514689326286316, -0.4127694368362427, -0.6559529304504395 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -147,7 +147,7 @@ const leakyReluTests = [ -61.47925567626953, 64.26514434814453, 21.469341278076172, -31.514690399169922, -41.27694320678711, -65.59529113769531 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -167,7 +167,7 @@ const leakyReluTests = [ -0.6147925853729248, 64.26514434814453, 21.469341278076172, -0.31514689326286316, -0.4127694368362427, -0.6559529304504395 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -187,7 +187,7 @@ const leakyReluTests = [ -61.47925567626953, 64.26514434814453, 21.469341278076172, -31.514690399169922, -41.27694320678711, -65.59529113769531 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -207,7 +207,7 @@ const leakyReluTests = [ -0.6147925853729248, 64.26514434814453, 21.469341278076172, -0.31514689326286316, -0.4127694368362427, -0.6559529304504395 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -227,7 +227,7 @@ const leakyReluTests = [ -61.47925567626953, 64.26514434814453, 21.469341278076172, -31.514690399169922, -41.27694320678711, -65.59529113769531 ], - 'descriptor': {'dimensions': [1, 2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -247,7 +247,7 @@ const leakyReluTests = [ -0.6147925853729248, 64.26514434814453, 21.469341278076172, -0.31514689326286316, -0.4127694368362427, -0.6559529304504395 ], - 'descriptor': {'dimensions': [1, 2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} } } } @@ -267,7 +267,7 @@ const leakyReluTests = [ -61.47925567626953, 64.26514434814453, 21.469341278076172, -31.514690399169922, -41.27694320678711, -65.59529113769531 ], - 'descriptor': {'dimensions': [1, 2, 1, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -287,7 +287,7 @@ const leakyReluTests = [ -0.6147925853729248, 64.26514434814453, 21.469341278076172, -0.31514689326286316, -0.4127694368362427, -0.6559529304504395 ], - 'descriptor': {'dimensions': [1, 2, 1, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 3, 4], dataType: 'float32'} } } } @@ -307,7 +307,7 @@ const leakyReluTests = [ -61.47925567626953, 64.26514434814453, 21.469341278076172, -31.514690399169922, -41.27694320678711, -65.59529113769531 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -330,7 +330,7 @@ const leakyReluTests = [ 6006.5908203125, 64.26514434814453, 21.469341278076172, 3079.019775390625, 4032.802490234375, 6408.73193359375 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -350,7 +350,7 @@ const leakyReluTests = [ -61.47925567626953, 64.26514434814453, 21.469341278076172, -31.514690399169922, -41.27694320678711, -65.59529113769531 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -373,7 +373,7 @@ const leakyReluTests = [ -2200.906005859375, 64.26514434814453, 21.469341278076172, -1128.1995849609375, -1477.6800537109375, -2348.256591796875 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -393,7 +393,7 @@ const leakyReluTests = [ -61.47925567626953, 64.26514434814453, 21.469341278076172, -31.514690399169922, -41.27694320678711, -65.59529113769531 ], - 'descriptor': {'dimensions': [1, 2, 1, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -429,7 +429,7 @@ const leakyReluTests = [ 0, 0 ], - 'descriptor': {'dimensions': [1, 2, 1, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 3, 4], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/lesser.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/lesser.https.any.js index f7200bc21d8a..322209f18a18 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/lesser.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/lesser.https.any.js @@ -28,11 +28,11 @@ const lesserTests = [ 'inputs': { 'inputA': { 'data': [-0.5228080153465271], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} }, 'inputB': { 'data': [0.8150388598442078], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -41,8 +41,7 @@ const lesserTests = [ 'outputs': 'output' }], 'expectedOutputs': { - 'output': - {'data': [1], 'descriptor': {'dimensions': [], 'dataType': 'uint8'}} + 'output': {'data': [1], 'descriptor': {shape: [], dataType: 'uint8'}} } } }, @@ -61,7 +60,7 @@ const lesserTests = [ 1.0030865669250488, -9.076244354248047, 8.907161712646484, 4.232614994049072, 2.1005890369415283, -6.201345443725586 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true }, 'inputB': { @@ -75,7 +74,7 @@ const lesserTests = [ -1.4069052934646606, -0.23742099106311798, -9.10597038269043, 6.811779975891113, -6.768326759338379, -8.952353477478027 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -90,7 +89,7 @@ const lesserTests = [ 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0 ], - 'descriptor': {'dimensions': [24], 'dataType': 'uint8'} + 'descriptor': {shape: [24], dataType: 'uint8'} } } } @@ -110,7 +109,7 @@ const lesserTests = [ 1.0030865669250488, -9.076244354248047, 8.907161712646484, 4.232614994049072, 2.1005890369415283, -6.201345443725586 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -123,7 +122,7 @@ const lesserTests = [ -1.4069052934646606, -0.23742099106311798, -9.10597038269043, 6.811779975891113, -6.768326759338379, -8.952353477478027 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -137,7 +136,7 @@ const lesserTests = [ 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0 ], - 'descriptor': {'dimensions': [24], 'dataType': 'uint8'} + 'descriptor': {shape: [24], dataType: 'uint8'} } } } @@ -157,7 +156,7 @@ const lesserTests = [ 1.0030865669250488, -9.076244354248047, 8.907161712646484, 4.232614994049072, 2.1005890369415283, -6.201345443725586 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -170,7 +169,7 @@ const lesserTests = [ -1.4069052934646606, -0.23742099106311798, -9.10597038269043, 6.811779975891113, -6.768326759338379, -8.952353477478027 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -184,7 +183,7 @@ const lesserTests = [ 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'uint8'} + 'descriptor': {shape: [4, 6], dataType: 'uint8'} } } } @@ -204,7 +203,7 @@ const lesserTests = [ 1.0030865669250488, -9.076244354248047, 8.907161712646484, 4.232614994049072, 2.1005890369415283, -6.201345443725586 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -217,7 +216,7 @@ const lesserTests = [ -1.4069052934646606, -0.23742099106311798, -9.10597038269043, 6.811779975891113, -6.768326759338379, -8.952353477478027 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -231,7 +230,7 @@ const lesserTests = [ 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 3, 4], dataType: 'uint8'} } } } @@ -251,7 +250,7 @@ const lesserTests = [ 1.0030865669250488, -9.076244354248047, 8.907161712646484, 4.232614994049072, 2.1005890369415283, -6.201345443725586 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -264,7 +263,7 @@ const lesserTests = [ -1.4069052934646606, -0.23742099106311798, -9.10597038269043, 6.811779975891113, -6.768326759338379, -8.952353477478027 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -278,7 +277,7 @@ const lesserTests = [ 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } @@ -298,7 +297,7 @@ const lesserTests = [ 1.0030865669250488, -9.076244354248047, 8.907161712646484, 4.232614994049072, 2.1005890369415283, -6.201345443725586 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -311,7 +310,7 @@ const lesserTests = [ -1.4069052934646606, -0.23742099106311798, -9.10597038269043, 6.811779975891113, -6.768326759338379, -8.952353477478027 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -325,7 +324,7 @@ const lesserTests = [ 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'uint8'} } } } @@ -336,7 +335,7 @@ const lesserTests = [ 'inputs': { 'inputA': { 'data': [-5.678369998931885], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -349,7 +348,7 @@ const lesserTests = [ 1.0030865669250488, -9.076244354248047, 8.907161712646484, 4.232614994049072, 2.1005890369415283, -6.201345443725586 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -363,7 +362,7 @@ const lesserTests = [ 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } @@ -374,7 +373,7 @@ const lesserTests = [ 'inputs': { 'inputA': { 'data': [-5.678369998931885], - 'descriptor': {'dimensions': [1], 'dataType': 'float32'} + 'descriptor': {shape: [1], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -387,7 +386,7 @@ const lesserTests = [ 1.0030865669250488, -9.076244354248047, 8.907161712646484, 4.232614994049072, 2.1005890369415283, -6.201345443725586 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -401,7 +400,7 @@ const lesserTests = [ 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } @@ -421,14 +420,14 @@ const lesserTests = [ 1.0030865669250488, -9.076244354248047, 8.907161712646484, 4.232614994049072, 2.1005890369415283, -6.201345443725586 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ 3.5869946479797363, -2.853332042694092, -3.684652805328369, 2.4055018424987793, -4.358371257781982, 5.5484747886657715 ], - 'descriptor': {'dimensions': [2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -442,7 +441,7 @@ const lesserTests = [ 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 1 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } @@ -462,14 +461,14 @@ const lesserTests = [ 1.0030865669250488, -9.076244354248047, 8.907161712646484, 4.232614994049072, 2.1005890369415283, -6.201345443725586 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ -4.439523696899414, 2.7518322467803955, 3.635943651199341, -2.8089921474456787 ], - 'descriptor': {'dimensions': [2, 2, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1], dataType: 'float32'} } }, 'operators': [{ @@ -483,7 +482,7 @@ const lesserTests = [ 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 1 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } @@ -494,7 +493,7 @@ const lesserTests = [ 'inputs': { 'inputA': { 'data': [-5.678369998931885], - 'descriptor': {'dimensions': [1, 1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -507,7 +506,7 @@ const lesserTests = [ 1.0030865669250488, -9.076244354248047, 8.907161712646484, 4.232614994049072, 2.1005890369415283, -6.201345443725586 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -521,7 +520,7 @@ const lesserTests = [ 1, 0, 1, 1, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 1, 1, 0, 1, 1, 0, 1, 1, 1, 0 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/lesser_or_equal.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/lesser_or_equal.https.any.js index fce69f611253..aceec9dc135f 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/lesser_or_equal.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/lesser_or_equal.https.any.js @@ -29,11 +29,11 @@ const lesserOrEqualTests = [ 'inputs': { 'inputA': { 'data': [-6.978766441345215], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} }, 'inputB': { 'data': [6.613064765930176], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -42,8 +42,7 @@ const lesserOrEqualTests = [ 'outputs': 'output' }], 'expectedOutputs': { - 'output': - {'data': [1], 'descriptor': {'dimensions': [], 'dataType': 'uint8'}} + 'output': {'data': [1], 'descriptor': {shape: [], dataType: 'uint8'}} } } }, @@ -62,7 +61,7 @@ const lesserOrEqualTests = [ 1.64528226852417, -1.4862726926803589, -4.998753547668457, -0.920993447303772, -9.434256553649902, 9.813238143920898 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true }, 'inputB': { @@ -76,7 +75,7 @@ const lesserOrEqualTests = [ -2.5953285694122314, -4.9998064041137695, 3.118950605392456, 9.705141067504883, 9.54673957824707, -6.189505577087402 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -91,7 +90,7 @@ const lesserOrEqualTests = [ 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0 ], - 'descriptor': {'dimensions': [24], 'dataType': 'uint8'} + 'descriptor': {shape: [24], dataType: 'uint8'} } } } @@ -111,7 +110,7 @@ const lesserOrEqualTests = [ 1.64528226852417, -1.4862726926803589, -4.998753547668457, -0.920993447303772, -9.434256553649902, 9.813238143920898 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -124,7 +123,7 @@ const lesserOrEqualTests = [ -2.5953285694122314, -4.9998064041137695, 3.118950605392456, 9.705141067504883, 9.54673957824707, -6.189505577087402 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -138,7 +137,7 @@ const lesserOrEqualTests = [ 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0 ], - 'descriptor': {'dimensions': [24], 'dataType': 'uint8'} + 'descriptor': {shape: [24], dataType: 'uint8'} } } } @@ -158,7 +157,7 @@ const lesserOrEqualTests = [ 1.64528226852417, -1.4862726926803589, -4.998753547668457, -0.920993447303772, -9.434256553649902, 9.813238143920898 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -171,7 +170,7 @@ const lesserOrEqualTests = [ -2.5953285694122314, -4.9998064041137695, 3.118950605392456, 9.705141067504883, 9.54673957824707, -6.189505577087402 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -185,7 +184,7 @@ const lesserOrEqualTests = [ 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'uint8'} + 'descriptor': {shape: [4, 6], dataType: 'uint8'} } } } @@ -205,7 +204,7 @@ const lesserOrEqualTests = [ 1.64528226852417, -1.4862726926803589, -4.998753547668457, -0.920993447303772, -9.434256553649902, 9.813238143920898 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -218,7 +217,7 @@ const lesserOrEqualTests = [ -2.5953285694122314, -4.9998064041137695, 3.118950605392456, 9.705141067504883, 9.54673957824707, -6.189505577087402 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -232,7 +231,7 @@ const lesserOrEqualTests = [ 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 3, 4], dataType: 'uint8'} } } } @@ -252,7 +251,7 @@ const lesserOrEqualTests = [ 1.64528226852417, -1.4862726926803589, -4.998753547668457, -0.920993447303772, -9.434256553649902, 9.813238143920898 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -265,7 +264,7 @@ const lesserOrEqualTests = [ -2.5953285694122314, -4.9998064041137695, 3.118950605392456, 9.705141067504883, 9.54673957824707, -6.189505577087402 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -279,7 +278,7 @@ const lesserOrEqualTests = [ 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } @@ -299,7 +298,7 @@ const lesserOrEqualTests = [ 1.64528226852417, -1.4862726926803589, -4.998753547668457, -0.920993447303772, -9.434256553649902, 9.813238143920898 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -312,7 +311,7 @@ const lesserOrEqualTests = [ -2.5953285694122314, -4.9998064041137695, 3.118950605392456, 9.705141067504883, 9.54673957824707, -6.189505577087402 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -326,7 +325,7 @@ const lesserOrEqualTests = [ 1, 1, 1, 0, 1, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 1, 1, 1, 0 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'uint8'} } } } @@ -337,7 +336,7 @@ const lesserOrEqualTests = [ 'inputs': { 'inputA': { 'data': [4.840610980987549], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -350,7 +349,7 @@ const lesserOrEqualTests = [ 1.64528226852417, -1.4862726926803589, -4.998753547668457, -0.920993447303772, -9.434256553649902, 9.813238143920898 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -364,7 +363,7 @@ const lesserOrEqualTests = [ 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } @@ -375,7 +374,7 @@ const lesserOrEqualTests = [ 'inputs': { 'inputA': { 'data': [4.840610980987549], - 'descriptor': {'dimensions': [1], 'dataType': 'float32'} + 'descriptor': {shape: [1], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -388,7 +387,7 @@ const lesserOrEqualTests = [ 1.64528226852417, -1.4862726926803589, -4.998753547668457, -0.920993447303772, -9.434256553649902, 9.813238143920898 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -402,7 +401,7 @@ const lesserOrEqualTests = [ 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } @@ -422,14 +421,14 @@ const lesserOrEqualTests = [ 1.64528226852417, -1.4862726926803589, -4.998753547668457, -0.920993447303772, -9.434256553649902, 9.813238143920898 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ -8.499547004699707, -8.321310043334961, -7.182070732116699, 3.418306350708008, 5.389469146728516, 6.904313087463379 ], - 'descriptor': {'dimensions': [2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -443,7 +442,7 @@ const lesserOrEqualTests = [ 0, 0, 0, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 0, 0, 0, 1, 1, 0 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } @@ -463,14 +462,14 @@ const lesserOrEqualTests = [ 1.64528226852417, -1.4862726926803589, -4.998753547668457, -0.920993447303772, -9.434256553649902, 9.813238143920898 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ 4.195140838623047, 7.8286590576171875, 6.6902031898498535, 0.9247010350227356 ], - 'descriptor': {'dimensions': [2, 2, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1], dataType: 'float32'} } }, 'operators': [{ @@ -484,7 +483,7 @@ const lesserOrEqualTests = [ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } @@ -495,7 +494,7 @@ const lesserOrEqualTests = [ 'inputs': { 'inputA': { 'data': [4.840610980987549], - 'descriptor': {'dimensions': [1, 1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -508,7 +507,7 @@ const lesserOrEqualTests = [ 1.64528226852417, -1.4862726926803589, -4.998753547668457, -0.920993447303772, -9.434256553649902, 9.813238143920898 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -522,7 +521,7 @@ const lesserOrEqualTests = [ 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/linear.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/linear.https.any.js index da4115bcfa62..72ff42c09245 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/linear.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/linear.https.any.js @@ -42,7 +42,7 @@ const linearTests = [ 5.2140889167785645, 9.65861701965332, -8.721749305725098, -0.4533396363258362, 9.992619514465332, -6.469675064086914 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -63,7 +63,7 @@ const linearTests = [ 5.2140889167785645, 9.65861701965332, -8.721749305725098, -0.4533396363258362, 9.992619514465332, -6.469675064086914 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -74,7 +74,7 @@ const linearTests = [ 'inputs': { 'linearInput': { 'data': [-1.12251615524292], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -85,7 +85,7 @@ const linearTests = [ 'expectedOutputs': { 'linearOutput': { 'data': [-1.12251615524292], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -105,7 +105,7 @@ const linearTests = [ 5.2140889167785645, 9.65861701965332, -8.721749305725098, -0.4533396363258362, 9.992619514465332, -6.469675064086914 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -125,7 +125,7 @@ const linearTests = [ 5.2140889167785645, 9.65861701965332, -8.721749305725098, -0.4533396363258362, 9.992619514465332, -6.469675064086914 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -145,7 +145,7 @@ const linearTests = [ 5.2140889167785645, 9.65861701965332, -8.721749305725098, -0.4533396363258362, 9.992619514465332, -6.469675064086914 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -165,7 +165,7 @@ const linearTests = [ 5.2140889167785645, 9.65861701965332, -8.721749305725098, -0.4533396363258362, 9.992619514465332, -6.469675064086914 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -185,7 +185,7 @@ const linearTests = [ 5.2140889167785645, 9.65861701965332, -8.721749305725098, -0.4533396363258362, 9.992619514465332, -6.469675064086914 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -205,7 +205,7 @@ const linearTests = [ 5.2140889167785645, 9.65861701965332, -8.721749305725098, -0.4533396363258362, 9.992619514465332, -6.469675064086914 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -225,7 +225,7 @@ const linearTests = [ 5.2140889167785645, 9.65861701965332, -8.721749305725098, -0.4533396363258362, 9.992619514465332, -6.469675064086914 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -245,7 +245,7 @@ const linearTests = [ 5.2140889167785645, 9.65861701965332, -8.721749305725098, -0.4533396363258362, 9.992619514465332, -6.469675064086914 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -265,7 +265,7 @@ const linearTests = [ 5.2140889167785645, 9.65861701965332, -8.721749305725098, -0.4533396363258362, 9.992619514465332, -6.469675064086914 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } }, 'operators': [{ @@ -285,7 +285,7 @@ const linearTests = [ 5.2140889167785645, 9.65861701965332, -8.721749305725098, -0.4533396363258362, 9.992619514465332, -6.469675064086914 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } } } @@ -306,7 +306,7 @@ const linearTests = [ 5.2140889167785645, 9.65861701965332, -8.721749305725098, -0.4533396363258362, 9.992619514465332, -6.469675064086914 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -328,7 +328,7 @@ const linearTests = [ 38.57796859741211, 71.46211242675781, -64.53042602539062, -3.3541665077209473, 73.9333267211914, -47.86779022216797 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -349,7 +349,7 @@ const linearTests = [ 5.16057825088501, 0.8060914278030396, 9.130533218383789, 3.1937403678894043, 5.748293399810791, 4.113487720489502 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -371,7 +371,7 @@ const linearTests = [ 11.079673767089844, 6.725186824798584, 15.049629211425781, 9.112835884094238, 11.667388916015625, 10.032583236694336 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -392,7 +392,7 @@ const linearTests = [ -5.16057825088501, -0.8060914278030396, -9.130533218383789, -3.1937403678894043, -5.748293399810791, -4.113487720489502 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -414,7 +414,7 @@ const linearTests = [ -11.079673767089844, -6.725186824798584, -15.049629211425781, -9.112835884094238, -11.667388916015625, -10.032583236694336 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -435,7 +435,7 @@ const linearTests = [ 5.16057825088501, 0.8060914278030396, 9.130533218383789, 3.1937403678894043, 5.748293399810791, 4.113487720489502 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -458,7 +458,7 @@ const linearTests = [ 44.10115051269531, 11.883199691772461, 73.47402954101562, 29.548921585083008, 48.44953155517578, 36.35394287109375 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -479,7 +479,7 @@ const linearTests = [ 5.16057825088501, 0.8060914278030396, 9.130533218383789, 3.1937403678894043, 5.748293399810791, 4.113487720489502 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -502,7 +502,7 @@ const linearTests = [ -44.10115051269531, -11.883199691772461, -73.47402954101562, -29.548921585083008, -48.44953155517578, -36.35394287109375 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -523,7 +523,7 @@ const linearTests = [ -5.16057825088501, -0.8060914278030396, -9.130533218383789, -3.1937403678894043, -5.748293399810791, -4.113487720489502 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -546,7 +546,7 @@ const linearTests = [ -44.10115051269531, -11.883199691772461, -73.47402954101562, -29.548921585083008, -48.44953155517578, -36.35394287109375 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/log.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/log.https.any.js index a8d5b006ebbb..8d6b5885c28f 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/log.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/log.https.any.js @@ -28,7 +28,7 @@ const logTests = [ 'inputs': { 'logInput': { 'data': [63.82542037963867], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -39,7 +39,7 @@ const logTests = [ 'expectedOutputs': { 'logOutput': { 'data': [4.15615177154541], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -59,7 +59,7 @@ const logTests = [ 30.385812759399414, 13.709558486938477, 10.396759986877441, 50.840946197509766, 5.682034492492676, 94.02275848388672 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -80,7 +80,7 @@ const logTests = [ 3.413975715637207, 2.618093252182007, 2.34149432182312, 3.9287021160125732, 1.7373093366622925, 4.54353666305542 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -100,7 +100,7 @@ const logTests = [ 30.385812759399414, 13.709558486938477, 10.396759986877441, 50.840946197509766, 5.682034492492676, 94.02275848388672 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -120,7 +120,7 @@ const logTests = [ 3.413975715637207, 2.618093252182007, 2.34149432182312, 3.9287021160125732, 1.7373093366622925, 4.54353666305542 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -140,7 +140,7 @@ const logTests = [ 30.385812759399414, 13.709558486938477, 10.396759986877441, 50.840946197509766, 5.682034492492676, 94.02275848388672 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -160,7 +160,7 @@ const logTests = [ 3.413975715637207, 2.618093252182007, 2.34149432182312, 3.9287021160125732, 1.7373093366622925, 4.54353666305542 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -180,7 +180,7 @@ const logTests = [ 30.385812759399414, 13.709558486938477, 10.396759986877441, 50.840946197509766, 5.682034492492676, 94.02275848388672 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -200,7 +200,7 @@ const logTests = [ 3.413975715637207, 2.618093252182007, 2.34149432182312, 3.9287021160125732, 1.7373093366622925, 4.54353666305542 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -220,7 +220,7 @@ const logTests = [ 30.385812759399414, 13.709558486938477, 10.396759986877441, 50.840946197509766, 5.682034492492676, 94.02275848388672 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -240,7 +240,7 @@ const logTests = [ 3.413975715637207, 2.618093252182007, 2.34149432182312, 3.9287021160125732, 1.7373093366622925, 4.54353666305542 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -260,7 +260,7 @@ const logTests = [ 30.385812759399414, 13.709558486938477, 10.396759986877441, 50.840946197509766, 5.682034492492676, 94.02275848388672 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } }, 'operators': [{ @@ -280,7 +280,7 @@ const logTests = [ 3.413975715637207, 2.618093252182007, 2.34149432182312, 3.9287021160125732, 1.7373093366622925, 4.54353666305542 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/logical_not.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/logical_not.https.any.js index 51db74cd3ae2..e56c5626ef8a 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/logical_not.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/logical_not.https.any.js @@ -27,7 +27,7 @@ const logicalNotTests = [ 'graph': { 'inputs': { 'logicalNotInput': - {'data': [1], 'descriptor': {'dimensions': [], 'dataType': 'uint8'}} + {'data': [1], 'descriptor': {shape: [], dataType: 'uint8'}} }, 'operators': [{ 'name': 'logicalNot', @@ -36,7 +36,7 @@ const logicalNotTests = [ }], 'expectedOutputs': { 'logicalNotOutput': - {'data': [0], 'descriptor': {'dimensions': [], 'dataType': 'uint8'}} + {'data': [0], 'descriptor': {shape: [], dataType: 'uint8'}} } } }, @@ -49,7 +49,7 @@ const logicalNotTests = [ 204, 130, 90, 0, 147, 42, 10, 18, 13, 235, 0, 233, 53, 83, 9, 254, 69, 56, 219, 109, 171, 0, 228, 135 ], - 'descriptor': {'dimensions': [24], 'dataType': 'uint8'}, + 'descriptor': {shape: [24], dataType: 'uint8'}, 'constant': true } }, @@ -64,7 +64,7 @@ const logicalNotTests = [ 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 ], - 'descriptor': {'dimensions': [24], 'dataType': 'uint8'} + 'descriptor': {shape: [24], dataType: 'uint8'} } } } @@ -78,7 +78,7 @@ const logicalNotTests = [ 204, 130, 90, 0, 147, 42, 10, 18, 13, 235, 0, 233, 53, 83, 9, 254, 69, 56, 219, 109, 171, 0, 228, 135 ], - 'descriptor': {'dimensions': [24], 'dataType': 'uint8'} + 'descriptor': {shape: [24], dataType: 'uint8'} } }, 'operators': [{ @@ -92,7 +92,7 @@ const logicalNotTests = [ 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 ], - 'descriptor': {'dimensions': [24], 'dataType': 'uint8'} + 'descriptor': {shape: [24], dataType: 'uint8'} } } } @@ -106,7 +106,7 @@ const logicalNotTests = [ 204, 130, 90, 0, 147, 42, 10, 18, 13, 235, 0, 233, 53, 83, 9, 254, 69, 56, 219, 109, 171, 0, 228, 135 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'uint8'} + 'descriptor': {shape: [4, 6], dataType: 'uint8'} } }, 'operators': [{ @@ -120,7 +120,7 @@ const logicalNotTests = [ 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'uint8'} + 'descriptor': {shape: [4, 6], dataType: 'uint8'} } } } @@ -134,7 +134,7 @@ const logicalNotTests = [ 204, 130, 90, 0, 147, 42, 10, 18, 13, 235, 0, 233, 53, 83, 9, 254, 69, 56, 219, 109, 171, 0, 228, 135 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 3, 4], dataType: 'uint8'} } }, 'operators': [{ @@ -148,7 +148,7 @@ const logicalNotTests = [ 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 3, 4], dataType: 'uint8'} } } } @@ -162,7 +162,7 @@ const logicalNotTests = [ 204, 130, 90, 0, 147, 42, 10, 18, 13, 235, 0, 233, 53, 83, 9, 254, 69, 56, 219, 109, 171, 0, 228, 135 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } }, 'operators': [{ @@ -176,7 +176,7 @@ const logicalNotTests = [ 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} } } } @@ -190,7 +190,7 @@ const logicalNotTests = [ 204, 130, 90, 0, 147, 42, 10, 18, 13, 235, 0, 233, 53, 83, 9, 254, 69, 56, 219, 109, 171, 0, 228, 135 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'uint8'} } }, 'operators': [{ @@ -204,7 +204,7 @@ const logicalNotTests = [ 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'uint8'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/lstm.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/lstm.https.any.js index 8b6cf73715c5..20198bfb2f5c 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/lstm.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/lstm.https.any.js @@ -66,26 +66,26 @@ const lstmTests = [ 'inputs': { 'lstmInput': { 'data': [1, 2, 2, 1], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} }, 'lstmWeight': { 'data': [1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2], - 'descriptor': {'dimensions': [1, 8, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8, 2], dataType: 'float32'} }, 'lstmRecurrentWeight': { 'data': [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 ], - 'descriptor': {'dimensions': [1, 8, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8, 2], dataType: 'float32'} }, 'lstmBias': { 'data': [1, 2, 1, 2, 1, 2, 1, 2], - 'descriptor': {'dimensions': [1, 8], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8], dataType: 'float32'} }, 'lstmRecurrentBias': { 'data': [1, 2, 1, 2, 1, 2, 1, 2], - 'descriptor': {'dimensions': [1, 8], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8], dataType: 'float32'} } }, 'operators': [{ @@ -106,11 +106,11 @@ const lstmTests = [ 'expectedOutputs': { 'lstmOutput1': { 'data': [1, 8, 27, 216], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} }, 'lstmOutput2': { 'data': [1, 4, 9, 36], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} } } } @@ -122,30 +122,30 @@ const lstmTests = [ 'inputs': { 'lstmInput': { 'data': [1, 2, 2, 1], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} }, 'lstmWeight': { 'data': [1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2], - 'descriptor': {'dimensions': [1, 8, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8, 2], dataType: 'float32'} }, 'lstmRecurrentWeight': { 'data': [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 ], - 'descriptor': {'dimensions': [1, 8, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8, 2], dataType: 'float32'} }, 'lstmBias': { 'data': [1, 2, 1, 2, 1, 2, 1, 2], - 'descriptor': {'dimensions': [1, 8], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8], dataType: 'float32'} }, 'lstmRecurrentBias': { 'data': [1, 2, 1, 2, 1, 2, 1, 2], - 'descriptor': {'dimensions': [1, 8], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8], dataType: 'float32'} }, 'lstmPeepholeWeight': { 'data': [0, 0, 0, 0, 0, 0], - 'descriptor': {'dimensions': [1, 6], 'dataType': 'float32'} + 'descriptor': {shape: [1, 6], dataType: 'float32'} } }, 'operators': [{ @@ -167,11 +167,11 @@ const lstmTests = [ 'expectedOutputs': { 'lstmOutput1': { 'data': [1, 8, 27, 216], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} }, 'lstmOutput2': { 'data': [1, 4, 9, 36], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} } } } @@ -183,30 +183,30 @@ const lstmTests = [ 'inputs': { 'lstmInput': { 'data': [1, 2, 2, 1], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} }, 'lstmWeight': { 'data': [1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2], - 'descriptor': {'dimensions': [1, 8, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8, 2], dataType: 'float32'} }, 'lstmRecurrentWeight': { 'data': [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 ], - 'descriptor': {'dimensions': [1, 8, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8, 2], dataType: 'float32'} }, 'lstmBias': { 'data': [1, 2, 1, 2, 1, 2, 1, 2], - 'descriptor': {'dimensions': [1, 8], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8], dataType: 'float32'} }, 'lstmRecurrentBias': { 'data': [1, 2, 1, 2, 1, 2, 1, 2], - 'descriptor': {'dimensions': [1, 8], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8], dataType: 'float32'} }, 'lstmInitialHiddenState': { 'data': [0, 0, 0, 0], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} } }, 'operators': [{ @@ -228,11 +228,11 @@ const lstmTests = [ 'expectedOutputs': { 'lstmOutput1': { 'data': [1, 8, 27, 216], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} }, 'lstmOutput2': { 'data': [1, 4, 9, 36], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} } } } @@ -244,30 +244,30 @@ const lstmTests = [ 'inputs': { 'lstmInput': { 'data': [1, 2, 2, 1], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} }, 'lstmWeight': { 'data': [1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2], - 'descriptor': {'dimensions': [1, 8, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8, 2], dataType: 'float32'} }, 'lstmRecurrentWeight': { 'data': [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 ], - 'descriptor': {'dimensions': [1, 8, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8, 2], dataType: 'float32'} }, 'lstmBias': { 'data': [1, 2, 1, 2, 1, 2, 1, 2], - 'descriptor': {'dimensions': [1, 8], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8], dataType: 'float32'} }, 'lstmRecurrentBias': { 'data': [1, 2, 1, 2, 1, 2, 1, 2], - 'descriptor': {'dimensions': [1, 8], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8], dataType: 'float32'} }, 'lstmInitialCellState': { 'data': [0, 0, 0, 0], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} } }, 'operators': [{ @@ -289,11 +289,11 @@ const lstmTests = [ 'expectedOutputs': { 'lstmOutput1': { 'data': [1, 8, 27, 216], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} }, 'lstmOutput2': { 'data': [1, 4, 9, 36], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} } } } @@ -305,26 +305,26 @@ const lstmTests = [ 'inputs': { 'lstmInput': { 'data': [1, 2, 2, 1], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} }, 'lstmWeight': { 'data': [1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2], - 'descriptor': {'dimensions': [1, 8, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8, 2], dataType: 'float32'} }, 'lstmRecurrentWeight': { 'data': [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 ], - 'descriptor': {'dimensions': [1, 8, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8, 2], dataType: 'float32'} }, 'lstmBias': { 'data': [1, 2, 1, 2, 1, 2, 1, 2], - 'descriptor': {'dimensions': [1, 8], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8], dataType: 'float32'} }, 'lstmRecurrentBias': { 'data': [1, 2, 1, 2, 1, 2, 1, 2], - 'descriptor': {'dimensions': [1, 8], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8], dataType: 'float32'} } }, 'operators': [{ @@ -346,11 +346,11 @@ const lstmTests = [ 'expectedOutputs': { 'lstmOutput1': { 'data': [1, 8, 27, 216], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} }, 'lstmOutput2': { 'data': [1, 4, 9, 36], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} } } } @@ -362,26 +362,26 @@ const lstmTests = [ 'inputs': { 'lstmInput': { 'data': [1, 2, 2, 1], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} }, 'lstmWeight': { 'data': [1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2], - 'descriptor': {'dimensions': [1, 8, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8, 2], dataType: 'float32'} }, 'lstmRecurrentWeight': { 'data': [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 ], - 'descriptor': {'dimensions': [1, 8, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8, 2], dataType: 'float32'} }, 'lstmBias': { 'data': [1, 2, 1, 2, 1, 2, 1, 2], - 'descriptor': {'dimensions': [1, 8], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8], dataType: 'float32'} }, 'lstmRecurrentBias': { 'data': [1, 2, 1, 2, 1, 2, 1, 2], - 'descriptor': {'dimensions': [1, 8], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8], dataType: 'float32'} } }, 'operators': [{ @@ -403,15 +403,15 @@ const lstmTests = [ 'expectedOutputs': { 'lstmOutput1': { 'data': [1, 8, 27, 216], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} }, 'lstmOutput2': { 'data': [1, 4, 9, 36], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} }, 'lstmOutput3': { 'data': [1, 8, 27, 216], - 'descriptor': {'dimensions': [1, 1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 2, 2], dataType: 'float32'} } } } @@ -423,26 +423,26 @@ const lstmTests = [ 'inputs': { 'lstmInput': { 'data': [1, 2, 2, 1], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} }, 'lstmWeight': { 'data': [1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2], - 'descriptor': {'dimensions': [1, 8, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8, 2], dataType: 'float32'} }, 'lstmRecurrentWeight': { 'data': [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 ], - 'descriptor': {'dimensions': [1, 8, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8, 2], dataType: 'float32'} }, 'lstmBias': { 'data': [1, 2, 1, 2, 1, 2, 1, 2], - 'descriptor': {'dimensions': [1, 8], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8], dataType: 'float32'} }, 'lstmRecurrentBias': { 'data': [1, 2, 1, 2, 1, 2, 1, 2], - 'descriptor': {'dimensions': [1, 8], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8], dataType: 'float32'} } }, 'operators': [{ @@ -464,11 +464,11 @@ const lstmTests = [ 'expectedOutputs': { 'lstmOutput1': { 'data': [1, 8, 27, 216], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} }, 'lstmOutput2': { 'data': [1, 4, 9, 36], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} } } } @@ -480,26 +480,26 @@ const lstmTests = [ 'inputs': { 'lstmInput': { 'data': [1, 2, 2, 1], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} }, 'lstmWeight': { 'data': [1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2], - 'descriptor': {'dimensions': [1, 8, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8, 2], dataType: 'float32'} }, 'lstmRecurrentWeight': { 'data': [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 ], - 'descriptor': {'dimensions': [1, 8, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8, 2], dataType: 'float32'} }, 'lstmBias': { 'data': [1, 2, 1, 2, 1, 2, 1, 2], - 'descriptor': {'dimensions': [1, 8], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8], dataType: 'float32'} }, 'lstmRecurrentBias': { 'data': [1, 2, 1, 2, 1, 2, 1, 2], - 'descriptor': {'dimensions': [1, 8], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8], dataType: 'float32'} } }, 'operators': [{ @@ -521,11 +521,11 @@ const lstmTests = [ 'expectedOutputs': { 'lstmOutput1': { 'data': [1, 8, 27, 216], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} }, 'lstmOutput2': { 'data': [1, 4, 9, 36], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} } } } @@ -537,26 +537,26 @@ const lstmTests = [ 'inputs': { 'lstmInput': { 'data': [1, 2, 2, 1], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} }, 'lstmWeight': { 'data': [1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2], - 'descriptor': {'dimensions': [1, 8, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8, 2], dataType: 'float32'} }, 'lstmRecurrentWeight': { 'data': [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 ], - 'descriptor': {'dimensions': [1, 8, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8, 2], dataType: 'float32'} }, 'lstmBias': { 'data': [1, 2, 1, 2, 1, 2, 1, 2], - 'descriptor': {'dimensions': [1, 8], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8], dataType: 'float32'} }, 'lstmRecurrentBias': { 'data': [1, 2, 1, 2, 1, 2, 1, 2], - 'descriptor': {'dimensions': [1, 8], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8], dataType: 'float32'} } }, 'operators': [{ @@ -578,11 +578,11 @@ const lstmTests = [ 'expectedOutputs': { 'lstmOutput1': { 'data': [1, 8, 27, 216], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} }, 'lstmOutput2': { 'data': [1, 4, 9, 36], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} } } } @@ -593,38 +593,38 @@ const lstmTests = [ 'inputs': { 'lstmInput': { 'data': [1, 2, 2, 1], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} }, 'lstmWeight': { 'data': [1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2], - 'descriptor': {'dimensions': [1, 8, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8, 2], dataType: 'float32'} }, 'lstmRecurrentWeight': { 'data': [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 ], - 'descriptor': {'dimensions': [1, 8, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8, 2], dataType: 'float32'} }, 'lstmBias': { 'data': [1, 2, 1, 2, 1, 2, 1, 2], - 'descriptor': {'dimensions': [1, 8], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8], dataType: 'float32'} }, 'lstmRecurrentBias': { 'data': [1, 2, 1, 2, 1, 2, 1, 2], - 'descriptor': {'dimensions': [1, 8], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8], dataType: 'float32'} }, 'lstmPeepholeWeight': { 'data': [0, 0, 0, 0, 0, 0], - 'descriptor': {'dimensions': [1, 6], 'dataType': 'float32'} + 'descriptor': {shape: [1, 6], dataType: 'float32'} }, 'lstmInitialHiddenState': { 'data': [0, 0, 0, 0], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} }, 'lstmInitialCellState': { 'data': [0, 0, 0, 0], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} } }, 'operators': [{ @@ -651,15 +651,15 @@ const lstmTests = [ 'expectedOutputs': { 'lstmOutput1': { 'data': [1, 8, 27, 216], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} }, 'lstmOutput2': { 'data': [1, 4, 9, 36], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} }, 'lstmOutput3': { 'data': [1, 8, 27, 216], - 'descriptor': {'dimensions': [1, 1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 2, 2], dataType: 'float32'} } } } @@ -671,26 +671,26 @@ const lstmTests = [ 'inputs': { 'lstmInput': { 'data': [1, 2, 2, 1, 3, 4, 1, 2], - 'descriptor': {'dimensions': [2, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2], dataType: 'float32'} }, 'lstmWeight': { 'data': [1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2], - 'descriptor': {'dimensions': [1, 8, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8, 2], dataType: 'float32'} }, 'lstmRecurrentWeight': { 'data': [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 ], - 'descriptor': {'dimensions': [1, 8, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8, 2], dataType: 'float32'} }, 'lstmBias': { 'data': [1, 2, 1, 2, 1, 2, 1, 2], - 'descriptor': {'dimensions': [1, 8], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8], dataType: 'float32'} }, 'lstmRecurrentBias': { 'data': [1, 2, 1, 2, 1, 2, 1, 2], - 'descriptor': {'dimensions': [1, 8], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8], dataType: 'float32'} } }, 'operators': [{ @@ -715,14 +715,14 @@ const lstmTests = [ 10.469000816345215, 58.02900695800781, 74.52900695800781, 518.948974609375 ], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} }, 'lstmOutput2': { 'data': [ 5.510000228881836, 20.01000213623047, 19.110000610351564, 75.20999908447266 ], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} } } } @@ -733,38 +733,38 @@ const lstmTests = [ 'inputs': { 'lstmInput': { 'data': [1, 2, 2, 1, 3, 4, 1, 2], - 'descriptor': {'dimensions': [2, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2], dataType: 'float32'} }, 'lstmWeight': { 'data': [1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2], - 'descriptor': {'dimensions': [1, 8, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8, 2], dataType: 'float32'} }, 'lstmRecurrentWeight': { 'data': [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 ], - 'descriptor': {'dimensions': [1, 8, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8, 2], dataType: 'float32'} }, 'lstmBias': { 'data': [1, 2, 1, 2, 1, 2, 1, 2], - 'descriptor': {'dimensions': [1, 8], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8], dataType: 'float32'} }, 'lstmRecurrentBias': { 'data': [1, 2, 1, 2, 1, 2, 1, 2], - 'descriptor': {'dimensions': [1, 8], 'dataType': 'float32'} + 'descriptor': {shape: [1, 8], dataType: 'float32'} }, 'lstmPeepholeWeight': { 'data': [0, 0, 0, 0, 0, 0], - 'descriptor': {'dimensions': [1, 6], 'dataType': 'float32'} + 'descriptor': {shape: [1, 6], dataType: 'float32'} }, 'lstmInitialHiddenState': { 'data': [0, 0, 0, 0], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} }, 'lstmInitialCellState': { 'data': [0, 0, 0, 0], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} } }, 'operators': [{ @@ -794,21 +794,21 @@ const lstmTests = [ 10.469000816345215, 58.02900695800781, 74.52900695800781, 518.948974609375 ], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} }, 'lstmOutput2': { 'data': [ 5.510000228881836, 20.01000213623047, 19.110000610351564, 75.20999908447266 ], - 'descriptor': {'dimensions': [1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2], dataType: 'float32'} }, 'lstmOutput3': { 'data': [ 10.469000816345215, 58.02900695800781, 74.52900695800781, 518.948974609375, 1, 8, 1, 8 ], - 'descriptor': {'dimensions': [2, 1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 2, 2], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/lstm_cell.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/lstm_cell.https.any.js index 9bc71a6224c9..d6b16029b0df 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/lstm_cell.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/lstm_cell.https.any.js @@ -59,34 +59,34 @@ const lstmCellTests = [ 'inputs': { 'lstmCellInput': { 'data': [1, 2, 2, 1], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} }, 'lstmCellWeight': { 'data': [1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2], - 'descriptor': {'dimensions': [8, 2], 'dataType': 'float32'} + 'descriptor': {shape: [8, 2], dataType: 'float32'} }, 'lstmCellRecurrentWeight': { 'data': [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 ], - 'descriptor': {'dimensions': [8, 2], 'dataType': 'float32'} + 'descriptor': {shape: [8, 2], dataType: 'float32'} }, 'lstmCellHiddenState': { 'data': [0, 0, 0, 0], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} }, 'lstmCellCellState': { 'data': [0, 0, 0, 0], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} }, 'lstmCellBias': { 'data': [1, 2, 1, 2, 1, 2, 1, 2], - 'descriptor': {'dimensions': [8], 'dataType': 'float32'} + 'descriptor': {shape: [8], dataType: 'float32'} }, 'lstmCellRecurrentBias': { 'data': [1, 2, 1, 2, 1, 2, 1, 2], - 'descriptor': {'dimensions': [8], 'dataType': 'float32'} + 'descriptor': {shape: [8], dataType: 'float32'} } }, 'operators': [{ @@ -108,11 +108,11 @@ const lstmCellTests = [ 'expectedOutputs': { 'lstmCellOutput1': { 'data': [1, 8, 27, 216], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} }, 'lstmCellOutput2': { 'data': [1, 4, 9, 36], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} } } } @@ -124,38 +124,38 @@ const lstmCellTests = [ 'inputs': { 'lstmCellInput': { 'data': [1, 2, 2, 1], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} }, 'lstmCellWeight': { 'data': [1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2], - 'descriptor': {'dimensions': [8, 2], 'dataType': 'float32'} + 'descriptor': {shape: [8, 2], dataType: 'float32'} }, 'lstmCellRecurrentWeight': { 'data': [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 ], - 'descriptor': {'dimensions': [8, 2], 'dataType': 'float32'} + 'descriptor': {shape: [8, 2], dataType: 'float32'} }, 'lstmCellHiddenState': { 'data': [0, 0, 0, 0], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} }, 'lstmCellCellState': { 'data': [0, 0, 0, 0], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} }, 'lstmCellBias': { 'data': [1, 2, 1, 2, 1, 2, 1, 2], - 'descriptor': {'dimensions': [8], 'dataType': 'float32'} + 'descriptor': {shape: [8], dataType: 'float32'} }, 'lstmCellRecurrentBias': { 'data': [1, 2, 1, 2, 1, 2, 1, 2], - 'descriptor': {'dimensions': [8], 'dataType': 'float32'} + 'descriptor': {shape: [8], dataType: 'float32'} }, 'lstmCellPeepholeWeight': { 'data': [0, 0, 0, 0, 0, 0], - 'descriptor': {'dimensions': [6], 'dataType': 'float32'} + 'descriptor': {shape: [6], dataType: 'float32'} } }, 'operators': [{ @@ -178,11 +178,11 @@ const lstmCellTests = [ 'expectedOutputs': { 'lstmCellOutput1': { 'data': [1, 8, 27, 216], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} }, 'lstmCellOutput2': { 'data': [1, 4, 9, 36], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} } } } @@ -194,34 +194,34 @@ const lstmCellTests = [ 'inputs': { 'lstmCellInput': { 'data': [1, 2, 2, 1], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} }, 'lstmCellWeight': { 'data': [1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2], - 'descriptor': {'dimensions': [8, 2], 'dataType': 'float32'} + 'descriptor': {shape: [8, 2], dataType: 'float32'} }, 'lstmCellRecurrentWeight': { 'data': [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 ], - 'descriptor': {'dimensions': [8, 2], 'dataType': 'float32'} + 'descriptor': {shape: [8, 2], dataType: 'float32'} }, 'lstmCellHiddenState': { 'data': [0, 0, 0, 0], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} }, 'lstmCellCellState': { 'data': [0, 0, 0, 0], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} }, 'lstmCellBias': { 'data': [1, 2, 1, 2, 1, 2, 1, 2], - 'descriptor': {'dimensions': [8], 'dataType': 'float32'} + 'descriptor': {shape: [8], dataType: 'float32'} }, 'lstmCellRecurrentBias': { 'data': [1, 2, 1, 2, 1, 2, 1, 2], - 'descriptor': {'dimensions': [8], 'dataType': 'float32'} + 'descriptor': {shape: [8], dataType: 'float32'} } }, 'operators': [{ @@ -244,11 +244,11 @@ const lstmCellTests = [ 'expectedOutputs': { 'lstmCellOutput1': { 'data': [1, 8, 27, 216], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} }, 'lstmCellOutput2': { 'data': [1, 4, 9, 36], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} } } } @@ -260,34 +260,34 @@ const lstmCellTests = [ 'inputs': { 'lstmCellInput': { 'data': [1, 2, 2, 1], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} }, 'lstmCellWeight': { 'data': [1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2], - 'descriptor': {'dimensions': [8, 2], 'dataType': 'float32'} + 'descriptor': {shape: [8, 2], dataType: 'float32'} }, 'lstmCellRecurrentWeight': { 'data': [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 ], - 'descriptor': {'dimensions': [8, 2], 'dataType': 'float32'} + 'descriptor': {shape: [8, 2], dataType: 'float32'} }, 'lstmCellHiddenState': { 'data': [0, 0, 0, 0], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} }, 'lstmCellCellState': { 'data': [0, 0, 0, 0], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} }, 'lstmCellBias': { 'data': [1, 2, 1, 2, 1, 2, 1, 2], - 'descriptor': {'dimensions': [8], 'dataType': 'float32'} + 'descriptor': {shape: [8], dataType: 'float32'} }, 'lstmCellRecurrentBias': { 'data': [1, 2, 1, 2, 1, 2, 1, 2], - 'descriptor': {'dimensions': [8], 'dataType': 'float32'} + 'descriptor': {shape: [8], dataType: 'float32'} } }, 'operators': [{ @@ -310,11 +310,11 @@ const lstmCellTests = [ 'expectedOutputs': { 'lstmCellOutput1': { 'data': [1, 8, 27, 216], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} }, 'lstmCellOutput2': { 'data': [1, 4, 9, 36], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} } } } @@ -325,38 +325,38 @@ const lstmCellTests = [ 'inputs': { 'lstmCellInput': { 'data': [1, 2, 2, 1], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} }, 'lstmCellWeight': { 'data': [1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2, 1, -1, 2, -2], - 'descriptor': {'dimensions': [8, 2], 'dataType': 'float32'} + 'descriptor': {shape: [8, 2], dataType: 'float32'} }, 'lstmCellRecurrentWeight': { 'data': [ 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1 ], - 'descriptor': {'dimensions': [8, 2], 'dataType': 'float32'} + 'descriptor': {shape: [8, 2], dataType: 'float32'} }, 'lstmCellHiddenState': { 'data': [0, 0, 0, 0], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} }, 'lstmCellCellState': { 'data': [0, 0, 0, 0], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} }, 'lstmCellBias': { 'data': [1, 2, 1, 2, 1, 2, 1, 2], - 'descriptor': {'dimensions': [8], 'dataType': 'float32'} + 'descriptor': {shape: [8], dataType: 'float32'} }, 'lstmCellRecurrentBias': { 'data': [1, 2, 1, 2, 1, 2, 1, 2], - 'descriptor': {'dimensions': [8], 'dataType': 'float32'} + 'descriptor': {shape: [8], dataType: 'float32'} }, 'lstmCellPeepholeWeight': { 'data': [0, 0, 0, 0, 0, 0], - 'descriptor': {'dimensions': [6], 'dataType': 'float32'} + 'descriptor': {shape: [6], dataType: 'float32'} } }, 'operators': [{ @@ -380,11 +380,11 @@ const lstmCellTests = [ 'expectedOutputs': { 'lstmCellOutput1': { 'data': [1, 8, 27, 216], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} }, 'lstmCellOutput2': { 'data': [1, 4, 9, 36], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/matmul.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/matmul.https.any.js index 888e511dfdbd..ef0b7f20051d 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/matmul.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/matmul.https.any.js @@ -15,8 +15,8 @@ const getMatmulPrecisionTolerance = (graphResources) => { const args = graphResources.operators[0].arguments; - const shapeA = graphResources.inputs[args[0][Object.keys(args[0])[0]]] - .descriptor.dimensions; + const shapeA = + graphResources.inputs[args[0][Object.keys(args[0])[0]]].descriptor.shape; const tolerance = shapeA[shapeA.length - 1] * 2; const toleranceValueDict = {float32: tolerance, float16: tolerance}; const expectedDataType = @@ -36,7 +36,7 @@ const matmulTests = [ 79.85144805908203, 99.64449310302734, 24.740541458129883, 65.9624252319336, 38.136077880859375, 87.11140441894531 ], - 'descriptor': {'dimensions': [3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -48,7 +48,7 @@ const matmulTests = [ 69.31697082519531, 31.984439849853516, 12.291812896728516, 13.304834365844727, 85.26705169677734 ], - 'descriptor': {'dimensions': [4, 5], 'dataType': 'float32'} + 'descriptor': {shape: [4, 5], dataType: 'float32'} } }, 'operators': [{ @@ -64,7 +64,7 @@ const matmulTests = [ 5133.4072265625, 8816.5986328125, 18226.65234375, 11841.033203125, 8869.705078125, 6051.1396484375, 5124.5390625, 12413.8984375 ], - 'descriptor': {'dimensions': [3, 5], 'dataType': 'float32'} + 'descriptor': {shape: [3, 5], dataType: 'float32'} } } } @@ -84,7 +84,7 @@ const matmulTests = [ 16.142963409423828, 57.45134735107422, 26.826417922973633, 85.02970123291016, 36.1988639831543, 89.60960388183594 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -103,7 +103,7 @@ const matmulTests = [ 38.19757843017578, 78.17564392089844, 62.57684326171875, 88.35256958007812 ], - 'descriptor': {'dimensions': [2, 4, 5], 'dataType': 'float32'} + 'descriptor': {shape: [2, 4, 5], dataType: 'float32'} } }, 'operators': [{ @@ -125,7 +125,7 @@ const matmulTests = [ 11060.98046875, 10352.16015625, 10515.310546875, 16153.86328125, 17833.36328125, 15971.80859375 ], - 'descriptor': {'dimensions': [2, 3, 5], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 5], dataType: 'float32'} } } } @@ -145,7 +145,7 @@ const matmulTests = [ 16.142963409423828, 57.45134735107422, 26.826417922973633, 85.02970123291016, 36.1988639831543, 89.60960388183594 ], - 'descriptor': {'dimensions': [2, 1, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -164,7 +164,7 @@ const matmulTests = [ 38.19757843017578, 78.17564392089844, 62.57684326171875, 88.35256958007812 ], - 'descriptor': {'dimensions': [2, 1, 4, 5], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 5], dataType: 'float32'} } }, 'operators': [{ @@ -186,7 +186,7 @@ const matmulTests = [ 11060.98046875, 10352.16015625, 10515.310546875, 16153.86328125, 17833.36328125, 15971.80859375 ], - 'descriptor': {'dimensions': [2, 1, 3, 5], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 3, 5], dataType: 'float32'} } } } @@ -206,14 +206,14 @@ const matmulTests = [ 16.142963409423828, 57.45134735107422, 26.826417922973633, 85.02970123291016, 36.1988639831543, 89.60960388183594 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ 27.829805374145508, 83.1454849243164, 34.41289520263672, 83.20379638671875 ], - 'descriptor': {'dimensions': [1, 4, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 4, 1], dataType: 'float32'} } }, 'operators': [{ @@ -227,7 +227,7 @@ const matmulTests = [ 15019.9462890625, 11942.376953125, 15035.0322265625, 13553.013671875, 12302.328125, 16517.9765625 ], - 'descriptor': {'dimensions': [2, 3, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 1], dataType: 'float32'} } } } @@ -247,14 +247,14 @@ const matmulTests = [ 16.142963409423828, 57.45134735107422, 26.826417922973633, 85.02970123291016, 36.1988639831543, 89.60960388183594 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ 27.829805374145508, 83.1454849243164, 34.41289520263672, 83.20379638671875 ], - 'descriptor': {'dimensions': [4, 1], 'dataType': 'float32'} + 'descriptor': {shape: [4, 1], dataType: 'float32'} } }, 'operators': [{ @@ -268,7 +268,7 @@ const matmulTests = [ 15019.9462890625, 11942.376953125, 15035.0322265625, 13553.013671875, 12302.328125, 16517.9765625 ], - 'descriptor': {'dimensions': [2, 3, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 1], dataType: 'float32'} } } } @@ -296,7 +296,7 @@ const matmulTests = [ 37.49127960205078, 51.397132873535156, 53.19015121459961, 38.33119201660156, 75.20586395263672, 3.8537938594818115 ], - 'descriptor': {'dimensions': [2, 2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -308,7 +308,7 @@ const matmulTests = [ 69.31697082519531, 31.984439849853516, 12.291812896728516, 13.304834365844727, 85.26705169677734 ], - 'descriptor': {'dimensions': [1, 1, 4, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 4, 5], dataType: 'float32'} } }, 'operators': [{ @@ -340,7 +340,7 @@ const matmulTests = [ 12841.802734375, 8145.45654296875, 8134.66650390625, 4344.25, 7138.79052734375, 8497.98046875 ], - 'descriptor': {'dimensions': [2, 2, 3, 5], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 3, 5], dataType: 'float32'} } } } @@ -368,7 +368,7 @@ const matmulTests = [ 37.49127960205078, 51.397132873535156, 53.19015121459961, 38.33119201660156, 75.20586395263672, 3.8537938594818115 ], - 'descriptor': {'dimensions': [2, 2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -387,7 +387,7 @@ const matmulTests = [ 38.19757843017578, 78.17564392089844, 62.57684326171875, 88.35256958007812 ], - 'descriptor': {'dimensions': [2, 4, 5], 'dataType': 'float32'} + 'descriptor': {shape: [2, 4, 5], dataType: 'float32'} } }, 'operators': [{ @@ -419,7 +419,7 @@ const matmulTests = [ 16430.63671875, 10880.1533203125, 10752.34765625, 6632.99462890625, 12342.2919921875, 8384.3896484375 ], - 'descriptor': {'dimensions': [2, 2, 3, 5], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 3, 5], dataType: 'float32'} } } } @@ -448,7 +448,7 @@ const matmulTests = [ 37.49127960205078, 51.397132873535156, 53.19015121459961, 38.33119201660156, 75.20586395263672, 3.8537938594818115 ], - 'descriptor': {'dimensions': [2, 2, 1, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -460,7 +460,7 @@ const matmulTests = [ 69.31697082519531, 31.984439849853516, 12.291812896728516, 13.304834365844727, 85.26705169677734 ], - 'descriptor': {'dimensions': [1, 1, 1, 4, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1, 4, 5], dataType: 'float32'} } }, 'operators': [{ @@ -492,7 +492,7 @@ const matmulTests = [ 12841.802734375, 8145.45654296875, 8134.66650390625, 4344.25, 7138.79052734375, 8497.98046875 ], - 'descriptor': {'dimensions': [2, 2, 1, 3, 5], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 3, 5], dataType: 'float32'} } } } @@ -521,7 +521,7 @@ const matmulTests = [ 37.49127960205078, 51.397132873535156, 53.19015121459961, 38.33119201660156, 75.20586395263672, 3.8537938594818115 ], - 'descriptor': {'dimensions': [2, 2, 1, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -540,7 +540,7 @@ const matmulTests = [ 31.984439849853516, 12.291812896728516, 13.304834365844727, 85.26705169677734 ], - 'descriptor': {'dimensions': [1, 2, 1, 4, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 4, 5], dataType: 'float32'} } }, 'operators': [{ @@ -572,7 +572,7 @@ const matmulTests = [ 12841.802734375, 8145.45654296875, 8134.66650390625, 4344.25, 7138.79052734375, 8497.98046875 ], - 'descriptor': {'dimensions': [2, 2, 1, 3, 5], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 3, 5], dataType: 'float32'} } } } @@ -600,7 +600,7 @@ const matmulTests = [ 37.49127960205078, 51.397132873535156, 53.19015121459961, 38.33119201660156, 75.20586395263672, 3.8537938594818115 ], - 'descriptor': {'dimensions': [2, 2, 1, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -612,7 +612,7 @@ const matmulTests = [ 69.31697082519531, 31.984439849853516, 12.291812896728516, 13.304834365844727, 85.26705169677734 ], - 'descriptor': {'dimensions': [4, 5], 'dataType': 'float32'} + 'descriptor': {shape: [4, 5], dataType: 'float32'} } }, 'operators': [{ @@ -644,7 +644,7 @@ const matmulTests = [ 12841.802734375, 8145.45654296875, 8134.66650390625, 4344.25, 7138.79052734375, 8497.98046875 ], - 'descriptor': {'dimensions': [2, 2, 1, 3, 5], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 3, 5], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/max.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/max.https.any.js index 0c28b85994da..08befe3da0cb 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/max.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/max.https.any.js @@ -36,7 +36,7 @@ const maxTests = [ 79.85667419433594, -22.918458938598633, 1.2300019264221191, 65.67964935302734, 99.89971160888672, -62.321685791015625 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true }, 'inputB': { @@ -50,7 +50,7 @@ const maxTests = [ -59.90718078613281, 97.15335083007812, -40.226924896240234, -61.5142707824707, 33.363243103027344, 12.693191528320312 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -71,7 +71,7 @@ const maxTests = [ 79.85667419433594, 97.15335083007812, 1.2300019264221191, 65.67964935302734, 99.89971160888672, 12.693191528320312 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -91,7 +91,7 @@ const maxTests = [ 79.85667419433594, -22.918458938598633, 1.2300019264221191, 65.67964935302734, 99.89971160888672, -62.321685791015625 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -104,7 +104,7 @@ const maxTests = [ -59.90718078613281, 97.15335083007812, -40.226924896240234, -61.5142707824707, 33.363243103027344, 12.693191528320312 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -124,7 +124,7 @@ const maxTests = [ 79.85667419433594, 97.15335083007812, 1.2300019264221191, 65.67964935302734, 99.89971160888672, 12.693191528320312 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -144,7 +144,7 @@ const maxTests = [ 79.85667419433594, -22.918458938598633, 1.2300019264221191, 65.67964935302734, 99.89971160888672, -62.321685791015625 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -157,7 +157,7 @@ const maxTests = [ -59.90718078613281, 97.15335083007812, -40.226924896240234, -61.5142707824707, 33.363243103027344, 12.693191528320312 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -177,7 +177,7 @@ const maxTests = [ 79.85667419433594, 97.15335083007812, 1.2300019264221191, 65.67964935302734, 99.89971160888672, 12.693191528320312 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -197,7 +197,7 @@ const maxTests = [ 79.85667419433594, -22.918458938598633, 1.2300019264221191, 65.67964935302734, 99.89971160888672, -62.321685791015625 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -210,7 +210,7 @@ const maxTests = [ -59.90718078613281, 97.15335083007812, -40.226924896240234, -61.5142707824707, 33.363243103027344, 12.693191528320312 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -230,7 +230,7 @@ const maxTests = [ 79.85667419433594, 97.15335083007812, 1.2300019264221191, 65.67964935302734, 99.89971160888672, 12.693191528320312 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -250,7 +250,7 @@ const maxTests = [ 79.85667419433594, -22.918458938598633, 1.2300019264221191, 65.67964935302734, 99.89971160888672, -62.321685791015625 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -263,7 +263,7 @@ const maxTests = [ -59.90718078613281, 97.15335083007812, -40.226924896240234, -61.5142707824707, 33.363243103027344, 12.693191528320312 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -283,7 +283,7 @@ const maxTests = [ 79.85667419433594, 97.15335083007812, 1.2300019264221191, 65.67964935302734, 99.89971160888672, 12.693191528320312 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -303,7 +303,7 @@ const maxTests = [ 79.85667419433594, -22.918458938598633, 1.2300019264221191, 65.67964935302734, 99.89971160888672, -62.321685791015625 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -316,7 +316,7 @@ const maxTests = [ -59.90718078613281, 97.15335083007812, -40.226924896240234, -61.5142707824707, 33.363243103027344, 12.693191528320312 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -336,7 +336,7 @@ const maxTests = [ 79.85667419433594, 97.15335083007812, 1.2300019264221191, 65.67964935302734, 99.89971160888672, 12.693191528320312 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} } } } @@ -347,7 +347,7 @@ const maxTests = [ 'inputs': { 'inputA': { 'data': [48.26115417480469], - 'descriptor': {'dimensions': [1], 'dataType': 'float32'} + 'descriptor': {shape: [1], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -360,7 +360,7 @@ const maxTests = [ 79.85667419433594, -22.918458938598633, 1.2300019264221191, 65.67964935302734, 99.89971160888672, -62.321685791015625 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -380,7 +380,7 @@ const maxTests = [ 79.85667419433594, 48.26115417480469, 48.26115417480469, 65.67964935302734, 99.89971160888672, 48.26115417480469 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -400,14 +400,14 @@ const maxTests = [ 79.85667419433594, -22.918458938598633, 1.2300019264221191, 65.67964935302734, 99.89971160888672, -62.321685791015625 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ 49.523128509521484, -61.555763244628906, -6.564808368682861, 93.32227325439453, 3.3104186058044434, -98.31839752197266 ], - 'descriptor': {'dimensions': [2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -427,7 +427,7 @@ const maxTests = [ 79.85667419433594, -22.918458938598633, 1.2300019264221191, 93.32227325439453, 99.89971160888672, -62.321685791015625 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -447,14 +447,14 @@ const maxTests = [ 79.85667419433594, -22.918458938598633, 1.2300019264221191, 65.67964935302734, 99.89971160888672, -62.321685791015625 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ 39.32178497314453, 44.523738861083984, 58.046287536621094, 84.13702392578125 ], - 'descriptor': {'dimensions': [2, 2, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1], dataType: 'float32'} } }, 'operators': [{ @@ -474,7 +474,7 @@ const maxTests = [ 79.85667419433594, 58.046287536621094, 58.046287536621094, 84.13702392578125, 99.89971160888672, 84.13702392578125 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -485,7 +485,7 @@ const maxTests = [ 'inputs': { 'inputA': { 'data': [48.26115417480469], - 'descriptor': {'dimensions': [1, 1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -498,7 +498,7 @@ const maxTests = [ 79.85667419433594, -22.918458938598633, 1.2300019264221191, 65.67964935302734, 99.89971160888672, -62.321685791015625 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -518,7 +518,7 @@ const maxTests = [ 79.85667419433594, 48.26115417480469, 48.26115417480469, 65.67964935302734, 99.89971160888672, 48.26115417480469 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/min.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/min.https.any.js index 2892bc1ec0f2..1dda0bb44a77 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/min.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/min.https.any.js @@ -36,7 +36,7 @@ const minTests = [ -80.47379302978516, -31.389848709106445, -73.2723617553711, -33.74562072753906, -21.70152473449707, 4.945605278015137 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true }, 'inputB': { @@ -50,7 +50,7 @@ const minTests = [ -69.85066223144531, 40.676490783691406, -18.700122833251953, 20.14988136291504, 41.95068359375, 23.482912063598633 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -71,7 +71,7 @@ const minTests = [ -80.47379302978516, -31.389848709106445, -73.2723617553711, -33.74562072753906, -21.70152473449707, 4.945605278015137 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -91,7 +91,7 @@ const minTests = [ -80.47379302978516, -31.389848709106445, -73.2723617553711, -33.74562072753906, -21.70152473449707, 4.945605278015137 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -104,7 +104,7 @@ const minTests = [ -69.85066223144531, 40.676490783691406, -18.700122833251953, 20.14988136291504, 41.95068359375, 23.482912063598633 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -124,7 +124,7 @@ const minTests = [ -80.47379302978516, -31.389848709106445, -73.2723617553711, -33.74562072753906, -21.70152473449707, 4.945605278015137 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -144,7 +144,7 @@ const minTests = [ -80.47379302978516, -31.389848709106445, -73.2723617553711, -33.74562072753906, -21.70152473449707, 4.945605278015137 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -157,7 +157,7 @@ const minTests = [ -69.85066223144531, 40.676490783691406, -18.700122833251953, 20.14988136291504, 41.95068359375, 23.482912063598633 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -177,7 +177,7 @@ const minTests = [ -80.47379302978516, -31.389848709106445, -73.2723617553711, -33.74562072753906, -21.70152473449707, 4.945605278015137 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -197,7 +197,7 @@ const minTests = [ -80.47379302978516, -31.389848709106445, -73.2723617553711, -33.74562072753906, -21.70152473449707, 4.945605278015137 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -210,7 +210,7 @@ const minTests = [ -69.85066223144531, 40.676490783691406, -18.700122833251953, 20.14988136291504, 41.95068359375, 23.482912063598633 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -230,7 +230,7 @@ const minTests = [ -80.47379302978516, -31.389848709106445, -73.2723617553711, -33.74562072753906, -21.70152473449707, 4.945605278015137 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -250,7 +250,7 @@ const minTests = [ -80.47379302978516, -31.389848709106445, -73.2723617553711, -33.74562072753906, -21.70152473449707, 4.945605278015137 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -263,7 +263,7 @@ const minTests = [ -69.85066223144531, 40.676490783691406, -18.700122833251953, 20.14988136291504, 41.95068359375, 23.482912063598633 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -283,7 +283,7 @@ const minTests = [ -80.47379302978516, -31.389848709106445, -73.2723617553711, -33.74562072753906, -21.70152473449707, 4.945605278015137 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -303,7 +303,7 @@ const minTests = [ -80.47379302978516, -31.389848709106445, -73.2723617553711, -33.74562072753906, -21.70152473449707, 4.945605278015137 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -316,7 +316,7 @@ const minTests = [ -69.85066223144531, 40.676490783691406, -18.700122833251953, 20.14988136291504, 41.95068359375, 23.482912063598633 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -336,7 +336,7 @@ const minTests = [ -80.47379302978516, -31.389848709106445, -73.2723617553711, -33.74562072753906, -21.70152473449707, 4.945605278015137 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} } } } @@ -347,7 +347,7 @@ const minTests = [ 'inputs': { 'inputA': { 'data': [34.42634582519531], - 'descriptor': {'dimensions': [1], 'dataType': 'float32'} + 'descriptor': {shape: [1], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -360,7 +360,7 @@ const minTests = [ -80.47379302978516, -31.389848709106445, -73.2723617553711, -33.74562072753906, -21.70152473449707, 4.945605278015137 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -380,7 +380,7 @@ const minTests = [ -80.47379302978516, -31.389848709106445, -73.2723617553711, -33.74562072753906, -21.70152473449707, 4.945605278015137 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -400,14 +400,14 @@ const minTests = [ -80.47379302978516, -31.389848709106445, -73.2723617553711, -33.74562072753906, -21.70152473449707, 4.945605278015137 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ -19.072668075561523, -78.27516174316406, -13.436244010925293, -93.01346588134766, -72.27899169921875, 63.14110565185547 ], - 'descriptor': {'dimensions': [2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -427,7 +427,7 @@ const minTests = [ -80.47379302978516, -78.27516174316406, -73.2723617553711, -93.01346588134766, -72.27899169921875, 4.945605278015137 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -447,14 +447,14 @@ const minTests = [ -80.47379302978516, -31.389848709106445, -73.2723617553711, -33.74562072753906, -21.70152473449707, 4.945605278015137 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ 23.231731414794922, 84.62673950195312, -83.33529663085938, -22.82455825805664 ], - 'descriptor': {'dimensions': [2, 2, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1], dataType: 'float32'} } }, 'operators': [{ @@ -474,7 +474,7 @@ const minTests = [ -83.33529663085938, -83.33529663085938, -83.33529663085938, -33.74562072753906, -22.82455825805664, -22.82455825805664 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -485,7 +485,7 @@ const minTests = [ 'inputs': { 'inputA': { 'data': [34.42634582519531], - 'descriptor': {'dimensions': [1, 1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -498,7 +498,7 @@ const minTests = [ -80.47379302978516, -31.389848709106445, -73.2723617553711, -33.74562072753906, -21.70152473449707, 4.945605278015137 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -518,7 +518,7 @@ const minTests = [ -80.47379302978516, -31.389848709106445, -73.2723617553711, -33.74562072753906, -21.70152473449707, 4.945605278015137 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/mul.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/mul.https.any.js index d46a4d907446..27a5dbd32499 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/mul.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/mul.https.any.js @@ -36,7 +36,7 @@ const mulTests = [ -84.02171325683594, -94.06755828857422, 58.807273864746094, -63.059783935546875, 3.3092827796936035, 9.884003639221191 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true }, 'inputB': { @@ -50,7 +50,7 @@ const mulTests = [ -26.158620834350586, -18.935443878173828, 34.6467170715332, -60.95826721191406, -11.119653701782227, 77.50324249267578 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -71,7 +71,7 @@ const mulTests = [ 2197.89208984375, 1781.2109375, 2037.47900390625, 3844.01513671875, -36.79807662963867, 766.0423583984375 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -91,7 +91,7 @@ const mulTests = [ -84.02171325683594, -94.06755828857422, 58.807273864746094, -63.059783935546875, 3.3092827796936035, 9.884003639221191 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -104,7 +104,7 @@ const mulTests = [ -26.158620834350586, -18.935443878173828, 34.6467170715332, -60.95826721191406, -11.119653701782227, 77.50324249267578 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -124,7 +124,7 @@ const mulTests = [ 2197.89208984375, 1781.2109375, 2037.47900390625, 3844.01513671875, -36.79807662963867, 766.0423583984375 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -144,7 +144,7 @@ const mulTests = [ -84.02171325683594, -94.06755828857422, 58.807273864746094, -63.059783935546875, 3.3092827796936035, 9.884003639221191 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -157,7 +157,7 @@ const mulTests = [ -26.158620834350586, -18.935443878173828, 34.6467170715332, -60.95826721191406, -11.119653701782227, 77.50324249267578 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -177,7 +177,7 @@ const mulTests = [ 2197.89208984375, 1781.2109375, 2037.47900390625, 3844.01513671875, -36.79807662963867, 766.0423583984375 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -197,7 +197,7 @@ const mulTests = [ -84.02171325683594, -94.06755828857422, 58.807273864746094, -63.059783935546875, 3.3092827796936035, 9.884003639221191 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -210,7 +210,7 @@ const mulTests = [ -26.158620834350586, -18.935443878173828, 34.6467170715332, -60.95826721191406, -11.119653701782227, 77.50324249267578 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -230,7 +230,7 @@ const mulTests = [ 2197.89208984375, 1781.2109375, 2037.47900390625, 3844.01513671875, -36.79807662963867, 766.0423583984375 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -250,7 +250,7 @@ const mulTests = [ -84.02171325683594, -94.06755828857422, 58.807273864746094, -63.059783935546875, 3.3092827796936035, 9.884003639221191 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -263,7 +263,7 @@ const mulTests = [ -26.158620834350586, -18.935443878173828, 34.6467170715332, -60.95826721191406, -11.119653701782227, 77.50324249267578 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -283,7 +283,7 @@ const mulTests = [ 2197.89208984375, 1781.2109375, 2037.47900390625, 3844.01513671875, -36.79807662963867, 766.0423583984375 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -303,7 +303,7 @@ const mulTests = [ -84.02171325683594, -94.06755828857422, 58.807273864746094, -63.059783935546875, 3.3092827796936035, 9.884003639221191 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -316,7 +316,7 @@ const mulTests = [ -26.158620834350586, -18.935443878173828, 34.6467170715332, -60.95826721191406, -11.119653701782227, 77.50324249267578 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -336,7 +336,7 @@ const mulTests = [ 2197.89208984375, 1781.2109375, 2037.47900390625, 3844.01513671875, -36.79807662963867, 766.0423583984375 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} } } } @@ -347,7 +347,7 @@ const mulTests = [ 'inputs': { 'inputA': { 'data': [67.50372314453125], - 'descriptor': {'dimensions': [1], 'dataType': 'float32'} + 'descriptor': {shape: [1], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -360,7 +360,7 @@ const mulTests = [ -84.02171325683594, -94.06755828857422, 58.807273864746094, -63.059783935546875, 3.3092827796936035, 9.884003639221191 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -380,7 +380,7 @@ const mulTests = [ -5671.7783203125, -6349.91064453125, 3969.7099609375, -4256.77001953125, 223.388916015625, 667.20703125 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -400,14 +400,14 @@ const mulTests = [ -84.02171325683594, -94.06755828857422, 58.807273864746094, -63.059783935546875, 3.3092827796936035, 9.884003639221191 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ -97.29339599609375, -81.70872497558594, -63.859336853027344, -25.192203521728516, 94.61557006835938, -20.381790161132812 ], - 'descriptor': {'dimensions': [2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -431,7 +431,7 @@ const mulTests = [ -3755.3935546875, 1588.6148681640625, 313.10968017578125, -201.4536895751953 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -451,14 +451,14 @@ const mulTests = [ -84.02171325683594, -94.06755828857422, 58.807273864746094, -63.059783935546875, 3.3092827796936035, 9.884003639221191 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ 8.696772575378418, 48.377689361572266, 97.7515869140625, 62.21574783325195 ], - 'descriptor': {'dimensions': [2, 2, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1], dataType: 'float32'} } }, 'operators': [{ @@ -478,7 +478,7 @@ const mulTests = [ -8213.255859375, -9195.2529296875, 5748.50439453125, -3923.3115234375, 205.88949584960938, 614.940673828125 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -489,7 +489,7 @@ const mulTests = [ 'inputs': { 'inputA': { 'data': [67.50372314453125], - 'descriptor': {'dimensions': [1, 1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -502,7 +502,7 @@ const mulTests = [ -84.02171325683594, -94.06755828857422, 58.807273864746094, -63.059783935546875, 3.3092827796936035, 9.884003639221191 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -522,7 +522,7 @@ const mulTests = [ -5671.7783203125, -6349.91064453125, 3969.7099609375, -4256.77001953125, 223.388916015625, 667.20703125 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/neg.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/neg.https.any.js index 8ffe36235672..a77109a9ef1a 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/neg.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/neg.https.any.js @@ -28,7 +28,7 @@ const negTests = [ 'inputs': { 'negInput': { 'data': [94.23045349121094], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -39,7 +39,7 @@ const negTests = [ 'expectedOutputs': { 'negOutput': { 'data': [-94.23045349121094], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -50,7 +50,7 @@ const negTests = [ 'inputs': { 'negInput': { 'data': [-58.334503173828125], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -61,7 +61,7 @@ const negTests = [ 'expectedOutputs': { 'negOutput': { 'data': [58.334503173828125], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -81,7 +81,7 @@ const negTests = [ -66.4577865600586, -11.172324180603027, -25.024961471557617, 22.26478385925293, 35.29130172729492, -86.18817138671875 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -102,7 +102,7 @@ const negTests = [ 66.4577865600586, 11.172324180603027, 25.024961471557617, -22.26478385925293, -35.29130172729492, 86.18817138671875 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -122,7 +122,7 @@ const negTests = [ -66.4577865600586, -11.172324180603027, -25.024961471557617, 22.26478385925293, 35.29130172729492, -86.18817138671875 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -142,7 +142,7 @@ const negTests = [ 66.4577865600586, 11.172324180603027, 25.024961471557617, -22.26478385925293, -35.29130172729492, 86.18817138671875 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -162,7 +162,7 @@ const negTests = [ -66.4577865600586, -11.172324180603027, -25.024961471557617, 22.26478385925293, 35.29130172729492, -86.18817138671875 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -182,7 +182,7 @@ const negTests = [ 66.4577865600586, 11.172324180603027, 25.024961471557617, -22.26478385925293, -35.29130172729492, 86.18817138671875 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -202,7 +202,7 @@ const negTests = [ -66.4577865600586, -11.172324180603027, -25.024961471557617, 22.26478385925293, 35.29130172729492, -86.18817138671875 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -222,7 +222,7 @@ const negTests = [ 66.4577865600586, 11.172324180603027, 25.024961471557617, -22.26478385925293, -35.29130172729492, 86.18817138671875 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -242,7 +242,7 @@ const negTests = [ -66.4577865600586, -11.172324180603027, -25.024961471557617, 22.26478385925293, 35.29130172729492, -86.18817138671875 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -262,7 +262,7 @@ const negTests = [ 66.4577865600586, 11.172324180603027, 25.024961471557617, -22.26478385925293, -35.29130172729492, 86.18817138671875 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -282,7 +282,7 @@ const negTests = [ -66.4577865600586, -11.172324180603027, -25.024961471557617, 22.26478385925293, 35.29130172729492, -86.18817138671875 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } }, 'operators': [{ @@ -302,7 +302,7 @@ const negTests = [ 66.4577865600586, 11.172324180603027, 25.024961471557617, -22.26478385925293, -35.29130172729492, 86.18817138671875 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/pad.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/pad.https.any.js index c05f18f83c28..203d0b7299c5 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/pad.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/pad.https.any.js @@ -47,7 +47,7 @@ const padTests = [ 16.863798141479492, 60.51472091674805, -70.56755065917969, -60.643272399902344, -47.8821907043457, 68.72557830810547 ], - 'descriptor': {'dimensions': [9], 'dataType': 'float32'}, + 'descriptor': {shape: [9], dataType: 'float32'}, 'constant': true } }, @@ -66,7 +66,7 @@ const padTests = [ 16.863798141479492, 60.51472091674805, -70.56755065917969, -60.643272399902344, -47.8821907043457, 68.72557830810547, 0 ], - 'descriptor': {'dimensions': [11], 'dataType': 'float32'} + 'descriptor': {shape: [11], dataType: 'float32'} } } } @@ -81,7 +81,7 @@ const padTests = [ 16.863798141479492, 60.51472091674805, -70.56755065917969, -60.643272399902344, -47.8821907043457, 68.72557830810547 ], - 'descriptor': {'dimensions': [9], 'dataType': 'float32'} + 'descriptor': {shape: [9], dataType: 'float32'} } }, 'operators': [{ @@ -99,7 +99,7 @@ const padTests = [ 16.863798141479492, 60.51472091674805, -70.56755065917969, -60.643272399902344, -47.8821907043457, 68.72557830810547, 0 ], - 'descriptor': {'dimensions': [11], 'dataType': 'float32'} + 'descriptor': {shape: [11], dataType: 'float32'} } } } @@ -114,7 +114,7 @@ const padTests = [ 16.863798141479492, 60.51472091674805, -70.56755065917969, -60.643272399902344, -47.8821907043457, 68.72557830810547 ], - 'descriptor': {'dimensions': [3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [3, 3], dataType: 'float32'} } }, 'operators': [{ @@ -154,7 +154,7 @@ const padTests = [ 0, 0 ], - 'descriptor': {'dimensions': [5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [5, 5], dataType: 'float32'} } } } @@ -169,7 +169,7 @@ const padTests = [ 16.863798141479492, 60.51472091674805, -70.56755065917969, -60.643272399902344, -47.8821907043457, 68.72557830810547 ], - 'descriptor': {'dimensions': [1, 3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 3], dataType: 'float32'} } }, 'operators': [{ @@ -259,7 +259,7 @@ const padTests = [ 0, 0 ], - 'descriptor': {'dimensions': [3, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [3, 5, 5], dataType: 'float32'} } } } @@ -274,7 +274,7 @@ const padTests = [ 16.863798141479492, 60.51472091674805, -70.56755065917969, -60.643272399902344, -47.8821907043457, 68.72557830810547 ], - 'descriptor': {'dimensions': [1, 3, 3, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 3, 1], dataType: 'float32'} } }, 'operators': [{ @@ -364,7 +364,7 @@ const padTests = [ 0, 0 ], - 'descriptor': {'dimensions': [1, 5, 5, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 5, 5, 3], dataType: 'float32'} } } } @@ -379,7 +379,7 @@ const padTests = [ 16.863798141479492, 60.51472091674805, -70.56755065917969, -60.643272399902344, -47.8821907043457, 68.72557830810547 ], - 'descriptor': {'dimensions': [1, 3, 3, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 3, 1, 1], dataType: 'float32'} } }, 'operators': [{ @@ -469,7 +469,7 @@ const padTests = [ 0, 0 ], - 'descriptor': {'dimensions': [1, 5, 5, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 5, 5, 1, 3], dataType: 'float32'} } } } @@ -484,7 +484,7 @@ const padTests = [ 16.863798141479492, 60.51472091674805, -70.56755065917969, -60.643272399902344, -47.8821907043457, 68.72557830810547 ], - 'descriptor': {'dimensions': [3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [3, 3], dataType: 'float32'} } }, 'operators': [{ @@ -524,7 +524,7 @@ const padTests = [ 0, 0 ], - 'descriptor': {'dimensions': [5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [5, 5], dataType: 'float32'} } } } @@ -539,7 +539,7 @@ const padTests = [ 16.863798141479492, 60.51472091674805, -70.56755065917969, -60.643272399902344, -47.8821907043457, 68.72557830810547 ], - 'descriptor': {'dimensions': [3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [3, 3], dataType: 'float32'} } }, 'operators': [{ @@ -579,7 +579,7 @@ const padTests = [ 1, 1 ], - 'descriptor': {'dimensions': [5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [5, 5], dataType: 'float32'} } } } @@ -594,7 +594,7 @@ const padTests = [ 16.863798141479492, 60.51472091674805, -70.56755065917969, -60.643272399902344, -47.8821907043457, 68.72557830810547 ], - 'descriptor': {'dimensions': [1, 3, 3, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 3, 1], dataType: 'float32'} } }, 'operators': [{ @@ -626,7 +626,7 @@ const padTests = [ -47.8821907043457, 68.72557830810547, 68.72557830810547, 68.72557830810547 ], - 'descriptor': {'dimensions': [1, 7, 7, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 7, 7, 1], dataType: 'float32'} } } } @@ -641,7 +641,7 @@ const padTests = [ 16.863798141479492, 60.51472091674805, -70.56755065917969, -60.643272399902344, -47.8821907043457, 68.72557830810547 ], - 'descriptor': {'dimensions': [1, 3, 3, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 3, 1], dataType: 'float32'} } }, 'operators': [{ @@ -673,7 +673,7 @@ const padTests = [ -21.168529510498047, -91.66168975830078, -21.168529510498047, 22.76361846923828 ], - 'descriptor': {'dimensions': [1, 7, 7, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 7, 7, 1], dataType: 'float32'} } } } @@ -688,7 +688,7 @@ const padTests = [ 16.863798141479492, 60.51472091674805, -70.56755065917969, -60.643272399902344, -47.8821907043457, 68.72557830810547 ], - 'descriptor': {'dimensions': [1, 3, 3, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 3, 1], dataType: 'float32'} } }, 'operators': [{ @@ -720,7 +720,7 @@ const padTests = [ 60.51472091674805, -70.56755065917969, -70.56755065917969, 60.51472091674805 ], - 'descriptor': {'dimensions': [1, 7, 7, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 7, 7, 1], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/parallel-compute.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/parallel-compute.https.any.js index 3b9c41276ad3..a1c20f1ff30d 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/parallel-compute.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/parallel-compute.https.any.js @@ -26,7 +26,7 @@ const testParallelCompute = () => { } // Construct a simple graph: A = B * 2. const builder = new MLGraphBuilder(mlContext); - const operandType = {dataType: 'float32', dimensions: [1]}; + const operandType = {dataType: 'float32', shape: [1]}; const inputOperand = builder.input('input', operandType); const constOperand = builder.constant(operandType, Float32Array.from([2])); const outputOperand = builder.mul(inputOperand, constOperand); diff --git a/testing/web-platform/tests/webnn/conformance_tests/parallel-dispatch.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/parallel-dispatch.https.any.js index 5594d845d9be..dfdf70a6aa46 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/parallel-dispatch.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/parallel-dispatch.https.any.js @@ -32,7 +32,7 @@ function buildMulGraph(context, operandDescriptor, multiplier) { promise_test(async () => { const operandDescriptor = { dataType: 'float32', - dimensions: [1], + shape: [1], usage: MLTensorUsage.WRITE | MLTensorUsage.READ, }; @@ -72,7 +72,7 @@ promise_test(async () => { promise_test(async () => { const operandDescriptor = { dataType: 'float32', - dimensions: [1], + shape: [1], usage: MLTensorUsage.WRITE | MLTensorUsage.READ, }; const mlGraph = await buildMulGraph(mlContext, operandDescriptor, 3); @@ -100,7 +100,7 @@ promise_test(async () => { promise_test(async () => { const operandDescriptor = { dataType: 'float32', - dimensions: [1], + shape: [1], usage: MLTensorUsage.WRITE | MLTensorUsage.READ, }; const mlGraph = await buildMulGraph(mlContext, operandDescriptor, 10); @@ -139,7 +139,7 @@ promise_test(async () => { promise_test(async () => { const operandDescriptor = { dataType: 'float32', - dimensions: [1], + shape: [1], usage: MLTensorUsage.WRITE | MLTensorUsage.READ, }; const mlGraph = await buildMulGraph(mlContext, operandDescriptor, 9); @@ -177,7 +177,7 @@ promise_test(async () => { promise_test(async () => { const operandDescriptor = { dataType: 'float32', - dimensions: [1], + shape: [1], usage: MLTensorUsage.WRITE | MLTensorUsage.READ, }; const mlGraph = await buildMulGraph(mlContext, operandDescriptor, 2); @@ -210,7 +210,7 @@ promise_test(async () => { promise_test(async () => { const operandDescriptor = { dataType: 'float32', - dimensions: [1], + shape: [1], usage: MLTensorUsage.WRITE | MLTensorUsage.READ, }; @@ -249,7 +249,7 @@ promise_test(async () => { promise_test(async () => { const operandDescriptor = { dataType: 'float32', - dimensions: [1], + shape: [1], usage: MLTensorUsage.WRITE | MLTensorUsage.READ, }; @@ -287,7 +287,7 @@ promise_test(async () => { promise_test(async () => { const operandDescriptor = { dataType: 'float32', - dimensions: [1], + shape: [1], usage: MLTensorUsage.WRITE | MLTensorUsage.READ, }; @@ -323,7 +323,7 @@ promise_test(async () => { promise_test(async () => { const operandDescriptor = { dataType: 'float32', - dimensions: [1], + shape: [1], usage: MLTensorUsage.WRITE | MLTensorUsage.READ, }; diff --git a/testing/web-platform/tests/webnn/conformance_tests/pooling.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/pooling.https.any.js index 9dfd6ba0ca4b..52c6c80c7b53 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/pooling.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/pooling.https.any.js @@ -37,8 +37,8 @@ const getPoolingOperatorsPrecisionTolerance = (graphResources) => { const args = graphResources.operators[0].arguments; - const inputShape = graphResources.inputs[args[0][Object.keys(args[0])[0]]] - .descriptor.dimensions; + const inputShape = + graphResources.inputs[args[0][Object.keys(args[0])[0]]].descriptor.shape; const options = args.length === 2 ? {...args[1][Object.keys(args[1])[0]]} : {}; let height; @@ -101,7 +101,7 @@ const poolingOperatorsTests = [ 2.2384984493255615, 14.50549030303955, 68.72449493408203, 76.45657348632812, 23.53263282775879 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'}, + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'}, 'constant': true } }, @@ -113,7 +113,7 @@ const poolingOperatorsTests = [ 'expectedOutputs': { 'averagePool2dOutput': { 'data': [47.26926803588867, 44.72445297241211], - 'descriptor': {'dimensions': [1, 2, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 1], dataType: 'float32'} } } } @@ -142,7 +142,7 @@ const poolingOperatorsTests = [ 2.2384984493255615, 14.50549030303955, 68.72449493408203, 76.45657348632812, 23.53263282775879 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } }, 'operators': [{ @@ -153,7 +153,7 @@ const poolingOperatorsTests = [ 'expectedOutputs': { 'averagePool2dOutput': { 'data': [47.26926803588867, 44.72445297241211], - 'descriptor': {'dimensions': [1, 2, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 1], dataType: 'float32'} } } } @@ -182,7 +182,7 @@ const poolingOperatorsTests = [ -26.032955169677734, -22.73752784729004, -70.32036590576172, -85.28227996826172, -92.10668182373047 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } }, 'operators': [{ @@ -193,7 +193,7 @@ const poolingOperatorsTests = [ 'expectedOutputs': { 'averagePool2dOutput': { 'data': [-49.258975982666016, -60.52408981323242], - 'descriptor': {'dimensions': [1, 2, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 1], dataType: 'float32'} } } } @@ -222,7 +222,7 @@ const poolingOperatorsTests = [ 2.2384984493255615, 14.50549030303955, 68.72449493408203, 76.45657348632812, 23.53263282775879 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } }, 'operators': [{ @@ -243,7 +243,7 @@ const poolingOperatorsTests = [ 43.23125457763672, 37.842769622802734, 32.67961120605469, 41.17021942138672, 42.79708480834961, 38.987247467041016 ], - 'descriptor': {'dimensions': [1, 2, 3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 3], dataType: 'float32'} } } } @@ -273,7 +273,7 @@ const poolingOperatorsTests = [ 2.2384984493255615, 14.50549030303955, 68.72449493408203, 76.45657348632812, 23.53263282775879 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } }, 'operators': [{ @@ -287,7 +287,7 @@ const poolingOperatorsTests = [ 'expectedOutputs': { 'averagePool2dOutput': { 'data': [47.26926803588867, 44.72445297241211], - 'descriptor': {'dimensions': [1, 2, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 1], dataType: 'float32'} } } } @@ -316,7 +316,7 @@ const poolingOperatorsTests = [ 2.2384984493255615, 14.50549030303955, 68.72449493408203, 76.45657348632812, 23.53263282775879 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } }, 'operators': [{ @@ -334,7 +334,7 @@ const poolingOperatorsTests = [ 46.15715408325195, 46.63268280029297, 43.616947174072266, 44.72445297241211, 44.05451583862305 ], - 'descriptor': {'dimensions': [1, 2, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2, 2], dataType: 'float32'} } } } @@ -363,7 +363,7 @@ const poolingOperatorsTests = [ 2.2384984493255615, 14.50549030303955, 68.72449493408203, 76.45657348632812, 23.53263282775879 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } }, 'operators': [{ @@ -381,7 +381,7 @@ const poolingOperatorsTests = [ 54.00202560424805, 49.65404510498047, 35.84912109375, 41.17021942138672, 38.987247467041016 ], - 'descriptor': {'dimensions': [1, 2, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2, 2], dataType: 'float32'} } } } @@ -410,7 +410,7 @@ const poolingOperatorsTests = [ 2.2384984493255615, 14.50549030303955, 68.72449493408203, 76.45657348632812, 23.53263282775879 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } }, 'operators': [{ @@ -424,7 +424,7 @@ const poolingOperatorsTests = [ 'expectedOutputs': { 'averagePool2dOutput': { 'data': [32.2001838684082, 42.971012115478516], - 'descriptor': {'dimensions': [1, 2, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 1], dataType: 'float32'} } } } @@ -453,7 +453,7 @@ const poolingOperatorsTests = [ 2.2384984493255615, 14.50549030303955, 68.72449493408203, 76.45657348632812, 23.53263282775879 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } }, 'operators': [{ @@ -465,7 +465,7 @@ const poolingOperatorsTests = [ 'expectedOutputs': { 'averagePool2dOutput': { 'data': [47.26926803588867, 44.72445297241211], - 'descriptor': {'dimensions': [1, 2, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 1], dataType: 'float32'} } } } @@ -494,7 +494,7 @@ const poolingOperatorsTests = [ 68.72449493408203, 1.4140757322311401, 76.45657348632812, 78.10037994384766, 23.53263282775879 ], - 'descriptor': {'dimensions': [1, 5, 5, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 5, 5, 2], dataType: 'float32'} } }, 'operators': [{ @@ -506,7 +506,7 @@ const poolingOperatorsTests = [ 'expectedOutputs': { 'averagePool2dOutput': { 'data': [47.26926803588867, 44.72445297241211], - 'descriptor': {'dimensions': [1, 1, 1, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1, 2], dataType: 'float32'} } } } @@ -536,7 +536,7 @@ const poolingOperatorsTests = [ 68.72449493408203, 1.4140757322311401, 76.45657348632812, 78.10037994384766, 23.53263282775879 ], - 'descriptor': {'dimensions': [1, 5, 5, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 5, 5, 2], dataType: 'float32'} } }, 'operators': [{ @@ -550,7 +550,7 @@ const poolingOperatorsTests = [ 'expectedOutputs': { 'averagePool2dOutput': { 'data': [47.26926803588867, 44.72445297241211], - 'descriptor': {'dimensions': [1, 1, 1, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1, 2], dataType: 'float32'} } } } @@ -579,7 +579,7 @@ const poolingOperatorsTests = [ 2.2384984493255615, 14.50549030303955, 68.72449493408203, 76.45657348632812, 23.53263282775879 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } }, 'operators': [{ @@ -603,7 +603,7 @@ const poolingOperatorsTests = [ 58.46046447753906, 52.73374557495117, 39.1442985534668, 43.23125457763672, 32.67961120605469 ], - 'descriptor': {'dimensions': [1, 2, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2, 2], dataType: 'float32'} } } } @@ -632,7 +632,7 @@ const poolingOperatorsTests = [ 2.2384984493255615, 14.50549030303955, 68.72449493408203, 76.45657348632812, 23.53263282775879 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } }, 'operators': [{ @@ -659,7 +659,7 @@ const poolingOperatorsTests = [ 43.23125457763672, 32.67961120605469, 56.23945999145508, 40.00800323486328, 43.85149002075195, 41.061283111572266 ], - 'descriptor': {'dimensions': [1, 2, 3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 3], dataType: 'float32'} } } } @@ -689,7 +689,7 @@ const poolingOperatorsTests = [ 68.72449493408203, 1.4140757322311401, 76.45657348632812, 78.10037994384766, 23.53263282775879 ], - 'descriptor': {'dimensions': [1, 5, 5, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 5, 5, 2], dataType: 'float32'} } }, 'operators': [{ @@ -714,7 +714,7 @@ const poolingOperatorsTests = [ 39.1442985534668, 50.038944244384766, 43.23125457763672, 58.46046447753906, 32.67961120605469 ], - 'descriptor': {'dimensions': [1, 2, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2, 2], dataType: 'float32'} } } } @@ -744,7 +744,7 @@ const poolingOperatorsTests = [ 68.72449493408203, 1.4140757322311401, 76.45657348632812, 78.10037994384766, 23.53263282775879 ], - 'descriptor': {'dimensions': [1, 5, 5, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 5, 5, 2], dataType: 'float32'} } }, 'operators': [{ @@ -772,7 +772,7 @@ const poolingOperatorsTests = [ 37.24428939819336, 40.00800323486328, 54.04661178588867, 43.85149002075195, 78.58363342285156, 41.061283111572266 ], - 'descriptor': {'dimensions': [1, 3, 3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 3, 2], dataType: 'float32'} } } } @@ -802,7 +802,7 @@ const poolingOperatorsTests = [ 2.2384984493255615, 14.50549030303955, 68.72449493408203, 76.45657348632812, 23.53263282775879 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } }, 'operators': [{ @@ -830,7 +830,7 @@ const poolingOperatorsTests = [ 43.23125457763672, 32.67961120605469, 56.23945999145508, 40.00800323486328, 43.85149002075195, 41.061283111572266 ], - 'descriptor': {'dimensions': [1, 2, 3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 3], dataType: 'float32'} } } } @@ -860,7 +860,7 @@ const poolingOperatorsTests = [ 2.2384984493255615, 14.50549030303955, 68.72449493408203, 76.45657348632812, 23.53263282775879 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } }, 'operators': [{ @@ -885,7 +885,7 @@ const poolingOperatorsTests = [ 58.46046447753906, 52.73374557495117, 39.1442985534668, 43.23125457763672, 32.67961120605469 ], - 'descriptor': {'dimensions': [1, 2, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2, 2], dataType: 'float32'} } } } @@ -931,7 +931,7 @@ const poolingOperatorsTests = [ 56.961090087890625, 34.77016067504883, 0.9611223936080933, 35.30686950683594, 98.00790405273438 ], - 'descriptor': {'dimensions': [1, 7, 7, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 7, 7, 2], dataType: 'float32'} } }, 'operators': [{ @@ -958,7 +958,7 @@ const poolingOperatorsTests = [ 50.19099807739258, 29.15436363220215, 52.98439025878906, 43.10562515258789, 66.77796936035156, 55.2725830078125 ], - 'descriptor': {'dimensions': [1, 3, 3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 3, 2], dataType: 'float32'} } } } @@ -989,7 +989,7 @@ const poolingOperatorsTests = [ 90.86540985107422, 39.56248474121094, 67.77167510986328, 69.69512176513672, 89.54518127441406 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'}, + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'}, 'constant': true } }, @@ -1001,7 +1001,7 @@ const poolingOperatorsTests = [ 'expectedOutputs': { 'l2Pool2dOutput': { 'data': [289.01953125, 292.6146545410156], - 'descriptor': {'dimensions': [1, 2, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 1], dataType: 'float32'} } } } @@ -1030,7 +1030,7 @@ const poolingOperatorsTests = [ 90.86540985107422, 39.56248474121094, 67.77167510986328, 69.69512176513672, 89.54518127441406 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } }, 'operators': [{ @@ -1041,7 +1041,7 @@ const poolingOperatorsTests = [ 'expectedOutputs': { 'l2Pool2dOutput': { 'data': [289.01953125, 292.6146545410156], - 'descriptor': {'dimensions': [1, 2, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 1], dataType: 'float32'} } } } @@ -1070,7 +1070,7 @@ const poolingOperatorsTests = [ -89.39192199707031, -61.13504409790039, -84.16869354248047, -77.36112213134766, -91.17266082763672 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } }, 'operators': [{ @@ -1081,7 +1081,7 @@ const poolingOperatorsTests = [ 'expectedOutputs': { 'l2Pool2dOutput': { 'data': [298.928955078125, 326.83587646484375], - 'descriptor': {'dimensions': [1, 2, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 1], dataType: 'float32'} } } } @@ -1110,7 +1110,7 @@ const poolingOperatorsTests = [ 90.86540985107422, 39.56248474121094, 67.77167510986328, 69.69512176513672, 89.54518127441406 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } }, 'operators': [{ @@ -1130,7 +1130,7 @@ const poolingOperatorsTests = [ 165.07762145996094, 165.45819091796875, 161.11062622070312, 176.6307373046875, 174.245361328125, 180.60714721679688 ], - 'descriptor': {'dimensions': [1, 2, 3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 3], dataType: 'float32'} } } } @@ -1159,7 +1159,7 @@ const poolingOperatorsTests = [ 90.86540985107422, 39.56248474121094, 67.77167510986328, 69.69512176513672, 89.54518127441406 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } }, 'operators': [{ @@ -1176,7 +1176,7 @@ const poolingOperatorsTests = [ 269.777587890625, 241.52200317382812, 212.99337768554688, 292.6146545410156, 253.77178955078125 ], - 'descriptor': {'dimensions': [1, 2, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2, 2], dataType: 'float32'} } } } @@ -1205,7 +1205,7 @@ const poolingOperatorsTests = [ 90.86540985107422, 39.56248474121094, 67.77167510986328, 69.69512176513672, 89.54518127441406 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } }, 'operators': [{ @@ -1223,7 +1223,7 @@ const poolingOperatorsTests = [ 168.4636688232422, 170.331787109375, 174.72145080566406, 176.6307373046875, 180.60714721679688 ], - 'descriptor': {'dimensions': [1, 2, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2, 2], dataType: 'float32'} } } } @@ -1252,7 +1252,7 @@ const poolingOperatorsTests = [ 90.86540985107422, 39.56248474121094, 67.77167510986328, 69.69512176513672, 89.54518127441406 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } }, 'operators': [{ @@ -1266,7 +1266,7 @@ const poolingOperatorsTests = [ 'expectedOutputs': { 'l2Pool2dOutput': { 'data': [189.47933959960938, 207.25343322753906], - 'descriptor': {'dimensions': [1, 2, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 1], dataType: 'float32'} } } } @@ -1295,7 +1295,7 @@ const poolingOperatorsTests = [ 90.86540985107422, 39.56248474121094, 67.77167510986328, 69.69512176513672, 89.54518127441406 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } }, 'operators': [{ @@ -1307,7 +1307,7 @@ const poolingOperatorsTests = [ 'expectedOutputs': { 'l2Pool2dOutput': { 'data': [289.01953125, 292.6146545410156], - 'descriptor': {'dimensions': [1, 2, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 1], dataType: 'float32'} } } } @@ -1336,7 +1336,7 @@ const poolingOperatorsTests = [ 67.77167510986328, 83.68133544921875, 69.69512176513672, 21.79571533203125, 89.54518127441406 ], - 'descriptor': {'dimensions': [1, 5, 5, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 5, 5, 2], dataType: 'float32'} } }, 'operators': [{ @@ -1348,7 +1348,7 @@ const poolingOperatorsTests = [ 'expectedOutputs': { 'l2Pool2dOutput': { 'data': [289.01953125, 292.6146545410156], - 'descriptor': {'dimensions': [1, 1, 1, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1, 2], dataType: 'float32'} } } } @@ -1377,7 +1377,7 @@ const poolingOperatorsTests = [ 90.86540985107422, 39.56248474121094, 67.77167510986328, 69.69512176513672, 89.54518127441406 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } }, 'operators': [{ @@ -1401,7 +1401,7 @@ const poolingOperatorsTests = [ 149.63897705078125, 142.6990966796875, 139.51637268066406, 165.07762145996094, 161.11062622070312 ], - 'descriptor': {'dimensions': [1, 2, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2, 2], dataType: 'float32'} } } } @@ -1430,7 +1430,7 @@ const poolingOperatorsTests = [ 90.86540985107422, 39.56248474121094, 67.77167510986328, 69.69512176513672, 89.54518127441406 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } }, 'operators': [{ @@ -1457,7 +1457,7 @@ const poolingOperatorsTests = [ 165.07762145996094, 161.11062622070312, 96.38701629638672, 150.1616668701172, 146.8201904296875, 8216.69921875 ], - 'descriptor': {'dimensions': [1, 2, 3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 3], dataType: 'float32'} } } } @@ -1487,7 +1487,7 @@ const poolingOperatorsTests = [ 90.86540985107422, 39.56248474121094, 67.77167510986328, 69.69512176513672, 89.54518127441406 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } }, 'operators': [{ @@ -1515,7 +1515,7 @@ const poolingOperatorsTests = [ 165.07762145996094, 161.11062622070312, 96.38701629638672, 150.1616668701172, 146.8201904296875, 8216.69921875 ], - 'descriptor': {'dimensions': [1, 2, 3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 3], dataType: 'float32'} } } } @@ -1545,7 +1545,7 @@ const poolingOperatorsTests = [ 90.86540985107422, 39.56248474121094, 67.77167510986328, 69.69512176513672, 89.54518127441406 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } }, 'operators': [{ @@ -1570,7 +1570,7 @@ const poolingOperatorsTests = [ 149.63897705078125, 142.6990966796875, 139.51637268066406, 165.07762145996094, 161.11062622070312 ], - 'descriptor': {'dimensions': [1, 2, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2, 2], dataType: 'float32'} } } } @@ -1615,7 +1615,7 @@ const poolingOperatorsTests = [ 60.689762115478516, 20.046878814697266, 13.203198432922363, 33.33952713012695, 0.5279953479766846 ], - 'descriptor': {'dimensions': [1, 7, 7, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 7, 7, 2], dataType: 'float32'} } }, 'operators': [{ @@ -1643,7 +1643,7 @@ const poolingOperatorsTests = [ 158.64576721191406, 166.2051544189453, 171.07916259765625, 148.70985412597656, 218.7123260498047, 153.33311462402344 ], - 'descriptor': {'dimensions': [1, 3, 3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 3, 2], dataType: 'float32'} } } } @@ -1674,7 +1674,7 @@ const poolingOperatorsTests = [ -57.294559478759766, -26.623577117919922, 15.935754776000977, -78.77953338623047, 72.33577728271484 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'}, + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'}, 'constant': true } }, @@ -1686,7 +1686,7 @@ const poolingOperatorsTests = [ 'expectedOutputs': { 'maxPool2dOutput': { 'data': [99.28312683105469, 81.73119354248047], - 'descriptor': {'dimensions': [1, 2, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 1], dataType: 'float32'} } } } @@ -1715,7 +1715,7 @@ const poolingOperatorsTests = [ -57.294559478759766, -26.623577117919922, 15.935754776000977, -78.77953338623047, 72.33577728271484 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } }, 'operators': [{ @@ -1726,7 +1726,7 @@ const poolingOperatorsTests = [ 'expectedOutputs': { 'maxPool2dOutput': { 'data': [99.28312683105469, 81.73119354248047], - 'descriptor': {'dimensions': [1, 2, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 1], dataType: 'float32'} } } } @@ -1755,7 +1755,7 @@ const poolingOperatorsTests = [ -57.294559478759766, -26.623577117919922, 15.935754776000977, -78.77953338623047, 72.33577728271484 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } }, 'operators': [{ @@ -1775,7 +1775,7 @@ const poolingOperatorsTests = [ 81.73119354248047, 72.8883056640625, 72.44898986816406, 80.30484008789062, 72.8883056640625, 72.33577728271484 ], - 'descriptor': {'dimensions': [1, 2, 3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 3], dataType: 'float32'} } } } @@ -1804,7 +1804,7 @@ const poolingOperatorsTests = [ -57.294559478759766, -26.623577117919922, 15.935754776000977, -78.77953338623047, 72.33577728271484 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } }, 'operators': [{ @@ -1821,7 +1821,7 @@ const poolingOperatorsTests = [ 99.28312683105469, 81.73119354248047, 72.8883056640625, 81.73119354248047, 72.8883056640625 ], - 'descriptor': {'dimensions': [1, 2, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2, 2], dataType: 'float32'} } } } @@ -1850,7 +1850,7 @@ const poolingOperatorsTests = [ -57.294559478759766, -26.623577117919922, 15.935754776000977, -78.77953338623047, 72.33577728271484 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } }, 'operators': [{ @@ -1868,7 +1868,7 @@ const poolingOperatorsTests = [ 72.1085205078125, 81.73119354248047, 72.44898986816406, 80.30484008789062, 72.33577728271484 ], - 'descriptor': {'dimensions': [1, 2, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2, 2], dataType: 'float32'} } } } @@ -1897,7 +1897,7 @@ const poolingOperatorsTests = [ -57.294559478759766, -26.623577117919922, 15.935754776000977, -78.77953338623047, 72.33577728271484 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } }, 'operators': [{ @@ -1911,7 +1911,7 @@ const poolingOperatorsTests = [ 'expectedOutputs': { 'maxPool2dOutput': { 'data': [89.00830078125, 72.33577728271484], - 'descriptor': {'dimensions': [1, 2, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 1], dataType: 'float32'} } } } @@ -1940,7 +1940,7 @@ const poolingOperatorsTests = [ -57.294559478759766, -26.623577117919922, 15.935754776000977, -78.77953338623047, 72.33577728271484 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } }, 'operators': [{ @@ -1952,7 +1952,7 @@ const poolingOperatorsTests = [ 'expectedOutputs': { 'maxPool2dOutput': { 'data': [99.28312683105469, 81.73119354248047], - 'descriptor': {'dimensions': [1, 2, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 1], dataType: 'float32'} } } } @@ -1981,7 +1981,7 @@ const poolingOperatorsTests = [ 15.935754776000977, 39.383602142333984, -78.77953338623047, 7.429088115692139, 72.33577728271484 ], - 'descriptor': {'dimensions': [1, 5, 5, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 5, 5, 2], dataType: 'float32'} } }, 'operators': [{ @@ -1993,7 +1993,7 @@ const poolingOperatorsTests = [ 'expectedOutputs': { 'maxPool2dOutput': { 'data': [99.28312683105469, 81.73119354248047], - 'descriptor': {'dimensions': [1, 1, 1, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1, 2], dataType: 'float32'} } } } @@ -2022,7 +2022,7 @@ const poolingOperatorsTests = [ -57.294559478759766, -26.623577117919922, 15.935754776000977, -78.77953338623047, 72.33577728271484 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } }, 'operators': [{ @@ -2046,7 +2046,7 @@ const poolingOperatorsTests = [ 72.1085205078125, 81.73119354248047, 72.44898986816406, 81.73119354248047, 72.44898986816406 ], - 'descriptor': {'dimensions': [1, 2, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2, 2], dataType: 'float32'} } } } @@ -2075,7 +2075,7 @@ const poolingOperatorsTests = [ -57.294559478759766, -26.623577117919922, 15.935754776000977, -78.77953338623047, 72.33577728271484 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } }, 'operators': [{ @@ -2102,7 +2102,7 @@ const poolingOperatorsTests = [ 81.73119354248047, 72.44898986816406, 55.890525817871094, 80.30484008789062, 72.33577728271484, 72.33577728271484 ], - 'descriptor': {'dimensions': [1, 2, 3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 3], dataType: 'float32'} } } } @@ -2132,7 +2132,7 @@ const poolingOperatorsTests = [ -57.294559478759766, -26.623577117919922, 15.935754776000977, -78.77953338623047, 72.33577728271484 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } }, 'operators': [{ @@ -2160,7 +2160,7 @@ const poolingOperatorsTests = [ 81.73119354248047, 72.44898986816406, 55.890525817871094, 80.30484008789062, 72.33577728271484, 72.33577728271484 ], - 'descriptor': {'dimensions': [1, 2, 3, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 3], dataType: 'float32'} } } } @@ -2190,7 +2190,7 @@ const poolingOperatorsTests = [ -57.294559478759766, -26.623577117919922, 15.935754776000977, -78.77953338623047, 72.33577728271484 ], - 'descriptor': {'dimensions': [1, 2, 5, 5], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 5, 5], dataType: 'float32'} } }, 'operators': [{ @@ -2215,7 +2215,7 @@ const poolingOperatorsTests = [ 72.1085205078125, 81.73119354248047, 72.44898986816406, 81.73119354248047, 72.44898986816406 ], - 'descriptor': {'dimensions': [1, 2, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 2, 2], dataType: 'float32'} } } } @@ -2261,7 +2261,7 @@ const poolingOperatorsTests = [ 58.0643424987793, -51.168277740478516, -17.768583297729492, 9.961172103881836, -52.73843002319336 ], - 'descriptor': {'dimensions': [1, 7, 7, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 7, 7, 2], dataType: 'float32'} } }, 'operators': [{ @@ -2289,7 +2289,7 @@ const poolingOperatorsTests = [ 95.25411224365234, 94.72747802734375, 95.25411224365234, 98.13465881347656, 63.419517517089844, 98.13465881347656 ], - 'descriptor': {'dimensions': [1, 3, 3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 3, 2], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/pow.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/pow.https.any.js index 3da766df69df..fa18368d94e9 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/pow.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/pow.https.any.js @@ -37,7 +37,7 @@ const powTests = [ 17.229148864746094, -2.885918140411377, -1.4400150775909424, -5.757015705108643, 17.41126823425293, 17.41521453857422 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true }, 'inputB': { @@ -45,7 +45,7 @@ const powTests = [ 1, 6, -7, 7, -2, 1, 4, -10, -2, -5, -2, -10, -8, -7, -1, -3, -9, 6, -6, 7, -5, -5, 7, -6 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -82,7 +82,7 @@ const powTests = [ 485079424, 3.584487018315485e-8 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -102,14 +102,14 @@ const powTests = [ 17.229148864746094, -2.885918140411377, -1.4400150775909424, -5.757015705108643, 17.41126823425293, 17.41521453857422 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} }, 'inputB': { 'data': [ 1, 6, -7, 7, -2, 1, 4, -10, -2, -5, -2, -10, -8, -7, -1, -3, -9, 6, -6, 7, -5, -5, 7, -6 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -145,7 +145,7 @@ const powTests = [ 485079424, 3.584487018315485e-8 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -165,14 +165,14 @@ const powTests = [ 17.229148864746094, -2.885918140411377, -1.4400150775909424, -5.757015705108643, 17.41126823425293, 17.41521453857422 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} }, 'inputB': { 'data': [ 1, 6, -7, 7, -2, 1, 4, -10, -2, -5, -2, -10, -8, -7, -1, -3, -9, 6, -6, 7, -5, -5, 7, -6 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -208,7 +208,7 @@ const powTests = [ 485079424, 3.584487018315485e-8 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -228,14 +228,14 @@ const powTests = [ 17.229148864746094, -2.885918140411377, -1.4400150775909424, -5.757015705108643, 17.41126823425293, 17.41521453857422 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ 1, 6, -7, 7, -2, 1, 4, -10, -2, -5, -2, -10, -8, -7, -1, -3, -9, 6, -6, 7, -5, -5, 7, -6 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -271,7 +271,7 @@ const powTests = [ 485079424, 3.584487018315485e-8 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -291,14 +291,14 @@ const powTests = [ 17.229148864746094, -2.885918140411377, -1.4400150775909424, -5.757015705108643, 17.41126823425293, 17.41521453857422 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ 1, 6, -7, 7, -2, 1, 4, -10, -2, -5, -2, -10, -8, -7, -1, -3, -9, 6, -6, 7, -5, -5, 7, -6 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -334,7 +334,7 @@ const powTests = [ 485079424, 3.584487018315485e-8 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -354,14 +354,14 @@ const powTests = [ 17.229148864746094, -2.885918140411377, -1.4400150775909424, -5.757015705108643, 17.41126823425293, 17.41521453857422 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ 1, 6, -7, 7, -2, 1, 4, -10, -2, -5, -2, -10, -8, -7, -1, -3, -9, 6, -6, 7, -5, -5, 7, -6 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -397,7 +397,7 @@ const powTests = [ 485079424, 3.584487018315485e-8 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} } } } @@ -418,13 +418,10 @@ const powTests = [ 17.229148864746094, -2.885918140411377, -1.4400150775909424, -5.757015705108643, 17.41126823425293, 17.41521453857422 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'}, + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'}, 'constant': true }, - 'inputB': { - 'data': [2], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} - } + 'inputB': {'data': [2], 'descriptor': {shape: [], dataType: 'float32'}} }, 'operators': [{ 'name': 'pow', @@ -443,7 +440,7 @@ const powTests = [ 296.84356689453125, 8.328523635864258, 2.073643445968628, 33.14323043823242, 303.1522521972656, 303.2897033691406 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -464,13 +461,11 @@ const powTests = [ 5.891367435455322, 0.12803149223327637, 19.654495239257812, 3.4122724533081055, 4.945034980773926, 4.437101364135742 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'}, + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'}, 'constant': true }, - 'inputB': { - 'data': [0.5], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} - } + 'inputB': + {'data': [0.5], 'descriptor': {shape: [], dataType: 'float32'}} }, 'operators': [{ 'name': 'pow', @@ -489,7 +484,7 @@ const powTests = [ 2.4272139072418213, 0.35781487822532654, 4.4333391189575195, 1.847233772277832, 2.223743438720703, 2.106442928314209 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -510,11 +505,11 @@ const powTests = [ 17.229148864746094, -2.885918140411377, -1.4400150775909424, -5.757015705108643, 17.41126823425293, 17.41521453857422 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [5, -10, -10, 7, -7, -9], - 'descriptor': {'dimensions': [2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -534,7 +529,7 @@ const powTests = [ 1518165.5, 0.00002495513399480842, 0.026081321761012077, -209595.46875, 2.0615180673644318e-9, 6.786416914539295e-12 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -555,11 +550,11 @@ const powTests = [ 17.229148864746094, -2.885918140411377, -1.4400150775909424, -5.757015705108643, 17.41126823425293, 17.41521453857422 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [-5, -10, 9, -6], - 'descriptor': {'dimensions': [2, 2, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1], dataType: 'float32'} } }, 'operators': [{ @@ -595,7 +590,7 @@ const powTests = [ 3.5893645389251105e-8, 3.584487018315485e-8 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/prelu.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/prelu.https.any.js index 4730d4e2d17a..ed7b91f70391 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/prelu.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/prelu.https.any.js @@ -30,12 +30,12 @@ const preluTests = [ 'inputs': { 'preluInput': { 'data': [-4.794857501983643], - 'descriptor': {'dimensions': [], 'dataType': 'float32'}, + 'descriptor': {shape: [], dataType: 'float32'}, 'constant': true }, 'preluSlope': { 'data': [1.1202747821807861], - 'descriptor': {'dimensions': [], 'dataType': 'float32'}, + 'descriptor': {shape: [], dataType: 'float32'}, 'constant': true } }, @@ -47,7 +47,7 @@ const preluTests = [ 'expectedOutputs': { 'preluOutput': { 'data': [-5.371557712554932], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -67,7 +67,7 @@ const preluTests = [ 8.47507381439209, 4.551425457000732, -9.267870903015137, -0.262177437543869, 1.3258955478668213, -7.41831111907959 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true }, 'preluSlope': { @@ -81,7 +81,7 @@ const preluTests = [ 3.58212947845459, -2.3224003314971924, -1.9816573858261108, 4.155889987945557, -1.799522042274475, 9.295849800109863 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -102,7 +102,7 @@ const preluTests = [ 8.47507381439209, 4.551425457000732, 18.365745544433594, -1.0895805358886719, 1.3258955478668213, -68.95950317382812 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -122,7 +122,7 @@ const preluTests = [ 8.47507381439209, 4.551425457000732, -9.267870903015137, -0.262177437543869, 1.3258955478668213, -7.41831111907959 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true }, 'preluSlope': { @@ -136,7 +136,7 @@ const preluTests = [ 3.58212947845459, -2.3224003314971924, -1.9816573858261108, 4.155889987945557, -1.799522042274475, 9.295849800109863 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -157,7 +157,7 @@ const preluTests = [ 8.47507381439209, 4.551425457000732, 18.365745544433594, -1.0895805358886719, 1.3258955478668213, -68.95950317382812 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -177,7 +177,7 @@ const preluTests = [ 8.47507381439209, 4.551425457000732, -9.267870903015137, -0.262177437543869, 1.3258955478668213, -7.41831111907959 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'}, + 'descriptor': {shape: [4, 6], dataType: 'float32'}, 'constant': true }, 'preluSlope': { @@ -191,7 +191,7 @@ const preluTests = [ 3.58212947845459, -2.3224003314971924, -1.9816573858261108, 4.155889987945557, -1.799522042274475, 9.295849800109863 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'}, + 'descriptor': {shape: [4, 6], dataType: 'float32'}, 'constant': true } }, @@ -212,7 +212,7 @@ const preluTests = [ 8.47507381439209, 4.551425457000732, 18.365745544433594, -1.0895805358886719, 1.3258955478668213, -68.95950317382812 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -232,7 +232,7 @@ const preluTests = [ 8.47507381439209, 4.551425457000732, -9.267870903015137, -0.262177437543869, 1.3258955478668213, -7.41831111907959 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'}, + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'}, 'constant': true }, 'preluSlope': { @@ -246,7 +246,7 @@ const preluTests = [ 3.58212947845459, -2.3224003314971924, -1.9816573858261108, 4.155889987945557, -1.799522042274475, 9.295849800109863 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'}, + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'}, 'constant': true } }, @@ -267,7 +267,7 @@ const preluTests = [ 8.47507381439209, 4.551425457000732, 18.365745544433594, -1.0895805358886719, 1.3258955478668213, -68.95950317382812 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -287,7 +287,7 @@ const preluTests = [ 8.47507381439209, 4.551425457000732, -9.267870903015137, -0.262177437543869, 1.3258955478668213, -7.41831111907959 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'}, + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'}, 'constant': true }, 'preluSlope': { @@ -301,7 +301,7 @@ const preluTests = [ 3.58212947845459, -2.3224003314971924, -1.9816573858261108, 4.155889987945557, -1.799522042274475, 9.295849800109863 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'}, + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'}, 'constant': true } }, @@ -322,7 +322,7 @@ const preluTests = [ 8.47507381439209, 4.551425457000732, 18.365745544433594, -1.0895805358886719, 1.3258955478668213, -68.95950317382812 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -342,7 +342,7 @@ const preluTests = [ 8.47507381439209, 4.551425457000732, -9.267870903015137, -0.262177437543869, 1.3258955478668213, -7.41831111907959 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'}, + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'}, 'constant': true }, 'preluSlope': { @@ -356,7 +356,7 @@ const preluTests = [ 3.58212947845459, -2.3224003314971924, -1.9816573858261108, 4.155889987945557, -1.799522042274475, 9.295849800109863 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'}, + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'}, 'constant': true } }, @@ -377,7 +377,7 @@ const preluTests = [ 8.47507381439209, 4.551425457000732, 18.365745544433594, -1.0895805358886719, 1.3258955478668213, -68.95950317382812 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} } } } @@ -397,12 +397,12 @@ const preluTests = [ 8.47507381439209, 4.551425457000732, -9.267870903015137, -0.262177437543869, 1.3258955478668213, -7.41831111907959 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'}, + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'}, 'constant': true }, 'preluSlope': { 'data': [5.073923110961914, 0.480774462223053, -7.091750144958496], - 'descriptor': {'dimensions': [3], 'dataType': 'float32'}, + 'descriptor': {shape: [3], dataType: 'float32'}, 'constant': true } }, @@ -423,7 +423,7 @@ const preluTests = [ 8.47507381439209, 4.551425457000732, 65.72542572021484, -1.330268144607544, 1.3258955478668213, 52.60881042480469 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -443,12 +443,12 @@ const preluTests = [ 8.47507381439209, 4.551425457000732, -9.267870903015137, -0.262177437543869, 1.3258955478668213, -7.41831111907959 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'}, + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'}, 'constant': true }, 'preluSlope': { 'data': [5.0114545822143555], - 'descriptor': {'dimensions': [1], 'dataType': 'float32'}, + 'descriptor': {shape: [1], dataType: 'float32'}, 'constant': true } }, @@ -469,7 +469,7 @@ const preluTests = [ 8.47507381439209, 4.551425457000732, -46.44551467895508, -1.3138903379440308, 1.3258955478668213, -37.17652893066406 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -489,7 +489,7 @@ const preluTests = [ 8.47507381439209, 4.551425457000732, -9.267870903015137, -0.262177437543869, 1.3258955478668213, -7.41831111907959 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'}, + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'}, 'constant': true }, 'preluSlope': { @@ -497,7 +497,7 @@ const preluTests = [ 4.874276161193848, -8.501633644104004, 1.1819270849227905, -9.985190391540527, -4.424202919006348, -6.654683589935303 ], - 'descriptor': {'dimensions': [2, 3], 'dataType': 'float32'}, + 'descriptor': {shape: [2, 3], dataType: 'float32'}, 'constant': true } }, @@ -518,7 +518,7 @@ const preluTests = [ 8.47507381439209, 4.551425457000732, -10.953948020935059, 2.617891550064087, 1.3258955478668213, 49.366512298583984 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -538,12 +538,12 @@ const preluTests = [ 8.47507381439209, 4.551425457000732, -9.267870903015137, -0.262177437543869, 1.3258955478668213, -7.41831111907959 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'}, + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'}, 'constant': true }, 'preluSlope': { 'data': [5.073923110961914, 0.480774462223053, -7.091750144958496], - 'descriptor': {'dimensions': [1, 1, 3], 'dataType': 'float32'}, + 'descriptor': {shape: [1, 1, 3], dataType: 'float32'}, 'constant': true } }, @@ -564,7 +564,7 @@ const preluTests = [ 8.47507381439209, 4.551425457000732, 65.72542572021484, -1.330268144607544, 1.3258955478668213, 52.60881042480469 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -584,12 +584,12 @@ const preluTests = [ 8.47507381439209, 4.551425457000732, -9.267870903015137, -0.262177437543869, 1.3258955478668213, -7.41831111907959 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'}, + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'}, 'constant': true }, 'preluSlope': { 'data': [5.0114545822143555], - 'descriptor': {'dimensions': [1, 1, 1, 1], 'dataType': 'float32'}, + 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float32'}, 'constant': true } }, @@ -610,7 +610,7 @@ const preluTests = [ 8.47507381439209, 4.551425457000732, -46.44551467895508, -1.3138903379440308, 1.3258955478668213, -37.17652893066406 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } 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 index acae378d80b4..0871c881b717 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/quantizeLinear.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/quantizeLinear.https.any.js @@ -32,17 +32,17 @@ const quantizeLinearTests = [ 'inputs': { 'quantizeLinearInput': { 'data': [10.794857501983643], - 'descriptor': {'dimensions': [], 'dataType': 'float32'}, + 'descriptor': {shape: [], dataType: 'float32'}, 'constant': true }, 'quantizeLinearScale': { 'data': [1.1202747821807861], - 'descriptor': {'dimensions': [], 'dataType': 'float32'}, + 'descriptor': {shape: [], dataType: 'float32'}, 'constant': true }, 'quantizeLinearZeroPoint': { 'data': [1], - 'descriptor': {'dimensions': [], 'dataType': 'int8'}, + 'descriptor': {shape: [], dataType: 'int8'}, 'constant': true } }, @@ -56,7 +56,7 @@ const quantizeLinearTests = [ }], 'expectedOutputs': { 'quantizeLinearOutput': - {'data': [11], 'descriptor': {'dimensions': [], 'dataType': 'int8'}} + {'data': [11], 'descriptor': {shape: [], dataType: 'int8'}} } } }, @@ -69,7 +69,7 @@ const quantizeLinearTests = [ -2.549168109893799, -4.794857501983643, 8.413617134094238, 6.108623504638672 ], - 'descriptor': {'dimensions': [4], 'dataType': 'float32'}, + 'descriptor': {shape: [4], dataType: 'float32'}, 'constant': true }, 'quantizeLinearScale': { @@ -79,12 +79,12 @@ const quantizeLinearTests = [ -4.617084980010986, 1.1202747821807861, ], - 'descriptor': {'dimensions': [4], 'dataType': 'float32'}, + 'descriptor': {shape: [4], dataType: 'float32'}, 'constant': true }, 'quantizeLinearZeroPoint': { 'data': [128], - 'descriptor': {'dimensions': [], 'dataType': 'uint8'}, + 'descriptor': {shape: [], dataType: 'uint8'}, 'constant': true } }, @@ -99,7 +99,7 @@ const quantizeLinearTests = [ 'expectedOutputs': { 'quantizeLinearOutput': { 'data': [128, 111, 126, 133], - 'descriptor': {'dimensions': [4], 'dataType': 'uint8'} + 'descriptor': {shape: [4], dataType: 'uint8'} } } } @@ -114,17 +114,17 @@ const quantizeLinearTests = [ -2.549168109893799, -4.794857501983643, 8.413617134094238, 6.108623504638672 ], - 'descriptor': {'dimensions': [1, 1, 2, 2], 'dataType': 'float32'}, + 'descriptor': {shape: [1, 1, 2, 2], dataType: 'float32'}, 'constant': true }, 'quantizeLinearScale': { 'data': [0.2800687253475189, -4.617084980010986], - 'descriptor': {'dimensions': [2, 1], 'dataType': 'float32'}, + 'descriptor': {shape: [2, 1], dataType: 'float32'}, 'constant': true }, 'quantizeLinearZeroPoint': { 'data': [128], - 'descriptor': {'dimensions': [], 'dataType': 'uint8'}, + 'descriptor': {shape: [], dataType: 'uint8'}, 'constant': true } }, @@ -139,7 +139,7 @@ const quantizeLinearTests = [ 'expectedOutputs': { 'quantizeLinearOutput': { 'data': [119, 111, 126, 127], - 'descriptor': {'dimensions': [1, 1, 2, 2], 'dataType': 'uint8'} + 'descriptor': {shape: [1, 1, 2, 2], dataType: 'uint8'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/reciprocal.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/reciprocal.https.any.js index a97c00e2b996..bbf49a1e0ac4 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/reciprocal.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/reciprocal.https.any.js @@ -28,7 +28,7 @@ const reciprocalTests = [ 'inputs': { 'reciprocalInput': { 'data': [-9.36349105834961], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -39,7 +39,7 @@ const reciprocalTests = [ 'expectedOutputs': { 'reciprocalOutput': { 'data': [-0.10679777711629868], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -59,7 +59,7 @@ const reciprocalTests = [ 8.246277809143066, -0.2039169818162918, -9.039937019348145, 9.942809104919434, -9.540112495422363, -0.08022662252187729 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -80,7 +80,7 @@ const reciprocalTests = [ 0.12126683443784714, -4.903956413269043, -0.11062023788690567, 0.10057520121335983, -0.10482056438922882, -12.464690208435059 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -100,7 +100,7 @@ const reciprocalTests = [ 8.246277809143066, -0.2039169818162918, -9.039937019348145, 9.942809104919434, -9.540112495422363, -0.08022662252187729 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -120,7 +120,7 @@ const reciprocalTests = [ 0.12126683443784714, -4.903956413269043, -0.11062023788690567, 0.10057520121335983, -0.10482056438922882, -12.464690208435059 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -140,7 +140,7 @@ const reciprocalTests = [ 8.246277809143066, -0.2039169818162918, -9.039937019348145, 9.942809104919434, -9.540112495422363, -0.08022662252187729 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -160,7 +160,7 @@ const reciprocalTests = [ 0.12126683443784714, -4.903956413269043, -0.11062023788690567, 0.10057520121335983, -0.10482056438922882, -12.464690208435059 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -180,7 +180,7 @@ const reciprocalTests = [ 8.246277809143066, -0.2039169818162918, -9.039937019348145, 9.942809104919434, -9.540112495422363, -0.08022662252187729 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -200,7 +200,7 @@ const reciprocalTests = [ 0.12126683443784714, -4.903956413269043, -0.11062023788690567, 0.10057520121335983, -0.10482056438922882, -12.464690208435059 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -220,7 +220,7 @@ const reciprocalTests = [ 8.246277809143066, -0.2039169818162918, -9.039937019348145, 9.942809104919434, -9.540112495422363, -0.08022662252187729 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -240,7 +240,7 @@ const reciprocalTests = [ 0.12126683443784714, -4.903956413269043, -0.11062023788690567, 0.10057520121335983, -0.10482056438922882, -12.464690208435059 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -260,7 +260,7 @@ const reciprocalTests = [ 8.246277809143066, -0.2039169818162918, -9.039937019348145, 9.942809104919434, -9.540112495422363, -0.08022662252187729 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } }, 'operators': [{ @@ -280,7 +280,7 @@ const reciprocalTests = [ 0.12126683443784714, -4.903956413269043, -0.11062023788690567, 0.10057520121335983, -0.10482056438922882, -12.464690208435059 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } } } 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 index f15de087cf0a..8fa1b4c09c28 100644 --- 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 @@ -33,7 +33,7 @@ const reduceL1Tests = [ 'inputs': { 'reduceL1Input': { 'data': [5.50882625579834], - 'descriptor': {'dimensions': [], 'dataType': 'float32'}, + 'descriptor': {shape: [], dataType: 'float32'}, 'constant': true } }, @@ -45,7 +45,7 @@ const reduceL1Tests = [ 'expectedOutputs': { 'reduceL1Output': { 'data': 5.50882625579834, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -56,7 +56,7 @@ const reduceL1Tests = [ 'inputs': { 'reduceL1Input': { 'data': [5.50882625579834], - 'descriptor': {'dimensions': [], 'dataType': 'float32'}, + 'descriptor': {shape: [], dataType: 'float32'}, 'constant': true } }, @@ -68,7 +68,7 @@ const reduceL1Tests = [ 'expectedOutputs': { 'reduceL1Output': { 'data': 5.50882625579834, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -88,7 +88,7 @@ const reduceL1Tests = [ 61.70843505859375, 69.76119232177734, 38.919403076171875, 52.288333892822266, 22.31783676147461, 99.0719223022461 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -100,7 +100,7 @@ const reduceL1Tests = [ 'expectedOutputs': { 'reduceL1Output': { 'data': 1092.72021484375, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -120,7 +120,7 @@ const reduceL1Tests = [ 61.70843505859375, 69.76119232177734, 38.919403076171875, 52.288333892822266, 22.31783676147461, 99.0719223022461 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -131,7 +131,7 @@ const reduceL1Tests = [ 'expectedOutputs': { 'reduceL1Output': { 'data': 1092.72021484375, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -151,7 +151,7 @@ const reduceL1Tests = [ -20.6556339263916, -92.2993392944336, -46.28858184814453, -80.57186126708984, -25.49472999572754, -48.96730041503906 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -162,7 +162,7 @@ const reduceL1Tests = [ 'expectedOutputs': { 'reduceL1Output': { 'data': 1215.228515625, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -176,7 +176,7 @@ const reduceL1Tests = [ 18, 29, 35, 36, 4, 76, 41, 18, 53, 29, 25, 94, 26, 1, 3, 68, 39, 25, 87, 30, 39, 75, 76, 66 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -185,10 +185,8 @@ const reduceL1Tests = [ 'outputs': 'reduceL1Output' }], 'expectedOutputs': { - 'reduceL1Output': { - 'data': 993, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} - } + 'reduceL1Output': + {'data': 993, 'descriptor': {shape: [], dataType: 'float32'}} } } }, @@ -201,7 +199,7 @@ const reduceL1Tests = [ -92, -52, -88, -78, -20, -73, -42, -57, -39, -75, -17, -36, -81, -24, -88, -91, -76, -5, -44, -66, -96, -8, -69, -27 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -210,10 +208,8 @@ const reduceL1Tests = [ 'outputs': 'reduceL1Output' }], 'expectedOutputs': { - 'reduceL1Output': { - 'data': 1344, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} - } + 'reduceL1Output': + {'data': 1344, 'descriptor': {shape: [], dataType: 'float32'}} } } }, @@ -232,7 +228,7 @@ const reduceL1Tests = [ 61.70843505859375, 69.76119232177734, 38.919403076171875, 52.288333892822266, 22.31783676147461, 99.0719223022461 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -243,7 +239,7 @@ const reduceL1Tests = [ 'expectedOutputs': { 'reduceL1Output': { 'data': 1092.72021484375, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -263,7 +259,7 @@ const reduceL1Tests = [ 61.70843505859375, 69.76119232177734, 38.919403076171875, 52.288333892822266, 22.31783676147461, 99.0719223022461 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -274,7 +270,7 @@ const reduceL1Tests = [ 'expectedOutputs': { 'reduceL1Output': { 'data': 1092.72021484375, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -294,7 +290,7 @@ const reduceL1Tests = [ 61.70843505859375, 69.76119232177734, 38.919403076171875, 52.288333892822266, 22.31783676147461, 99.0719223022461 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -305,7 +301,7 @@ const reduceL1Tests = [ 'expectedOutputs': { 'reduceL1Output': { 'data': 1092.72021484375, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -325,7 +321,7 @@ const reduceL1Tests = [ 61.70843505859375, 69.76119232177734, 38.919403076171875, 52.288333892822266, 22.31783676147461, 99.0719223022461 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } }, 'operators': [{ @@ -336,7 +332,7 @@ const reduceL1Tests = [ 'expectedOutputs': { 'reduceL1Output': { 'data': 1092.72021484375, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -356,7 +352,7 @@ const reduceL1Tests = [ 61.70843505859375, 69.76119232177734, 38.919403076171875, 52.288333892822266, 22.31783676147461, 99.0719223022461 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -370,7 +366,7 @@ const reduceL1Tests = [ 142.01541137695312, 106.62430572509766, 175.39280700683594, 286.7269592285156, 169.36322021484375, 212.59750366210938 ], - 'descriptor': {'dimensions': [2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3], dataType: 'float32'} } } } @@ -390,7 +386,7 @@ const reduceL1Tests = [ 61.70843505859375, 69.76119232177734, 38.919403076171875, 52.288333892822266, 22.31783676147461, 99.0719223022461 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -405,7 +401,7 @@ const reduceL1Tests = [ 258.57110595703125, 174.42807006835938, 102.19830322265625, 134.52191162109375, 207.92910766601562, 215.07168579101562 ], - 'descriptor': {'dimensions': [2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3], dataType: 'float32'} } } } @@ -425,7 +421,7 @@ const reduceL1Tests = [ 61.70843505859375, 69.76119232177734, 38.919403076171875, 52.288333892822266, 22.31783676147461, 99.0719223022461 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -438,7 +434,7 @@ const reduceL1Tests = [ 'expectedOutputs': { 'reduceL1Output': { 'data': 1092.72021484375, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -458,7 +454,7 @@ const reduceL1Tests = [ 61.70843505859375, 69.76119232177734, 38.919403076171875, 52.288333892822266, 22.31783676147461, 99.0719223022461 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -470,7 +466,7 @@ const reduceL1Tests = [ 'expectedOutputs': { 'reduceL1Output': { 'data': [1092.72021484375], - 'descriptor': {'dimensions': [1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1], dataType: 'float32'} } } } @@ -490,7 +486,7 @@ const reduceL1Tests = [ 61.70843505859375, 69.76119232177734, 38.919403076171875, 52.288333892822266, 22.31783676147461, 99.0719223022461 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -503,7 +499,7 @@ const reduceL1Tests = [ 'expectedOutputs': { 'reduceL1Output': { 'data': 1092.72021484375, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -523,7 +519,7 @@ const reduceL1Tests = [ 61.70843505859375, 69.76119232177734, 38.919403076171875, 52.288333892822266, 22.31783676147461, 99.0719223022461 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -535,7 +531,7 @@ const reduceL1Tests = [ 'expectedOutputs': { 'reduceL1Output': { 'data': [1092.72021484375], - 'descriptor': {'dimensions': [1, 1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float32'} } } } @@ -556,7 +552,7 @@ const reduceL1Tests = [ 61.70843505859375, 69.76119232177734, 38.919403076171875, 52.288333892822266, 22.31783676147461, 99.0719223022461 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -573,7 +569,7 @@ const reduceL1Tests = [ 108.43173217773438, 315.6007995605469, 359.5506591796875, 309.13702392578125 ], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} } } } @@ -594,7 +590,7 @@ const reduceL1Tests = [ 61.70843505859375, 69.76119232177734, 38.919403076171875, 52.288333892822266, 22.31783676147461, 99.0719223022461 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -611,7 +607,7 @@ const reduceL1Tests = [ 108.43173217773438, 315.6007995605469, 359.5506591796875, 309.13702392578125 ], - 'descriptor': {'dimensions': [2, 1, 2, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 2, 1], dataType: 'float32'} } } } 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 index 7c1d45434620..7fc2ee8e6212 100644 --- 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 @@ -34,7 +34,7 @@ const reduceL2Tests = [ 'inputs': { 'reduceL2Input': { 'data': [4.860228061676025], - 'descriptor': {'dimensions': [], 'dataType': 'float32'}, + 'descriptor': {shape: [], dataType: 'float32'}, 'constant': true } }, @@ -46,7 +46,7 @@ const reduceL2Tests = [ 'expectedOutputs': { 'reduceL2Output': { 'data': 4.860228061676025, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -57,7 +57,7 @@ const reduceL2Tests = [ 'inputs': { 'reduceL2Input': { 'data': [4.860228061676025], - 'descriptor': {'dimensions': [], 'dataType': 'float32'}, + 'descriptor': {shape: [], dataType: 'float32'}, 'constant': true } }, @@ -69,7 +69,7 @@ const reduceL2Tests = [ 'expectedOutputs': { 'reduceL2Output': { 'data': 4.860228061676025, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -89,7 +89,7 @@ const reduceL2Tests = [ 11.320085525512695, 64.75763702392578, 43.6589469909668, 0.8374307155609131, 0.6848266124725342, 33.504703521728516 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -101,7 +101,7 @@ const reduceL2Tests = [ 'expectedOutputs': { 'reduceL2Output': { 'data': 272.0996398925781, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -121,7 +121,7 @@ const reduceL2Tests = [ 11.320085525512695, 64.75763702392578, 43.6589469909668, 0.8374307155609131, 0.6848266124725342, 33.504703521728516 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -132,7 +132,7 @@ const reduceL2Tests = [ 'expectedOutputs': { 'reduceL2Output': { 'data': 272.0996398925781, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -152,7 +152,7 @@ const reduceL2Tests = [ -85.05448913574219, -30.235260009765625, -47.33808135986328, -25.268428802490234, -78.11959075927734, -28.330944061279297 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -163,7 +163,7 @@ const reduceL2Tests = [ 'expectedOutputs': { 'reduceL2Output': { 'data': 292.57574462890625, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -177,7 +177,7 @@ const reduceL2Tests = [ 4, 29, 8, 56, 42, 78, 89, 64, 56, 81, 85, 18, 6, 39, 35, 63, 87, 50, 81, 89, 5, 8, 37, 37 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -188,7 +188,7 @@ const reduceL2Tests = [ 'expectedOutputs': { 'reduceL2Output': { 'data': 274.4029846191406, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -202,7 +202,7 @@ const reduceL2Tests = [ -70, -78, -65, -77, -25, -47, -63, -67, -66, -15, -28, -75, -88, -54, -13, -27, -5, -18, -68, -71, -50, -56, -99, -99 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -213,7 +213,7 @@ const reduceL2Tests = [ 'expectedOutputs': { 'reduceL2Output': { 'data': 300.3830871582031, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -233,7 +233,7 @@ const reduceL2Tests = [ 11.320085525512695, 64.75763702392578, 43.6589469909668, 0.8374307155609131, 0.6848266124725342, 33.504703521728516 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -244,7 +244,7 @@ const reduceL2Tests = [ 'expectedOutputs': { 'reduceL2Output': { 'data': 272.0996398925781, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -264,7 +264,7 @@ const reduceL2Tests = [ 11.320085525512695, 64.75763702392578, 43.6589469909668, 0.8374307155609131, 0.6848266124725342, 33.504703521728516 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -275,7 +275,7 @@ const reduceL2Tests = [ 'expectedOutputs': { 'reduceL2Output': { 'data': 272.0996398925781, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -295,7 +295,7 @@ const reduceL2Tests = [ 11.320085525512695, 64.75763702392578, 43.6589469909668, 0.8374307155609131, 0.6848266124725342, 33.504703521728516 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -306,7 +306,7 @@ const reduceL2Tests = [ 'expectedOutputs': { 'reduceL2Output': { 'data': 272.0996398925781, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -326,7 +326,7 @@ const reduceL2Tests = [ 11.320085525512695, 64.75763702392578, 43.6589469909668, 0.8374307155609131, 0.6848266124725342, 33.504703521728516 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } }, 'operators': [{ @@ -337,7 +337,7 @@ const reduceL2Tests = [ 'expectedOutputs': { 'reduceL2Output': { 'data': 272.0996398925781, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -357,7 +357,7 @@ const reduceL2Tests = [ 11.320085525512695, 64.75763702392578, 43.6589469909668, 0.8374307155609131, 0.6848266124725342, 33.504703521728516 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -371,7 +371,7 @@ const reduceL2Tests = [ 122.352783203125, 124.8213119506836, 128.20062255859375, 128.14801025390625, 87.18083953857422, 55.043975830078125 ], - 'descriptor': {'dimensions': [2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3], dataType: 'float32'} } } } @@ -391,7 +391,7 @@ const reduceL2Tests = [ 11.320085525512695, 64.75763702392578, 43.6589469909668, 0.8374307155609131, 0.6848266124725342, 33.504703521728516 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -406,7 +406,7 @@ const reduceL2Tests = [ 114.44775390625, 110.26422882080078, 133.47344970703125, 64.96752166748047, 128.0914764404297, 101.677734375 ], - 'descriptor': {'dimensions': [2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3], dataType: 'float32'} } } } @@ -426,7 +426,7 @@ const reduceL2Tests = [ 11.320085525512695, 64.75763702392578, 43.6589469909668, 0.8374307155609131, 0.6848266124725342, 33.504703521728516 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -439,7 +439,7 @@ const reduceL2Tests = [ 'expectedOutputs': { 'reduceL2Output': { 'data': 272.0996398925781, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -459,7 +459,7 @@ const reduceL2Tests = [ 11.320085525512695, 64.75763702392578, 43.6589469909668, 0.8374307155609131, 0.6848266124725342, 33.504703521728516 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -471,7 +471,7 @@ const reduceL2Tests = [ 'expectedOutputs': { 'reduceL2Output': { 'data': [272.0996398925781], - 'descriptor': {'dimensions': [1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1], dataType: 'float32'} } } } @@ -491,7 +491,7 @@ const reduceL2Tests = [ 11.320085525512695, 64.75763702392578, 43.6589469909668, 0.8374307155609131, 0.6848266124725342, 33.504703521728516 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -504,7 +504,7 @@ const reduceL2Tests = [ 'expectedOutputs': { 'reduceL2Output': { 'data': 272.0996398925781, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -524,7 +524,7 @@ const reduceL2Tests = [ 11.320085525512695, 64.75763702392578, 43.6589469909668, 0.8374307155609131, 0.6848266124725342, 33.504703521728516 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -536,7 +536,7 @@ const reduceL2Tests = [ 'expectedOutputs': { 'reduceL2Output': { 'data': [272.0996398925781], - 'descriptor': {'dimensions': [1, 1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float32'} } } } @@ -557,7 +557,7 @@ const reduceL2Tests = [ 11.320085525512695, 64.75763702392578, 43.6589469909668, 0.8374307155609131, 0.6848266124725342, 33.504703521728516 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -573,7 +573,7 @@ const reduceL2Tests = [ 'data': [ 138.580078125, 166.67791748046875, 149.91552734375, 67.6578598022461 ], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} } } } @@ -594,7 +594,7 @@ const reduceL2Tests = [ 11.320085525512695, 64.75763702392578, 43.6589469909668, 0.8374307155609131, 0.6848266124725342, 33.504703521728516 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -610,7 +610,7 @@ const reduceL2Tests = [ 'data': [ 138.580078125, 166.67791748046875, 149.91552734375, 67.6578598022461 ], - 'descriptor': {'dimensions': [2, 1, 2, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 2, 1], dataType: 'float32'} } } } 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 index 47a88732dedc..5ed23e1af47d 100644 --- 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 @@ -34,7 +34,7 @@ const reduceLogSumTests = [ 'inputs': { 'reduceLogSumInput': { 'data': [64.54827117919922], - 'descriptor': {'dimensions': [], 'dataType': 'float32'}, + 'descriptor': {shape: [], dataType: 'float32'}, 'constant': true } }, @@ -46,7 +46,7 @@ const reduceLogSumTests = [ 'expectedOutputs': { 'reduceLogSumOutput': { 'data': 4.167413234710693, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -57,7 +57,7 @@ const reduceLogSumTests = [ 'inputs': { 'reduceLogSumInput': { 'data': [64.54827117919922], - 'descriptor': {'dimensions': [], 'dataType': 'float32'}, + 'descriptor': {shape: [], dataType: 'float32'}, 'constant': true } }, @@ -70,7 +70,7 @@ const reduceLogSumTests = [ 'expectedOutputs': { 'reduceLogSumOutput': { 'data': 4.167413234710693, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -91,7 +91,7 @@ const reduceLogSumTests = [ 8.568099021911621, 0.8337112069129944, 69.23146057128906, 3.8541641235351562, 70.5567398071289, 71.99264526367188 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -103,7 +103,7 @@ const reduceLogSumTests = [ 'expectedOutputs': { 'reduceLogSumOutput': { 'data': 7.039101600646973, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -123,7 +123,7 @@ const reduceLogSumTests = [ 8.568099021911621, 0.8337112069129944, 69.23146057128906, 3.8541641235351562, 70.5567398071289, 71.99264526367188 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -134,7 +134,7 @@ const reduceLogSumTests = [ 'expectedOutputs': { 'reduceLogSumOutput': { 'data': 7.039101600646973, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -149,7 +149,7 @@ const reduceLogSumTests = [ 63, 82, 49, 23, 98, 67, 15, 9, 89, 7, 69, 61, 47, 50, 41, 39, 58, 52, 35, 83, 81, 7, 34, 9 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -160,7 +160,7 @@ const reduceLogSumTests = [ 'expectedOutputs': { 'reduceLogSumOutput': { 'data': 7.063048362731934, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -180,7 +180,7 @@ const reduceLogSumTests = [ 8.568099021911621, 0.8337112069129944, 69.23146057128906, 3.8541641235351562, 70.5567398071289, 71.99264526367188 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -191,7 +191,7 @@ const reduceLogSumTests = [ 'expectedOutputs': { 'reduceLogSumOutput': { 'data': 7.039101600646973, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -211,7 +211,7 @@ const reduceLogSumTests = [ 8.568099021911621, 0.8337112069129944, 69.23146057128906, 3.8541641235351562, 70.5567398071289, 71.99264526367188 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -222,7 +222,7 @@ const reduceLogSumTests = [ 'expectedOutputs': { 'reduceLogSumOutput': { 'data': 7.039101600646973, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -242,7 +242,7 @@ const reduceLogSumTests = [ 8.568099021911621, 0.8337112069129944, 69.23146057128906, 3.8541641235351562, 70.5567398071289, 71.99264526367188 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -253,7 +253,7 @@ const reduceLogSumTests = [ 'expectedOutputs': { 'reduceLogSumOutput': { 'data': 7.039101600646973, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -273,7 +273,7 @@ const reduceLogSumTests = [ 8.568099021911621, 0.8337112069129944, 69.23146057128906, 3.8541641235351562, 70.5567398071289, 71.99264526367188 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } }, 'operators': [{ @@ -284,7 +284,7 @@ const reduceLogSumTests = [ 'expectedOutputs': { 'reduceLogSumOutput': { 'data': 7.039101600646973, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -304,7 +304,7 @@ const reduceLogSumTests = [ 8.568099021911621, 0.8337112069129944, 69.23146057128906, 3.8541641235351562, 70.5567398071289, 71.99264526367188 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -319,7 +319,7 @@ const reduceLogSumTests = [ 5.593751907348633, 4.773046016693115, 5.3115739822387695, 5.2497639656066895, 4.973392486572266, 5.373587131500244 ], - 'descriptor': {'dimensions': [2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3], dataType: 'float32'} } } } @@ -339,7 +339,7 @@ const reduceLogSumTests = [ 8.568099021911621, 0.8337112069129944, 69.23146057128906, 3.8541641235351562, 70.5567398071289, 71.99264526367188 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -354,7 +354,7 @@ const reduceLogSumTests = [ 5.410027980804443, 5.367736339569092, 5.399682998657227, 4.652334213256836, 4.744638442993164, 5.565346717834473 ], - 'descriptor': {'dimensions': [2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3], dataType: 'float32'} } } } @@ -374,7 +374,7 @@ const reduceLogSumTests = [ 8.568099021911621, 0.8337112069129944, 69.23146057128906, 3.8541641235351562, 70.5567398071289, 71.99264526367188 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -387,7 +387,7 @@ const reduceLogSumTests = [ 'expectedOutputs': { 'reduceLogSumOutput': { 'data': 7.039101600646973, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -407,7 +407,7 @@ const reduceLogSumTests = [ 8.568099021911621, 0.8337112069129944, 69.23146057128906, 3.8541641235351562, 70.5567398071289, 71.99264526367188 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -420,7 +420,7 @@ const reduceLogSumTests = [ 'expectedOutputs': { 'reduceLogSumOutput': { 'data': [7.039101600646973], - 'descriptor': {'dimensions': [1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1], dataType: 'float32'} } } } @@ -440,7 +440,7 @@ const reduceLogSumTests = [ 8.568099021911621, 0.8337112069129944, 69.23146057128906, 3.8541641235351562, 70.5567398071289, 71.99264526367188 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -453,7 +453,7 @@ const reduceLogSumTests = [ 'expectedOutputs': { 'reduceLogSumOutput': { 'data': 7.039101600646973, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -473,7 +473,7 @@ const reduceLogSumTests = [ 8.568099021911621, 0.8337112069129944, 69.23146057128906, 3.8541641235351562, 70.5567398071289, 71.99264526367188 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -486,7 +486,7 @@ const reduceLogSumTests = [ 'expectedOutputs': { 'reduceLogSumOutput': { 'data': [7.039101600646973], - 'descriptor': {'dimensions': [1, 1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float32'} } } } @@ -507,7 +507,7 @@ const reduceLogSumTests = [ 8.568099021911621, 0.8337112069129944, 69.23146057128906, 3.8541641235351562, 70.5567398071289, 71.99264526367188 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -524,7 +524,7 @@ const reduceLogSumTests = [ 5.7273993492126465, 5.64375114440918, 5.453810214996338, 5.758983135223389 ], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} } } } @@ -545,7 +545,7 @@ const reduceLogSumTests = [ 8.568099021911621, 0.8337112069129944, 69.23146057128906, 3.8541641235351562, 70.5567398071289, 71.99264526367188 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -562,7 +562,7 @@ const reduceLogSumTests = [ 5.7273993492126465, 5.64375114440918, 5.453810214996338, 5.758983135223389 ], - 'descriptor': {'dimensions': [2, 1, 2, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 2, 1], dataType: 'float32'} } } } 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 index 5ba2e3930778..e9a0b7b54930 100644 --- 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 @@ -34,7 +34,7 @@ const reduceLogSumExpTests = [ 'inputs': { 'reduceLogSumExpInput': { 'data': [0.7974132895469666], - 'descriptor': {'dimensions': [], 'dataType': 'float32'}, + 'descriptor': {shape: [], dataType: 'float32'}, 'constant': true } }, @@ -46,7 +46,7 @@ const reduceLogSumExpTests = [ 'expectedOutputs': { 'reduceLogSumExpOutput': { 'data': 0.7974132895469666, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -57,7 +57,7 @@ const reduceLogSumExpTests = [ 'inputs': { 'reduceLogSumExpInput': { 'data': [0.7974132895469666], - 'descriptor': {'dimensions': [], 'dataType': 'float32'}, + 'descriptor': {shape: [], dataType: 'float32'}, 'constant': true } }, @@ -70,7 +70,7 @@ const reduceLogSumExpTests = [ 'expectedOutputs': { 'reduceLogSumExpOutput': { 'data': 0.7974132895469666, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -91,7 +91,7 @@ const reduceLogSumExpTests = [ 6.802876949310303, 5.234325408935547, 8.914905548095703, 9.166799545288086, 5.717507362365723, 0.3255050778388977 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -103,7 +103,7 @@ const reduceLogSumExpTests = [ 'expectedOutputs': { 'reduceLogSumExpOutput': { 'data': 10.39477825164795, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -123,7 +123,7 @@ const reduceLogSumExpTests = [ 6.802876949310303, 5.234325408935547, 8.914905548095703, 9.166799545288086, 5.717507362365723, 0.3255050778388977 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -134,7 +134,7 @@ const reduceLogSumExpTests = [ 'expectedOutputs': { 'reduceLogSumExpOutput': { 'data': 10.39477825164795, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -154,7 +154,7 @@ const reduceLogSumExpTests = [ -9.963415145874023, -5.991659641265869, -6.180599689483643, -1.2336505651474, -0.44234341382980347, -6.990072250366211 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -165,7 +165,7 @@ const reduceLogSumExpTests = [ 'expectedOutputs': { 'reduceLogSumExpOutput': { 'data': 1.1666961908340454, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -180,7 +180,7 @@ const reduceLogSumExpTests = [ 1, 5, 7, 5, 7, 5, 4, 2, 1, 5, 8, 2, 4, 1, 4, 5, 4, 8, 6, 2, 7, 7, 8, 5 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -191,7 +191,7 @@ const reduceLogSumExpTests = [ 'expectedOutputs': { 'reduceLogSumExpOutput': { 'data': 9.607237815856934, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -206,7 +206,7 @@ const reduceLogSumExpTests = [ -6, -3, -5, -1, -9, -5, -1, -2, -10, -1, -5, -7, -7, -3, -10, -10, -8, -6, -2, -6, -1, -9, -5, -2 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -217,7 +217,7 @@ const reduceLogSumExpTests = [ 'expectedOutputs': { 'reduceLogSumExpOutput': { 'data': 0.7001367211341858, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -237,7 +237,7 @@ const reduceLogSumExpTests = [ 6.802876949310303, 5.234325408935547, 8.914905548095703, 9.166799545288086, 5.717507362365723, 0.3255050778388977 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -248,7 +248,7 @@ const reduceLogSumExpTests = [ 'expectedOutputs': { 'reduceLogSumExpOutput': { 'data': 10.39477825164795, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -268,7 +268,7 @@ const reduceLogSumExpTests = [ 6.802876949310303, 5.234325408935547, 8.914905548095703, 9.166799545288086, 5.717507362365723, 0.3255050778388977 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -279,7 +279,7 @@ const reduceLogSumExpTests = [ 'expectedOutputs': { 'reduceLogSumExpOutput': { 'data': 10.39477825164795, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -299,7 +299,7 @@ const reduceLogSumExpTests = [ 6.802876949310303, 5.234325408935547, 8.914905548095703, 9.166799545288086, 5.717507362365723, 0.3255050778388977 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -310,7 +310,7 @@ const reduceLogSumExpTests = [ 'expectedOutputs': { 'reduceLogSumExpOutput': { 'data': 10.39477825164795, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -330,7 +330,7 @@ const reduceLogSumExpTests = [ 6.802876949310303, 5.234325408935547, 8.914905548095703, 9.166799545288086, 5.717507362365723, 0.3255050778388977 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } }, 'operators': [{ @@ -341,7 +341,7 @@ const reduceLogSumExpTests = [ 'expectedOutputs': { 'reduceLogSumExpOutput': { 'data': 10.39477825164795, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -361,7 +361,7 @@ const reduceLogSumExpTests = [ 6.802876949310303, 5.234325408935547, 8.914905548095703, 9.166799545288086, 5.717507362365723, 0.3255050778388977 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -376,7 +376,7 @@ const reduceLogSumExpTests = [ 8.55212688446045, 3.985233783721924, 5.52872896194458, 9.081488609313965, 6.996237754821777, 9.759706497192383 ], - 'descriptor': {'dimensions': [2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3], dataType: 'float32'} } } } @@ -396,7 +396,7 @@ const reduceLogSumExpTests = [ 6.802876949310303, 5.234325408935547, 8.914905548095703, 9.166799545288086, 5.717507362365723, 0.3255050778388977 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -411,7 +411,7 @@ const reduceLogSumExpTests = [ 4.66951847076416, 9.08117961883545, 8.533217430114746, 9.270560264587402, 6.450263977050781, 8.917200088500977 ], - 'descriptor': {'dimensions': [2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3], dataType: 'float32'} } } } @@ -431,7 +431,7 @@ const reduceLogSumExpTests = [ 6.802876949310303, 5.234325408935547, 8.914905548095703, 9.166799545288086, 5.717507362365723, 0.3255050778388977 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -445,7 +445,7 @@ const reduceLogSumExpTests = [ 'expectedOutputs': { 'reduceLogSumExpOutput': { 'data': 10.39477825164795, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -465,7 +465,7 @@ const reduceLogSumExpTests = [ 6.802876949310303, 5.234325408935547, 8.914905548095703, 9.166799545288086, 5.717507362365723, 0.3255050778388977 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -479,7 +479,7 @@ const reduceLogSumExpTests = [ 'expectedOutputs': { 'reduceLogSumExpOutput': { 'data': [10.39477825164795], - 'descriptor': {'dimensions': [1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1], dataType: 'float32'} } } } @@ -499,7 +499,7 @@ const reduceLogSumExpTests = [ 6.802876949310303, 5.234325408935547, 8.914905548095703, 9.166799545288086, 5.717507362365723, 0.3255050778388977 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -513,7 +513,7 @@ const reduceLogSumExpTests = [ 'expectedOutputs': { 'reduceLogSumExpOutput': { 'data': 10.39477825164795, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -533,7 +533,7 @@ const reduceLogSumExpTests = [ 6.802876949310303, 5.234325408935547, 8.914905548095703, 9.166799545288086, 5.717507362365723, 0.3255050778388977 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -547,7 +547,7 @@ const reduceLogSumExpTests = [ 'expectedOutputs': { 'reduceLogSumExpOutput': { 'data': [10.39477825164795], - 'descriptor': {'dimensions': [1, 1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float32'} } } } @@ -568,7 +568,7 @@ const reduceLogSumExpTests = [ 6.802876949310303, 5.234325408935547, 8.914905548095703, 9.166799545288086, 5.717507362365723, 0.3255050778388977 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -585,7 +585,7 @@ const reduceLogSumExpTests = [ 8.563796997070312, 5.500619411468506, 9.753945350646973, 9.20864486694336 ], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} } } } @@ -606,7 +606,7 @@ const reduceLogSumExpTests = [ 6.802876949310303, 5.234325408935547, 8.914905548095703, 9.166799545288086, 5.717507362365723, 0.3255050778388977 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -623,7 +623,7 @@ const reduceLogSumExpTests = [ 8.563796997070312, 5.500619411468506, 9.753945350646973, 9.20864486694336 ], - 'descriptor': {'dimensions': [2, 1, 2, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 2, 1], dataType: 'float32'} } } } 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 index 709b25b0ad31..5096e553239c 100644 --- 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 @@ -33,7 +33,7 @@ const reduceMaxTests = [ 'inputs': { 'reduceMaxInput': { 'data': [32.16658401489258], - 'descriptor': {'dimensions': [], 'dataType': 'float32'}, + 'descriptor': {shape: [], dataType: 'float32'}, 'constant': true } }, @@ -45,7 +45,7 @@ const reduceMaxTests = [ 'expectedOutputs': { 'reduceMaxOutput': { 'data': 32.16658401489258, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -56,7 +56,7 @@ const reduceMaxTests = [ 'inputs': { 'reduceMaxInput': { 'data': [32.16658401489258], - 'descriptor': {'dimensions': [], 'dataType': 'float32'}, + 'descriptor': {shape: [], dataType: 'float32'}, 'constant': true } }, @@ -68,7 +68,7 @@ const reduceMaxTests = [ 'expectedOutputs': { 'reduceMaxOutput': { 'data': 32.16658401489258, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -88,7 +88,7 @@ const reduceMaxTests = [ -72.86485290527344, -46.03200912475586, 20.253753662109375, -21.557384490966797, -51.28727340698242, -42.58832931518555 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -100,7 +100,7 @@ const reduceMaxTests = [ 'expectedOutputs': { 'reduceMaxOutput': { 'data': 99.77313232421875, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -120,7 +120,7 @@ const reduceMaxTests = [ -72.86485290527344, -46.03200912475586, 20.253753662109375, -21.557384490966797, -51.28727340698242, -42.58832931518555 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -131,7 +131,7 @@ const reduceMaxTests = [ 'expectedOutputs': { 'reduceMaxOutput': { 'data': 99.77313232421875, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -151,7 +151,7 @@ const reduceMaxTests = [ -72.86485290527344, -46.03200912475586, 20.253753662109375, -21.557384490966797, -51.28727340698242, -42.58832931518555 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -162,7 +162,7 @@ const reduceMaxTests = [ 'expectedOutputs': { 'reduceMaxOutput': { 'data': 99.77313232421875, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -182,7 +182,7 @@ const reduceMaxTests = [ -72.86485290527344, -46.03200912475586, 20.253753662109375, -21.557384490966797, -51.28727340698242, -42.58832931518555 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -193,7 +193,7 @@ const reduceMaxTests = [ 'expectedOutputs': { 'reduceMaxOutput': { 'data': 99.77313232421875, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -213,7 +213,7 @@ const reduceMaxTests = [ -72.86485290527344, -46.03200912475586, 20.253753662109375, -21.557384490966797, -51.28727340698242, -42.58832931518555 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -224,7 +224,7 @@ const reduceMaxTests = [ 'expectedOutputs': { 'reduceMaxOutput': { 'data': 99.77313232421875, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -244,7 +244,7 @@ const reduceMaxTests = [ -72.86485290527344, -46.03200912475586, 20.253753662109375, -21.557384490966797, -51.28727340698242, -42.58832931518555 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } }, 'operators': [{ @@ -255,7 +255,7 @@ const reduceMaxTests = [ 'expectedOutputs': { 'reduceMaxOutput': { 'data': 99.77313232421875, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -275,7 +275,7 @@ const reduceMaxTests = [ -72.86485290527344, -46.03200912475586, 20.253753662109375, -21.557384490966797, -51.28727340698242, -42.58832931518555 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -289,7 +289,7 @@ const reduceMaxTests = [ 90.42288208007812, 75.90379333496094, 94.99645233154297, 96.55397033691406, 99.77313232421875, 20.253753662109375 ], - 'descriptor': {'dimensions': [2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3], dataType: 'float32'} } } } @@ -309,7 +309,7 @@ const reduceMaxTests = [ -72.86485290527344, -46.03200912475586, 20.253753662109375, -21.557384490966797, -51.28727340698242, -42.58832931518555 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -324,7 +324,7 @@ const reduceMaxTests = [ 62.504642486572266, 96.55397033691406, 99.77313232421875, -21.557384490966797, 94.99645233154297, 37.28493118286133 ], - 'descriptor': {'dimensions': [2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3], dataType: 'float32'} } } } @@ -344,7 +344,7 @@ const reduceMaxTests = [ -72.86485290527344, -46.03200912475586, 20.253753662109375, -21.557384490966797, -51.28727340698242, -42.58832931518555 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -357,7 +357,7 @@ const reduceMaxTests = [ 'expectedOutputs': { 'reduceMaxOutput': { 'data': 99.77313232421875, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -377,7 +377,7 @@ const reduceMaxTests = [ -72.86485290527344, -46.03200912475586, 20.253753662109375, -21.557384490966797, -51.28727340698242, -42.58832931518555 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -390,7 +390,7 @@ const reduceMaxTests = [ 'expectedOutputs': { 'reduceMaxOutput': { 'data': [99.77313232421875], - 'descriptor': {'dimensions': [1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1], dataType: 'float32'} } } } @@ -410,7 +410,7 @@ const reduceMaxTests = [ -72.86485290527344, -46.03200912475586, 20.253753662109375, -21.557384490966797, -51.28727340698242, -42.58832931518555 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -423,7 +423,7 @@ const reduceMaxTests = [ 'expectedOutputs': { 'reduceMaxOutput': { 'data': 99.77313232421875, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -443,7 +443,7 @@ const reduceMaxTests = [ -72.86485290527344, -46.03200912475586, 20.253753662109375, -21.557384490966797, -51.28727340698242, -42.58832931518555 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -456,7 +456,7 @@ const reduceMaxTests = [ 'expectedOutputs': { 'reduceMaxOutput': { 'data': [99.77313232421875], - 'descriptor': {'dimensions': [1, 1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float32'} } } } @@ -477,7 +477,7 @@ const reduceMaxTests = [ -72.86485290527344, -46.03200912475586, 20.253753662109375, -21.557384490966797, -51.28727340698242, -42.58832931518555 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -494,7 +494,7 @@ const reduceMaxTests = [ 90.42288208007812, 94.99645233154297, 96.55397033691406, 99.77313232421875 ], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} } } } @@ -515,7 +515,7 @@ const reduceMaxTests = [ -72.86485290527344, -46.03200912475586, 20.253753662109375, -21.557384490966797, -51.28727340698242, -42.58832931518555 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -532,7 +532,7 @@ const reduceMaxTests = [ 90.42288208007812, 94.99645233154297, 96.55397033691406, 99.77313232421875 ], - 'descriptor': {'dimensions': [2, 1, 2, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 2, 1], dataType: 'float32'} } } } 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 index 21fa1a5102c7..ee5bf3673c08 100644 --- 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 @@ -33,7 +33,7 @@ const reduceMeanTests = [ 'inputs': { 'reduceMeanInput': { 'data': [95.84498596191406], - 'descriptor': {'dimensions': [], 'dataType': 'float32'}, + 'descriptor': {shape: [], dataType: 'float32'}, 'constant': true } }, @@ -45,7 +45,7 @@ const reduceMeanTests = [ 'expectedOutputs': { 'reduceMeanOutput': { 'data': 95.84498596191406, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -56,7 +56,7 @@ const reduceMeanTests = [ 'inputs': { 'reduceMeanInput': { 'data': [95.84498596191406], - 'descriptor': {'dimensions': [], 'dataType': 'float32'}, + 'descriptor': {shape: [], dataType: 'float32'}, 'constant': true } }, @@ -68,7 +68,7 @@ const reduceMeanTests = [ 'expectedOutputs': { 'reduceMeanOutput': { 'data': 95.84498596191406, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -89,7 +89,7 @@ const reduceMeanTests = [ 58.56523132324219, 28.673492431640625, 42.13419723510742, 21.63775062561035, 14.160697937011719, 15.127351760864258 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -101,7 +101,7 @@ const reduceMeanTests = [ 'expectedOutputs': { 'reduceMeanOutput': { 'data': 40.31047439575195, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -121,7 +121,7 @@ const reduceMeanTests = [ 58.56523132324219, 28.673492431640625, 42.13419723510742, 21.63775062561035, 14.160697937011719, 15.127351760864258 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -132,7 +132,7 @@ const reduceMeanTests = [ 'expectedOutputs': { 'reduceMeanOutput': { 'data': 40.31047439575195, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -152,7 +152,7 @@ const reduceMeanTests = [ -21.981258392333984, -61.31269454956055, -58.598960876464844, -76.02980041503906, -23.91740608215332, -22.94187355041504 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -163,7 +163,7 @@ const reduceMeanTests = [ 'expectedOutputs': { 'reduceMeanOutput': { 'data': -34.74319839477539, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -178,7 +178,7 @@ const reduceMeanTests = [ 42, 24, 44, 38, 82, 93, 64, 40, 48, 78, 81, 59, 45, 18, 3, 77, 60, 19, 66, 8, 21, 19, 62, 71 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -189,7 +189,7 @@ const reduceMeanTests = [ 'expectedOutputs': { 'reduceMeanOutput': { 'data': 48.41666793823242, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -204,7 +204,7 @@ const reduceMeanTests = [ -73, -8, -55, -73, -61, -54, -5, -39, -66, -53, -57, -39, -62, -98, -36, -1, -75, -8, -71, -72, -67, -16, -21, -31 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -215,7 +215,7 @@ const reduceMeanTests = [ 'expectedOutputs': { 'reduceMeanOutput': { 'data': -47.54166793823242, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -235,7 +235,7 @@ const reduceMeanTests = [ 58.56523132324219, 28.673492431640625, 42.13419723510742, 21.63775062561035, 14.160697937011719, 15.127351760864258 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -246,7 +246,7 @@ const reduceMeanTests = [ 'expectedOutputs': { 'reduceMeanOutput': { 'data': 40.31047439575195, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -266,7 +266,7 @@ const reduceMeanTests = [ 58.56523132324219, 28.673492431640625, 42.13419723510742, 21.63775062561035, 14.160697937011719, 15.127351760864258 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -277,7 +277,7 @@ const reduceMeanTests = [ 'expectedOutputs': { 'reduceMeanOutput': { 'data': 40.31047439575195, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -297,7 +297,7 @@ const reduceMeanTests = [ 58.56523132324219, 28.673492431640625, 42.13419723510742, 21.63775062561035, 14.160697937011719, 15.127351760864258 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -308,7 +308,7 @@ const reduceMeanTests = [ 'expectedOutputs': { 'reduceMeanOutput': { 'data': 40.31047439575195, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -328,7 +328,7 @@ const reduceMeanTests = [ 58.56523132324219, 28.673492431640625, 42.13419723510742, 21.63775062561035, 14.160697937011719, 15.127351760864258 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } }, 'operators': [{ @@ -339,7 +339,7 @@ const reduceMeanTests = [ 'expectedOutputs': { 'reduceMeanOutput': { 'data': 40.31047439575195, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -359,7 +359,7 @@ const reduceMeanTests = [ 58.56523132324219, 28.673492431640625, 42.13419723510742, 21.63775062561035, 14.160697937011719, 15.127351760864258 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -373,7 +373,7 @@ const reduceMeanTests = [ 45.46687316894531, 49.670711517333984, 50.94768142700195, 44.734745025634766, 27.777833938598633, 23.264999389648438 ], - 'descriptor': {'dimensions': [2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3], dataType: 'float32'} } } } @@ -393,7 +393,7 @@ const reduceMeanTests = [ 58.56523132324219, 28.673492431640625, 42.13419723510742, 21.63775062561035, 14.160697937011719, 15.127351760864258 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -408,7 +408,7 @@ const reduceMeanTests = [ 54.82453536987305, 40.251548767089844, 22.060470581054688, 48.58541488647461, 51.343353271484375, 24.797523498535156 ], - 'descriptor': {'dimensions': [2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3], dataType: 'float32'} } } } @@ -428,7 +428,7 @@ const reduceMeanTests = [ 58.56523132324219, 28.673492431640625, 42.13419723510742, 21.63775062561035, 14.160697937011719, 15.127351760864258 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -441,7 +441,7 @@ const reduceMeanTests = [ 'expectedOutputs': { 'reduceMeanOutput': { 'data': 40.31047439575195, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -461,7 +461,7 @@ const reduceMeanTests = [ 58.56523132324219, 28.673492431640625, 42.13419723510742, 21.63775062561035, 14.160697937011719, 15.127351760864258 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -474,7 +474,7 @@ const reduceMeanTests = [ 'expectedOutputs': { 'reduceMeanOutput': { 'data': [40.31047439575195], - 'descriptor': {'dimensions': [1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1], dataType: 'float32'} } } } @@ -494,7 +494,7 @@ const reduceMeanTests = [ 58.56523132324219, 28.673492431640625, 42.13419723510742, 21.63775062561035, 14.160697937011719, 15.127351760864258 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -507,7 +507,7 @@ const reduceMeanTests = [ 'expectedOutputs': { 'reduceMeanOutput': { 'data': 40.31047439575195, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -527,7 +527,7 @@ const reduceMeanTests = [ 58.56523132324219, 28.673492431640625, 42.13419723510742, 21.63775062561035, 14.160697937011719, 15.127351760864258 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -540,7 +540,7 @@ const reduceMeanTests = [ 'expectedOutputs': { 'reduceMeanOutput': { 'data': [40.31047439575195], - 'descriptor': {'dimensions': [1, 1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float32'} } } } @@ -561,7 +561,7 @@ const reduceMeanTests = [ 58.56523132324219, 28.673492431640625, 42.13419723510742, 21.63775062561035, 14.160697937011719, 15.127351760864258 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -578,7 +578,7 @@ const reduceMeanTests = [ 52.287559509277344, 45.10261917114258, 47.640018463134766, 16.211700439453125 ], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} } } } @@ -599,7 +599,7 @@ const reduceMeanTests = [ 58.56523132324219, 28.673492431640625, 42.13419723510742, 21.63775062561035, 14.160697937011719, 15.127351760864258 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -616,7 +616,7 @@ const reduceMeanTests = [ 52.287559509277344, 45.10261917114258, 47.640018463134766, 16.211700439453125 ], - 'descriptor': {'dimensions': [2, 1, 2, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 2, 1], dataType: 'float32'} } } } 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 index 6cc38d6a0782..7a5989045db8 100644 --- 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 @@ -33,7 +33,7 @@ const reduceMinTests = [ 'inputs': { 'reduceMinInput': { 'data': [-58.76195526123047], - 'descriptor': {'dimensions': [], 'dataType': 'float32'}, + 'descriptor': {shape: [], dataType: 'float32'}, 'constant': true } }, @@ -45,7 +45,7 @@ const reduceMinTests = [ 'expectedOutputs': { 'reduceMinOutput': { 'data': -58.76195526123047, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -56,7 +56,7 @@ const reduceMinTests = [ 'inputs': { 'reduceMinInput': { 'data': [-58.76195526123047], - 'descriptor': {'dimensions': [], 'dataType': 'float32'}, + 'descriptor': {shape: [], dataType: 'float32'}, 'constant': true } }, @@ -68,7 +68,7 @@ const reduceMinTests = [ 'expectedOutputs': { 'reduceMinOutput': { 'data': -58.76195526123047, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -88,7 +88,7 @@ const reduceMinTests = [ -59.40851974487305, -84.4076919555664, 75.88834381103516, 96.02651977539062, -55.97655487060547, -1.7911018133163452 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -100,7 +100,7 @@ const reduceMinTests = [ 'expectedOutputs': { 'reduceMinOutput': { 'data': -87.9623031616211, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -120,7 +120,7 @@ const reduceMinTests = [ -59.40851974487305, -84.4076919555664, 75.88834381103516, 96.02651977539062, -55.97655487060547, -1.7911018133163452 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -131,7 +131,7 @@ const reduceMinTests = [ 'expectedOutputs': { 'reduceMinOutput': { 'data': -87.9623031616211, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -151,7 +151,7 @@ const reduceMinTests = [ -59.40851974487305, -84.4076919555664, 75.88834381103516, 96.02651977539062, -55.97655487060547, -1.7911018133163452 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -162,7 +162,7 @@ const reduceMinTests = [ 'expectedOutputs': { 'reduceMinOutput': { 'data': -87.9623031616211, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -182,7 +182,7 @@ const reduceMinTests = [ -59.40851974487305, -84.4076919555664, 75.88834381103516, 96.02651977539062, -55.97655487060547, -1.7911018133163452 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -193,7 +193,7 @@ const reduceMinTests = [ 'expectedOutputs': { 'reduceMinOutput': { 'data': -87.9623031616211, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -213,7 +213,7 @@ const reduceMinTests = [ -59.40851974487305, -84.4076919555664, 75.88834381103516, 96.02651977539062, -55.97655487060547, -1.7911018133163452 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -224,7 +224,7 @@ const reduceMinTests = [ 'expectedOutputs': { 'reduceMinOutput': { 'data': -87.9623031616211, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -244,7 +244,7 @@ const reduceMinTests = [ -59.40851974487305, -84.4076919555664, 75.88834381103516, 96.02651977539062, -55.97655487060547, -1.7911018133163452 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } }, 'operators': [{ @@ -255,7 +255,7 @@ const reduceMinTests = [ 'expectedOutputs': { 'reduceMinOutput': { 'data': -87.9623031616211, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -275,7 +275,7 @@ const reduceMinTests = [ -59.40851974487305, -84.4076919555664, 75.88834381103516, 96.02651977539062, -55.97655487060547, -1.7911018133163452 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -289,7 +289,7 @@ const reduceMinTests = [ -87.9623031616211, -39.50931167602539, -53.747413635253906, -31.713542938232422, -84.4076919555664, -55.97655487060547 ], - 'descriptor': {'dimensions': [2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3], dataType: 'float32'} } } } @@ -309,7 +309,7 @@ const reduceMinTests = [ -59.40851974487305, -84.4076919555664, 75.88834381103516, 96.02651977539062, -55.97655487060547, -1.7911018133163452 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -324,7 +324,7 @@ const reduceMinTests = [ -58.76195526123047, -87.9623031616211, -70.13690185546875, -59.40851974487305, -84.4076919555664, -53.747413635253906 ], - 'descriptor': {'dimensions': [2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3], dataType: 'float32'} } } } @@ -344,7 +344,7 @@ const reduceMinTests = [ -59.40851974487305, -84.4076919555664, 75.88834381103516, 96.02651977539062, -55.97655487060547, -1.7911018133163452 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -357,7 +357,7 @@ const reduceMinTests = [ 'expectedOutputs': { 'reduceMinOutput': { 'data': -87.9623031616211, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -377,7 +377,7 @@ const reduceMinTests = [ -59.40851974487305, -84.4076919555664, 75.88834381103516, 96.02651977539062, -55.97655487060547, -1.7911018133163452 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -390,7 +390,7 @@ const reduceMinTests = [ 'expectedOutputs': { 'reduceMinOutput': { 'data': [-87.9623031616211], - 'descriptor': {'dimensions': [1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1], dataType: 'float32'} } } } @@ -410,7 +410,7 @@ const reduceMinTests = [ -59.40851974487305, -84.4076919555664, 75.88834381103516, 96.02651977539062, -55.97655487060547, -1.7911018133163452 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -423,7 +423,7 @@ const reduceMinTests = [ 'expectedOutputs': { 'reduceMinOutput': { 'data': -87.9623031616211, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -443,7 +443,7 @@ const reduceMinTests = [ -59.40851974487305, -84.4076919555664, 75.88834381103516, 96.02651977539062, -55.97655487060547, -1.7911018133163452 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -456,7 +456,7 @@ const reduceMinTests = [ 'expectedOutputs': { 'reduceMinOutput': { 'data': [-87.9623031616211], - 'descriptor': {'dimensions': [1, 1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float32'} } } } @@ -477,7 +477,7 @@ const reduceMinTests = [ -59.40851974487305, -84.4076919555664, 75.88834381103516, 96.02651977539062, -55.97655487060547, -1.7911018133163452 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -494,7 +494,7 @@ const reduceMinTests = [ -87.9623031616211, -53.747413635253906, -84.4076919555664, -55.97655487060547 ], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} } } } @@ -515,7 +515,7 @@ const reduceMinTests = [ -59.40851974487305, -84.4076919555664, 75.88834381103516, 96.02651977539062, -55.97655487060547, -1.7911018133163452 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -532,7 +532,7 @@ const reduceMinTests = [ -87.9623031616211, -53.747413635253906, -84.4076919555664, -55.97655487060547 ], - 'descriptor': {'dimensions': [2, 1, 2, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 2, 1], dataType: 'float32'} } } } 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 index 745f83b3ceab..1a2e23c4f76e 100644 --- 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 @@ -34,7 +34,7 @@ const reduceProductTests = [ 'inputs': { 'reduceProductInput': { 'data': [-68.75911712646484], - 'descriptor': {'dimensions': [], 'dataType': 'float32'}, + 'descriptor': {shape: [], dataType: 'float32'}, 'constant': true } }, @@ -46,7 +46,7 @@ const reduceProductTests = [ 'expectedOutputs': { 'reduceProductOutput': { 'data': -68.75911712646484, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -57,7 +57,7 @@ const reduceProductTests = [ 'inputs': { 'reduceProductInput': { 'data': [-68.75911712646484], - 'descriptor': {'dimensions': [], 'dataType': 'float32'}, + 'descriptor': {shape: [], dataType: 'float32'}, 'constant': true } }, @@ -70,7 +70,7 @@ const reduceProductTests = [ 'expectedOutputs': { 'reduceProductOutput': { 'data': -68.75911712646484, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -90,7 +90,7 @@ const reduceProductTests = [ -85.19523620605469, -18.16986083984375, 64.83759307861328, -14.95883846282959, -74.50932312011719, -11.319679260253906 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -102,7 +102,7 @@ const reduceProductTests = [ 'expectedOutputs': { 'reduceProductOutput': { 'data': 1.5855958784642327e+37, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -122,7 +122,7 @@ const reduceProductTests = [ -85.19523620605469, -18.16986083984375, 64.83759307861328, -14.95883846282959, -74.50932312011719, -11.319679260253906 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -133,7 +133,7 @@ const reduceProductTests = [ 'expectedOutputs': { 'reduceProductOutput': { 'data': 1.5855958784642327e+37, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -153,7 +153,7 @@ const reduceProductTests = [ -85.19523620605469, -18.16986083984375, 64.83759307861328, -14.95883846282959, -74.50932312011719, -11.319679260253906 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -164,7 +164,7 @@ const reduceProductTests = [ 'expectedOutputs': { 'reduceProductOutput': { 'data': 1.5855958784642327e+37, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -184,7 +184,7 @@ const reduceProductTests = [ -85.19523620605469, -18.16986083984375, 64.83759307861328, -14.95883846282959, -74.50932312011719, -11.319679260253906 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -195,7 +195,7 @@ const reduceProductTests = [ 'expectedOutputs': { 'reduceProductOutput': { 'data': 1.5855958784642327e+37, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -215,7 +215,7 @@ const reduceProductTests = [ -85.19523620605469, -18.16986083984375, 64.83759307861328, -14.95883846282959, -74.50932312011719, -11.319679260253906 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -226,7 +226,7 @@ const reduceProductTests = [ 'expectedOutputs': { 'reduceProductOutput': { 'data': 1.5855958784642327e+37, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -246,7 +246,7 @@ const reduceProductTests = [ -85.19523620605469, -18.16986083984375, 64.83759307861328, -14.95883846282959, -74.50932312011719, -11.319679260253906 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } }, 'operators': [{ @@ -257,7 +257,7 @@ const reduceProductTests = [ 'expectedOutputs': { 'reduceProductOutput': { 'data': 1.5855958784642327e+37, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -277,7 +277,7 @@ const reduceProductTests = [ -85.19523620605469, -18.16986083984375, 64.83759307861328, -14.95883846282959, -74.50932312011719, -11.319679260253906 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -292,7 +292,7 @@ const reduceProductTests = [ 7519895, -1292816.375, 2441721.75, -110637.7734375, -7380313.5, -818030.5 ], - 'descriptor': {'dimensions': [2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3], dataType: 'float32'} } } } @@ -312,7 +312,7 @@ const reduceProductTests = [ -85.19523620605469, -18.16986083984375, 64.83759307861328, -14.95883846282959, -74.50932312011719, -11.319679260253906 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -327,7 +327,7 @@ const reduceProductTests = [ 4227263.5, -446960.5625, 3811296.75, 1280298.5, -1343475.375, 1280118.75 ], - 'descriptor': {'dimensions': [2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3], dataType: 'float32'} } } } @@ -347,7 +347,7 @@ const reduceProductTests = [ -85.19523620605469, -18.16986083984375, 64.83759307861328, -14.95883846282959, -74.50932312011719, -11.319679260253906 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -361,7 +361,7 @@ const reduceProductTests = [ 'expectedOutputs': { 'reduceProductOutput': { 'data': 1.5855958784642327e+37, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -381,7 +381,7 @@ const reduceProductTests = [ -85.19523620605469, -18.16986083984375, 64.83759307861328, -14.95883846282959, -74.50932312011719, -11.319679260253906 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -394,7 +394,7 @@ const reduceProductTests = [ 'expectedOutputs': { 'reduceProductOutput': { 'data': [1.5855958784642327e+37], - 'descriptor': {'dimensions': [1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1], dataType: 'float32'} } } } @@ -414,7 +414,7 @@ const reduceProductTests = [ -85.19523620605469, -18.16986083984375, 64.83759307861328, -14.95883846282959, -74.50932312011719, -11.319679260253906 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -428,7 +428,7 @@ const reduceProductTests = [ 'expectedOutputs': { 'reduceProductOutput': { 'data': 1.5855958784642327e+37, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -448,7 +448,7 @@ const reduceProductTests = [ -85.19523620605469, -18.16986083984375, 64.83759307861328, -14.95883846282959, -74.50932312011719, -11.319679260253906 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -461,7 +461,7 @@ const reduceProductTests = [ 'expectedOutputs': { 'reduceProductOutput': { 'data': [1.5855958784642327e+37], - 'descriptor': {'dimensions': [1, 1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float32'} } } } @@ -482,7 +482,7 @@ const reduceProductTests = [ -85.19523620605469, -18.16986083984375, 64.83759307861328, -14.95883846282959, -74.50932312011719, -11.319679260253906 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -496,7 +496,7 @@ const reduceProductTests = [ 'expectedOutputs': { 'reduceProductOutput': { 'data': [-3638925568, 6523364352, -414643360, 1610916352], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} } } } @@ -517,7 +517,7 @@ const reduceProductTests = [ -85.19523620605469, -18.16986083984375, 64.83759307861328, -14.95883846282959, -74.50932312011719, -11.319679260253906 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -531,7 +531,7 @@ const reduceProductTests = [ 'expectedOutputs': { 'reduceProductOutput': { 'data': [-3638925568, 6523364352, -414643360, 1610916352], - 'descriptor': {'dimensions': [2, 1, 2, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 2, 1], dataType: 'float32'} } } } 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 index 9aec31d3f682..6b9180274555 100644 --- 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 @@ -33,7 +33,7 @@ const reduceSumTests = [ 'inputs': { 'reduceSumInput': { 'data': [69.6038589477539], - 'descriptor': {'dimensions': [], 'dataType': 'float32'}, + 'descriptor': {shape: [], dataType: 'float32'}, 'constant': true } }, @@ -45,7 +45,7 @@ const reduceSumTests = [ 'expectedOutputs': { 'reduceSumOutput': { 'data': 69.6038589477539, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -56,7 +56,7 @@ const reduceSumTests = [ 'inputs': { 'reduceSumInput': { 'data': [69.6038589477539], - 'descriptor': {'dimensions': [], 'dataType': 'float32'}, + 'descriptor': {shape: [], dataType: 'float32'}, 'constant': true } }, @@ -68,7 +68,7 @@ const reduceSumTests = [ 'expectedOutputs': { 'reduceSumOutput': { 'data': 69.6038589477539, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -88,7 +88,7 @@ const reduceSumTests = [ 35.54289627075195, 42.856414794921875, 88.58631896972656, 98.85772705078125, 25.626853942871094, 60.1761360168457 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -100,7 +100,7 @@ const reduceSumTests = [ 'expectedOutputs': { 'reduceSumOutput': { 'data': 1313.87939453125, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -120,7 +120,7 @@ const reduceSumTests = [ 35.54289627075195, 42.856414794921875, 88.58631896972656, 98.85772705078125, 25.626853942871094, 60.1761360168457 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -131,7 +131,7 @@ const reduceSumTests = [ 'expectedOutputs': { 'reduceSumOutput': { 'data': 1313.87939453125, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -151,7 +151,7 @@ const reduceSumTests = [ -96.29924774169922, -68.46700286865234, -26.107192993164062, -68.0182113647461, -4.8330769538879395, -48.900699615478516 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -162,7 +162,7 @@ const reduceSumTests = [ 'expectedOutputs': { 'reduceSumOutput': { 'data': -1163.642578125, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -176,7 +176,7 @@ const reduceSumTests = [ 56, 90, 67, 33, 20, 58, 22, 15, 86, 79, 59, 99, 16, 95, 67, 11, 60, 89, 50, 57, 77, 89, 10, 2 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -185,10 +185,8 @@ const reduceSumTests = [ 'outputs': 'reduceSumOutput' }], 'expectedOutputs': { - 'reduceSumOutput': { - 'data': 1307, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} - } + 'reduceSumOutput': + {'data': 1307, 'descriptor': {shape: [], dataType: 'float32'}} } } }, @@ -201,7 +199,7 @@ const reduceSumTests = [ -55, -36, -74, -17, -67, -95, -3, -67, -95, -13, -45, -9, -33, -98, -86, -11, -70, -44, -31, -68, -79, -24, -60, -36 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -210,10 +208,8 @@ const reduceSumTests = [ 'outputs': 'reduceSumOutput' }], 'expectedOutputs': { - 'reduceSumOutput': { - 'data': -1216, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} - } + 'reduceSumOutput': + {'data': -1216, 'descriptor': {shape: [], dataType: 'float32'}} } } }, @@ -232,7 +228,7 @@ const reduceSumTests = [ 35.54289627075195, 42.856414794921875, 88.58631896972656, 98.85772705078125, 25.626853942871094, 60.1761360168457 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -243,7 +239,7 @@ const reduceSumTests = [ 'expectedOutputs': { 'reduceSumOutput': { 'data': 1313.87939453125, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -263,7 +259,7 @@ const reduceSumTests = [ 35.54289627075195, 42.856414794921875, 88.58631896972656, 98.85772705078125, 25.626853942871094, 60.1761360168457 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -274,7 +270,7 @@ const reduceSumTests = [ 'expectedOutputs': { 'reduceSumOutput': { 'data': 1313.87939453125, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -294,7 +290,7 @@ const reduceSumTests = [ 35.54289627075195, 42.856414794921875, 88.58631896972656, 98.85772705078125, 25.626853942871094, 60.1761360168457 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -305,7 +301,7 @@ const reduceSumTests = [ 'expectedOutputs': { 'reduceSumOutput': { 'data': 1313.87939453125, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -325,7 +321,7 @@ const reduceSumTests = [ 35.54289627075195, 42.856414794921875, 88.58631896972656, 98.85772705078125, 25.626853942871094, 60.1761360168457 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } }, 'operators': [{ @@ -336,7 +332,7 @@ const reduceSumTests = [ 'expectedOutputs': { 'reduceSumOutput': { 'data': 1313.87939453125, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -356,7 +352,7 @@ const reduceSumTests = [ 35.54289627075195, 42.856414794921875, 88.58631896972656, 98.85772705078125, 25.626853942871094, 60.1761360168457 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -370,7 +366,7 @@ const reduceSumTests = [ 210.44241333007812, 104.54179382324219, 226.2177734375, 239.025390625, 260.405029296875, 273.2470397949219 ], - 'descriptor': {'dimensions': [2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3], dataType: 'float32'} } } } @@ -390,7 +386,7 @@ const reduceSumTests = [ 35.54289627075195, 42.856414794921875, 88.58631896972656, 98.85772705078125, 25.626853942871094, 60.1761360168457 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -405,7 +401,7 @@ const reduceSumTests = [ 179.63900756835938, 260.37457275390625, 219.3611297607422, 246.83712768554688, 157.4895782470703, 250.1780242919922 ], - 'descriptor': {'dimensions': [2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3], dataType: 'float32'} } } } @@ -425,7 +421,7 @@ const reduceSumTests = [ 35.54289627075195, 42.856414794921875, 88.58631896972656, 98.85772705078125, 25.626853942871094, 60.1761360168457 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -438,7 +434,7 @@ const reduceSumTests = [ 'expectedOutputs': { 'reduceSumOutput': { 'data': 1313.87939453125, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -458,7 +454,7 @@ const reduceSumTests = [ 35.54289627075195, 42.856414794921875, 88.58631896972656, 98.85772705078125, 25.626853942871094, 60.1761360168457 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -471,7 +467,7 @@ const reduceSumTests = [ 'expectedOutputs': { 'reduceSumOutput': { 'data': [1313.87939453125], - 'descriptor': {'dimensions': [1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1], dataType: 'float32'} } } } @@ -491,7 +487,7 @@ const reduceSumTests = [ 35.54289627075195, 42.856414794921875, 88.58631896972656, 98.85772705078125, 25.626853942871094, 60.1761360168457 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -504,7 +500,7 @@ const reduceSumTests = [ 'expectedOutputs': { 'reduceSumOutput': { 'data': 1313.87939453125, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -524,7 +520,7 @@ const reduceSumTests = [ 35.54289627075195, 42.856414794921875, 88.58631896972656, 98.85772705078125, 25.626853942871094, 60.1761360168457 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -537,7 +533,7 @@ const reduceSumTests = [ 'expectedOutputs': { 'reduceSumOutput': { 'data': [1313.87939453125], - 'descriptor': {'dimensions': [1, 1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float32'} } } } @@ -558,7 +554,7 @@ const reduceSumTests = [ 35.54289627075195, 42.856414794921875, 88.58631896972656, 98.85772705078125, 25.626853942871094, 60.1761360168457 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -575,7 +571,7 @@ const reduceSumTests = [ 355.21942138671875, 185.98255920410156, 362.3598937988281, 410.3175354003906 ], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} } } } @@ -596,7 +592,7 @@ const reduceSumTests = [ 35.54289627075195, 42.856414794921875, 88.58631896972656, 98.85772705078125, 25.626853942871094, 60.1761360168457 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -613,7 +609,7 @@ const reduceSumTests = [ 355.21942138671875, 185.98255920410156, 362.3598937988281, 410.3175354003906 ], - 'descriptor': {'dimensions': [2, 1, 2, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 2, 1], dataType: 'float32'} } } } 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 index 10930c44c6e7..0f92d817e615 100644 --- 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 @@ -34,7 +34,7 @@ const reduceSumSquareTests = [ 'inputs': { 'reduceSumSquareInput': { 'data': [52.5615348815918], - 'descriptor': {'dimensions': [], 'dataType': 'float32'}, + 'descriptor': {shape: [], dataType: 'float32'}, 'constant': true } }, @@ -46,7 +46,7 @@ const reduceSumSquareTests = [ 'expectedOutputs': { 'reduceSumSquareOutput': { 'data': 2762.71484375, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -57,7 +57,7 @@ const reduceSumSquareTests = [ 'inputs': { 'reduceSumSquareInput': { 'data': [52.5615348815918], - 'descriptor': {'dimensions': [], 'dataType': 'float32'}, + 'descriptor': {shape: [], dataType: 'float32'}, 'constant': true } }, @@ -70,7 +70,7 @@ const reduceSumSquareTests = [ 'expectedOutputs': { 'reduceSumSquareOutput': { 'data': 2762.71484375, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -91,7 +91,7 @@ const reduceSumSquareTests = [ 6.654552936553955, 85.79743957519531, 89.91349029541016, 53.55647277832031, 39.48537063598633, 3.9460408687591553 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -103,7 +103,7 @@ const reduceSumSquareTests = [ 'expectedOutputs': { 'reduceSumSquareOutput': { 'data': 73275.859375, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -123,7 +123,7 @@ const reduceSumSquareTests = [ 6.654552936553955, 85.79743957519531, 89.91349029541016, 53.55647277832031, 39.48537063598633, 3.9460408687591553 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -134,7 +134,7 @@ const reduceSumSquareTests = [ 'expectedOutputs': { 'reduceSumSquareOutput': { 'data': 73275.859375, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -154,7 +154,7 @@ const reduceSumSquareTests = [ -98.22420501708984, -60.272953033447266, -74.73202514648438, -8.543684005737305, -59.888736724853516, -17.99894142150879 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -165,7 +165,7 @@ const reduceSumSquareTests = [ 'expectedOutputs': { 'reduceSumSquareOutput': { 'data': 80052.015625, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -180,7 +180,7 @@ const reduceSumSquareTests = [ 52, 48, 2, 66, 30, 39, 14, 23, 81, 94, 78, 64, 38, 16, 63, 11, 46, 95, 17, 47, 40, 53, 87, 43 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -189,10 +189,8 @@ const reduceSumSquareTests = [ 'outputs': 'reduceSumSquareOutput' }], 'expectedOutputs': { - 'reduceSumSquareOutput': { - 'data': 71347, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} - } + 'reduceSumSquareOutput': + {'data': 71347, 'descriptor': {shape: [], dataType: 'float32'}} } } }, @@ -206,7 +204,7 @@ const reduceSumSquareTests = [ -10, -60, -69, -88, -35, -84, -74, -42, -93, -26, -40, -55, -92, -26, -39, -30, -61, -16, -16, -36, -9, -89, -45, -29 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -215,10 +213,8 @@ const reduceSumSquareTests = [ 'outputs': 'reduceSumSquareOutput' }], 'expectedOutputs': { - 'reduceSumSquareOutput': { - 'data': 73634, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} - } + 'reduceSumSquareOutput': + {'data': 73634, 'descriptor': {shape: [], dataType: 'float32'}} } } }, @@ -226,10 +222,8 @@ const reduceSumSquareTests = [ 'name': 'reduceSumSquare float32 1D tensor with empty axes', 'graph': { 'inputs': { - 'reduceSumSquareInput': { - 'data': [2, 3], - 'descriptor': {'dimensions': [2], 'dataType': 'float32'} - } + 'reduceSumSquareInput': + {'data': [2, 3], 'descriptor': {shape: [2], dataType: 'float32'}} }, 'operators': [{ 'name': 'reduceSumSquare', @@ -238,10 +232,8 @@ const reduceSumSquareTests = [ 'outputs': 'reduceSumSquareOutput' }], 'expectedOutputs': { - 'reduceSumSquareOutput': { - 'data': [4, 9], - 'descriptor': {'dimensions': [2], 'dataType': 'float32'} - } + 'reduceSumSquareOutput': + {'data': [4, 9], 'descriptor': {shape: [2], dataType: 'float32'}} } } }, @@ -260,7 +252,7 @@ const reduceSumSquareTests = [ 6.654552936553955, 85.79743957519531, 89.91349029541016, 53.55647277832031, 39.48537063598633, 3.9460408687591553 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -271,7 +263,7 @@ const reduceSumSquareTests = [ 'expectedOutputs': { 'reduceSumSquareOutput': { 'data': 73275.859375, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -291,7 +283,7 @@ const reduceSumSquareTests = [ 6.654552936553955, 85.79743957519531, 89.91349029541016, 53.55647277832031, 39.48537063598633, 3.9460408687591553 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -302,7 +294,7 @@ const reduceSumSquareTests = [ 'expectedOutputs': { 'reduceSumSquareOutput': { 'data': 73275.859375, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -322,7 +314,7 @@ const reduceSumSquareTests = [ 6.654552936553955, 85.79743957519531, 89.91349029541016, 53.55647277832031, 39.48537063598633, 3.9460408687591553 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -333,7 +325,7 @@ const reduceSumSquareTests = [ 'expectedOutputs': { 'reduceSumSquareOutput': { 'data': 73275.859375, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -353,7 +345,7 @@ const reduceSumSquareTests = [ 6.654552936553955, 85.79743957519531, 89.91349029541016, 53.55647277832031, 39.48537063598633, 3.9460408687591553 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } }, 'operators': [{ @@ -364,7 +356,7 @@ const reduceSumSquareTests = [ 'expectedOutputs': { 'reduceSumSquareOutput': { 'data': 73275.859375, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -384,7 +376,7 @@ const reduceSumSquareTests = [ 6.654552936553955, 85.79743957519531, 89.91349029541016, 53.55647277832031, 39.48537063598633, 3.9460408687591553 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -399,7 +391,7 @@ const reduceSumSquareTests = [ 9709.013671875, 10817.7685546875, 14548.470703125, 16385.8515625, 9287.357421875, 12527.3974609375 ], - 'descriptor': {'dimensions': [2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3], dataType: 'float32'} } } } @@ -419,7 +411,7 @@ const reduceSumSquareTests = [ 6.654552936553955, 85.79743957519531, 89.91349029541016, 53.55647277832031, 39.48537063598633, 3.9460408687591553 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -434,7 +426,7 @@ const reduceSumSquareTests = [ 8585.87109375, 7700.654296875, 19889.1796875, 7113.0439453125, 16775.708984375, 13211.3994140625 ], - 'descriptor': {'dimensions': [2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3], dataType: 'float32'} } } } @@ -454,7 +446,7 @@ const reduceSumSquareTests = [ 6.654552936553955, 85.79743957519531, 89.91349029541016, 53.55647277832031, 39.48537063598633, 3.9460408687591553 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -468,7 +460,7 @@ const reduceSumSquareTests = [ 'expectedOutputs': { 'reduceSumSquareOutput': { 'data': 73275.859375, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -488,7 +480,7 @@ const reduceSumSquareTests = [ 6.654552936553955, 85.79743957519531, 89.91349029541016, 53.55647277832031, 39.48537063598633, 3.9460408687591553 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -502,7 +494,7 @@ const reduceSumSquareTests = [ 'expectedOutputs': { 'reduceSumSquareOutput': { 'data': [73275.859375], - 'descriptor': {'dimensions': [1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1], dataType: 'float32'} } } } @@ -522,7 +514,7 @@ const reduceSumSquareTests = [ 6.654552936553955, 85.79743957519531, 89.91349029541016, 53.55647277832031, 39.48537063598633, 3.9460408687591553 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -536,7 +528,7 @@ const reduceSumSquareTests = [ 'expectedOutputs': { 'reduceSumSquareOutput': { 'data': 73275.859375, - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -556,7 +548,7 @@ const reduceSumSquareTests = [ 6.654552936553955, 85.79743957519531, 89.91349029541016, 53.55647277832031, 39.48537063598633, 3.9460408687591553 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -570,7 +562,7 @@ const reduceSumSquareTests = [ 'expectedOutputs': { 'reduceSumSquareOutput': { 'data': [73275.859375], - 'descriptor': {'dimensions': [1, 1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float32'} } } } @@ -591,7 +583,7 @@ const reduceSumSquareTests = [ 6.654552936553955, 85.79743957519531, 89.91349029541016, 53.55647277832031, 39.48537063598633, 3.9460408687591553 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -607,7 +599,7 @@ const reduceSumSquareTests = [ 'data': [ 12302.474609375, 22772.77734375, 26919.09765625, 11281.5068359375 ], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2], dataType: 'float32'} } } } @@ -628,7 +620,7 @@ const reduceSumSquareTests = [ 6.654552936553955, 85.79743957519531, 89.91349029541016, 53.55647277832031, 39.48537063598633, 3.9460408687591553 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -644,7 +636,7 @@ const reduceSumSquareTests = [ 'data': [ 12302.474609375, 22772.77734375, 26919.09765625, 11281.5068359375 ], - 'descriptor': {'dimensions': [2, 1, 2, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 2, 1], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/relu.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/relu.https.any.js index 45388383fffe..18088d649d8e 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/relu.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/relu.https.any.js @@ -37,7 +37,7 @@ const reluTests = [ 51.51447296142578, -51.63370132446289, -64.56800079345703, -5.093302249908447, 15.354103088378906, 90.03858947753906 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -74,7 +74,7 @@ const reluTests = [ 15.354103088378906, 90.03858947753906 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -85,7 +85,7 @@ const reluTests = [ 'inputs': { 'reluInput': { 'data': [79.04724884033203], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -98,7 +98,7 @@ const reluTests = [ 'data': [ 79.04724884033203, ], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -118,7 +118,7 @@ const reluTests = [ 51.51447296142578, -51.63370132446289, -64.56800079345703, -5.093302249908447, 15.354103088378906, 90.03858947753906 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -154,7 +154,7 @@ const reluTests = [ 15.354103088378906, 90.03858947753906 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -174,7 +174,7 @@ const reluTests = [ 51.51447296142578, -51.63370132446289, -64.56800079345703, -5.093302249908447, 15.354103088378906, 90.03858947753906 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -210,7 +210,7 @@ const reluTests = [ 15.354103088378906, 90.03858947753906 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -230,7 +230,7 @@ const reluTests = [ 51.51447296142578, -51.63370132446289, -64.56800079345703, -5.093302249908447, 15.354103088378906, 90.03858947753906 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -266,7 +266,7 @@ const reluTests = [ 15.354103088378906, 90.03858947753906 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -286,7 +286,7 @@ const reluTests = [ 51.51447296142578, -51.63370132446289, -64.56800079345703, -5.093302249908447, 15.354103088378906, 90.03858947753906 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -322,7 +322,7 @@ const reluTests = [ 15.354103088378906, 90.03858947753906 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -342,7 +342,7 @@ const reluTests = [ 51.51447296142578, -51.63370132446289, -64.56800079345703, -5.093302249908447, 15.354103088378906, 90.03858947753906 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } }, 'operators': [{ @@ -378,7 +378,7 @@ const reluTests = [ 15.354103088378906, 90.03858947753906 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/resample2d.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/resample2d.https.any.js index 65faca22abdd..c10b4182ec0c 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/resample2d.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/resample2d.https.any.js @@ -70,7 +70,7 @@ const resample2dTests = [ 62.06375503540039, 1.7712159156799316, 99.4723129272461, 11.440549850463867, 25.396343231201172, 67.0217514038086 ], - 'descriptor': {'dimensions': [1, 1, 4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -90,7 +90,7 @@ const resample2dTests = [ 62.06375503540039, 1.7712159156799316, 99.4723129272461, 11.440549850463867, 25.396343231201172, 67.0217514038086 ], - 'descriptor': {'dimensions': [1, 1, 4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 4, 6], dataType: 'float32'} } } } @@ -104,7 +104,7 @@ const resample2dTests = [ 59.92947006225586, 41.98918914794922, 66.39534759521484, 90.7006607055664, 86.95105743408203, 79.10005187988281 ], - 'descriptor': {'dimensions': [1, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -125,7 +125,7 @@ const resample2dTests = [ 90.7006607055664, 90.7006607055664, 86.95105743408203, 86.95105743408203, 79.10005187988281, 79.10005187988281 ], - 'descriptor': {'dimensions': [1, 1, 4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 4, 6], dataType: 'float32'} } } } @@ -139,7 +139,7 @@ const resample2dTests = [ 59.92947006225586, 41.98918914794922, 66.39534759521484, 90.7006607055664, 86.95105743408203, 79.10005187988281 ], - 'descriptor': {'dimensions': [1, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -160,7 +160,7 @@ const resample2dTests = [ 90.7006607055664, 90.7006607055664, 86.95105743408203, 86.95105743408203, 79.10005187988281, 79.10005187988281 ], - 'descriptor': {'dimensions': [1, 1, 4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 4, 6], dataType: 'float32'} } } } @@ -175,7 +175,7 @@ const resample2dTests = [ 59.92947006225586, 41.98918914794922, 66.39534759521484, 90.7006607055664, 86.95105743408203, 79.10005187988281 ], - 'descriptor': {'dimensions': [1, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -198,7 +198,7 @@ const resample2dTests = [ 90.7006607055664, 90.7006607055664, 86.95105743408203, 86.95105743408203, 79.10005187988281, 79.10005187988281 ], - 'descriptor': {'dimensions': [1, 1, 4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 4, 6], dataType: 'float32'} } } } @@ -212,7 +212,7 @@ const resample2dTests = [ 59.92947006225586, 41.98918914794922, 66.39534759521484, 90.7006607055664, 86.95105743408203, 79.10005187988281 ], - 'descriptor': {'dimensions': [1, 2, 3, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 1], dataType: 'float32'} } }, 'operators': [{ @@ -235,7 +235,7 @@ const resample2dTests = [ 90.7006607055664, 90.7006607055664, 86.95105743408203, 86.95105743408203, 79.10005187988281, 79.10005187988281 ], - 'descriptor': {'dimensions': [1, 4, 6, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 4, 6, 1], dataType: 'float32'} } } } @@ -250,7 +250,7 @@ const resample2dTests = [ 59.92947006225586, 41.98918914794922, 66.39534759521484, 90.7006607055664, 86.95105743408203, 79.10005187988281 ], - 'descriptor': {'dimensions': [1, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -273,7 +273,7 @@ const resample2dTests = [ 90.7006607055664, 90.7006607055664, 86.95105743408203, 86.95105743408203, 79.10005187988281, 79.10005187988281 ], - 'descriptor': {'dimensions': [1, 1, 4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 4, 6], dataType: 'float32'} } } } @@ -288,7 +288,7 @@ const resample2dTests = [ 59.92947006225586, 41.98918914794922, 66.39534759521484, 90.7006607055664, 86.95105743408203, 79.10005187988281 ], - 'descriptor': {'dimensions': [1, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -311,7 +311,7 @@ const resample2dTests = [ 90.7006607055664, 90.7006607055664, 86.95105743408203, 86.95105743408203, 79.10005187988281, 79.10005187988281 ], - 'descriptor': {'dimensions': [1, 1, 4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 4, 6], dataType: 'float32'} } } } @@ -326,7 +326,7 @@ const resample2dTests = [ 59.92947006225586, 41.98918914794922, 66.39534759521484, 90.7006607055664, 86.95105743408203, 79.10005187988281 ], - 'descriptor': {'dimensions': [1, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -349,7 +349,7 @@ const resample2dTests = [ 90.7006607055664, 90.7006607055664, 86.95105743408203, 86.95105743408203, 79.10005187988281, 79.10005187988281 ], - 'descriptor': {'dimensions': [1, 1, 4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 4, 6], dataType: 'float32'} } } } @@ -364,7 +364,7 @@ const resample2dTests = [ 59.92947006225586, 41.98918914794922, 66.39534759521484, 90.7006607055664, 86.95105743408203, 79.10005187988281 ], - 'descriptor': {'dimensions': [1, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -387,7 +387,7 @@ const resample2dTests = [ 90.7006607055664, 89.76325988769531, 87.88845825195312, 84.9883041381836, 81.06280517578125, 79.10005187988281 ], - 'descriptor': {'dimensions': [1, 1, 4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 4, 6], dataType: 'float32'} } } } @@ -402,7 +402,7 @@ const resample2dTests = [ 59.92947006225586, 41.98918914794922, 66.39534759521484, 90.7006607055664, 86.95105743408203, 79.10005187988281 ], - 'descriptor': {'dimensions': [1, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -425,7 +425,7 @@ const resample2dTests = [ 90.7006607055664, 89.76325988769531, 87.88845825195312, 84.9883041381836, 81.06280517578125, 79.10005187988281 ], - 'descriptor': {'dimensions': [1, 1, 4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 4, 6], dataType: 'float32'} } } } @@ -440,7 +440,7 @@ const resample2dTests = [ 59.92947006225586, 41.98918914794922, 66.39534759521484, 90.7006607055664, 86.95105743408203, 79.10005187988281 ], - 'descriptor': {'dimensions': [1, 2, 3, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 1], dataType: 'float32'} } }, 'operators': [{ @@ -463,7 +463,7 @@ const resample2dTests = [ 90.7006607055664, 89.76325988769531, 87.88845825195312, 84.9883041381836, 81.06280517578125, 79.10005187988281 ], - 'descriptor': {'dimensions': [1, 4, 6, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 4, 6, 1], dataType: 'float32'} } } } @@ -477,7 +477,7 @@ const resample2dTests = [ 59.92947006225586, 90.7006607055664, 41.98918914794922, 86.95105743408203, 66.39534759521484, 79.10005187988281 ], - 'descriptor': {'dimensions': [3, 2, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [3, 2, 1, 1], dataType: 'float32'} } }, 'operators': [{ @@ -500,7 +500,7 @@ const resample2dTests = [ 79.10005187988281, 79.10005187988281, 66.39534759521484, 66.39534759521484, 79.10005187988281, 79.10005187988281 ], - 'descriptor': {'dimensions': [6, 4, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [6, 4, 1, 1], dataType: 'float32'} } } } @@ -514,7 +514,7 @@ const resample2dTests = [ 59.92947006225586, 90.7006607055664, 41.98918914794922, 86.95105743408203, 66.39534759521484, 79.10005187988281 ], - 'descriptor': {'dimensions': [3, 2, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [3, 2, 1, 1], dataType: 'float32'} } }, 'operators': [{ @@ -537,7 +537,7 @@ const resample2dTests = [ 79.10005187988281, 79.10005187988281, 66.39534759521484, 66.39534759521484, 79.10005187988281, 79.10005187988281 ], - 'descriptor': {'dimensions': [6, 4, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [6, 4, 1, 1], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/reshape.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/reshape.https.any.js index 212e93575bc0..fd13b5f05e3a 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/reshape.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/reshape.https.any.js @@ -38,7 +38,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -58,7 +58,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [4, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [4, 2, 3], dataType: 'float32'} } } } @@ -78,7 +78,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [4, 1, 1, 1, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 1, 1, 1, 6], dataType: 'float32'} } }, 'operators': [{ @@ -98,7 +98,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [4, 1, 1, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 1, 1, 6], dataType: 'float32'} } } } @@ -118,7 +118,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -138,7 +138,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [2, 2, 2, 3, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3, 1], dataType: 'float32'} } } } @@ -158,7 +158,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [3, 2, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 2, 2, 2], dataType: 'float32'} } }, 'operators': [{ @@ -178,7 +178,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [4, 2, 3, 1], 'dataType': 'float32'} + 'descriptor': {shape: [4, 2, 3, 1], dataType: 'float32'} } } } @@ -198,7 +198,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [3, 2, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 2, 2, 2], dataType: 'float32'} } }, 'operators': [{ @@ -218,7 +218,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -238,7 +238,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [1, 24], 'dataType': 'float32'} + 'descriptor': {shape: [1, 24], dataType: 'float32'} } }, 'operators': [{ @@ -258,7 +258,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -278,7 +278,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [4, 1, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 1, 6], dataType: 'float32'} } }, 'operators': [{ @@ -298,7 +298,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -318,7 +318,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [1, 24, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 24, 1], dataType: 'float32'} } }, 'operators': [{ @@ -338,7 +338,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -358,7 +358,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [1, 4, 1, 6], 'dataType': 'float32'} + 'descriptor': {shape: [1, 4, 1, 6], dataType: 'float32'} } }, 'operators': [{ @@ -378,7 +378,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -389,7 +389,7 @@ const reshapeTests = [ 'inputs': { 'reshapeInput': { 'data': [-33.82555389404297], - 'descriptor': {'dimensions': [1, 1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float32'} } }, 'operators': [{ @@ -400,7 +400,7 @@ const reshapeTests = [ 'expectedOutputs': { 'reshapeOutput': { 'data': [-33.82555389404297], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -421,7 +421,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [1, 1, 1, 24, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1, 24, 1], dataType: 'float32'} } }, 'operators': [{ @@ -441,7 +441,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -461,7 +461,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [1, 24], 'dataType': 'float32'} + 'descriptor': {shape: [1, 24], dataType: 'float32'} } }, 'operators': [{ @@ -481,7 +481,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -502,7 +502,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [24, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [24, 1, 1], dataType: 'float32'} } }, 'operators': [{ @@ -522,7 +522,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -543,7 +543,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [1, 4, 6, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 4, 6, 1], dataType: 'float32'} } }, 'operators': [{ @@ -563,7 +563,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -584,7 +584,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [2, 1, 1, 12, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 1, 12, 1], dataType: 'float32'} } }, 'operators': [{ @@ -604,7 +604,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [2, 12, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 12, 1], dataType: 'float32'} } } } @@ -625,7 +625,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [1, 1, 1, 24, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1, 24, 1], dataType: 'float32'} } }, 'operators': [{ @@ -645,7 +645,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [1, 24], 'dataType': 'float32'} + 'descriptor': {shape: [1, 24], dataType: 'float32'} } } } @@ -656,7 +656,7 @@ const reshapeTests = [ 'inputs': { 'reshapeInput': { 'data': [-33.82555389404297], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -667,7 +667,7 @@ const reshapeTests = [ 'expectedOutputs': { 'reshapeOutput': { 'data': [-33.82555389404297], - 'descriptor': {'dimensions': [1, 1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float32'} } } } @@ -687,7 +687,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -707,7 +707,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [1, 24], 'dataType': 'float32'} + 'descriptor': {shape: [1, 24], dataType: 'float32'} } } } @@ -727,7 +727,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -747,7 +747,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [1, 24, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 24, 1], dataType: 'float32'} } } } @@ -767,7 +767,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -788,7 +788,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [1, 1, 1, 24, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1, 24, 1], dataType: 'float32'} } } } @@ -809,7 +809,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -829,7 +829,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [24, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [24, 1, 1], dataType: 'float32'} } } } @@ -849,7 +849,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -869,7 +869,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [4, 1, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 1, 6], dataType: 'float32'} } } } @@ -889,7 +889,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -909,7 +909,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [1, 4, 1, 6], 'dataType': 'float32'} + 'descriptor': {shape: [1, 4, 1, 6], dataType: 'float32'} } } } @@ -929,7 +929,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -949,7 +949,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [1, 24], 'dataType': 'float32'} + 'descriptor': {shape: [1, 24], dataType: 'float32'} } } } @@ -970,7 +970,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -990,7 +990,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [1, 4, 6, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 4, 6, 1], dataType: 'float32'} } } } @@ -1011,7 +1011,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [2, 12, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 12, 1], dataType: 'float32'} } }, 'operators': [{ @@ -1032,7 +1032,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [2, 1, 1, 12, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 1, 12, 1], dataType: 'float32'} } } } @@ -1052,7 +1052,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -1072,7 +1072,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [2, 1, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 2, 2, 3], dataType: 'float32'} } } } @@ -1092,7 +1092,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [2, 1, 4, 3, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 3, 1], dataType: 'float32'} } }, 'operators': [{ @@ -1113,8 +1113,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': - {'dimensions': [2, 1, 4, 1, 3, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3, 1], dataType: 'float32'} } } } @@ -1134,7 +1133,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -1154,7 +1153,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [2, 12], 'dataType': 'float32'} + 'descriptor': {shape: [2, 12], dataType: 'float32'} } } } @@ -1174,7 +1173,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -1194,7 +1193,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -1214,7 +1213,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -1234,7 +1233,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [1, 24], 'dataType': 'float32'} + 'descriptor': {shape: [1, 24], dataType: 'float32'} } } } @@ -1254,7 +1253,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -1274,7 +1273,7 @@ const reshapeTests = [ -96.93603515625, 65.34143829345703, 34.835994720458984, 62.01485824584961, -2.8698415756225586, 27.903749465942383 ], - 'descriptor': {'dimensions': [24, 1], 'dataType': 'float32'} + 'descriptor': {shape: [24, 1], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/sigmoid.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/sigmoid.https.any.js index 5bcdb39969c6..97a5a5caa759 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/sigmoid.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/sigmoid.https.any.js @@ -39,7 +39,7 @@ const sigmoidTests = [ 4.791460037231445, 2.0745489597320557, 0.8354471325874329, -5.433595657348633, -4.184835910797119, -2.484982490539551 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -60,7 +60,7 @@ const sigmoidTests = [ 0.9917680025100708, 0.8884047269821167, 0.6975054740905762, 0.004348373040556908, 0.014996387995779514, 0.07691769301891327 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -71,7 +71,7 @@ const sigmoidTests = [ 'inputs': { 'sigmoidInput': { 'data': [-0.37699514627456665], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -82,7 +82,7 @@ const sigmoidTests = [ 'expectedOutputs': { 'sigmoidOutput': { 'data': [0.4068518280982971], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -102,7 +102,7 @@ const sigmoidTests = [ 4.791460037231445, 2.0745489597320557, 0.8354471325874329, -5.433595657348633, -4.184835910797119, -2.484982490539551 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -122,7 +122,7 @@ const sigmoidTests = [ 0.9917680025100708, 0.8884047269821167, 0.6975054740905762, 0.004348373040556908, 0.014996387995779514, 0.07691769301891327 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -142,7 +142,7 @@ const sigmoidTests = [ 4.791460037231445, 2.0745489597320557, 0.8354471325874329, -5.433595657348633, -4.184835910797119, -2.484982490539551 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -162,7 +162,7 @@ const sigmoidTests = [ 0.9917680025100708, 0.8884047269821167, 0.6975054740905762, 0.004348373040556908, 0.014996387995779514, 0.07691769301891327 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -182,7 +182,7 @@ const sigmoidTests = [ 4.791460037231445, 2.0745489597320557, 0.8354471325874329, -5.433595657348633, -4.184835910797119, -2.484982490539551 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -202,7 +202,7 @@ const sigmoidTests = [ 0.9917680025100708, 0.8884047269821167, 0.6975054740905762, 0.004348373040556908, 0.014996387995779514, 0.07691769301891327 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -222,7 +222,7 @@ const sigmoidTests = [ 4.791460037231445, 2.0745489597320557, 0.8354471325874329, -5.433595657348633, -4.184835910797119, -2.484982490539551 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -242,7 +242,7 @@ const sigmoidTests = [ 0.9917680025100708, 0.8884047269821167, 0.6975054740905762, 0.004348373040556908, 0.014996387995779514, 0.07691769301891327 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -262,7 +262,7 @@ const sigmoidTests = [ 4.791460037231445, 2.0745489597320557, 0.8354471325874329, -5.433595657348633, -4.184835910797119, -2.484982490539551 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } }, 'operators': [{ @@ -282,7 +282,7 @@ const sigmoidTests = [ 0.9917680025100708, 0.8884047269821167, 0.6975054740905762, 0.004348373040556908, 0.014996387995779514, 0.07691769301891327 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/sign.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/sign.https.any.js index e00c6b705012..aad868544715 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/sign.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/sign.https.any.js @@ -29,7 +29,7 @@ const signTests = [ -0.946033775806427, 0.9996118545532227, 0.21998752653598785, -0.22639396786689758 ], - 'descriptor': {'dimensions': [4], 'dataType': 'float32'}, + 'descriptor': {shape: [4], dataType: 'float32'}, 'constant': true } }, @@ -41,7 +41,7 @@ const signTests = [ 'expectedOutputs': { 'signOutput': { 'data': [-1, 1, 1, -1], - 'descriptor': {'dimensions': [4], 'dataType': 'float32'} + 'descriptor': {shape: [4], dataType: 'float32'} } } } @@ -55,7 +55,7 @@ const signTests = [ -0.946033775806427, 0.9996118545532227, 0.21998752653598785, -0.22639396786689758 ], - 'descriptor': {'dimensions': [4], 'dataType': 'float16'} + 'descriptor': {shape: [4], dataType: 'float16'} } }, 'operators': [{ @@ -66,7 +66,7 @@ const signTests = [ 'expectedOutputs': { 'signOutput': { 'data': [-1, 1, 1, -1], - 'descriptor': {'dimensions': [4], 'dataType': 'float16'} + 'descriptor': {shape: [4], dataType: 'float16'} } } } @@ -79,7 +79,7 @@ const signTests = [ 'data': [ -0.946033775806427, 0.9996118545532227, 0.21998752653598785, 0.0 ], - 'descriptor': {'dimensions': [4], 'dataType': 'float32'} + 'descriptor': {shape: [4], dataType: 'float32'} } }, 'operators': [{ @@ -90,7 +90,7 @@ const signTests = [ 'expectedOutputs': { 'signOutput': { 'data': [-1, 1, 1, 0], - 'descriptor': {'dimensions': [4], 'dataType': 'float32'} + 'descriptor': {shape: [4], dataType: 'float32'} } } } @@ -101,7 +101,7 @@ const signTests = [ 'inputs': { 'signInput': { 'data': [-0.946033775806427, 0.9996118545532227, -Infinity, Infinity], - 'descriptor': {'dimensions': [4], 'dataType': 'float32'} + 'descriptor': {shape: [4], dataType: 'float32'} } }, 'operators': [{ @@ -112,7 +112,7 @@ const signTests = [ 'expectedOutputs': { 'signOutput': { 'data': [-1, 1, -1, 1], - 'descriptor': {'dimensions': [4], 'dataType': 'float32'} + 'descriptor': {shape: [4], dataType: 'float32'} } } } @@ -123,7 +123,7 @@ const signTests = [ 'inputs': { 'signInput': { 'data': [-1, 0, 1, 2], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'int32'} + 'descriptor': {shape: [2, 2], dataType: 'int32'} } }, 'operators': [{ @@ -134,7 +134,7 @@ const signTests = [ 'expectedOutputs': { 'signOutput': { 'data': [-1, 0, 1, 1], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'int32'} + 'descriptor': {shape: [2, 2], dataType: 'int32'} } } } @@ -145,7 +145,7 @@ const signTests = [ 'inputs': { 'signInput': { 'data': [-1, 0, 1, 2, -2, -1, 0, 1], - 'descriptor': {'dimensions': [2, 2, 2], 'dataType': 'int64'} + 'descriptor': {shape: [2, 2, 2], dataType: 'int64'} } }, 'operators': [{ @@ -156,7 +156,7 @@ const signTests = [ 'expectedOutputs': { 'signOutput': { 'data': [-1, 0, 1, 1, -1, -1, 0, 1], - 'descriptor': {'dimensions': [2, 2, 2], 'dataType': 'int64'} + 'descriptor': {shape: [2, 2, 2], dataType: 'int64'} } } } @@ -167,7 +167,7 @@ const signTests = [ 'inputs': { 'signInput': { 'data': [-1, 0, 1, 2, -2, -1, 0, 1], - 'descriptor': {'dimensions': [1, 2, 2, 2], 'dataType': 'int8'} + 'descriptor': {shape: [1, 2, 2, 2], dataType: 'int8'} } }, 'operators': [{ @@ -178,7 +178,7 @@ const signTests = [ 'expectedOutputs': { 'signOutput': { 'data': [-1, 0, 1, 1, -1, -1, 0, 1], - 'descriptor': {'dimensions': [1, 2, 2, 2], 'dataType': 'int8'} + 'descriptor': {shape: [1, 2, 2, 2], dataType: 'int8'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/sin.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/sin.https.any.js index 30fc9a54f8f0..d0dd150c6c2f 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/sin.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/sin.https.any.js @@ -28,7 +28,7 @@ const sinTests = [ 'inputs': { 'sinInput': { 'data': [79.78058624267578], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -39,7 +39,7 @@ const sinTests = [ 'expectedOutputs': { 'sinOutput': { 'data': [-0.946033775806427], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -59,7 +59,7 @@ const sinTests = [ 31.016063690185547, -94.88304901123047, -84.58417510986328, 44.8487434387207, -19.000272750854492, -48.03827667236328 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -80,7 +80,7 @@ const sinTests = [ -0.38929200172424316, -0.59339439868927, -0.23656263947486877, 0.7620325684547424, -0.15014687180519104, 0.7921885848045349 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -100,7 +100,7 @@ const sinTests = [ 31.016063690185547, -94.88304901123047, -84.58417510986328, 44.8487434387207, -19.000272750854492, -48.03827667236328 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -120,7 +120,7 @@ const sinTests = [ -0.38929200172424316, -0.59339439868927, -0.23656263947486877, 0.7620325684547424, -0.15014687180519104, 0.7921885848045349 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -140,7 +140,7 @@ const sinTests = [ 31.016063690185547, -94.88304901123047, -84.58417510986328, 44.8487434387207, -19.000272750854492, -48.03827667236328 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -160,7 +160,7 @@ const sinTests = [ -0.38929200172424316, -0.59339439868927, -0.23656263947486877, 0.7620325684547424, -0.15014687180519104, 0.7921885848045349 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -180,7 +180,7 @@ const sinTests = [ 31.016063690185547, -94.88304901123047, -84.58417510986328, 44.8487434387207, -19.000272750854492, -48.03827667236328 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -200,7 +200,7 @@ const sinTests = [ -0.38929200172424316, -0.59339439868927, -0.23656263947486877, 0.7620325684547424, -0.15014687180519104, 0.7921885848045349 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -220,7 +220,7 @@ const sinTests = [ 31.016063690185547, -94.88304901123047, -84.58417510986328, 44.8487434387207, -19.000272750854492, -48.03827667236328 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -240,7 +240,7 @@ const sinTests = [ -0.38929200172424316, -0.59339439868927, -0.23656263947486877, 0.7620325684547424, -0.15014687180519104, 0.7921885848045349 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -260,7 +260,7 @@ const sinTests = [ 31.016063690185547, -94.88304901123047, -84.58417510986328, 44.8487434387207, -19.000272750854492, -48.03827667236328 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } }, 'operators': [{ @@ -280,7 +280,7 @@ const sinTests = [ -0.38929200172424316, -0.59339439868927, -0.23656263947486877, 0.7620325684547424, -0.15014687180519104, 0.7921885848045349 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/slice.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/slice.https.any.js index 1c53d45fd5c0..58604d2b8ebf 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/slice.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/slice.https.any.js @@ -39,7 +39,7 @@ const sliceTests = [ -70.42774200439453, 59.82632064819336, -58.46095275878906, 79.80570983886719, -9.857853889465332, 42.665199279785156 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -57,7 +57,7 @@ const sliceTests = [ -70.42774200439453, 59.82632064819336, -58.46095275878906, 79.80570983886719, -9.857853889465332, 42.665199279785156 ], - 'descriptor': {'dimensions': [12], 'dataType': 'float32'} + 'descriptor': {shape: [12], dataType: 'float32'} } } } @@ -77,7 +77,7 @@ const sliceTests = [ -70.42774200439453, 59.82632064819336, -58.46095275878906, 79.80570983886719, -9.857853889465332, 42.665199279785156 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -94,7 +94,7 @@ const sliceTests = [ -70.42774200439453, 59.82632064819336, -58.46095275878906, 79.80570983886719, -9.857853889465332, 42.665199279785156 ], - 'descriptor': {'dimensions': [12], 'dataType': 'float32'} + 'descriptor': {shape: [12], dataType: 'float32'} } } } @@ -114,7 +114,7 @@ const sliceTests = [ -70.42774200439453, 59.82632064819336, -58.46095275878906, 79.80570983886719, -9.857853889465332, 42.665199279785156 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -130,7 +130,7 @@ const sliceTests = [ -27.306041717529297, -58.46095275878906, 79.80570983886719, -9.857853889465332, 42.665199279785156 ], - 'descriptor': {'dimensions': [2, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 4], dataType: 'float32'} } } } @@ -150,7 +150,7 @@ const sliceTests = [ -70.42774200439453, 59.82632064819336, -58.46095275878906, 79.80570983886719, -9.857853889465332, 42.665199279785156 ], - 'descriptor': {'dimensions': [4, 3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [4, 3, 2], dataType: 'float32'} } }, 'operators': [{ @@ -166,7 +166,7 @@ const sliceTests = [ 57.4397087097168, -4.513182163238525, 74.02619171142578, -27.306041717529297, 79.80570983886719, 42.665199279785156 ], - 'descriptor': {'dimensions': [3, 2, 1], 'dataType': 'float32'} + 'descriptor': {shape: [3, 2, 1], dataType: 'float32'} } } } @@ -186,7 +186,7 @@ const sliceTests = [ -70.42774200439453, 59.82632064819336, -58.46095275878906, 79.80570983886719, -9.857853889465332, 42.665199279785156 ], - 'descriptor': {'dimensions': [2, 2, 3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 3, 2], dataType: 'float32'} } }, 'operators': [{ @@ -200,7 +200,7 @@ const sliceTests = [ 'expectedOutputs': { 'sliceOutput': { 'data': [-27.306041717529297, 42.665199279785156], - 'descriptor': {'dimensions': [1, 2, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 1], dataType: 'float32'} } } } @@ -220,7 +220,7 @@ const sliceTests = [ -70.42774200439453, 59.82632064819336, -58.46095275878906, 79.80570983886719, -9.857853889465332, 42.665199279785156 ], - 'descriptor': {'dimensions': [2, 2, 3, 2, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 3, 2, 1], dataType: 'float32'} } }, 'operators': [{ @@ -234,7 +234,7 @@ const sliceTests = [ 'expectedOutputs': { 'sliceOutput': { 'data': [-27.306041717529297, 42.665199279785156], - 'descriptor': {'dimensions': [1, 2, 1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 1, 1], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/softmax.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/softmax.https.any.js index 28c0ff5ecac2..6d48a2707d18 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/softmax.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/softmax.https.any.js @@ -16,8 +16,8 @@ const getSoftmaxPrecisionTolerance = (graphResources) => { const args = graphResources.operators[0].arguments; - const inputShape = graphResources.inputs[args[0][Object.keys(args[0])[0]]] - .descriptor.dimensions; + const inputShape = + graphResources.inputs[args[0][Object.keys(args[0])[0]]].descriptor.shape; const axis = args.length === 2 ? args[1][Object.keys(args[1])[0]] : 1; const tolerance = inputShape[axis] * 3 + 3; const toleranceValueDict = {float32: tolerance, float16: tolerance}; @@ -42,7 +42,7 @@ const softmaxTests = [ 1.6371468305587769, 0.27626121044158936, 5.02822732925415, 3.8983259201049805, 2.8967113494873047, 6.88947057723999 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'}, + 'descriptor': {shape: [4, 6], dataType: 'float32'}, 'constant': true } }, @@ -67,7 +67,7 @@ const softmaxTests = [ 0.12633030116558075, 0.040812913328409195, 0.014990009367465973, 0.8125221133232117 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -87,7 +87,7 @@ const softmaxTests = [ 1.6371468305587769, 0.27626121044158936, 5.02822732925415, 3.8983259201049805, 2.8967113494873047, 6.88947057723999 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -111,7 +111,7 @@ const softmaxTests = [ 0.12633030116558075, 0.040812913328409195, 0.014990009367465973, 0.8125221133232117 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -131,7 +131,7 @@ const softmaxTests = [ -1.8421411514282227, -4.994808197021484, -9.527292251586914, -4.985682964324951, -8.421041488647461, -6.235629558563232 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -151,7 +151,7 @@ const softmaxTests = [ 0.9090295433998108, 0.0388500951230526, 0.00041779119055718184, 0.039206232875585556, 0.0012629841221496463, 0.011233373545110226 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -167,7 +167,7 @@ const softmaxTests = [ 0.5397239923477173, -0.9535139799118042, -0.5920282602310181, -0.17344485223293304, 0.14395014941692352, -0.37920907139778137 ], - 'descriptor': {'dimensions': [1, 3, 4], 'dataType': 'float32'}, + 'descriptor': {shape: [1, 3, 4], dataType: 'float32'}, 'constant': true } }, @@ -184,7 +184,7 @@ const softmaxTests = [ 0.5390242338180542, 0.16964708268642426, 0.142439603805542, 0.22368484735488892, 0.36284899711608887, 0.3012755215167999 ], - 'descriptor': {'dimensions': [1, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 3, 4], dataType: 'float32'} } } } @@ -200,7 +200,7 @@ const softmaxTests = [ 0.5397239923477173, -0.9535139799118042, -0.5920282602310181, -0.17344485223293304, 0.14395014941692352, -0.37920907139778137 ], - 'descriptor': {'dimensions': [3, 4, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4, 1, 1], dataType: 'float32'} } }, 'operators': [{ @@ -216,7 +216,7 @@ const softmaxTests = [ 0.33747196197509766, 0.07581108063459396, 0.17110128700733185, 0.26004093885421753, 0.3571779429912567, 0.2116798311471939 ], - 'descriptor': {'dimensions': [3, 4, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4, 1, 1], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/softplus.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/softplus.https.any.js index 2b45700493ed..d6f472832c57 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/softplus.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/softplus.https.any.js @@ -38,7 +38,7 @@ const softplusTests = [ 5.517927169799805, 7.192322254180908, 8.764925003051758, 1.373470425605774, 8.930668830871582, 8.660283088684082 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -59,7 +59,7 @@ const softplusTests = [ 5.521933078765869, 7.1930742263793945, 8.765081405639648, 1.5991919040679932, 8.930801391601562, 8.660456657409668 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -70,7 +70,7 @@ const softplusTests = [ 'inputs': { 'softplusInput': { 'data': [5.626614570617676], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -81,7 +81,7 @@ const softplusTests = [ 'expectedOutputs': { 'softplusOutput': { 'data': [5.630208969116211], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -101,7 +101,7 @@ const softplusTests = [ 5.517927169799805, 7.192322254180908, 8.764925003051758, 1.373470425605774, 8.930668830871582, 8.660283088684082 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -121,7 +121,7 @@ const softplusTests = [ 5.521933078765869, 7.1930742263793945, 8.765081405639648, 1.5991919040679932, 8.930801391601562, 8.660456657409668 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -141,7 +141,7 @@ const softplusTests = [ 5.517927169799805, 7.192322254180908, 8.764925003051758, 1.373470425605774, 8.930668830871582, 8.660283088684082 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -161,7 +161,7 @@ const softplusTests = [ 5.521933078765869, 7.1930742263793945, 8.765081405639648, 1.5991919040679932, 8.930801391601562, 8.660456657409668 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -181,7 +181,7 @@ const softplusTests = [ 5.517927169799805, 7.192322254180908, 8.764925003051758, 1.373470425605774, 8.930668830871582, 8.660283088684082 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -201,7 +201,7 @@ const softplusTests = [ 5.521933078765869, 7.1930742263793945, 8.765081405639648, 1.5991919040679932, 8.930801391601562, 8.660456657409668 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -221,7 +221,7 @@ const softplusTests = [ 5.517927169799805, 7.192322254180908, 8.764925003051758, 1.373470425605774, 8.930668830871582, 8.660283088684082 ], - 'descriptor': {'dimensions': [1, 2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -241,7 +241,7 @@ const softplusTests = [ 5.521933078765869, 7.1930742263793945, 8.765081405639648, 1.5991919040679932, 8.930801391601562, 8.660456657409668 ], - 'descriptor': {'dimensions': [1, 2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} } } } @@ -261,7 +261,7 @@ const softplusTests = [ 5.517927169799805, 7.192322254180908, 8.764925003051758, 1.373470425605774, 8.930668830871582, 8.660283088684082 ], - 'descriptor': {'dimensions': [1, 2, 1, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -281,7 +281,7 @@ const softplusTests = [ 5.521933078765869, 7.1930742263793945, 8.765081405639648, 1.5991919040679932, 8.930801391601562, 8.660456657409668 ], - 'descriptor': {'dimensions': [1, 2, 1, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 3, 4], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/softsign.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/softsign.https.any.js index 06560af48a5f..56779650c538 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/softsign.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/softsign.https.any.js @@ -38,7 +38,7 @@ const softsignTests = [ 7.816190242767334, 5.849185943603516, 8.780370712280273, 5.120515823364258, 7.117222309112549, 4.599106788635254 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -59,7 +59,7 @@ const softsignTests = [ 0.8865723013877869, 0.8539972305297852, 0.8977543711662292, 0.8366150856018066, 0.8768051266670227, 0.8214001059532166 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -70,7 +70,7 @@ const softsignTests = [ 'inputs': { 'softsignInput': { 'data': [1.5834133625030518], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -81,7 +81,7 @@ const softsignTests = [ 'expectedOutputs': { 'softsignOutput': { 'data': [0.6129152178764343], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -92,7 +92,7 @@ const softsignTests = [ 'inputs': { 'softsignInput': { 'data': [-2.597844123840332], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -103,7 +103,7 @@ const softsignTests = [ 'expectedOutputs': { 'softsignOutput': { 'data': [-0.7220557928085327], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -123,7 +123,7 @@ const softsignTests = [ 7.816190242767334, 5.849185943603516, 8.780370712280273, 5.120515823364258, 7.117222309112549, 4.599106788635254 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -143,7 +143,7 @@ const softsignTests = [ 0.8865723013877869, 0.8539972305297852, 0.8977543711662292, 0.8366150856018066, 0.8768051266670227, 0.8214001059532166 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -163,7 +163,7 @@ const softsignTests = [ -3.5247786045074463, -4.43991231918335, -5.234262466430664, -1.5911732912063599, -9.106277465820312, -8.523774147033691 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -183,7 +183,7 @@ const softsignTests = [ -0.7789947390556335, -0.8161734938621521, -0.8395960927009583, -0.6140744686126709, -0.9010515809059143, -0.894999623298645 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -203,7 +203,7 @@ const softsignTests = [ 3.0513505935668945, 7.426476955413818, -8.454667091369629, 7.135868072509766, -4.986093997955322, -7.859614849090576 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -223,7 +223,7 @@ const softsignTests = [ 0.7531687617301941, 0.88132643699646, -0.8942321538925171, 0.8770874738693237, -0.8329461812973022, -0.8871282935142517 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -243,7 +243,7 @@ const softsignTests = [ 3.0513505935668945, 7.426476955413818, -8.454667091369629, 7.135868072509766, -4.986093997955322, -7.859614849090576 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -263,7 +263,7 @@ const softsignTests = [ 0.7531687617301941, 0.88132643699646, -0.8942321538925171, 0.8770874738693237, -0.8329461812973022, -0.8871282935142517 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -283,7 +283,7 @@ const softsignTests = [ 3.0513505935668945, 7.426476955413818, -8.454667091369629, 7.135868072509766, -4.986093997955322, -7.859614849090576 ], - 'descriptor': {'dimensions': [1, 2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -303,7 +303,7 @@ const softsignTests = [ 0.7531687617301941, 0.88132643699646, -0.8942321538925171, 0.8770874738693237, -0.8329461812973022, -0.8871282935142517 ], - 'descriptor': {'dimensions': [1, 2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} } } } @@ -323,7 +323,7 @@ const softsignTests = [ 3.0513505935668945, 7.426476955413818, -8.454667091369629, 7.135868072509766, -4.986093997955322, -7.859614849090576 ], - 'descriptor': {'dimensions': [1, 2, 1, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -343,7 +343,7 @@ const softsignTests = [ 0.7531687617301941, 0.88132643699646, -0.8942321538925171, 0.8770874738693237, -0.8329461812973022, -0.8871282935142517 ], - 'descriptor': {'dimensions': [1, 2, 1, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 3, 4], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/split.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/split.https.any.js index eee757f29766..1eabc6a6d100 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/split.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/split.https.any.js @@ -46,7 +46,7 @@ const splitTests = [ -27.127241134643555, 65.1489486694336, -30.40681266784668, -6.818390369415283, 46.673622131347656, -21.12453842163086 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -60,7 +60,7 @@ const splitTests = [ -23.446075439453125, -85.64382934570312, 46.87752151489258, -68.11224365234375, 75.99607849121094 ], - 'descriptor': {'dimensions': [8], 'dataType': 'float32'} + 'descriptor': {shape: [8], dataType: 'float32'} }, 'splitOutput2': { 'data': [ @@ -68,7 +68,7 @@ const splitTests = [ 84.16268920898438, -95.57494354248047, -52.40757751464844, -29.007186889648438, 71.65496063232422 ], - 'descriptor': {'dimensions': [8], 'dataType': 'float32'} + 'descriptor': {shape: [8], dataType: 'float32'} }, 'splitOutput3': { 'data': [ @@ -76,7 +76,7 @@ const splitTests = [ 65.1489486694336, -30.40681266784668, -6.818390369415283, 46.673622131347656, -21.12453842163086 ], - 'descriptor': {'dimensions': [8], 'dataType': 'float32'} + 'descriptor': {shape: [8], dataType: 'float32'} } } } @@ -96,7 +96,7 @@ const splitTests = [ -27.127241134643555, 65.1489486694336, -30.40681266784668, -6.818390369415283, 46.673622131347656, -21.12453842163086 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [ @@ -109,7 +109,7 @@ const splitTests = [ -23.446075439453125, -85.64382934570312, 46.87752151489258, -68.11224365234375, 75.99607849121094 ], - 'descriptor': {'dimensions': [8], 'dataType': 'float32'} + 'descriptor': {shape: [8], dataType: 'float32'} }, 'splitOutput2': { 'data': [ @@ -117,7 +117,7 @@ const splitTests = [ 84.16268920898438, -95.57494354248047, -52.40757751464844, -29.007186889648438, 71.65496063232422 ], - 'descriptor': {'dimensions': [8], 'dataType': 'float32'} + 'descriptor': {shape: [8], dataType: 'float32'} }, 'splitOutput3': { 'data': [ @@ -125,7 +125,7 @@ const splitTests = [ 65.1489486694336, -30.40681266784668, -6.818390369415283, 46.673622131347656, -21.12453842163086 ], - 'descriptor': {'dimensions': [8], 'dataType': 'float32'} + 'descriptor': {shape: [8], dataType: 'float32'} } } } @@ -145,7 +145,7 @@ const splitTests = [ -27.127241134643555, 65.1489486694336, -30.40681266784668, -6.818390369415283, 46.673622131347656, -21.12453842163086 ], - 'descriptor': {'dimensions': [8, 3], 'dataType': 'float32'} + 'descriptor': {shape: [8, 3], dataType: 'float32'} } }, 'operators': [ @@ -159,7 +159,7 @@ const splitTests = [ -68.11224365234375, 75.99607849121094, -61.05668640136719, -90.92643737792969, 53.916622161865234, 84.16268920898438 ], - 'descriptor': {'dimensions': [4, 3], 'dataType': 'float32'} + 'descriptor': {shape: [4, 3], dataType: 'float32'} }, 'splitOutput2': { 'data': [ @@ -168,7 +168,7 @@ const splitTests = [ -27.127241134643555, 65.1489486694336, -30.40681266784668, -6.818390369415283, 46.673622131347656, -21.12453842163086 ], - 'descriptor': {'dimensions': [4, 3], 'dataType': 'float32'} + 'descriptor': {shape: [4, 3], dataType: 'float32'} } } } @@ -188,7 +188,7 @@ const splitTests = [ -27.127241134643555, 65.1489486694336, -30.40681266784668, -6.818390369415283, 46.673622131347656, -21.12453842163086 ], - 'descriptor': {'dimensions': [4, 3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [4, 3, 2], dataType: 'float32'} } }, 'operators': [ @@ -202,7 +202,7 @@ const splitTests = [ -68.11224365234375, 75.99607849121094, -61.05668640136719, -90.92643737792969, 53.916622161865234, 84.16268920898438 ], - 'descriptor': {'dimensions': [2, 3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 2], dataType: 'float32'} }, 'splitOutput2': { 'data': [ @@ -211,7 +211,7 @@ const splitTests = [ -27.127241134643555, 65.1489486694336, -30.40681266784668, -6.818390369415283, 46.673622131347656, -21.12453842163086 ], - 'descriptor': {'dimensions': [2, 3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 2], dataType: 'float32'} } } } @@ -231,7 +231,7 @@ const splitTests = [ -27.127241134643555, 65.1489486694336, -30.40681266784668, -6.818390369415283, 46.673622131347656, -21.12453842163086 ], - 'descriptor': {'dimensions': [12, 1, 1, 2], 'dataType': 'float32'} + 'descriptor': {shape: [12, 1, 1, 2], dataType: 'float32'} } }, 'operators': [ @@ -243,28 +243,28 @@ const splitTests = [ -64.52056884765625, -84.60513305664062, -67.99282836914062, -23.446075439453125, -85.64382934570312, 46.87752151489258 ], - 'descriptor': {'dimensions': [3, 1, 1, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 1, 1, 2], dataType: 'float32'} }, 'splitOutput2': { 'data': [ -68.11224365234375, 75.99607849121094, -61.05668640136719, -90.92643737792969, 53.916622161865234, 84.16268920898438 ], - 'descriptor': {'dimensions': [3, 1, 1, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 1, 1, 2], dataType: 'float32'} }, 'splitOutput3': { 'data': [ -95.57494354248047, -52.40757751464844, -29.007186889648438, 71.65496063232422, 50.66357421875, 21.364582061767578 ], - 'descriptor': {'dimensions': [3, 1, 1, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 1, 1, 2], dataType: 'float32'} }, 'splitOutput4': { 'data': [ -27.127241134643555, 65.1489486694336, -30.40681266784668, -6.818390369415283, 46.673622131347656, -21.12453842163086 ], - 'descriptor': {'dimensions': [3, 1, 1, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 1, 1, 2], dataType: 'float32'} } } } @@ -284,7 +284,7 @@ const splitTests = [ -27.127241134643555, 65.1489486694336, -30.40681266784668, -6.818390369415283, 46.673622131347656, -21.12453842163086 ], - 'descriptor': {'dimensions': [6, 1, 1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [6, 1, 1, 2, 2], dataType: 'float32'} } }, 'operators': [ @@ -298,7 +298,7 @@ const splitTests = [ -68.11224365234375, 75.99607849121094, -61.05668640136719, -90.92643737792969, 53.916622161865234, 84.16268920898438 ], - 'descriptor': {'dimensions': [3, 1, 1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 1, 1, 2, 2], dataType: 'float32'} }, 'splitOutput2': { 'data': [ @@ -307,7 +307,7 @@ const splitTests = [ -27.127241134643555, 65.1489486694336, -30.40681266784668, -6.818390369415283, 46.673622131347656, -21.12453842163086 ], - 'descriptor': {'dimensions': [3, 1, 1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 1, 1, 2, 2], dataType: 'float32'} } } } @@ -327,7 +327,7 @@ const splitTests = [ -27.127241134643555, 65.1489486694336, -30.40681266784668, -6.818390369415283, 46.673622131347656, -21.12453842163086 ], - 'descriptor': {'dimensions': [12, 1, 1, 2], 'dataType': 'float32'} + 'descriptor': {shape: [12, 1, 1, 2], dataType: 'float32'} } }, 'operators': [{ @@ -340,28 +340,28 @@ const splitTests = [ -64.52056884765625, -84.60513305664062, -67.99282836914062, -23.446075439453125, -85.64382934570312, 46.87752151489258 ], - 'descriptor': {'dimensions': [3, 1, 1, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 1, 1, 2], dataType: 'float32'} }, 'splitOutput2': { 'data': [ -68.11224365234375, 75.99607849121094, -61.05668640136719, -90.92643737792969, 53.916622161865234, 84.16268920898438 ], - 'descriptor': {'dimensions': [3, 1, 1, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 1, 1, 2], dataType: 'float32'} }, 'splitOutput3': { 'data': [ -95.57494354248047, -52.40757751464844, -29.007186889648438, 71.65496063232422, 50.66357421875, 21.364582061767578 ], - 'descriptor': {'dimensions': [3, 1, 1, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 1, 1, 2], dataType: 'float32'} }, 'splitOutput4': { 'data': [ -27.127241134643555, 65.1489486694336, -30.40681266784668, -6.818390369415283, 46.673622131347656, -21.12453842163086 ], - 'descriptor': {'dimensions': [3, 1, 1, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 1, 1, 2], dataType: 'float32'} } } } @@ -381,7 +381,7 @@ const splitTests = [ -27.127241134643555, 65.1489486694336, -30.40681266784668, -6.818390369415283, 46.673622131347656, -21.12453842163086 ], - 'descriptor': {'dimensions': [12, 1, 1, 2], 'dataType': 'float32'} + 'descriptor': {shape: [12, 1, 1, 2], dataType: 'float32'} } }, 'operators': [{ @@ -396,7 +396,7 @@ const splitTests = [ -23.446075439453125, -85.64382934570312, 46.87752151489258, -68.11224365234375, 75.99607849121094 ], - 'descriptor': {'dimensions': [4, 1, 1, 2], 'dataType': 'float32'} + 'descriptor': {shape: [4, 1, 1, 2], dataType: 'float32'} }, 'splitOutput2': { 'data': [ @@ -404,7 +404,7 @@ const splitTests = [ 84.16268920898438, -95.57494354248047, -52.40757751464844, -29.007186889648438, 71.65496063232422 ], - 'descriptor': {'dimensions': [4, 1, 1, 2], 'dataType': 'float32'} + 'descriptor': {shape: [4, 1, 1, 2], dataType: 'float32'} }, 'splitOutput3': { 'data': [ @@ -412,7 +412,7 @@ const splitTests = [ 65.1489486694336, -30.40681266784668, -6.818390369415283, 46.673622131347656, -21.12453842163086 ], - 'descriptor': {'dimensions': [4, 1, 1, 2], 'dataType': 'float32'} + 'descriptor': {shape: [4, 1, 1, 2], dataType: 'float32'} } } } @@ -432,7 +432,7 @@ const splitTests = [ -27.127241134643555, 65.1489486694336, -30.40681266784668, -6.818390369415283, 46.673622131347656, -21.12453842163086 ], - 'descriptor': {'dimensions': [1, 1, 6, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 6, 2, 2], dataType: 'float32'} } }, 'operators': [{ @@ -449,7 +449,7 @@ const splitTests = [ -68.11224365234375, 75.99607849121094, -61.05668640136719, -90.92643737792969, 53.916622161865234, 84.16268920898438 ], - 'descriptor': {'dimensions': [1, 1, 3, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 3, 2, 2], dataType: 'float32'} }, 'splitOutput2': { 'data': [ @@ -458,7 +458,7 @@ const splitTests = [ -27.127241134643555, 65.1489486694336, -30.40681266784668, -6.818390369415283, 46.673622131347656, -21.12453842163086 ], - 'descriptor': {'dimensions': [1, 1, 3, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 3, 2, 2], dataType: 'float32'} } } } @@ -478,7 +478,7 @@ const splitTests = [ -27.127241134643555, 65.1489486694336, -30.40681266784668, -6.818390369415283, 46.673622131347656, -21.12453842163086 ], - 'descriptor': {'dimensions': [6, 1, 1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [6, 1, 1, 2, 2], dataType: 'float32'} } }, 'operators': [{ @@ -494,7 +494,7 @@ const splitTests = [ -23.446075439453125, -85.64382934570312, 46.87752151489258, -68.11224365234375, 75.99607849121094 ], - 'descriptor': {'dimensions': [2, 1, 1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 1, 2, 2], dataType: 'float32'} }, 'splitOutput2': { 'data': [ @@ -505,7 +505,7 @@ const splitTests = [ -30.40681266784668, -6.818390369415283, 46.673622131347656, -21.12453842163086 ], - 'descriptor': {'dimensions': [4, 1, 1, 2, 2], 'dataType': 'float32'} + 'descriptor': {shape: [4, 1, 1, 2, 2], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/sqrt.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/sqrt.https.any.js index aa24dc5501f3..b6b13ec07595 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/sqrt.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/sqrt.https.any.js @@ -28,7 +28,7 @@ const sqrtTests = [ 'inputs': { 'sqrtInput': { 'data': [4.0044636726379395], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -39,7 +39,7 @@ const sqrtTests = [ 'expectedOutputs': { 'sqrtOutput': { 'data': [2.001115560531616], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -59,7 +59,7 @@ const sqrtTests = [ 4.424484729766846, 0.09894099831581116, 4.6900248527526855, 1.5277378559112549, 5.929779529571533, 6.066471576690674 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -80,7 +80,7 @@ const sqrtTests = [ 2.1034460067749023, 0.31454887986183167, 2.165646553039551, 1.2360169887542725, 2.4351139068603516, 2.4630208015441895 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -100,7 +100,7 @@ const sqrtTests = [ 4.424484729766846, 0.09894099831581116, 4.6900248527526855, 1.5277378559112549, 5.929779529571533, 6.066471576690674 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -120,7 +120,7 @@ const sqrtTests = [ 2.1034460067749023, 0.31454887986183167, 2.165646553039551, 1.2360169887542725, 2.4351139068603516, 2.4630208015441895 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -140,7 +140,7 @@ const sqrtTests = [ 4.424484729766846, 0.09894099831581116, 4.6900248527526855, 1.5277378559112549, 5.929779529571533, 6.066471576690674 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -160,7 +160,7 @@ const sqrtTests = [ 2.1034460067749023, 0.31454887986183167, 2.165646553039551, 1.2360169887542725, 2.4351139068603516, 2.4630208015441895 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -180,7 +180,7 @@ const sqrtTests = [ 4.424484729766846, 0.09894099831581116, 4.6900248527526855, 1.5277378559112549, 5.929779529571533, 6.066471576690674 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -200,7 +200,7 @@ const sqrtTests = [ 2.1034460067749023, 0.31454887986183167, 2.165646553039551, 1.2360169887542725, 2.4351139068603516, 2.4630208015441895 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -220,7 +220,7 @@ const sqrtTests = [ 4.424484729766846, 0.09894099831581116, 4.6900248527526855, 1.5277378559112549, 5.929779529571533, 6.066471576690674 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -240,7 +240,7 @@ const sqrtTests = [ 2.1034460067749023, 0.31454887986183167, 2.165646553039551, 1.2360169887542725, 2.4351139068603516, 2.4630208015441895 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -260,7 +260,7 @@ const sqrtTests = [ 4.424484729766846, 0.09894099831581116, 4.6900248527526855, 1.5277378559112549, 5.929779529571533, 6.066471576690674 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } }, 'operators': [{ @@ -280,7 +280,7 @@ const sqrtTests = [ 2.1034460067749023, 0.31454887986183167, 2.165646553039551, 1.2360169887542725, 2.4351139068603516, 2.4630208015441895 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/sub.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/sub.https.any.js index c034cf7b0ada..3bb23caf5f51 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/sub.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/sub.https.any.js @@ -36,7 +36,7 @@ const subTests = [ 80.56973266601562, 97.62598419189453, 52.74850845336914, 89.1660385131836, -20.50341796875, 99.48707580566406 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true }, 'inputB': { @@ -50,7 +50,7 @@ const subTests = [ 35.2364616394043, -77.05516815185547, -57.8714714050293, -58.15085983276367, 27.488866806030273, 31.99802017211914 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -71,7 +71,7 @@ const subTests = [ 45.33327102661133, 174.68115234375, 110.61997985839844, 147.31689453125, -47.992286682128906, 67.48905944824219 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -91,7 +91,7 @@ const subTests = [ 80.56973266601562, 97.62598419189453, 52.74850845336914, 89.1660385131836, -20.50341796875, 99.48707580566406 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -104,7 +104,7 @@ const subTests = [ 35.2364616394043, -77.05516815185547, -57.8714714050293, -58.15085983276367, 27.488866806030273, 31.99802017211914 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -124,7 +124,7 @@ const subTests = [ 45.33327102661133, 174.68115234375, 110.61997985839844, 147.31689453125, -47.992286682128906, 67.48905944824219 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -144,7 +144,7 @@ const subTests = [ 80.56973266601562, 97.62598419189453, 52.74850845336914, 89.1660385131836, -20.50341796875, 99.48707580566406 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -157,7 +157,7 @@ const subTests = [ 35.2364616394043, -77.05516815185547, -57.8714714050293, -58.15085983276367, 27.488866806030273, 31.99802017211914 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -177,7 +177,7 @@ const subTests = [ 45.33327102661133, 174.68115234375, 110.61997985839844, 147.31689453125, -47.992286682128906, 67.48905944824219 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -197,7 +197,7 @@ const subTests = [ 80.56973266601562, 97.62598419189453, 52.74850845336914, 89.1660385131836, -20.50341796875, 99.48707580566406 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -210,7 +210,7 @@ const subTests = [ 35.2364616394043, -77.05516815185547, -57.8714714050293, -58.15085983276367, 27.488866806030273, 31.99802017211914 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -230,7 +230,7 @@ const subTests = [ 45.33327102661133, 174.68115234375, 110.61997985839844, 147.31689453125, -47.992286682128906, 67.48905944824219 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -250,7 +250,7 @@ const subTests = [ 80.56973266601562, 97.62598419189453, 52.74850845336914, 89.1660385131836, -20.50341796875, 99.48707580566406 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -263,7 +263,7 @@ const subTests = [ 35.2364616394043, -77.05516815185547, -57.8714714050293, -58.15085983276367, 27.488866806030273, 31.99802017211914 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -283,7 +283,7 @@ const subTests = [ 45.33327102661133, 174.68115234375, 110.61997985839844, 147.31689453125, -47.992286682128906, 67.48905944824219 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -303,7 +303,7 @@ const subTests = [ 80.56973266601562, 97.62598419189453, 52.74850845336914, 89.1660385131836, -20.50341796875, 99.48707580566406 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -316,7 +316,7 @@ const subTests = [ 35.2364616394043, -77.05516815185547, -57.8714714050293, -58.15085983276367, 27.488866806030273, 31.99802017211914 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -336,7 +336,7 @@ const subTests = [ 45.33327102661133, 174.68115234375, 110.61997985839844, 147.31689453125, -47.992286682128906, 67.48905944824219 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} } } } @@ -347,7 +347,7 @@ const subTests = [ 'inputs': { 'inputA': { 'data': [-97.04911804199219], - 'descriptor': {'dimensions': [1], 'dataType': 'float32'} + 'descriptor': {shape: [1], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -360,7 +360,7 @@ const subTests = [ 80.56973266601562, 97.62598419189453, 52.74850845336914, 89.1660385131836, -20.50341796875, 99.48707580566406 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -380,7 +380,7 @@ const subTests = [ -177.6188507080078, -194.67510986328125, -149.79762268066406, -186.21514892578125, -76.54570007324219, -196.53619384765625 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -400,14 +400,14 @@ const subTests = [ 80.56973266601562, 97.62598419189453, 52.74850845336914, 89.1660385131836, -20.50341796875, 99.48707580566406 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ 10.762838363647461, -90.23992156982422, 12.787367820739746, -62.44633865356445, 32.18257522583008, 20.359493255615234 ], - 'descriptor': {'dimensions': [2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -427,7 +427,7 @@ const subTests = [ 69.80689239501953, 187.86590576171875, 39.96113967895508, 151.6123809814453, -52.68599319458008, 79.12757873535156 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -447,14 +447,14 @@ const subTests = [ 80.56973266601562, 97.62598419189453, 52.74850845336914, 89.1660385131836, -20.50341796875, 99.48707580566406 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputB': { 'data': [ -8.39311408996582, 75.54753112792969, -32.325870513916016, 8.088332176208496 ], - 'descriptor': {'dimensions': [2, 2, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1], dataType: 'float32'} } }, 'operators': [{ @@ -474,7 +474,7 @@ const subTests = [ 112.89559936523438, 129.9518585205078, 85.07437896728516, 81.07770538330078, -28.591751098632812, 91.39874267578125 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -485,7 +485,7 @@ const subTests = [ 'inputs': { 'inputA': { 'data': [-97.04911804199219], - 'descriptor': {'dimensions': [1, 1, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float32'} }, 'inputB': { 'data': [ @@ -498,7 +498,7 @@ const subTests = [ 80.56973266601562, 97.62598419189453, 52.74850845336914, 89.1660385131836, -20.50341796875, 99.48707580566406 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -518,7 +518,7 @@ const subTests = [ -177.6188507080078, -194.67510986328125, -149.79762268066406, -186.21514892578125, -76.54570007324219, -196.53619384765625 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/tan.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/tan.https.any.js index 5fcf0e689968..a8b6bba13c17 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/tan.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/tan.https.any.js @@ -28,7 +28,7 @@ const tanTests = [ 'inputs': { 'tanInput': { 'data': [52.69781494140625], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -39,7 +39,7 @@ const tanTests = [ 'expectedOutputs': { 'tanOutput': { 'data': [-0.8582430481910706], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -59,7 +59,7 @@ const tanTests = [ 84.79766845703125, -95.58502960205078, 15.552484512329102, -55.25654220581055, -26.884889602661133, 0.159261092543602 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -80,7 +80,7 @@ const tanTests = [ -0.025338610634207726, -4.203672409057617, -0.1567438244819641, 3.495089292526245, 5.453553199768066, 0.16062140464782715 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -100,7 +100,7 @@ const tanTests = [ 84.79766845703125, -95.58502960205078, 15.552484512329102, -55.25654220581055, -26.884889602661133, 0.159261092543602 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -120,7 +120,7 @@ const tanTests = [ -0.025338610634207726, -4.203672409057617, -0.1567438244819641, 3.495089292526245, 5.453553199768066, 0.16062140464782715 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -140,7 +140,7 @@ const tanTests = [ 84.79766845703125, -95.58502960205078, 15.552484512329102, -55.25654220581055, -26.884889602661133, 0.159261092543602 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -160,7 +160,7 @@ const tanTests = [ -0.025338610634207726, -4.203672409057617, -0.1567438244819641, 3.495089292526245, 5.453553199768066, 0.16062140464782715 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -180,7 +180,7 @@ const tanTests = [ 84.79766845703125, -95.58502960205078, 15.552484512329102, -55.25654220581055, -26.884889602661133, 0.159261092543602 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -200,7 +200,7 @@ const tanTests = [ -0.025338610634207726, -4.203672409057617, -0.1567438244819641, 3.495089292526245, 5.453553199768066, 0.16062140464782715 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -220,7 +220,7 @@ const tanTests = [ 84.79766845703125, -95.58502960205078, 15.552484512329102, -55.25654220581055, -26.884889602661133, 0.159261092543602 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -240,7 +240,7 @@ const tanTests = [ -0.025338610634207726, -4.203672409057617, -0.1567438244819641, 3.495089292526245, 5.453553199768066, 0.16062140464782715 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -260,7 +260,7 @@ const tanTests = [ 84.79766845703125, -95.58502960205078, 15.552484512329102, -55.25654220581055, -26.884889602661133, 0.159261092543602 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } }, 'operators': [{ @@ -280,7 +280,7 @@ const tanTests = [ -0.025338610634207726, -4.203672409057617, -0.1567438244819641, 3.495089292526245, 5.453553199768066, 0.16062140464782715 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/tanh.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/tanh.https.any.js index 8fc7317a2cf5..ad35c0e3fc30 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/tanh.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/tanh.https.any.js @@ -38,7 +38,7 @@ const tanhTests = [ -1.443918228149414, -1.9129083156585693, 2.7495968341827393, -0.7420240044593811, 4.856568336486816, -0.7563357949256897 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -59,7 +59,7 @@ const tanhTests = [ -0.894483745098114, -0.9573289752006531, 0.9918531775474548, -0.6303664445877075, 0.9998790621757507, -0.6389135718345642 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -79,7 +79,7 @@ const tanhTests = [ -1.443918228149414, -1.9129083156585693, 2.7495968341827393, -0.7420240044593811, 4.856568336486816, -0.7563357949256897 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -99,7 +99,7 @@ const tanhTests = [ -0.894483745098114, -0.9573289752006531, 0.9918531775474548, -0.6303664445877075, 0.9998790621757507, -0.6389135718345642 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -119,7 +119,7 @@ const tanhTests = [ -1.443918228149414, -1.9129083156585693, 2.7495968341827393, -0.7420240044593811, 4.856568336486816, -0.7563357949256897 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -139,7 +139,7 @@ const tanhTests = [ -0.894483745098114, -0.9573289752006531, 0.9918531775474548, -0.6303664445877075, 0.9998790621757507, -0.6389135718345642 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -159,7 +159,7 @@ const tanhTests = [ -1.443918228149414, -1.9129083156585693, 2.7495968341827393, -0.7420240044593811, 4.856568336486816, -0.7563357949256897 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -179,7 +179,7 @@ const tanhTests = [ -0.894483745098114, -0.9573289752006531, 0.9918531775474548, -0.6303664445877075, 0.9998790621757507, -0.6389135718345642 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -199,7 +199,7 @@ const tanhTests = [ -1.443918228149414, -1.9129083156585693, 2.7495968341827393, -0.7420240044593811, 4.856568336486816, -0.7563357949256897 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -219,7 +219,7 @@ const tanhTests = [ -0.894483745098114, -0.9573289752006531, 0.9918531775474548, -0.6303664445877075, 0.9998790621757507, -0.6389135718345642 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -239,7 +239,7 @@ const tanhTests = [ -1.443918228149414, -1.9129083156585693, 2.7495968341827393, -0.7420240044593811, 4.856568336486816, -0.7563357949256897 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } }, 'operators': [{ @@ -259,7 +259,7 @@ const tanhTests = [ -0.894483745098114, -0.9573289752006531, 0.9918531775474548, -0.6303664445877075, 0.9998790621757507, -0.6389135718345642 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/tensor.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/tensor.https.any.js index 68153b8afd42..51905bbaf3c5 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/tensor.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/tensor.https.any.js @@ -27,17 +27,13 @@ const bytesPerDataType = (dataType) => { }; const sizeOfDescriptor = (descriptor) => { - return descriptor.dimensions.reduce( + return descriptor.shape.reduce( (accumulator, currentValue) => accumulator * currentValue, bytesPerDataType(descriptor.dataType)); }; const getDescriptorFromTensor = (tensor) => { - return { - dataType: tensor.dataType, - dimensions: tensor.shape, - usage: tensor.usage - }; + return {dataType: tensor.dataType, shape: tensor.shape, usage: tensor.usage}; }; @@ -57,7 +53,7 @@ const testDestroyTensor = (testName) => { try { const mlTensor = - await mlContext.createTensor({dataType: 'int32', dimensions: [2, 3]}); + await mlContext.createTensor({dataType: 'int32', shape: [2, 3]}); } catch (e) { throw new AssertionError( `Unable to create tensor for ${variant} variant. ${e}`); @@ -65,7 +61,7 @@ const testDestroyTensor = (testName) => { }); promise_test(async () => { let mlTensor = - await mlContext.createTensor({dataType: 'int32', dimensions: [2, 3]}); + await mlContext.createTensor({dataType: 'int32', shape: [2, 3]}); mlTensor.destroy(); mlTensor.destroy(); }, `${testName}`); @@ -100,8 +96,7 @@ const testCreateTensor = (testName, tensorDescriptor) => { mlTensor.dataType, tensorDescriptor.dataType, 'tensor data types do not match'); assert_array_equals( - mlTensor.shape, tensorDescriptor.dimensions, - 'tensor shapes do not match'); + mlTensor.shape, tensorDescriptor.shape, 'tensor shapes do not match'); }, `${testName} / ${tensorDescriptor.dataType}`); }; @@ -156,7 +151,7 @@ const testWriteTensor = (testName) => { try { const mlTensor = - await mlContext.createTensor({dataType: 'int32', dimensions: [2, 3]}); + await mlContext.createTensor({dataType: 'int32', shape: [2, 3]}); } catch (e) { throw new AssertionError( `Unable to create tensor for ${variant} variant. ${e}`); @@ -166,7 +161,7 @@ const testWriteTensor = (testName) => { promise_test(async () => { const tensorDescriptor = { dataType: 'int32', - dimensions: [1], + shape: [1], usage: MLTensorUsage.WRITE, }; let mlTensor = await mlContext.createTensor(tensorDescriptor); @@ -215,7 +210,7 @@ const testWriteTensor = (testName) => { promise_test(async () => { const tensorDescriptor = { dataType: 'int32', - dimensions: [2, 2], + shape: [2, 2], usage: MLTensorUsage.WRITE, }; let mlTensor = await mlContext.createTensor(tensorDescriptor); @@ -232,7 +227,7 @@ const testWriteTensor = (testName) => { promise_test(async () => { const tensorDescriptor = { dataType: 'int32', - dimensions: [2, 3], + shape: [2, 3], usage: MLTensorUsage.WRITE, }; let mlTensor = await mlContext.createTensor(tensorDescriptor); @@ -251,7 +246,7 @@ const testWriteTensor = (testName) => { promise_test(async () => { let mlTensor = await mlContext.createTensor({ dataType: 'int32', - dimensions: [1], + shape: [1], usage: MLTensorUsage.WRITE | MLTensorUsage.READ, }); @@ -274,7 +269,7 @@ const testWriteTensor = (testName) => { promise_test(async () => { const tensorDescriptor = { dataType: 'int32', - dimensions: [2, 2], + shape: [2, 2], usage: MLTensorUsage.WRITE | MLTensorUsage.READ, }; let mlTensor = await mlContext.createTensor(tensorDescriptor); @@ -315,7 +310,7 @@ const testReadTensor = (testName) => { try { const mlTensor = - await mlContext.createTensor({dataType: 'int32', dimensions: [2, 3]}); + await mlContext.createTensor({dataType: 'int32', shape: [2, 3]}); } catch (e) { throw new AssertionError( `Unable to create tensor for ${variant} variant. ${e}`); @@ -325,7 +320,7 @@ const testReadTensor = (testName) => { promise_test(async t => { let mlTensor = await mlContext.createTensor({ dataType: 'int32', - dimensions: [2, 2], + shape: [2, 2], usage: MLTensorUsage.READ, }); @@ -339,7 +334,7 @@ const testReadTensor = (testName) => { promise_test(async t => { let mlTensor = await mlContext.createTensor({ dataType: 'int32', - dimensions: [2, 3], + shape: [2, 3], usage: MLTensorUsage.READ, }); @@ -355,7 +350,7 @@ const testReadTensor = (testName) => { promise_test(async () => { let mlTensor = await mlContext.createTensor({ dataType: 'int32', - dimensions: [1024], + shape: [1024], usage: MLTensorUsage.READ, }); @@ -365,7 +360,7 @@ const testReadTensor = (testName) => { promise_test(async () => { let mlTensor = await mlContext.createTensor({ dataType: 'int32', - dimensions: [1], + shape: [1], usage: MLTensorUsage.READ | MLTensorUsage.WRITE, }); @@ -381,7 +376,7 @@ const testReadTensor = (testName) => { promise_test(async () => { let mlTensor = await mlContext.createTensor({ dataType: 'int32', - dimensions: [1], + shape: [1], usage: MLTensorUsage.WRITE | MLTensorUsage.READ, }); @@ -399,7 +394,7 @@ const testReadTensor = (testName) => { promise_test(async () => { let mlTensor = await mlContext.createTensor({ dataType: 'int32', - dimensions: [1], + shape: [1], usage: MLTensorUsage.WRITE | MLTensorUsage.READ, }); @@ -417,7 +412,7 @@ const testReadTensor = (testName) => { promise_test(async () => { let mlTensor = await mlContext.createTensor({ dataType: 'int32', - dimensions: [1], + shape: [1], usage: MLTensorUsage.WRITE | MLTensorUsage.READ, }); @@ -435,7 +430,7 @@ const testReadTensor = (testName) => { promise_test(async () => { let mlTensor = await mlContext.createTensor({ dataType: 'int32', - dimensions: [1], + shape: [1], usage: MLTensorUsage.WRITE | MLTensorUsage.READ, }); @@ -452,7 +447,7 @@ const testReadTensor = (testName) => { promise_test(async t => { const tensorDescriptor = { dataType: 'int32', - dimensions: [2, 3], + shape: [2, 3], usage: MLTensorUsage.READ, }; let mlTensor = await mlContext.createTensor(tensorDescriptor); @@ -488,7 +483,7 @@ const testDispatchTensor = (testName) => { const builder = new MLGraphBuilder(mlContext); const tensorDescriptor = { dataType: 'float32', - dimensions: shape, + shape: shape, usage: MLTensorUsage.WRITE | MLTensorUsage.READ, }; const lhsOperand = builder.input('lhs', tensorDescriptor); @@ -500,7 +495,7 @@ const testDispatchTensor = (testName) => { try { const mlTensor = - await mlContext.createTensor({dataType: 'int32', dimensions: [2, 3]}); + await mlContext.createTensor({dataType: 'int32', shape: [2, 3]}); } catch (e) { throw new AssertionError( `Unable to create tensor for ${variant} variant. ${e}`); @@ -551,7 +546,7 @@ const testDispatchTensor = (testName) => { const lhsTensor = await mlContext.createTensor({ dataType: inputs['lhs'].dataType, // Input rank is too high. - dimensions: inputs['lhs'].shape.concat([2]) + shape: inputs['lhs'].shape.concat([2]) }); assert_throws_js( @@ -566,7 +561,7 @@ const testDispatchTensor = (testName) => { const rhsTensor = await mlContext.createTensor({ dataType: inputs['rhs'].dataType, // Input rank is too low. - dimensions: inputs['rhs'].shape.slice(1) + shape: inputs['rhs'].shape.slice(1) }); assert_throws_js( @@ -582,7 +577,7 @@ const testDispatchTensor = (testName) => { let output1WrongShape = [...outputs['output1'].shape]; output1WrongShape[0] += 2; const outputTensor1 = await mlContext.createTensor( - {dataType: outputs['output1'].dataType, dimensions: output1WrongShape}); + {dataType: outputs['output1'].dataType, shape: output1WrongShape}); assert_throws_js(TypeError, () => mlContext.dispatch(mlGraph, inputs, { 'output1': outputTensor1, @@ -593,7 +588,7 @@ const testDispatchTensor = (testName) => { let output2WrongShape = [...outputs['output2'].shape]; output2WrongShape[1] -= 1; const outputTensor2 = await mlContext.createTensor( - {dataType: outputs['output2'].dataType, dimensions: output2WrongShape}); + {dataType: outputs['output2'].dataType, shape: output2WrongShape}); assert_throws_js(TypeError, () => mlContext.dispatch(mlGraph, inputs, { 'output1': outputs['output1'], @@ -613,10 +608,8 @@ const testDispatchTensor = (testName) => { TypeError, () => mlContext.dispatch( mlGraph, { - 'lhs': mlContext.createTensor({ - dataType: inputWrongDataType, - dimensions: inputs['lhs'].shape - }), + 'lhs': mlContext.createTensor( + {dataType: inputWrongDataType, shape: inputs['lhs'].shape}), 'rhs': inputs['rhs'], }, outputs)); @@ -626,10 +619,8 @@ const testDispatchTensor = (testName) => { () => mlContext.dispatch( mlGraph, { 'lhs': inputs['lhs'], - 'rhs': mlContext.createTensor({ - dataType: inputWrongDataType, - dimensions: inputs['rhs'].shape - }), + 'rhs': mlContext.createTensor( + {dataType: inputWrongDataType, shape: inputs['rhs'].shape}), }, outputs)); @@ -638,7 +629,7 @@ const testDispatchTensor = (testName) => { assert_not_equals(outputs['output1'].dataType, outputWrongDataType); assert_not_equals(outputs['output2'].dataType, outputWrongDataType); const outputTensor1 = await mlContext.createTensor( - {dataType: outputWrongDataType, dimensions: outputs['output1'].shape}); + {dataType: outputWrongDataType, shape: outputs['output1'].shape}); assert_throws_js(TypeError, () => mlContext.dispatch(mlGraph, inputs, { 'output1': outputTensor1, @@ -646,7 +637,7 @@ const testDispatchTensor = (testName) => { })); const outputTensor2 = await mlContext.createTensor( - {dataType: outputWrongDataType, dimensions: outputs['output2'].shape}); + {dataType: outputWrongDataType, shape: outputs['output2'].shape}); assert_throws_js(TypeError, () => mlContext.dispatch(mlGraph, inputs, { 'output1': outputs['output1'], @@ -961,7 +952,7 @@ const testDispatchTensor = (testName) => { promise_test(async () => { // Construct a simple graph: OUTPUT = LHS - RHS. const builder = new MLGraphBuilder(mlContext); - const operandType = {dataType: 'float32', dimensions: shape}; + const operandType = {dataType: 'float32', shape}; const lhsOperand = builder.input('lhs', operandType); const rhsOperand = builder.input('rhs', operandType); const graph = @@ -1148,16 +1139,16 @@ const testDispatchTensor = (testName) => { }; if (navigator.ml) { - testCreateTensor('create', {dataType: 'float16', dimensions: [2, 3]}); - testCreateTensor('create', {dataType: 'float32', dimensions: [1, 5]}); - testCreateTensor('create', {dataType: 'int32', dimensions: [4]}); - testCreateTensor('create', {dataType: 'uint8', dimensions: [3, 2, 4]}); + testCreateTensor('create', {dataType: 'float16', shape: [2, 3]}); + testCreateTensor('create', {dataType: 'float32', shape: [1, 5]}); + testCreateTensor('create', {dataType: 'int32', shape: [4]}); + testCreateTensor('create', {dataType: 'uint8', shape: [3, 2, 4]}); testCreateTensorFails( - 'createFailsEmptyDimension', {dataType: 'int32', dimensions: [2, 0, 3]}); + 'createFailsEmptyDimension', {dataType: 'int32', shape: [2, 0, 3]}); testCreateTensorFails('createFailsTooLarge', { dataType: 'int32', - dimensions: [kMaxUnsignedLong, kMaxUnsignedLong, kMaxUnsignedLong] + shape: [kMaxUnsignedLong, kMaxUnsignedLong, kMaxUnsignedLong] }); testDestroyTensor('destroyTwice'); 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 index 427fd2160159..f85518e52486 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/tile.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/tile.https.any.js @@ -28,7 +28,7 @@ const tileTests = [ 'inputs': { 'tileInput': { 'data': [1, 2, 3, 4], - 'descriptor': {'dimensions': [4], 'dataType': 'float32'}, + 'descriptor': {shape: [4], dataType: 'float32'}, 'constant': true } }, @@ -40,7 +40,7 @@ const tileTests = [ 'expectedOutputs': { 'tileOutput': { 'data': [1, 2, 3, 4, 1, 2, 3, 4], - 'descriptor': {'dimensions': [8], 'dataType': 'float32'} + 'descriptor': {shape: [8], dataType: 'float32'} } } } @@ -51,7 +51,7 @@ const tileTests = [ 'inputs': { 'tileInput': { 'data': [1, 2, 3, 4], - 'descriptor': {'dimensions': [2, 2], 'dataType': 'uint32'}, + 'descriptor': {shape: [2, 2], dataType: 'uint32'}, 'constant': true } }, @@ -66,7 +66,7 @@ const tileTests = [ 1, 2, 1, 2, 1, 2, 3, 4, 3, 4, 3, 4, 1, 2, 1, 2, 1, 2, 3, 4, 3, 4, 3, 4 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'uint32'} + 'descriptor': {shape: [4, 6], dataType: 'uint32'} } } } @@ -77,7 +77,7 @@ const tileTests = [ 'inputs': { 'tileInput': { 'data': [1, 2, 3, 4], - 'descriptor': {'dimensions': [1, 1, 2, 2], 'dataType': 'int32'}, + 'descriptor': {shape: [1, 1, 2, 2], dataType: 'int32'}, 'constant': true } }, @@ -89,7 +89,7 @@ const tileTests = [ 'expectedOutputs': { 'tileOutput': { 'data': [1, 2, 1, 2, 3, 4, 3, 4, 1, 2, 1, 2, 3, 4, 3, 4], - 'descriptor': {'dimensions': [1, 1, 4, 4], 'dataType': 'int32'} + 'descriptor': {shape: [1, 1, 4, 4], dataType: 'int32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/transpose.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/transpose.https.any.js index 61f043a9b0fc..4370c63de4ab 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/transpose.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/transpose.https.any.js @@ -43,7 +43,7 @@ const transposeTests = [ 99.46284484863281, -87.58920288085938, -65.3779067993164, -66.00990295410156, 38.466827392578125, 2.1999382972717285 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -64,7 +64,7 @@ const transposeTests = [ 99.46284484863281, -87.58920288085938, -65.3779067993164, -66.00990295410156, 38.466827392578125, 2.1999382972717285 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -84,7 +84,7 @@ const transposeTests = [ 99.46284484863281, -87.58920288085938, -65.3779067993164, -66.00990295410156, 38.466827392578125, 2.1999382972717285 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -104,7 +104,7 @@ const transposeTests = [ 99.46284484863281, -87.58920288085938, -65.3779067993164, -66.00990295410156, 38.466827392578125, 2.1999382972717285 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -124,7 +124,7 @@ const transposeTests = [ 99.46284484863281, -87.58920288085938, -65.3779067993164, -66.00990295410156, 38.466827392578125, 2.1999382972717285 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -144,7 +144,7 @@ const transposeTests = [ 5.62217378616333, 38.466827392578125, -69.25324249267578, -84.74308776855469, -25.66281509399414, 2.1999382972717285 ], - 'descriptor': {'dimensions': [6, 4], 'dataType': 'float32'} + 'descriptor': {shape: [6, 4], dataType: 'float32'} } } } @@ -164,7 +164,7 @@ const transposeTests = [ 99.46284484863281, -87.58920288085938, -65.3779067993164, -66.00990295410156, 38.466827392578125, 2.1999382972717285 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -184,7 +184,7 @@ const transposeTests = [ 38.081748962402344, -25.695144653320312, 92.8102798461914, -87.58920288085938, -84.74308776855469, 2.1999382972717285 ], - 'descriptor': {'dimensions': [4, 3, 2], 'dataType': 'float32'} + 'descriptor': {shape: [4, 3, 2], dataType: 'float32'} } } } @@ -204,7 +204,7 @@ const transposeTests = [ 99.46284484863281, -87.58920288085938, -65.3779067993164, -66.00990295410156, 38.466827392578125, 2.1999382972717285 ], - 'descriptor': {'dimensions': [1, 2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -224,7 +224,7 @@ const transposeTests = [ 38.081748962402344, -25.695144653320312, 92.8102798461914, -87.58920288085938, -84.74308776855469, 2.1999382972717285 ], - 'descriptor': {'dimensions': [4, 3, 2, 1], 'dataType': 'float32'} + 'descriptor': {shape: [4, 3, 2, 1], dataType: 'float32'} } } } @@ -244,7 +244,7 @@ const transposeTests = [ 99.46284484863281, -87.58920288085938, -65.3779067993164, -66.00990295410156, 38.466827392578125, 2.1999382972717285 ], - 'descriptor': {'dimensions': [1, 2, 1, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -264,7 +264,7 @@ const transposeTests = [ 38.081748962402344, -25.695144653320312, 92.8102798461914, -87.58920288085938, -84.74308776855469, 2.1999382972717285 ], - 'descriptor': {'dimensions': [4, 3, 1, 2, 1], 'dataType': 'float32'} + 'descriptor': {shape: [4, 3, 1, 2, 1], dataType: 'float32'} } } } @@ -284,7 +284,7 @@ const transposeTests = [ 99.46284484863281, -87.58920288085938, -65.3779067993164, -66.00990295410156, 38.466827392578125, 2.1999382972717285 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -305,7 +305,7 @@ const transposeTests = [ 99.46284484863281, -87.58920288085938, -65.3779067993164, -66.00990295410156, 38.466827392578125, 2.1999382972717285 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -325,7 +325,7 @@ const transposeTests = [ 99.46284484863281, -87.58920288085938, -65.3779067993164, -66.00990295410156, 38.466827392578125, 2.1999382972717285 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -346,7 +346,7 @@ const transposeTests = [ 5.62217378616333, 38.466827392578125, -69.25324249267578, -84.74308776855469, -25.66281509399414, 2.1999382972717285 ], - 'descriptor': {'dimensions': [6, 4], 'dataType': 'float32'} + 'descriptor': {shape: [6, 4], dataType: 'float32'} } } } @@ -366,7 +366,7 @@ const transposeTests = [ 99.46284484863281, -87.58920288085938, -65.3779067993164, -66.00990295410156, 38.466827392578125, 2.1999382972717285 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -388,7 +388,7 @@ const transposeTests = [ 38.081748962402344, 92.8102798461914, -84.74308776855469, -25.695144653320312, -87.58920288085938, 2.1999382972717285 ], - 'descriptor': {'dimensions': [4, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [4, 2, 3], dataType: 'float32'} } } } @@ -408,7 +408,7 @@ const transposeTests = [ 99.46284484863281, -87.58920288085938, -65.3779067993164, -66.00990295410156, 38.466827392578125, 2.1999382972717285 ], - 'descriptor': {'dimensions': [1, 2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -431,7 +431,7 @@ const transposeTests = [ 77.05838012695312, -66.00990295410156, 57.46807861328125, 38.466827392578125, -84.74308776855469, 2.1999382972717285 ], - 'descriptor': {'dimensions': [3, 4, 1, 2], 'dataType': 'float32'} + 'descriptor': {shape: [3, 4, 1, 2], dataType: 'float32'} } } } @@ -451,7 +451,7 @@ const transposeTests = [ 99.46284484863281, -87.58920288085938, -65.3779067993164, -66.00990295410156, 38.466827392578125, 2.1999382972717285 ], - 'descriptor': {'dimensions': [1, 2, 1, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -474,7 +474,7 @@ const transposeTests = [ 99.46284484863281, -87.58920288085938, -65.3779067993164, -66.00990295410156, 38.466827392578125, 2.1999382972717285 ], - 'descriptor': {'dimensions': [2, 3, 1, 4, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 1, 4, 1], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/triangular.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/triangular.https.any.js index 7c79518d43f9..64a33e4a4c2d 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/triangular.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/triangular.https.any.js @@ -46,7 +46,7 @@ const triangularTests = [ 20.88446617126465, 71.37139892578125, -84.96932220458984, -88.97057342529297, 77.58269500732422, 91.03327178955078 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -82,7 +82,7 @@ const triangularTests = [ 77.58269500732422, 91.03327178955078 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -102,7 +102,7 @@ const triangularTests = [ 20.88446617126465, 71.37139892578125, -84.96932220458984, -88.97057342529297, 77.58269500732422, 91.03327178955078 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -138,7 +138,7 @@ const triangularTests = [ 77.58269500732422, 91.03327178955078 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -158,7 +158,7 @@ const triangularTests = [ 20.88446617126465, 71.37139892578125, -84.96932220458984, -88.97057342529297, 77.58269500732422, 91.03327178955078 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -182,7 +182,7 @@ const triangularTests = [ -84.96932220458984, 0, 77.58269500732422, 91.03327178955078 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -202,7 +202,7 @@ const triangularTests = [ 20.88446617126465, 71.37139892578125, -84.96932220458984, -88.97057342529297, 77.58269500732422, 91.03327178955078 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } }, 'operators': [{ @@ -222,7 +222,7 @@ const triangularTests = [ 20.88446617126465, 71.37139892578125, -84.96932220458984, -88.97057342529297, 77.58269500732422, 91.03327178955078 ], - 'descriptor': {'dimensions': [2, 1, 4, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} } } } @@ -242,7 +242,7 @@ const triangularTests = [ 20.88446617126465, 71.37139892578125, -84.96932220458984, -88.97057342529297, 77.58269500732422, 91.03327178955078 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -267,7 +267,7 @@ const triangularTests = [ -84.96932220458984, 0, 77.58269500732422, 91.03327178955078 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -287,7 +287,7 @@ const triangularTests = [ 20.88446617126465, 71.37139892578125, -84.96932220458984, -88.97057342529297, 77.58269500732422, 91.03327178955078 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -324,7 +324,7 @@ const triangularTests = [ 77.58269500732422, 0 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -344,7 +344,7 @@ const triangularTests = [ 20.88446617126465, 71.37139892578125, -84.96932220458984, -88.97057342529297, 77.58269500732422, 91.03327178955078 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -369,7 +369,7 @@ const triangularTests = [ -84.96932220458984, 0, 77.58269500732422, 91.03327178955078 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -389,7 +389,7 @@ const triangularTests = [ 20.88446617126465, 71.37139892578125, -84.96932220458984, -88.97057342529297, 77.58269500732422, 91.03327178955078 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -426,7 +426,7 @@ const triangularTests = [ 0, 91.03327178955078 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -446,7 +446,7 @@ const triangularTests = [ 20.88446617126465, 71.37139892578125, -84.96932220458984, -88.97057342529297, 77.58269500732422, 91.03327178955078 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -467,7 +467,7 @@ const triangularTests = [ 20.88446617126465, 71.37139892578125, -84.96932220458984, -88.97057342529297, 77.58269500732422, 91.03327178955078 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -487,7 +487,7 @@ const triangularTests = [ 20.88446617126465, 71.37139892578125, -84.96932220458984, -88.97057342529297, 77.58269500732422, 91.03327178955078 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -502,7 +502,7 @@ const triangularTests = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -522,7 +522,7 @@ const triangularTests = [ 20.88446617126465, 71.37139892578125, -84.96932220458984, -88.97057342529297, 77.58269500732422, 91.03327178955078 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -543,7 +543,7 @@ const triangularTests = [ 20.88446617126465, 71.37139892578125, -84.96932220458984, -88.97057342529297, 77.58269500732422, 91.03327178955078 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -564,7 +564,7 @@ const triangularTests = [ 20.88446617126465, 71.37139892578125, -84.96932220458984, -88.97057342529297, 77.58269500732422, 91.03327178955078 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -603,7 +603,7 @@ const triangularTests = [ 0, 91.03327178955078 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -624,7 +624,7 @@ const triangularTests = [ 20.88446617126465, 71.37139892578125, -84.96932220458984, -88.97057342529297, 77.58269500732422, 91.03327178955078 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -647,7 +647,7 @@ const triangularTests = [ 20.88446617126465, 71.37139892578125, 0, -88.97057342529297, 77.58269500732422, 91.03327178955078 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -668,7 +668,7 @@ const triangularTests = [ 20.88446617126465, 71.37139892578125, -84.96932220458984, -88.97057342529297, 77.58269500732422, 91.03327178955078 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -687,7 +687,7 @@ const triangularTests = [ 0, 0, 0, 67.48285675048828, 0, 0, 0, 0, 0, -88.97057342529297, 0, 0 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -708,7 +708,7 @@ const triangularTests = [ 20.88446617126465, 71.37139892578125, -84.96932220458984, -88.97057342529297, 77.58269500732422, 91.03327178955078 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -731,7 +731,7 @@ const triangularTests = [ 20.88446617126465, 71.37139892578125, -84.96932220458984, -88.97057342529297, 77.58269500732422, 91.03327178955078 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -752,7 +752,7 @@ const triangularTests = [ 20.88446617126465, 71.37139892578125, -84.96932220458984, -88.97057342529297, 77.58269500732422, 91.03327178955078 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -769,7 +769,7 @@ const triangularTests = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/conformance_tests/where.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/where.https.any.js index 957f82860839..10a206a8f65e 100644 --- a/testing/web-platform/tests/webnn/conformance_tests/where.https.any.js +++ b/testing/web-platform/tests/webnn/conformance_tests/where.https.any.js @@ -28,17 +28,15 @@ const whereTests = [ 'name': 'where float32 0D scalars', 'graph': { 'inputs': { - 'inputCondition': { - 'data': [247], - 'descriptor': {'dimensions': [], 'dataType': 'uint8'} - }, + 'inputCondition': + {'data': [247], 'descriptor': {shape: [], dataType: 'uint8'}}, 'inputTrueValue': { 'data': [-22.83924102783203], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} }, 'inputFalseValue': { 'data': [-50.02232360839844], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } }, 'operators': [{ @@ -52,7 +50,7 @@ const whereTests = [ 'expectedOutputs': { 'whereOutput': { 'data': [-22.83924102783203], - 'descriptor': {'dimensions': [], 'dataType': 'float32'} + 'descriptor': {shape: [], dataType: 'float32'} } } } @@ -66,7 +64,7 @@ const whereTests = [ 241, 0, 85, 0, 227, 51, 202, 0, 104, 227, 129, 129, 175, 134, 130, 140, 103, 46, 158, 17, 0, 41, 94, 0 ], - 'descriptor': {'dimensions': [24], 'dataType': 'uint8'}, + 'descriptor': {shape: [24], dataType: 'uint8'}, 'constant': true }, 'inputTrueValue': { @@ -80,7 +78,7 @@ const whereTests = [ -29.081029891967773, -12.19106674194336, -10.8577880859375, -23.302522659301758, 30.851404190063477, -58.82704544067383 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true }, 'inputFalseValue': { @@ -94,7 +92,7 @@ const whereTests = [ 22.937334060668945, 74.97810363769531, 18.877336502075195, 62.31299591064453, 48.867103576660156, -75.41789245605469 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'}, + 'descriptor': {shape: [24], dataType: 'float32'}, 'constant': true } }, @@ -118,7 +116,7 @@ const whereTests = [ -29.081029891967773, -12.19106674194336, 18.877336502075195, -23.302522659301758, 30.851404190063477, -75.41789245605469 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -132,7 +130,7 @@ const whereTests = [ 241, 0, 85, 0, 227, 51, 202, 0, 104, 227, 129, 129, 175, 134, 130, 140, 103, 46, 158, 17, 0, 41, 94, 0 ], - 'descriptor': {'dimensions': [24], 'dataType': 'uint8'} + 'descriptor': {shape: [24], dataType: 'uint8'} }, 'inputTrueValue': { 'data': [ @@ -145,7 +143,7 @@ const whereTests = [ -29.081029891967773, -12.19106674194336, -10.8577880859375, -23.302522659301758, 30.851404190063477, -58.82704544067383 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} }, 'inputFalseValue': { 'data': [ @@ -158,7 +156,7 @@ const whereTests = [ 22.937334060668945, 74.97810363769531, 18.877336502075195, 62.31299591064453, 48.867103576660156, -75.41789245605469 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } }, 'operators': [{ @@ -181,7 +179,7 @@ const whereTests = [ -29.081029891967773, -12.19106674194336, 18.877336502075195, -23.302522659301758, 30.851404190063477, -75.41789245605469 ], - 'descriptor': {'dimensions': [24], 'dataType': 'float32'} + 'descriptor': {shape: [24], dataType: 'float32'} } } } @@ -195,7 +193,7 @@ const whereTests = [ 241, 0, 85, 0, 227, 51, 202, 0, 104, 227, 129, 129, 175, 134, 130, 140, 103, 46, 158, 17, 0, 41, 94, 0 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'uint8'} + 'descriptor': {shape: [4, 6], dataType: 'uint8'} }, 'inputTrueValue': { 'data': [ @@ -208,7 +206,7 @@ const whereTests = [ -29.081029891967773, -12.19106674194336, -10.8577880859375, -23.302522659301758, 30.851404190063477, -58.82704544067383 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} }, 'inputFalseValue': { 'data': [ @@ -221,7 +219,7 @@ const whereTests = [ 22.937334060668945, 74.97810363769531, 18.877336502075195, 62.31299591064453, 48.867103576660156, -75.41789245605469 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } }, 'operators': [{ @@ -244,7 +242,7 @@ const whereTests = [ -29.081029891967773, -12.19106674194336, 18.877336502075195, -23.302522659301758, 30.851404190063477, -75.41789245605469 ], - 'descriptor': {'dimensions': [4, 6], 'dataType': 'float32'} + 'descriptor': {shape: [4, 6], dataType: 'float32'} } } } @@ -258,7 +256,7 @@ const whereTests = [ 241, 0, 85, 0, 227, 51, 202, 0, 104, 227, 129, 129, 175, 134, 130, 140, 103, 46, 158, 17, 0, 41, 94, 0 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 3, 4], dataType: 'uint8'} }, 'inputTrueValue': { 'data': [ @@ -271,7 +269,7 @@ const whereTests = [ -29.081029891967773, -12.19106674194336, -10.8577880859375, -23.302522659301758, 30.851404190063477, -58.82704544067383 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} }, 'inputFalseValue': { 'data': [ @@ -284,7 +282,7 @@ const whereTests = [ 22.937334060668945, 74.97810363769531, 18.877336502075195, 62.31299591064453, 48.867103576660156, -75.41789245605469 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } }, 'operators': [{ @@ -307,7 +305,7 @@ const whereTests = [ -29.081029891967773, -12.19106674194336, 18.877336502075195, -23.302522659301758, 30.851404190063477, -75.41789245605469 ], - 'descriptor': {'dimensions': [2, 3, 4], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} } } } @@ -321,7 +319,7 @@ const whereTests = [ 241, 0, 85, 0, 227, 51, 202, 0, 104, 227, 129, 129, 175, 134, 130, 140, 103, 46, 158, 17, 0, 41, 94, 0 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} }, 'inputTrueValue': { 'data': [ @@ -334,7 +332,7 @@ const whereTests = [ -29.081029891967773, -12.19106674194336, -10.8577880859375, -23.302522659301758, 30.851404190063477, -58.82704544067383 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputFalseValue': { 'data': [ @@ -347,7 +345,7 @@ const whereTests = [ 22.937334060668945, 74.97810363769531, 18.877336502075195, 62.31299591064453, 48.867103576660156, -75.41789245605469 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -370,7 +368,7 @@ const whereTests = [ -29.081029891967773, -12.19106674194336, 18.877336502075195, -23.302522659301758, 30.851404190063477, -75.41789245605469 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -384,7 +382,7 @@ const whereTests = [ 241, 0, 85, 0, 227, 51, 202, 0, 104, 227, 129, 129, 175, 134, 130, 140, 103, 46, 158, 17, 0, 41, 94, 0 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'uint8'} }, 'inputTrueValue': { 'data': [ @@ -397,7 +395,7 @@ const whereTests = [ -29.081029891967773, -12.19106674194336, -10.8577880859375, -23.302522659301758, 30.851404190063477, -58.82704544067383 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} }, 'inputFalseValue': { 'data': [ @@ -410,7 +408,7 @@ const whereTests = [ 22.937334060668945, 74.97810363769531, 18.877336502075195, 62.31299591064453, 48.867103576660156, -75.41789245605469 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -433,7 +431,7 @@ const whereTests = [ -29.081029891967773, -12.19106674194336, 18.877336502075195, -23.302522659301758, 30.851404190063477, -75.41789245605469 ], - 'descriptor': {'dimensions': [2, 2, 1, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 2, 3], dataType: 'float32'} } } } @@ -442,10 +440,8 @@ const whereTests = [ 'name': 'where float32 4D tensors only broadcast condition 0D to 4D', 'graph': { 'inputs': { - 'inputCondition': { - 'data': [247], - 'descriptor': {'dimensions': [], 'dataType': 'uint8'} - }, + 'inputCondition': + {'data': [247], 'descriptor': {shape: [], dataType: 'uint8'}}, 'inputTrueValue': { 'data': [ 70.27151489257812, 89.99047088623047, -1.5351932048797607, @@ -457,7 +453,7 @@ const whereTests = [ -29.081029891967773, -12.19106674194336, -10.8577880859375, -23.302522659301758, 30.851404190063477, -58.82704544067383 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputFalseValue': { 'data': [ @@ -470,7 +466,7 @@ const whereTests = [ 22.937334060668945, 74.97810363769531, 18.877336502075195, 62.31299591064453, 48.867103576660156, -75.41789245605469 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -493,7 +489,7 @@ const whereTests = [ -29.081029891967773, -12.19106674194336, -10.8577880859375, -23.302522659301758, 30.851404190063477, -58.82704544067383 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -504,7 +500,7 @@ const whereTests = [ 'inputs': { 'inputCondition': { 'data': [253, 222, 0], - 'descriptor': {'dimensions': [3], 'dataType': 'uint8'} + 'descriptor': {shape: [3], dataType: 'uint8'} }, 'inputTrueValue': { 'data': [ @@ -517,7 +513,7 @@ const whereTests = [ -29.081029891967773, -12.19106674194336, -10.8577880859375, -23.302522659301758, 30.851404190063477, -58.82704544067383 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputFalseValue': { 'data': [ @@ -530,7 +526,7 @@ const whereTests = [ 22.937334060668945, 74.97810363769531, 18.877336502075195, 62.31299591064453, 48.867103576660156, -75.41789245605469 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -553,7 +549,7 @@ const whereTests = [ -29.081029891967773, -12.19106674194336, 18.877336502075195, -23.302522659301758, 30.851404190063477, -75.41789245605469 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -564,7 +560,7 @@ const whereTests = [ 'inputs': { 'inputCondition': { 'data': [103, 0], - 'descriptor': {'dimensions': [2, 1], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 1], dataType: 'uint8'} }, 'inputTrueValue': { 'data': [ @@ -577,7 +573,7 @@ const whereTests = [ -29.081029891967773, -12.19106674194336, -10.8577880859375, -23.302522659301758, 30.851404190063477, -58.82704544067383 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputFalseValue': { 'data': [ @@ -590,7 +586,7 @@ const whereTests = [ 22.937334060668945, 74.97810363769531, 18.877336502075195, 62.31299591064453, 48.867103576660156, -75.41789245605469 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -613,7 +609,7 @@ const whereTests = [ -29.081029891967773, -12.19106674194336, -10.8577880859375, 62.31299591064453, 48.867103576660156, -75.41789245605469 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -624,7 +620,7 @@ const whereTests = [ 'inputs': { 'inputCondition': { 'data': [235, 0, 93, 213, 0, 117], - 'descriptor': {'dimensions': [1, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [1, 2, 3], dataType: 'uint8'} }, 'inputTrueValue': { 'data': [ @@ -637,7 +633,7 @@ const whereTests = [ -29.081029891967773, -12.19106674194336, -10.8577880859375, -23.302522659301758, 30.851404190063477, -58.82704544067383 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputFalseValue': { 'data': [ @@ -650,7 +646,7 @@ const whereTests = [ 22.937334060668945, 74.97810363769531, 18.877336502075195, 62.31299591064453, 48.867103576660156, -75.41789245605469 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -673,7 +669,7 @@ const whereTests = [ -29.081029891967773, 74.97810363769531, -10.8577880859375, -23.302522659301758, 48.867103576660156, -58.82704544067383 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -684,7 +680,7 @@ const whereTests = [ 'inputs': { 'inputCondition': { 'data': [0, 165, 0, 90], - 'descriptor': {'dimensions': [1, 2, 2, 1], 'dataType': 'uint8'} + 'descriptor': {shape: [1, 2, 2, 1], dataType: 'uint8'} }, 'inputTrueValue': { 'data': [ @@ -697,7 +693,7 @@ const whereTests = [ -29.081029891967773, -12.19106674194336, -10.8577880859375, -23.302522659301758, 30.851404190063477, -58.82704544067383 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputFalseValue': { 'data': [ @@ -710,7 +706,7 @@ const whereTests = [ 22.937334060668945, 74.97810363769531, 18.877336502075195, 62.31299591064453, 48.867103576660156, -75.41789245605469 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -733,7 +729,7 @@ const whereTests = [ 22.937334060668945, 74.97810363769531, 18.877336502075195, -23.302522659301758, 30.851404190063477, -58.82704544067383 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -747,14 +743,14 @@ const whereTests = [ 241, 0, 85, 0, 227, 51, 202, 0, 104, 227, 129, 129, 175, 134, 130, 140, 103, 46, 158, 17, 0, 41, 94, 0 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} }, 'inputTrueValue': { 'data': [ 38.77214050292969, 18.20477294921875, -11.542049407958984, -82.74693298339844, -18.61202621459961, -75.77534484863281 ], - 'descriptor': {'dimensions': [2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3], dataType: 'float32'} }, 'inputFalseValue': { 'data': [ @@ -767,7 +763,7 @@ const whereTests = [ 22.937334060668945, 74.97810363769531, 18.877336502075195, 62.31299591064453, 48.867103576660156, -75.41789245605469 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -790,7 +786,7 @@ const whereTests = [ 38.77214050292969, 18.20477294921875, 18.877336502075195, -82.74693298339844, -18.61202621459961, -75.41789245605469 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -804,14 +800,14 @@ const whereTests = [ 241, 0, 85, 0, 227, 51, 202, 0, 104, 227, 129, 129, 175, 134, 130, 140, 103, 46, 158, 17, 0, 41, 94, 0 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} }, 'inputTrueValue': { 'data': [ -29.164173126220703, 32.200286865234375, -6.146966457366943, -24.822790145874023 ], - 'descriptor': {'dimensions': [2, 2, 1, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1, 1], dataType: 'float32'} }, 'inputFalseValue': { 'data': [ @@ -824,7 +820,7 @@ const whereTests = [ 22.937334060668945, 74.97810363769531, 18.877336502075195, 62.31299591064453, 48.867103576660156, -75.41789245605469 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } }, 'operators': [{ @@ -847,7 +843,7 @@ const whereTests = [ -24.822790145874023, -24.822790145874023, 18.877336502075195, -24.822790145874023, -24.822790145874023, -75.41789245605469 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -861,7 +857,7 @@ const whereTests = [ 241, 0, 85, 0, 227, 51, 202, 0, 104, 227, 129, 129, 175, 134, 130, 140, 103, 46, 158, 17, 0, 41, 94, 0 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} }, 'inputTrueValue': { 'data': [ @@ -874,14 +870,14 @@ const whereTests = [ -29.081029891967773, -12.19106674194336, -10.8577880859375, -23.302522659301758, 30.851404190063477, -58.82704544067383 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputFalseValue': { 'data': [ -86.59848022460938, -67.72773742675781, -30.731334686279297, -93.49223327636719 ], - 'descriptor': {'dimensions': [2, 2, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1], dataType: 'float32'} } }, 'operators': [{ @@ -904,7 +900,7 @@ const whereTests = [ -29.081029891967773, -12.19106674194336, -30.731334686279297, -23.302522659301758, 30.851404190063477, -93.49223327636719 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -918,7 +914,7 @@ const whereTests = [ 241, 0, 85, 0, 227, 51, 202, 0, 104, 227, 129, 129, 175, 134, 130, 140, 103, 46, 158, 17, 0, 41, 94, 0 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'uint8'} }, 'inputTrueValue': { 'data': [ @@ -931,14 +927,14 @@ const whereTests = [ -29.081029891967773, -12.19106674194336, -10.8577880859375, -23.302522659301758, 30.851404190063477, -58.82704544067383 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} }, 'inputFalseValue': { 'data': [ 17.777414321899414, -1.9890096187591553, -57.28207015991211, -80.01390838623047, 66.87323760986328, -31.328258514404297 ], - 'descriptor': {'dimensions': [1, 2, 1, 3], 'dataType': 'float32'} + 'descriptor': {shape: [1, 2, 1, 3], dataType: 'float32'} } }, 'operators': [{ @@ -961,7 +957,7 @@ const whereTests = [ -29.081029891967773, -12.19106674194336, -31.328258514404297, -23.302522659301758, 30.851404190063477, -31.328258514404297 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } @@ -972,21 +968,21 @@ const whereTests = [ 'inputs': { 'inputCondition': { 'data': [58, 217], - 'descriptor': {'dimensions': [2, 1, 1, 1], 'dataType': 'uint8'} + 'descriptor': {shape: [2, 1, 1, 1], dataType: 'uint8'} }, 'inputTrueValue': { 'data': [ 38.77214050292969, 18.20477294921875, -11.542049407958984, -82.74693298339844, -18.61202621459961, -75.77534484863281 ], - 'descriptor': {'dimensions': [2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 3], dataType: 'float32'} }, 'inputFalseValue': { 'data': [ -86.59848022460938, -67.72773742675781, -30.731334686279297, -93.49223327636719 ], - 'descriptor': {'dimensions': [2, 2, 1], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 1], dataType: 'float32'} } }, 'operators': [{ @@ -1009,7 +1005,7 @@ const whereTests = [ 38.77214050292969, 18.20477294921875, -11.542049407958984, -82.74693298339844, -18.61202621459961, -75.77534484863281 ], - 'descriptor': {'dimensions': [2, 2, 2, 3], 'dataType': 'float32'} + 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} } } } diff --git a/testing/web-platform/tests/webnn/idlharness.https.any.js b/testing/web-platform/tests/webnn/idlharness.https.any.js index 6c95e534a4cd..905744ffea61 100644 --- a/testing/web-platform/tests/webnn/idlharness.https.any.js +++ b/testing/web-platform/tests/webnn/idlharness.https.any.js @@ -28,11 +28,9 @@ idl_test( self.context = await navigator.ml.createContext(); self.builder = new MLGraphBuilder(self.context); - self.input = - builder.input('input', {dataType: 'float32', dimensions: [2, 3]}); + self.input = builder.input('input', {dataType: 'float32', shape: [2, 3]}); self.constant = builder.constant( - {dataType: 'float32', dimensions: [2, 3]}, - new Float32Array(2 * 3).fill(1)); + {dataType: 'float32', shape: [2, 3]}, new Float32Array(2 * 3).fill(1)); self.output = builder.add(input, constant); diff --git a/testing/web-platform/tests/webnn/resources/utils.js b/testing/web-platform/tests/webnn/resources/utils.js index c6b6010b3b0c..8e42f1ea7344 100644 --- a/testing/web-platform/tests/webnn/resources/utils.js +++ b/testing/web-platform/tests/webnn/resources/utils.js @@ -62,8 +62,8 @@ const assertDescriptorsEquals = (outputOperand, expected) => { outputOperand.dataType() === dataType, 'actual output dataType should be equal to expected output dataType'); assert_array_equals( - outputOperand.shape(), expected.dimensions, - 'actual output dimesnisons should be equal to expected output dimensions'); + outputOperand.shape(), expected.shape, + 'actual output shape should be equal to expected output shape'); }; // ref: @@ -289,10 +289,10 @@ const assertResultsEquals = (toleranceFunc, actual, graphResources) => { // If data is scalar and shape is not, it means it's expecting to be // filled by the scalar value. Also limit the array size so it doesn't // timeout. - if (typeof (expectedData) === 'number' && expectedDescriptor.dimensions && - sizeOfShape(expectedDescriptor.dimensions) > 1) { + if (typeof (expectedData) === 'number' && expectedDescriptor.shape && + sizeOfShape(expectedDescriptor.shape) > 1) { const size = Math.min( - kMaximumIndexToValidate, sizeOfShape(expectedDescriptor.dimensions)); + kMaximumIndexToValidate, sizeOfShape(expectedDescriptor.shape)); expectedData = new Array(size).fill(expectedData); outputData = outputData.subarray(0, kMaximumIndexToValidate); } @@ -322,7 +322,7 @@ const createOperand = (context, builder, operandName, resources) => { builder.constant( descriptor, getTypedArrayData( - descriptor.dataType, sizeOfShape(descriptor.dimensions), + descriptor.dataType, sizeOfShape(descriptor.shape), resources.data)) : builder.input(operandName, descriptor); @@ -341,7 +341,7 @@ const prepareInputsForGraph = (inputs, resources) => { inputOperandResources.descriptor.castedType ? inputOperandResources.descriptor.castedType : inputOperandResources.descriptor.dataType, - sizeOfShape(inputOperandResources.descriptor.dimensions), + sizeOfShape(inputOperandResources.descriptor.shape), inputOperandResources.data); } } @@ -353,7 +353,7 @@ const prepareOutputsForGraph = (outputs, resources) => { const dataType = descriptor.castedType ? descriptor.castedType : descriptor.dataType; outputs[operandName] = - new TypedArrayDict[dataType](sizeOfShape(descriptor.dimensions)); + new TypedArrayDict[dataType](sizeOfShape(descriptor.shape)); } }; @@ -470,10 +470,10 @@ const getConv2dPrecisionTolerance = (graphResources) => { const operatorResources = graphResources.operators[0]; const operatorName = operatorResources.name; const args = operatorResources.arguments; - const inputShape = graphResources.inputs[args[0][Object.keys(args[0])[0]]] - .descriptor.dimensions; - const filterShape = graphResources.inputs[args[1][Object.keys(args[1])[0]]] - .descriptor.dimensions; + const inputShape = + graphResources.inputs[args[0][Object.keys(args[0])[0]]].descriptor.shape; + const filterShape = + graphResources.inputs[args[1][Object.keys(args[1])[0]]].descriptor.shape; const options = args.length === 3 ? {...args[2][Object.keys(args[2])[0]]} : {}; let inputChannels = inputShape[1]; // default nchw inputLayout @@ -538,7 +538,7 @@ const getReducedElementCount = (graphResources) => { const args = graphResources.operators[0].arguments; const inputShape = graphResources.inputs[args[0][Object.keys(args[0])[0]]] - .descriptor.dimensions; + .descriptor.shape; const rank = inputShape.length; const options = args.length === 2 ? {...args[1][Object.keys(args[1])[0]]} : {}; diff --git a/testing/web-platform/tests/webnn/resources/utils_validation.js b/testing/web-platform/tests/webnn/resources/utils_validation.js index 856eea6cb3fc..f491801bf3a6 100644 --- a/testing/web-platform/tests/webnn/resources/utils_validation.js +++ b/testing/web-platform/tests/webnn/resources/utils_validation.js @@ -24,12 +24,12 @@ const signedIntegerTypes = ['int32', 'int64', 'int8']; const unsignedLongType = 'unsigned long'; -const dimensions0D = []; -const dimensions1D = [2]; -const dimensions2D = [2, 3]; -const dimensions3D = [2, 3, 4]; -const dimensions4D = [2, 3, 4, 5]; -const dimensions5D = [2, 3, 4, 5, 6]; +const shape0D = []; +const shape1D = [2]; +const shape2D = [2, 3]; +const shape3D = [2, 3, 4]; +const shape4D = [2, 3, 4, 5]; +const shape5D = [2, 3, 4, 5, 6]; const adjustOffsetsArray = [ // Decrease 1 @@ -40,14 +40,8 @@ const adjustOffsetsArray = [ // TODO // Add more 5+ dimensions -const allWebNNDimensionsArray = [ - dimensions0D, - dimensions1D, - dimensions2D, - dimensions3D, - dimensions4D, - dimensions5D -]; +const allWebNNShapesArray = + [shape0D, shape1D, shape2D, shape3D, shape4D, shape5D]; const notUnsignedLongAxisArray = [ // String @@ -64,15 +58,15 @@ const notUnsignedLongAxisArray = [ new Date("2024-01-01"), ]; -function getRank(inputDimensions) { - return inputDimensions.length; +function getRank(inputShape) { + return inputShape.length; } -function getAxisArray(inputDimensions) { - return Array.from({length: inputDimensions.length}, (_, i) => i); +function getAxisArray(inputShape) { + return Array.from({length: inputShape.length}, (_, i) => i); } -function getAxesArrayContainSameValues(inputDimensions) { +function getAxesArrayContainSameValues(inputShape) { // TODO // Currently this function returns an array containing each element which all have the same value. // For example axes: [0, 1, 2] for 3D input tensor @@ -117,9 +111,9 @@ function getAxesArrayContainSameValues(inputDimensions) { // [2, 2, 2] // ] const axesArrayContainSameValues = []; - const length = inputDimensions.length; + const length = inputShape.length; if (length >= 2) { - const validAxesArrayFull = getAxisArray(inputDimensions); + const validAxesArrayFull = getAxisArray(inputShape); for (let index = 0; index < length; index++) { axesArrayContainSameValues.push(new Array(2).fill(validAxesArrayFull[index])); if (length > 2) { @@ -130,9 +124,9 @@ function getAxesArrayContainSameValues(inputDimensions) { return axesArrayContainSameValues; } -function generateUnbroadcastableDimensionsArray(dimensions) { - // Currently this function returns an array of some unbroadcastable dimensions. - // for example given dimensions [2, 3, 4] +function generateUnbroadcastableShapes(shape) { + // Currently this function returns an array of some unbroadcastable shapes. + // for example given the input shape [2, 3, 4] // this function returns // [ // [3, 3, 4], @@ -149,34 +143,34 @@ function generateUnbroadcastableDimensionsArray(dimensions) { // [1, 1, 1, 3], // [1, 1, 1, 5], // ] - if (dimensions.every(v => v === 1)) { - throw new Error(`[${dimensions}] always can be broadcasted`); + if (shape.every(dimension => dimension === 1)) { + throw new Error(`[${shape}] always can be broadcasted`); } - const resultDimensions = []; - const length = dimensions.length; - if (!dimensions.slice(0, length - 1).every(v => v === 1)) { + const resultShapes = []; + const length = shape.length; + if (!shape.slice(0, length - 1).every(dimension => dimension === 1)) { for (let i = 0; i < length; i++) { - if (dimensions[i] !== 1) { + if (shape[i] !== 1) { for (let offset of [-1, 1]) { - const dimensionsB = dimensions.slice(); - dimensionsB[i] += offset; - if (dimensionsB[i] !== 1) { - resultDimensions.push(dimensionsB); + const shapeB = shape.slice(); + shapeB[i] += offset; + if (shapeB[i] !== 1) { + resultShapes.push(shapeB); } } } } } - const lastDimensionSize = dimensions[length - 1]; + const lastDimensionSize = shape[length - 1]; if (lastDimensionSize !== 1) { for (let j = 0; j <= length; j++) { if (lastDimensionSize > 2) { - resultDimensions.push(Array(j).fill(1).concat([lastDimensionSize - 1])); + resultShapes.push(Array(j).fill(1).concat([lastDimensionSize - 1])); } - resultDimensions.push(Array(j).fill(1).concat([lastDimensionSize + 1])); + resultShapes.push(Array(j).fill(1).concat([lastDimensionSize + 1])); } } - return resultDimensions; + return resultShapes; } function generateOutOfRangeValuesArray(type) { @@ -229,15 +223,17 @@ function validateTwoInputsBroadcastable(operationName, label) { assert_throws_js( TypeError, () => builder.input( - `inputA${++inputAIndex}`, {dataType, dimensions1D})); + `inputA${++inputAIndex}`, {dataType, shape: shape1D})); continue; } - for (let dimensions of allWebNNDimensionsArray) { - if (dimensions.length > 0) { - const inputA = builder.input(`inputA${++inputAIndex}`, {dataType, dimensions}); - const unbroadcastableDimensionsArray = generateUnbroadcastableDimensionsArray(dimensions); - for (let unbroadcastableDimensions of unbroadcastableDimensionsArray) { - const inputB = builder.input(`inputB${++inputBIndex}`, {dataType, dimensions: unbroadcastableDimensions}); + for (let shape of allWebNNShapesArray) { + if (shape.length > 0) { + const inputA = + builder.input(`inputA${++inputAIndex}`, {dataType, shape}); + const unbroadcastableShapes = generateUnbroadcastableShapes(shape); + for (let shape of unbroadcastableShapes) { + const inputB = + builder.input(`inputB${++inputBIndex}`, {dataType, shape}); assert_equals(typeof builder[operationName], 'function'); const options = {label}; const regrexp = new RegExp('\\[' + label + '\\]'); @@ -272,22 +268,24 @@ function validateTwoInputsOfSameDataType(operationName, label) { assert_throws_js( TypeError, () => builder.input( - `inputA${++inputAIndex}`, {dataType, dimensions1D})); + `inputA${++inputAIndex}`, {dataType, shape: shape1D})); continue; } - for (let dimensions of allWebNNDimensionsArray) { - const inputA = builder.input(`inputA${++inputAIndex}`, {dataType, dimensions}); + for (let shape of allWebNNShapesArray) { + const inputA = + builder.input(`inputA${++inputAIndex}`, {dataType, shape}); for (let dataTypeB of allWebNNOperandDataTypes) { if (!context.opSupportLimits().input.dataTypes.includes( dataTypeB)) { assert_throws_js( TypeError, () => builder.input( - `inputB${++inputBIndex}`, {dataTypeB, dimensions1D})); + `inputB${++inputBIndex}`, {dataTypeB, shape1D})); continue; } if (dataType !== dataTypeB) { - const inputB = builder.input(`inputB${++inputBIndex}`, {dataType: dataTypeB, dimensions}); + const inputB = builder.input( + `inputB${++inputBIndex}`, {dataType: dataTypeB, shape}); const options = {label}; const regrexp = new RegExp('\\[' + label + '\\]'); assert_equals(typeof builder[subOperationName], 'function'); @@ -330,14 +328,14 @@ function validateOptionsAxes(operationName) { assert_throws_js( TypeError, () => builder.input( - `inputA${++inputAIndex}`, {dataType, dimensions1D})); + `inputA${++inputAIndex}`, {dataType, shape: shape1D})); continue; } - for (let dimensions of allWebNNDimensionsArray) { - const rank = getRank(dimensions); + for (let shape of allWebNNShapesArray) { + const rank = getRank(shape); if (rank >= 1) { const input = - builder.input(`input${++inputIndex}`, {dataType, dimensions}); + builder.input(`input${++inputIndex}`, {dataType, shape}); for (let invalidAxis of invalidAxisArray) { assert_equals(typeof builder[subOperationName], 'function'); assert_throws_js( @@ -367,14 +365,14 @@ function validateOptionsAxes(operationName) { assert_throws_js( TypeError, () => builder.input( - `inputA${++inputAIndex}`, {dataType, dimensions1D})); + `inputA${++inputAIndex}`, {dataType, shape: shape1D})); continue; } - for (let dimensions of allWebNNDimensionsArray) { - const rank = getRank(dimensions); + for (let shape of allWebNNShapesArray) { + const rank = getRank(shape); if (rank >= 1) { const input = - builder.input(`input${++inputIndex}`, {dataType, dimensions}); + builder.input(`input${++inputIndex}`, {dataType, shape}); assert_equals(typeof builder[subOperationName], 'function'); assert_throws_js( TypeError, @@ -395,16 +393,16 @@ function validateOptionsAxes(operationName) { assert_throws_js( TypeError, () => builder.input( - `inputA${++inputAIndex}`, {dataType, dimensions1D})); + `inputA${++inputAIndex}`, {dataType, shape: shape1D})); continue; } - for (let dimensions of allWebNNDimensionsArray) { - const rank = getRank(dimensions); + for (let shape of allWebNNShapesArray) { + const rank = getRank(shape); if (rank >= 2) { const input = - builder.input(`input${++inputIndex}`, {dataType, dimensions}); + builder.input(`input${++inputIndex}`, {dataType, shape}); const axesArrayContainSameValues = - getAxesArrayContainSameValues(dimensions); + getAxesArrayContainSameValues(shape); for (let axes of axesArrayContainSameValues) { assert_equals(typeof builder[subOperationName], 'function'); assert_throws_js( @@ -433,15 +431,15 @@ function validateUnaryOperation(operationName, supportedDataTypes, label) { assert_throws_js( TypeError, () => builder.input( - `inputA${++inputAIndex}`, {dataType, dimensions1D})); + `inputA${++inputAIndex}`, {dataType, shape: shape1D})); continue; } - for (let dimensions of allWebNNDimensionsArray) { - const input = builder.input(`input`, {dataType, dimensions}); + for (let shape of allWebNNShapesArray) { + const input = builder.input(`input`, {dataType, shape}); assert_equals(typeof builder[operationName], 'function'); const output = builder[operationName](input); assert_equals(output.dataType(), dataType); - assert_array_equals(output.shape(), dimensions); + assert_array_equals(output.shape(), shape); } } }, `[${operationName}] Test building an unary operator with supported type.`); @@ -455,11 +453,11 @@ function validateUnaryOperation(operationName, supportedDataTypes, label) { assert_throws_js( TypeError, () => builder.input( - `inputA${++inputAIndex}`, {dataType, dimensions1D})); + `inputA${++inputAIndex}`, {dataType, shape: shape1D})); continue; } - for (let dimensions of allWebNNDimensionsArray) { - const input = builder.input(`input`, {dataType, dimensions}); + for (let shape of allWebNNShapesArray) { + const input = builder.input(`input`, {dataType, shape}); assert_equals(typeof builder[operationName], 'function'); const options = {label}; const regrexp = new RegExp('\\[' + label + '\\]'); @@ -483,11 +481,11 @@ function validateSingleInputOperation(operationName, label) { if (!context.opSupportLimits().input.dataTypes.includes(dataType)) { continue; } - for (let dimensions of allWebNNDimensionsArray) { - const input = builder.input(`input`, {dataType, dimensions}); + for (let shape of allWebNNShapesArray) { + const input = builder.input(`input`, {dataType, shape}); const output = builder[operationName](input); assert_equals(output.dataType(), dataType); - assert_array_equals(output.shape(), dimensions); + assert_array_equals(output.shape(), shape); } } }, `[${operationName}] Test building the operator with supported data type.`); @@ -503,11 +501,11 @@ function validateSingleInputOperation(operationName, label) { assert_throws_js( TypeError, () => builder.input( - `inputA${++inputAIndex}`, {dataType, dimensions1D})); + `inputA${++inputAIndex}`, {dataType, shape: shape1D})); continue; } - for (let dimensions of allWebNNDimensionsArray) { - const input = builder.input(`input`, {dataType, dimensions}); + for (let shape of allWebNNShapesArray) { + const input = builder.input(`input`, {dataType, shape}); assert_equals(typeof builder[operationName], 'function'); const options = {label}; const regrexp = new RegExp('\\[' + label + '\\]'); @@ -527,7 +525,7 @@ function validateSingleInputOperation(operationName, label) { */ function validateInputFromAnotherBuilder(operatorName, operatorDescriptor = { dataType: 'float32', - dimensions: [2, 2] + shape: [2, 2] }) { multi_builder_test(async (t, builder, otherBuilder) => { const inputFromOtherBuilder = @@ -545,7 +543,7 @@ function validateInputFromAnotherBuilder(operatorName, operatorDescriptor = { * @param {String} operationName */ function validateTwoInputsFromMultipleBuilders(operatorName) { - const opDescriptor = {dataType: 'float32', dimensions: [2, 2]}; + const opDescriptor = {dataType: 'float32', shape: [2, 2]}; multi_builder_test(async (t, builder, otherBuilder) => { const inputFromOtherBuilder = otherBuilder.input('other', opDescriptor); diff --git a/testing/web-platform/tests/webnn/validation_tests/argMinMax.https.any.js b/testing/web-platform/tests/webnn/validation_tests/argMinMax.https.any.js index 3d3f71487158..abd4e878a2a5 100644 --- a/testing/web-platform/tests/webnn/validation_tests/argMinMax.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/argMinMax.https.any.js @@ -17,38 +17,38 @@ const label = 'arg_min_max_1_!'; const tests = [ { name: '[argMin/Max] Test with default options.', - input: {dataType: 'float32', dimensions: [1, 2, 3, 4]}, + input: {dataType: 'float32', shape: [1, 2, 3, 4]}, axis: 0, - output: {dimensions: [2, 3, 4]} + output: {shape: [2, 3, 4]} }, { name: '[argMin/Max] Test with axes=1.', - input: {dataType: 'float32', dimensions: [1, 2, 3, 4]}, + input: {dataType: 'float32', shape: [1, 2, 3, 4]}, axis: 1, - output: {dimensions: [1, 3, 4]} + output: {shape: [1, 3, 4]} }, { name: '[argMin/Max] Test with outputDataType=int32', - input: {dataType: 'float32', dimensions: [1, 2, 3, 4]}, + input: {dataType: 'float32', shape: [1, 2, 3, 4]}, axis: 1, options: { outputDataType: 'int32', }, - output: {dimensions: [1, 3, 4]} + output: {shape: [1, 3, 4]} }, { name: '[argMin/Max] Test with outputDataType=int64', - input: {dataType: 'float32', dimensions: [1, 2, 3, 4]}, + input: {dataType: 'float32', shape: [1, 2, 3, 4]}, axis: 1, options: { outputDataType: 'int64', }, - output: {dimensions: [1, 3, 4]} + output: {shape: [1, 3, 4]} }, { name: '[argMin/Max] Throw if the value in axis is greater than or equal to input rank.', - input: {dataType: 'float32', dimensions: [1, 2, 3, 4]}, + input: {dataType: 'float32', shape: [1, 2, 3, 4]}, axis: 4, options: { label: label, @@ -56,7 +56,7 @@ const tests = [ }, { name: '[argMin/Max] Throw if input is a scalar and axis=0.', - input: {dataType: 'float32', dimensions: []}, + input: {dataType: 'float32', shape: []}, axis: 0, options: { label: label, @@ -68,16 +68,14 @@ function runTests(operatorName, tests) { tests.forEach(test => { promise_test(async t => { const builder = new MLGraphBuilder(context); - const input = builder.input( - 'input', - { dataType: test.input.dataType, dimensions: test.input.dimensions }); + const input = builder.input('input', test.input); const axis = test.axis; if (test.options && test.options.outputDataType !== undefined) { if (context.opSupportLimits()[operatorName].output.dataTypes.includes( test.options.outputDataType)) { const output = builder[operatorName](input, axis, test.options); assert_equals(output.dataType(), test.options.outputDataType); - assert_array_equals(output.shape(), test.output.dimensions); + assert_array_equals(output.shape(), test.output.shape); } else { assert_throws_js( TypeError, () => builder[operatorName](input, axis, test.options)); @@ -87,7 +85,7 @@ function runTests(operatorName, tests) { if (test.output) { const output = builder[operatorName](input, axis, test.options); assert_equals(output.dataType(), 'int32'); - assert_array_equals(output.shape(), test.output.dimensions); + assert_array_equals(output.shape(), test.output.shape); } else { const regrexp = /\[arg_min_max_1_\!\]/; assert_throws_with_label( diff --git a/testing/web-platform/tests/webnn/validation_tests/batchNormalization.https.any.js b/testing/web-platform/tests/webnn/validation_tests/batchNormalization.https.any.js index 6a884de3ee33..636f803ecb7e 100644 --- a/testing/web-platform/tests/webnn/validation_tests/batchNormalization.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/batchNormalization.https.any.js @@ -12,13 +12,13 @@ let varianceIndex = 0; const kExampleInputDescriptor = { dataType: 'float32', - dimensions: [2, 2] + shape: [2, 2] }; // 1D tensor descriptor which may be used for `mean`, `variance`, `scale`, or // `bias` inputs. const kExample1DTensorDescriptor = { dataType: 'float32', - dimensions: [kExampleInputDescriptor.dimensions[/* axis */ 1]] + shape: [kExampleInputDescriptor.shape[/* axis */ 1]] }; multi_builder_test(async (t, builder, otherBuilder) => { @@ -83,28 +83,28 @@ const label = `batchNormalization_?_123`; const tests = [ { name: '[batchNormalization] Test with default options.', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, - mean: {dataType: 'float32', dimensions: [2]}, - variance: {dataType: 'float32', dimensions: [2]}, - output: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, + mean: {dataType: 'float32', shape: [2]}, + variance: {dataType: 'float32', shape: [2]}, + output: {dataType: 'float32', shape: [1, 2, 5, 5]}, }, { name: '[batchNormalization] Test with axis = 2 and epsilon = 0.0001.', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, - mean: {dataType: 'float32', dimensions: [5]}, - variance: {dataType: 'float32', dimensions: [5]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, + mean: {dataType: 'float32', shape: [5]}, + variance: {dataType: 'float32', shape: [5]}, options: { axis: 2, epsilon: 1e-4, // 1e-5 is the default value of epsilon. }, - output: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, + output: {dataType: 'float32', shape: [1, 2, 5, 5]}, }, { name: '[batchNormalization] Throw if the input data type is not one of floating point types.', - input: {dataType: 'int32', dimensions: [1, 2, 5, 5]}, - mean: {dataType: 'int32', dimensions: [2]}, - variance: {dataType: 'int32', dimensions: [2]}, + input: {dataType: 'int32', shape: [1, 2, 5, 5]}, + mean: {dataType: 'int32', shape: [2]}, + variance: {dataType: 'int32', shape: [2]}, options: { label: label, }, @@ -112,18 +112,18 @@ const tests = [ { name: '[batchNormalization] Throw if the mean data type is not the same as the input data type.', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, - mean: {dataType: 'float16', dimensions: [2]}, - variance: {dataType: 'float32', dimensions: [2]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, + mean: {dataType: 'float16', shape: [2]}, + variance: {dataType: 'float32', shape: [2]}, options: { label: label, }, }, { name: '[batchNormalization] Throw if the mean operand is not a 1-D tensor.', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, - mean: {dataType: 'float32', dimensions: [1, 2]}, - variance: {dataType: 'float32', dimensions: [2]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, + mean: {dataType: 'float32', shape: [1, 2]}, + variance: {dataType: 'float32', shape: [2]}, options: { label: label, }, @@ -131,9 +131,9 @@ const tests = [ { name: '[batchNormalization] Throw if the size of mean operand is not equal to the size of the input dimension denoted by axis.', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, - mean: {dataType: 'float32', dimensions: [3]}, - variance: {dataType: 'float32', dimensions: [2]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, + mean: {dataType: 'float32', shape: [3]}, + variance: {dataType: 'float32', shape: [2]}, options: { axis: 1, label: label, @@ -142,9 +142,9 @@ const tests = [ { name: '[batchNormalization] Throw if the variance data type is not the same as the input data type.', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, - mean: {dataType: 'float32', dimensions: [2]}, - variance: {dataType: 'float16', dimensions: [2]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, + mean: {dataType: 'float32', shape: [2]}, + variance: {dataType: 'float16', shape: [2]}, options: { label: label, }, @@ -152,9 +152,9 @@ const tests = [ { name: '[batchNormalization] Throw if the variance operand is not a 1-D tensor.', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, - mean: {dataType: 'float32', dimensions: [2]}, - variance: {dataType: 'float32', dimensions: [2, 2]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, + mean: {dataType: 'float32', shape: [2]}, + variance: {dataType: 'float32', shape: [2, 2]}, options: { label: label, }, @@ -162,9 +162,9 @@ const tests = [ { name: '[batchNormalization] Throw if the size of variance operand is not equal to the size of the input dimension denoted by axis.', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, - mean: {dataType: 'float32', dimensions: [5]}, - variance: {dataType: 'float32', dimensions: [2]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, + mean: {dataType: 'float32', shape: [5]}, + variance: {dataType: 'float32', shape: [2]}, options: { axis: 2, label: label, @@ -173,76 +173,76 @@ const tests = [ { name: '[batchNormalization] Throw if the scale data type is not the same as the input data type.', - input: {dataType: 'float16', dimensions: [1, 2, 5, 5]}, - mean: {dataType: 'float16', dimensions: [2]}, - variance: {dataType: 'float16', dimensions: [2]}, + input: {dataType: 'float16', shape: [1, 2, 5, 5]}, + mean: {dataType: 'float16', shape: [2]}, + variance: {dataType: 'float16', shape: [2]}, options: { - scale: {dataType: 'float32', dimensions: [2]}, + scale: {dataType: 'float32', shape: [2]}, label: label, }, }, { name: '[batchNormalization] Throw if the scale operand is not a 1-D tensor.', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, - mean: {dataType: 'float32', dimensions: [2]}, - variance: {dataType: 'float32', dimensions: [2]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, + mean: {dataType: 'float32', shape: [2]}, + variance: {dataType: 'float32', shape: [2]}, options: { - scale: {dataType: 'float32', dimensions: [2, 1]}, + scale: {dataType: 'float32', shape: [2, 1]}, label: label, }, }, { name: '[batchNormalization] Throw if the size of scale operand is not equal to the size of the input dimension denoted by axis.', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, - mean: {dataType: 'float32', dimensions: [5]}, - variance: {dataType: 'float32', dimensions: [5]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, + mean: {dataType: 'float32', shape: [5]}, + variance: {dataType: 'float32', shape: [5]}, options: { axis: 2, - scale: {dataType: 'float32', dimensions: [2]}, + scale: {dataType: 'float32', shape: [2]}, label: label, }, }, { name: '[batchNormalization] Throw if the bias data type is not the same as the input data type.', - input: {dataType: 'float16', dimensions: [1, 2, 5, 5]}, - mean: {dataType: 'float16', dimensions: [2]}, - variance: {dataType: 'float16', dimensions: [2]}, + input: {dataType: 'float16', shape: [1, 2, 5, 5]}, + mean: {dataType: 'float16', shape: [2]}, + variance: {dataType: 'float16', shape: [2]}, options: { - bias: {dataType: 'float32', dimensions: [2]}, + bias: {dataType: 'float32', shape: [2]}, label: label, }, }, { name: '[batchNormalization] Throw if the bias operand is not a 1-D tensor.', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, - mean: {dataType: 'float32', dimensions: [2]}, - variance: {dataType: 'float32', dimensions: [2]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, + mean: {dataType: 'float32', shape: [2]}, + variance: {dataType: 'float32', shape: [2]}, options: { - bias: {dataType: 'float32', dimensions: [2, 1]}, + bias: {dataType: 'float32', shape: [2, 1]}, label: label, }, }, { name: '[batchNormalization] Throw if the size of bias operand is not equal to the size of the input dimension denoted by axis.', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, - mean: {dataType: 'float32', dimensions: [5]}, - variance: {dataType: 'float32', dimensions: [5]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, + mean: {dataType: 'float32', shape: [5]}, + variance: {dataType: 'float32', shape: [5]}, options: { axis: 2, - bias: {dataType: 'float32', dimensions: [2]}, + bias: {dataType: 'float32', shape: [2]}, label: label, }, }, { name: '[batchNormalization] Throw if the value of axis is not in the range of [0,N-1].', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, - mean: {dataType: 'float32', dimensions: [5]}, - variance: {dataType: 'float32', dimensions: [5]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, + mean: {dataType: 'float32', shape: [5]}, + variance: {dataType: 'float32', shape: [5]}, options: { axis: 4, label: label, @@ -253,35 +253,22 @@ const tests = [ tests.forEach( test => promise_test(async t => { const builder = new MLGraphBuilder(context); - const input = builder.input( - 'input', - {dataType: test.input.dataType, dimensions: test.input.dimensions}); - const mean = builder.input( - 'mean', - {dataType: test.mean.dataType, dimensions: test.mean.dimensions}); - const variance = builder.input('variance', { - dataType: test.variance.dataType, - dimensions: test.variance.dimensions - }); + const input = builder.input('input', test.input); + const mean = builder.input('mean', test.mean); + const variance = builder.input('variance', test.variance); if (test.options && test.options.bias) { - test.options.bias = builder.input('bias', { - dataType: test.options.bias.dataType, - dimensions: test.options.bias.dimensions - }); + test.options.bias = builder.input('bias', test.options.bias); } if (test.options && test.options.scale) { - test.options.scale = builder.input('scale', { - dataType: test.options.scale.dataType, - dimensions: test.options.scale.dimensions - }); + test.options.scale = builder.input('scale', test.options.scale); } if (test.output) { const output = builder.batchNormalization(input, mean, variance, test.options); assert_equals(output.dataType(), test.output.dataType); - assert_array_equals(output.shape(), test.output.dimensions); + assert_array_equals(output.shape(), test.output.shape); } else { const regrexp = /\[batchNormalization_\?_123\]/; assert_throws_with_label( diff --git a/testing/web-platform/tests/webnn/validation_tests/build-more-than-once.https.any.js b/testing/web-platform/tests/webnn/validation_tests/build-more-than-once.https.any.js index c4cbcae8f32d..3d648c9b0191 100644 --- a/testing/web-platform/tests/webnn/validation_tests/build-more-than-once.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/build-more-than-once.https.any.js @@ -7,7 +7,7 @@ const kExampleInputDescriptor = { dataType: 'float32', - dimensions: [2] + shape: [2] }; promise_test(async t => { diff --git a/testing/web-platform/tests/webnn/validation_tests/cast.https.any.js b/testing/web-platform/tests/webnn/validation_tests/cast.https.any.js index b20d81869006..0dee2f0f0710 100644 --- a/testing/web-platform/tests/webnn/validation_tests/cast.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/cast.https.any.js @@ -9,7 +9,7 @@ multi_builder_test(async (t, builder, otherBuilder) => { const inputFromOtherBuilder = - otherBuilder.input('input', {dataType: 'int32', dimensions: [2, 2]}); + otherBuilder.input('input', {dataType: 'int32', shape: [2, 2]}); assert_throws_js( TypeError, () => builder.cast(inputFromOtherBuilder, 'int64')); diff --git a/testing/web-platform/tests/webnn/validation_tests/clamp.https.any.js b/testing/web-platform/tests/webnn/validation_tests/clamp.https.any.js index 10cf0028e524..e76092daf43a 100644 --- a/testing/web-platform/tests/webnn/validation_tests/clamp.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/clamp.https.any.js @@ -16,8 +16,7 @@ validateSingleInputOperation('clamp', label); promise_test(async t => { const builder = new MLGraphBuilder(context); const options = {minValue: 1.0, maxValue: 3.0}; - const input = - builder.input('input', {dataType: 'float32', dimensions: [1, 2, 3]}); + const input = builder.input('input', {dataType: 'float32', shape: [1, 2, 3]}); const output = builder.clamp(input, options); assert_equals(output.dataType(), 'float32'); assert_array_equals(output.shape(), [1, 2, 3]); @@ -27,7 +26,7 @@ promise_test(async t => { const builder = new MLGraphBuilder(context); const options = {minValue: 0, maxValue: 0}; const input = - builder.input('input', {dataType: 'float32', dimensions: [1, 2, 3, 4]}); + builder.input('input', {dataType: 'float32', shape: [1, 2, 3, 4]}); const output = builder.clamp(input, options); assert_equals(output.dataType(), 'float32'); assert_array_equals(output.shape(), [1, 2, 3, 4]); @@ -40,8 +39,7 @@ promise_test(async t => { maxValue: 1.0, label: label, }; - const input = - builder.input('input', {dataType: 'float32', dimensions: [1, 2, 3]}); + const input = builder.input('input', {dataType: 'float32', shape: [1, 2, 3]}); const regrexp = new RegExp('\\[' + label + '\\]'); assert_throws_with_label(() => builder.clamp(input, options), regrexp); }, '[clamp] Throw if options.minValue > options.maxValue'); @@ -54,6 +52,6 @@ promise_test(async t => { minValue: -Infinity, label: label, }; - const input = builder.input('input', {dataType: 'float32', dimensions: []}); + const input = builder.input('input', {dataType: 'float32', shape: []}); assert_throws_js(TypeError, () => builder.clamp(input, options)); }, '[clamp] Throw if options.minValue is -Infinity'); diff --git a/testing/web-platform/tests/webnn/validation_tests/compute-multiple-arraybufferviews-sharing-same-arraybuffer.https.any.js b/testing/web-platform/tests/webnn/validation_tests/compute-multiple-arraybufferviews-sharing-same-arraybuffer.https.any.js index 65bd805c31f6..097a8f84d8b0 100644 --- a/testing/web-platform/tests/webnn/validation_tests/compute-multiple-arraybufferviews-sharing-same-arraybuffer.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/compute-multiple-arraybufferviews-sharing-same-arraybuffer.https.any.js @@ -9,8 +9,8 @@ // https://issues.chromium.org/issues/332002364 promise_test(async t => { const builder = new MLGraphBuilder(context); - const a = builder.input('a', {dataType: 'float32', dimensions: [2]}); - const b = builder.input('b', {dataType: 'float32', dimensions: [2]}); + const a = builder.input('a', {dataType: 'float32', shape: [2]}); + const b = builder.input('b', {dataType: 'float32', shape: [2]}); const c = builder.add(a, b); const graph = await builder.build({c}); const arraybuffer = new ArrayBuffer(100); @@ -24,7 +24,7 @@ promise_test(async t => { promise_test(async t => { const builder = new MLGraphBuilder(context); - const a = builder.input('a', {dataType: 'float32', dimensions: [2]}); + const a = builder.input('a', {dataType: 'float32', shape: [2]}); const [b, c] = builder.split(a, 2); const graph = await builder.build({b, c}); const aBuffer = new Float32Array(2); @@ -38,7 +38,7 @@ promise_test(async t => { promise_test(async t => { const builder = new MLGraphBuilder(context); - const a = builder.input('a', {dataType: 'float32', dimensions: [2]}); + const a = builder.input('a', {dataType: 'float32', shape: [2]}); const b = builder.relu(a); const graph = await builder.build({b}); const arraybuffer = new ArrayBuffer(100); @@ -50,7 +50,7 @@ promise_test(async t => { promise_test(async t => { const builder = new MLGraphBuilder(context); - const a = builder.input('a', {dataType: 'float32', dimensions: [2]}); + const a = builder.input('a', {dataType: 'float32', shape: [2]}); const b = builder.relu(a); const graph = await builder.build({b}); const buffer = new Float32Array(2); diff --git a/testing/web-platform/tests/webnn/validation_tests/concat.https.any.js b/testing/web-platform/tests/webnn/validation_tests/concat.https.any.js index 4902caf6619c..65c56a842461 100644 --- a/testing/web-platform/tests/webnn/validation_tests/concat.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/concat.https.any.js @@ -11,37 +11,35 @@ const label = `concate_123`; const tests = [ { name: '[concat] Test building Concat with one input.', - inputs: [{dataType: 'float32', dimensions: [4, 4, 3]}], + inputs: [{dataType: 'float32', shape: [4, 4, 3]}], axis: 2, - output: {dataType: 'float32', dimensions: [4, 4, 3]} + output: {dataType: 'float32', shape: [4, 4, 3]} }, { name: '[concat] Test building Concat with two inputs', inputs: [ - {dataType: 'float32', dimensions: [3, 1, 5]}, - {dataType: 'float32', dimensions: [3, 2, 5]} + {dataType: 'float32', shape: [3, 1, 5]}, + {dataType: 'float32', shape: [3, 2, 5]} ], axis: 1, - output: {dataType: 'float32', dimensions: [3, 3, 5]} + output: {dataType: 'float32', shape: [3, 3, 5]} }, { name: '[concat] Test building Concat with three inputs', inputs: [ - {dataType: 'float32', dimensions: [3, 5, 1]}, - {dataType: 'float32', dimensions: [3, 5, 2]}, - {dataType: 'float32', dimensions: [3, 5, 3]} + {dataType: 'float32', shape: [3, 5, 1]}, + {dataType: 'float32', shape: [3, 5, 2]}, + {dataType: 'float32', shape: [3, 5, 3]} ], axis: 2, - output: {dataType: 'float32', dimensions: [3, 5, 6]} + output: {dataType: 'float32', shape: [3, 5, 6]} }, { name: '[concat] Test building Concat with two 1D inputs.', - inputs: [ - {dataType: 'float32', dimensions: [1]}, - {dataType: 'float32', dimensions: [1]} - ], + inputs: + [{dataType: 'float32', shape: [1]}, {dataType: 'float32', shape: [1]}], axis: 0, - output: {dataType: 'float32', dimensions: [2]} + output: {dataType: 'float32', shape: [2]} }, { name: '[concat] Throw if the inputs are empty.', @@ -50,16 +48,15 @@ const tests = [ { name: '[concat] Throw if the argument types are inconsistent.', inputs: [ - {dataType: 'float32', dimensions: [1, 1]}, - {dataType: 'int32', dimensions: [1, 1]} + {dataType: 'float32', shape: [1, 1]}, {dataType: 'int32', shape: [1, 1]} ], axis: 0, }, { name: '[concat] Throw if the inputs have different ranks.', inputs: [ - {dataType: 'float32', dimensions: [1, 1]}, - {dataType: 'float32', dimensions: [1, 1, 1]} + {dataType: 'float32', shape: [1, 1]}, + {dataType: 'float32', shape: [1, 1, 1]} ], axis: 0, }, @@ -67,25 +64,22 @@ const tests = [ name: '[concat] Throw if the axis is equal to or greater than the size of ranks', inputs: [ - {dataType: 'float32', dimensions: [1, 1]}, - {dataType: 'float32', dimensions: [1, 1]} + {dataType: 'float32', shape: [1, 1]}, {dataType: 'float32', shape: [1, 1]} ], axis: 2, }, { name: '[concat] Throw if concat with two 0-D scalars.', - inputs: [ - {dataType: 'float32', dimensions: []}, - {dataType: 'float32', dimensions: []} - ], + inputs: + [{dataType: 'float32', shape: []}, {dataType: 'float32', shape: []}], axis: 0, }, { name: '[concat] Throw if the inputs have other axes with different sizes except on the axis.', inputs: [ - {dataType: 'float32', dimensions: [1, 1, 1]}, - {dataType: 'float32', dimensions: [1, 2, 3]} + {dataType: 'float32', shape: [1, 1, 1]}, + {dataType: 'float32', shape: [1, 2, 3]} ], axis: 1, }, @@ -98,16 +92,13 @@ tests.forEach( let inputs = []; if (test.inputs) { for (let i = 0; i < test.inputs.length; ++i) { - inputs[i] = builder.input( - `inputs[${i}]`, - { dataType: test.inputs[i].dataType, dimensions: test.inputs[i].dimensions } - ); + inputs[i] = builder.input(`inputs[${i}]`, test.inputs[i]); } } if (test.output) { const output = builder.concat(inputs, test.axis); assert_equals(output.dataType(), test.output.dataType); - assert_array_equals(output.shape(), test.output.dimensions); + assert_array_equals(output.shape(), test.output.shape); } else { const options = {label}; const regrexp = new RegExp('\\[' + label + '\\]'); @@ -117,7 +108,7 @@ tests.forEach( }, test.name)); multi_builder_test(async (t, builder, otherBuilder) => { - const operandDescriptor = {dataType: 'float32', dimensions: [2, 2]}; + const operandDescriptor = {dataType: 'float32', shape: [2, 2]}; const inputFromOtherBuilder = otherBuilder.input('input', operandDescriptor); diff --git a/testing/web-platform/tests/webnn/validation_tests/constant-changed-buffer.https.any.js b/testing/web-platform/tests/webnn/validation_tests/constant-changed-buffer.https.any.js index 1a516c0b1d4f..40f3a0ccaef2 100644 --- a/testing/web-platform/tests/webnn/validation_tests/constant-changed-buffer.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/constant-changed-buffer.https.any.js @@ -11,13 +11,13 @@ promise_test(async t => { let aBuffer = new Float32Array(backingBuffer, 0, 2); aBuffer[0] = 2; aBuffer[1] = 3; - const a = builder.constant({dataType: 'float32', dimensions: [2]}, aBuffer); + const a = builder.constant({dataType: 'float32', shape: [2]}, aBuffer); // Detach `aBuffer`. Constant data should already be copied, so changes to // the buffer afterwards should not be reflected in the graph. const unusedBuffer = backingBuffer.transfer(); - const b = builder.input('b', {dataType: 'float32', dimensions: [2]}); + const b = builder.input('b', {dataType: 'float32', shape: [2]}); const c = builder.add(a, b); const graph = await builder.build({c}); @@ -32,14 +32,14 @@ promise_test(async t => { promise_test(async t => { const builder = new MLGraphBuilder(context); let aBuffer = new Float32Array([2, 3]); - const a = builder.constant({dataType: 'float32', dimensions: [2]}, aBuffer); + const a = builder.constant({dataType: 'float32', shape: [2]}, aBuffer); // Rewrite `aBuffer` contents. Constant data should already be copied, so // changes to the buffer afterwards should not be reflected in the graph. aBuffer[0] = 10; aBuffer[1] = 20; - const b = builder.input('b', {dataType: 'float32', dimensions: [2]}); + const b = builder.input('b', {dataType: 'float32', shape: [2]}); const c = builder.add(a, b); const graph = await builder.build({c}); @@ -63,5 +63,5 @@ promise_test(async t => { assert_throws_js( TypeError, - () => builder.constant({dataType: 'float32', dimensions: [2]}, aBuffer)); + () => builder.constant({dataType: 'float32', shape: [2]}, aBuffer)); }, 'Constant data cannot use a detached buffer, which is empty'); diff --git a/testing/web-platform/tests/webnn/validation_tests/constant.https.any.js b/testing/web-platform/tests/webnn/validation_tests/constant.https.any.js index d101d92fb809..b9b75e372b01 100644 --- a/testing/web-platform/tests/webnn/validation_tests/constant.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/constant.https.any.js @@ -14,25 +14,25 @@ const tests = [ '[constant] Test building a 0-D scalar constant without presenting dimensions', descriptor: {dataType: 'float32'}, bufferView: {type: Float32Array, byteLength: 1 * 4}, - output: {dataType: 'float32', dimensions: []} + output: {dataType: 'float32', shape: []} }, { name: '[constant] Test building a 0-D scalar constant with empty dimensions', - descriptor: {dataType: 'float32', dimensions: []}, + descriptor: {dataType: 'float32', shape: []}, bufferView: {type: Float32Array, byteLength: 1 * 4}, - output: {dataType: 'float32', dimensions: []} + output: {dataType: 'float32', shape: []} }, { name: '[constant] Test building a constant with float32 data type', - descriptor: {dataType: 'float32', dimensions: [2, 3]}, + descriptor: {dataType: 'float32', shape: [2, 3]}, bufferView: {type: Float32Array, byteLength: 6 * 4}, - output: {dataType: 'float32', dimensions: [2, 3]} + output: {dataType: 'float32', shape: [2, 3]} }, { name: '[constant] Throw if byte length of bufferView for float32 doesn\'t match the given dimensions', - descriptor: {dataType: 'float32', dimensions: [2, 3]}, + descriptor: {dataType: 'float32', shape: [2, 3]}, bufferView: { type: Float32Array, byteLength: 6 * 4 - 4 // The bufferView's byte length is less than the @@ -42,14 +42,14 @@ const tests = [ // TODO (crbug.com/329702838): Test building a constant with float16 data type { name: '[constant] Test building a constant with int32 data type', - descriptor: {dataType: 'int32', dimensions: [2, 3]}, + descriptor: {dataType: 'int32', shape: [2, 3]}, bufferView: {type: Int32Array, byteLength: 6 * 4}, - output: {dataType: 'int32', dimensions: [2, 3]} + output: {dataType: 'int32', shape: [2, 3]} }, { name: '[constant] Throw if byte length of bufferView for int32 doesn\'t match the given dimensions', - descriptor: {dataType: 'int32', dimensions: [2, 3]}, + descriptor: {dataType: 'int32', shape: [2, 3]}, bufferView: { type: Int32Array, byteLength: 6 * 4 + 4 // The bufferView's byte length is greater than the @@ -58,73 +58,73 @@ const tests = [ }, { name: '[constant] Test building a constant with uint32 data type', - descriptor: {dataType: 'uint32', dimensions: [2, 3]}, + descriptor: {dataType: 'uint32', shape: [2, 3]}, bufferView: {type: Uint32Array, byteLength: 6 * 4}, - output: {dataType: 'uint32', dimensions: [2, 3]} + output: {dataType: 'uint32', shape: [2, 3]} }, { name: '[constant] Throw if byte length of bufferView for uint32 doesn\'t match the given dimensions', - descriptor: {dataType: 'uint32', dimensions: [2, 3]}, + descriptor: {dataType: 'uint32', shape: [2, 3]}, bufferView: {type: Uint32Array, byteLength: 6 * 4 + 4} }, { name: '[constant] Test building a constant with int64 data type', - descriptor: {dataType: 'int64', dimensions: [2, 3]}, + descriptor: {dataType: 'int64', shape: [2, 3]}, bufferView: {type: BigInt64Array, byteLength: 6 * 8}, - output: {dataType: 'int64', dimensions: [2, 3]} + output: {dataType: 'int64', shape: [2, 3]} }, { name: '[constant] Throw if byte length of bufferView for int64 doesn\'t match the given dimensions', - descriptor: {dataType: 'int64', dimensions: [2, 3]}, + descriptor: {dataType: 'int64', shape: [2, 3]}, bufferView: {type: BigInt64Array, byteLength: 6 * 8 + 8} }, { name: '[constant] Test building a constant with uint64 data type', - descriptor: {dataType: 'uint64', dimensions: [2, 3]}, + descriptor: {dataType: 'uint64', shape: [2, 3]}, bufferView: {type: BigUint64Array, byteLength: 6 * 8}, - output: {dataType: 'uint64', dimensions: [2, 3]} + output: {dataType: 'uint64', shape: [2, 3]} }, { name: '[constant] Throw if byte length of bufferView for uint64 doesn\'t match the given dimensions', - descriptor: {dataType: 'uint64', dimensions: [2, 3]}, + descriptor: {dataType: 'uint64', shape: [2, 3]}, bufferView: {type: BigUint64Array, byteLength: 6 * 8 + 8} }, { name: '[constant] Test building a constant with int8 data type', - descriptor: {dataType: 'int8', dimensions: [2, 3]}, + descriptor: {dataType: 'int8', shape: [2, 3]}, bufferView: {type: Int8Array, byteLength: 6 * 1}, - output: {dataType: 'int8', dimensions: [2, 3]} + output: {dataType: 'int8', shape: [2, 3]} }, { name: '[constant] Throw if byte length of bufferView for int8 doesn\'t match the given dimensions', - descriptor: {dataType: 'int8', dimensions: [2, 3]}, + descriptor: {dataType: 'int8', shape: [2, 3]}, bufferView: {type: Int8Array, byteLength: 6 * 4 - 4} }, { name: '[constant] Test building a constant with uint8 data type', - descriptor: {dataType: 'uint8', dimensions: [2, 3]}, + descriptor: {dataType: 'uint8', shape: [2, 3]}, bufferView: {type: Uint8Array, byteLength: 6 * 1}, - output: {dataType: 'uint8', dimensions: [2, 3]} + output: {dataType: 'uint8', shape: [2, 3]} }, { name: '[constant] Throw if byte length of bufferView for uint8 doesn\'t match the given dimensions', - descriptor: {dataType: 'uint8', dimensions: [2, 3]}, + descriptor: {dataType: 'uint8', shape: [2, 3]}, bufferView: {type: Uint8Array, byteLength: 6 * 4 - 4} }, { name: '[constant] Throw if a dimension is 0', - descriptor: {dataType: 'float32', dimensions: [2, 0]}, + descriptor: {dataType: 'float32', shape: [2, 0]}, bufferView: {type: Float32Array, byteLength: 2 * 4} }, { name: '[constant] Throw if bufferView type doesn\'t match the operand data type', - descriptor: {dataType: 'float32', dimensions: [2, 3]}, + descriptor: {dataType: 'float32', shape: [2, 3]}, bufferView: {type: Int32Array, byteLength: 6 * 4} } ]; @@ -137,7 +137,7 @@ tests.forEach( if (test.output) { const constantOperand = builder.constant(test.descriptor, bufferView); assert_equals(constantOperand.dataType(), test.output.dataType); - assert_array_equals(constantOperand.shape(), test.output.dimensions); + assert_array_equals(constantOperand.shape(), test.output.shape); } else { assert_throws_js( TypeError, () => builder.constant(test.descriptor, bufferView)); 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 84f6a5975c1f..405538ff4d80 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 @@ -10,16 +10,16 @@ // Example input in NCHW layout. const kExampleInputDescriptor = { dataType: 'float32', - dimensions: [1, 1, 5, 5] + shape: [1, 1, 5, 5] }; // Example filter in OIHW layout. const kExampleFilterDescriptor = { dataType: 'float32', - dimensions: [1, 1, 3, 3] + shape: [1, 1, 3, 3] }; const kExampleBiasDescriptor = { dataType: 'float32', - dimensions: [/* output channels */ 1] + shape: [/* output channels */ 1] }; const label = `conv_2d_*`; @@ -54,183 +54,183 @@ multi_builder_test(async (t, builder, otherBuilder) => { const tests = [ { name: '[conv2d] Test with default options.', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 3, 3]}, - output: {dataType: 'float32', dimensions: [1, 1, 3, 3]} + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 3, 3]}, + output: {dataType: 'float32', shape: [1, 1, 3, 3]} }, { name: '[conv2d] Test with padding.', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 3, 3]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 3, 3]}, options: { padding: [1, 1, 1, 1], }, - output: {dataType: 'float32', dimensions: [1, 1, 5, 5]} + output: {dataType: 'float32', shape: [1, 1, 5, 5]} }, { name: '[conv2d] Test with strides and padding.', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 3, 3]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 3, 3]}, options: { padding: [1, 1, 1, 1], strides: [2, 2], }, - output: {dataType: 'float32', dimensions: [1, 1, 3, 3]} + output: {dataType: 'float32', shape: [1, 1, 3, 3]} }, { name: '[conv2d] Test with strides and asymmetric padding.', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 4, 2]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 4, 2]}, options: { padding: [1, 2, 0, 1], strides: [2, 2], }, - output: {dataType: 'float32', dimensions: [1, 1, 3, 3]} + output: {dataType: 'float32', shape: [1, 1, 3, 3]} }, { name: '[conv2d] Test depthwise conv2d by setting groups to input channels.', - input: {dataType: 'float32', dimensions: [1, 4, 2, 2]}, - filter: {dataType: 'float32', dimensions: [4, 1, 2, 2]}, + input: {dataType: 'float32', shape: [1, 4, 2, 2]}, + filter: {dataType: 'float32', shape: [4, 1, 2, 2]}, options: { groups: 4, }, - output: {dataType: 'float32', dimensions: [1, 4, 1, 1]} + output: {dataType: 'float32', shape: [1, 4, 1, 1]} }, { name: '[conv2d] Test depthwise conv2d with groups, inputLayout="nhwc" and filterLayout="ihwo".', - input: {dataType: 'float32', dimensions: [1, 2, 2, 4]}, - filter: {dataType: 'float32', dimensions: [1, 2, 2, 4]}, + input: {dataType: 'float32', shape: [1, 2, 2, 4]}, + filter: {dataType: 'float32', shape: [1, 2, 2, 4]}, options: { groups: 4, inputLayout: 'nhwc', filterLayout: 'ihwo', }, - output: {dataType: 'float32', dimensions: [1, 1, 1, 4]} + output: {dataType: 'float32', shape: [1, 1, 1, 4]} }, { name: '[conv2d] Test with dilations, inputLayout="nhwc" and filterLayout="ihwo".', - input: {dataType: 'float32', dimensions: [1, 65, 65, 1]}, - filter: {dataType: 'float32', dimensions: [1, 3, 3, 1]}, + input: {dataType: 'float32', shape: [1, 65, 65, 1]}, + filter: {dataType: 'float32', shape: [1, 3, 3, 1]}, options: { inputLayout: 'nhwc', filterLayout: 'ihwo', dilations: [4, 4], }, - output: {dataType: 'float32', dimensions: [1, 57, 57, 1]} + output: {dataType: 'float32', shape: [1, 57, 57, 1]} }, { name: '[conv2d] Test with inputLayout="nchw" and filterLayout="oihw".', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 2, 3, 3]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 2, 3, 3]}, options: { inputLayout: 'nchw', filterLayout: 'oihw', }, - output: {dataType: 'float32', dimensions: [1, 1, 3, 3]} + output: {dataType: 'float32', shape: [1, 1, 3, 3]} }, { name: '[conv2d] Test with inputLayout="nchw" and filterLayout="hwio".', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, - filter: {dataType: 'float32', dimensions: [3, 3, 2, 1]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, + filter: {dataType: 'float32', shape: [3, 3, 2, 1]}, options: { inputLayout: 'nchw', filterLayout: 'hwio', }, - output: {dataType: 'float32', dimensions: [1, 1, 3, 3]} + output: {dataType: 'float32', shape: [1, 1, 3, 3]} }, { name: '[conv2d] Test with inputLayout="nchw" and filterLayout="ohwi".', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 3, 3, 2]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 3, 3, 2]}, options: { inputLayout: 'nchw', filterLayout: 'ohwi', }, - output: {dataType: 'float32', dimensions: [1, 1, 3, 3]} + output: {dataType: 'float32', shape: [1, 1, 3, 3]} }, { name: '[conv2d] Test with inputLayout="nchw" and filterLayout="ihwo".', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, - filter: {dataType: 'float32', dimensions: [2, 3, 3, 1]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, + filter: {dataType: 'float32', shape: [2, 3, 3, 1]}, options: { inputLayout: 'nchw', filterLayout: 'ihwo', }, - output: {dataType: 'float32', dimensions: [1, 1, 3, 3]} + output: {dataType: 'float32', shape: [1, 1, 3, 3]} }, { name: '[conv2d] Test with inputLayout="nhwc" and filterLayout="oihw".', - input: {dataType: 'float32', dimensions: [1, 5, 5, 2]}, - filter: {dataType: 'float32', dimensions: [1, 2, 3, 3]}, + input: {dataType: 'float32', shape: [1, 5, 5, 2]}, + filter: {dataType: 'float32', shape: [1, 2, 3, 3]}, options: { inputLayout: 'nhwc', filterLayout: 'oihw', }, - output: {dataType: 'float32', dimensions: [1, 3, 3, 1]} + output: {dataType: 'float32', shape: [1, 3, 3, 1]} }, { name: '[conv2d] Test with inputLayout="nhwc" and filterLayout="hwio".', - input: {dataType: 'float32', dimensions: [1, 5, 5, 2]}, - filter: {dataType: 'float32', dimensions: [3, 3, 2, 1]}, + input: {dataType: 'float32', shape: [1, 5, 5, 2]}, + filter: {dataType: 'float32', shape: [3, 3, 2, 1]}, options: { inputLayout: 'nhwc', filterLayout: 'hwio', }, - output: {dataType: 'float32', dimensions: [1, 3, 3, 1]} + output: {dataType: 'float32', shape: [1, 3, 3, 1]} }, { name: '[conv2d] Test with inputLayout="nhwc" and filterLayout="ohwi".', - input: {dataType: 'float32', dimensions: [1, 5, 5, 2]}, - filter: {dataType: 'float32', dimensions: [1, 3, 3, 2]}, + input: {dataType: 'float32', shape: [1, 5, 5, 2]}, + filter: {dataType: 'float32', shape: [1, 3, 3, 2]}, options: { inputLayout: 'nhwc', filterLayout: 'ohwi', }, - output: {dataType: 'float32', dimensions: [1, 3, 3, 1]} + output: {dataType: 'float32', shape: [1, 3, 3, 1]} }, { name: '[conv2d] Test with inputLayout="nhwc" and filterLayout="ihwo".', - input: {dataType: 'float32', dimensions: [1, 5, 5, 2]}, - filter: {dataType: 'float32', dimensions: [2, 3, 3, 1]}, + input: {dataType: 'float32', shape: [1, 5, 5, 2]}, + filter: {dataType: 'float32', shape: [2, 3, 3, 1]}, options: { inputLayout: 'nhwc', filterLayout: 'ihwo', }, - output: {dataType: 'float32', dimensions: [1, 3, 3, 1]} + output: {dataType: 'float32', shape: [1, 3, 3, 1]} }, { name: '[conv2d] Throw if the input is not a 4-D tensor.', - input: {dataType: 'float32', dimensions: [1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 2, 2, 1]}, + input: {dataType: 'float32', shape: [1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 2, 2, 1]}, options: {label}, }, { 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]}, + input: {dataType: 'int32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'int32', shape: [1, 1, 2, 2]}, options: {label}, }, { name: '[conv2d] Throw if the filter is not a 4-D tensor.', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [2, 2]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [2, 2]}, options: {label}, }, { name: '[conv2d] Throw if the filter data type doesn\'t match the input data type.', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'int32', dimensions: [1, 1, 2, 2]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'int32', shape: [1, 1, 2, 2]}, options: { label: label, }, }, { name: '[conv2d] Throw if the length of padding is not 4.', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 2, 2]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 2, 2]}, options: { padding: [2, 2], label: label, @@ -238,8 +238,8 @@ const tests = [ }, { name: '[conv2d] Throw if the length of strides is not 2.', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 2, 2]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 2, 2]}, options: { strides: [2], label: label, @@ -247,8 +247,8 @@ const tests = [ }, { name: '[conv2d] Throw if strideHeight is smaller than 1.', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 2, 2]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 2, 2]}, options: { strides: [0, 1], label: label, @@ -256,8 +256,8 @@ const tests = [ }, { name: '[conv2d] Throw if strideWidth is smaller than 1.', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 2, 2]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 2, 2]}, options: { strides: [1, 0], label: label, @@ -265,8 +265,8 @@ const tests = [ }, { name: '[conv2d] Throw if the length of dilations is not 2.', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 2, 2]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 2, 2]}, options: { dilations: [1], label: label, @@ -274,8 +274,8 @@ const tests = [ }, { name: '[conv2d] Throw if dilationHeight is smaller than 1.', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 2, 2]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 2, 2]}, options: { dilations: [0, 1], label: label, @@ -283,8 +283,8 @@ const tests = [ }, { name: '[conv2d] Throw if dilationWidth is smaller than 1.', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 2, 2]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 2, 2]}, options: { dilations: [1, 0], label: label, @@ -292,8 +292,8 @@ const tests = [ }, { name: '[conv2d] Throw if inputChannels % groups is not 0.', - input: {dataType: 'float32', dimensions: [1, 4, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 2, 2]}, + input: {dataType: 'float32', shape: [1, 4, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 2, 2]}, options: { groups: 3, label: label, @@ -302,8 +302,8 @@ const tests = [ { name: '[conv2d] Throw if inputChannels / groups is not equal to filterInputChannels.', - input: {dataType: 'float32', dimensions: [1, 4, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 2, 2]}, + input: {dataType: 'float32', shape: [1, 4, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 2, 2]}, options: { groups: 2, label: label, @@ -311,8 +311,8 @@ const tests = [ }, { name: '[conv2d] Throw if the groups is smaller than 1.', - input: {dataType: 'float32', dimensions: [1, 4, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 2, 2]}, + input: {dataType: 'float32', shape: [1, 4, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 2, 2]}, options: { groups: 0, label: label, @@ -321,8 +321,8 @@ const tests = [ { name: '[conv2d] Throw due to overflow when calculating the effective filter height.', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 434983, 2]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 434983, 2]}, options: { dilations: [328442, 1], label: label, @@ -331,8 +331,8 @@ const tests = [ { name: '[conv2d] Throw due to overflow when calculating the effective filter width.', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 2, 234545]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 2, 234545]}, options: { dilations: [2, 843452], label: label, @@ -340,8 +340,8 @@ const tests = [ }, { name: '[conv2d] Throw due to overflow when dilation height is too large.', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 3, 3]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 3, 3]}, options: { dilations: [kMaxUnsignedLong, 1], label: label, @@ -349,8 +349,8 @@ const tests = [ }, { name: '[conv2d] Throw due to overflow when dilation width is too large.', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 3, 3]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 3, 3]}, options: { dilations: [1, kMaxUnsignedLong], label: label, @@ -358,8 +358,8 @@ const tests = [ }, { name: '[conv2d] Throw due to underflow when calculating the output height.', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 4, 2]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 4, 2]}, options: { dilations: [4, 1], padding: [1, 1, 1, 1], @@ -369,8 +369,8 @@ const tests = [ }, { name: '[conv2d] Throw due to underflow when calculating the output width.', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 2, 8]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 2, 8]}, options: { dilations: [1, 4], padding: [1, 1, 1, 1], @@ -380,68 +380,68 @@ const tests = [ }, { name: '[conv2d] Throw if the bias is not a 1-D tensor.', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 2, 2]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 2, 2]}, options: { - bias: {dataType: 'float32', dimensions: [1, 2]}, + bias: {dataType: 'float32', shape: [1, 2]}, label: label, }, }, { name: '[conv2d] Throw if the bias shape is not equal to [output_channels] with filterLayout="oihw".', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 2, 2]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 2, 2]}, options: { - bias: {dataType: 'float32', dimensions: [2]}, + bias: {dataType: 'float32', shape: [2]}, label: label, }, }, { name: '[conv2d] Throw if the bias shape is not equal to [output_channels] with filterLayout="hwio".', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [2, 2, 1, 1]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [2, 2, 1, 1]}, options: { - bias: {dataType: 'float32', dimensions: [2]}, + bias: {dataType: 'float32', shape: [2]}, label: label, }, }, { name: '[conv2d] Throw if the bias shape is not equal to [output_channels] with filterLayout="ohwi".', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 2, 2, 1]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 2, 2, 1]}, options: { - bias: {dataType: 'float32', dimensions: [2]}, + bias: {dataType: 'float32', shape: [2]}, label: label, }, }, { name: '[conv2d] Throw if the bias shape is not equal to [output_channels] with filterLayout="ihwo".', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 2, 2, 1]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 2, 2, 1]}, options: { - bias: {dataType: 'float32', dimensions: [2]}, + bias: {dataType: 'float32', shape: [2]}, label: label, }, }, { name: '[conv2d] Throw if the bias data type doesn\'t match input data type.', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 2, 2]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 2, 2]}, options: { - bias: {dataType: 'int32', dimensions: [1]}, + bias: {dataType: 'int32', shape: [1]}, label: label, }, }, { name: '[conv2d] Throw if inputChannels / groups is not equal to filterInputChannels with inputLayout="nchw" and filterLayout="oihw".', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 2, 3, 3]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 2, 3, 3]}, options: { inputLayout: 'nchw', filterLayout: 'oihw', @@ -452,8 +452,8 @@ const tests = [ { name: '[conv2d] Throw if inputChannels / groups is not equal to filterInputChannels with inputLayout="nchw" and filterLayout="hwio".', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, - filter: {dataType: 'float32', dimensions: [3, 3, 2, 1]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, + filter: {dataType: 'float32', shape: [3, 3, 2, 1]}, options: { inputLayout: 'nchw', filterLayout: 'hwio', @@ -464,8 +464,8 @@ const tests = [ { name: '[conv2d] Throw if inputChannels / groups is not equal to filterInputChannels with inputLayout="nchw" and filterLayout="ohwi".', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 3, 3, 2]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 3, 3, 2]}, options: { inputLayout: 'nchw', filterLayout: 'ohwi', @@ -476,8 +476,8 @@ const tests = [ { name: '[conv2d] Throw if inputChannels / groups is not equal to filterInputChannels with inputLayout="nchw" and filterLayout="ihwo".', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, - filter: {dataType: 'float32', dimensions: [2, 3, 3, 1]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, + filter: {dataType: 'float32', shape: [2, 3, 3, 1]}, options: { inputLayout: 'nchw', filterLayout: 'ihwo', @@ -489,8 +489,8 @@ const tests = [ { name: '[conv2d] Throw if inputChannels / groups is not equal to filterInputChannels with inputLayout="nhwc" and filterLayout="oihw".', - input: {dataType: 'float32', dimensions: [1, 5, 5, 2]}, - filter: {dataType: 'float32', dimensions: [1, 2, 3, 3]}, + input: {dataType: 'float32', shape: [1, 5, 5, 2]}, + filter: {dataType: 'float32', shape: [1, 2, 3, 3]}, options: { inputLayout: 'nhwc', filterLayout: 'oihw', @@ -501,8 +501,8 @@ const tests = [ { name: '[conv2d] Throw if inputChannels / groups is not equal to filterInputChannels with inputLayout="nhwc" and filterLayout="hwio".', - input: {dataType: 'float32', dimensions: [1, 5, 5, 2]}, - filter: {dataType: 'float32', dimensions: [3, 3, 2, 1]}, + input: {dataType: 'float32', shape: [1, 5, 5, 2]}, + filter: {dataType: 'float32', shape: [3, 3, 2, 1]}, options: { inputLayout: 'nhwc', filterLayout: 'hwio', @@ -513,8 +513,8 @@ const tests = [ { name: '[conv2d] Throw if inputChannels / groups is not equal to filterInputChannels with inputLayout="nhwc" and filterLayout="ohwi".', - input: {dataType: 'float32', dimensions: [1, 5, 5, 2]}, - filter: {dataType: 'float32', dimensions: [1, 3, 3, 2]}, + input: {dataType: 'float32', shape: [1, 5, 5, 2]}, + filter: {dataType: 'float32', shape: [1, 3, 3, 2]}, options: { inputLayout: 'nhwc', filterLayout: 'ohwi', @@ -525,8 +525,8 @@ const tests = [ { name: '[conv2d] Throw if inputChannels / groups is not equal to filterInputChannels with inputLayout="nhwc" and filterLayout="ihwo".', - input: {dataType: 'float32', dimensions: [1, 5, 5, 2]}, - filter: {dataType: 'float32', dimensions: [2, 3, 3, 1]}, + input: {dataType: 'float32', shape: [1, 5, 5, 2]}, + filter: {dataType: 'float32', shape: [2, 3, 3, 1]}, options: { inputLayout: 'nhwc', filterLayout: 'ihwo', @@ -539,18 +539,11 @@ const tests = [ tests.forEach( test => promise_test(async t => { const builder = new MLGraphBuilder(context); - const input = builder.input( - 'input', - {dataType: test.input.dataType, dimensions: test.input.dimensions}); - const filter = builder.input( - 'filter', - {dataType: test.filter.dataType, dimensions: test.filter.dimensions}); + const input = builder.input('input', test.input); + const filter = builder.input('filter', test.filter); if (test.options && test.options.bias) { - test.options.bias = builder.input('bias', { - dataType: test.options.bias.dataType, - dimensions: test.options.bias.dimensions - }); + test.options.bias = builder.input('bias', test.options.bias); } if (test.output && @@ -558,7 +551,7 @@ tests.forEach( test.input.dataType)) { const output = builder.conv2d(input, filter, test.options); assert_equals(output.dataType(), test.output.dataType); - assert_array_equals(output.shape(), test.output.dimensions); + assert_array_equals(output.shape(), test.output.shape); } else { const regrexp = /\[conv_2d_\*\]/; assert_throws_with_label( 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 2c4e9dc44284..c128903e9cc5 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 @@ -10,16 +10,16 @@ // Example input in NCHW layout. const kExampleInputDescriptor = { dataType: 'float32', - dimensions: [1, 1, 5, 5] + shape: [1, 1, 5, 5] }; // Example filter in OIHW layout. const kExampleFilterDescriptor = { dataType: 'float32', - dimensions: [1, 1, 3, 3] + shape: [1, 1, 3, 3] }; const kExampleBiasDescriptor = { dataType: 'float32', - dimensions: [/* output channels */ 1] + shape: [/* output channels */ 1] }; multi_builder_test(async (t, builder, otherBuilder) => { @@ -55,167 +55,167 @@ const label = 'conv_transpose_2d'; const tests = [ { name: '[convTranspose2d] Test with default options.', - input: {dataType: 'float32', dimensions: [1, 1, 3, 3]}, - filter: {dataType: 'float32', dimensions: [1, 1, 3, 3]}, - output: {dataType: 'float32', dimensions: [1, 1, 5, 5]} + input: {dataType: 'float32', shape: [1, 1, 3, 3]}, + filter: {dataType: 'float32', shape: [1, 1, 3, 3]}, + output: {dataType: 'float32', shape: [1, 1, 5, 5]} }, { name: '[convTranspose2d] Test with inputLayout="nchw" and filterLayout="hwoi".', - input: {dataType: 'float32', dimensions: [1, 1, 3, 3]}, - filter: {dataType: 'float32', dimensions: [3, 3, 2, 1]}, + input: {dataType: 'float32', shape: [1, 1, 3, 3]}, + filter: {dataType: 'float32', shape: [3, 3, 2, 1]}, options: { filterLayout: 'hwoi', inputLayout: 'nchw', }, - output: {dataType: 'float32', dimensions: [1, 2, 5, 5]} + output: {dataType: 'float32', shape: [1, 2, 5, 5]} }, { name: '[convTranspose2d] Test with inputLayout="nchw" and filterLayout="ohwi".', - input: {dataType: 'float32', dimensions: [1, 1, 3, 3]}, - filter: {dataType: 'float32', dimensions: [2, 3, 3, 1]}, + input: {dataType: 'float32', shape: [1, 1, 3, 3]}, + filter: {dataType: 'float32', shape: [2, 3, 3, 1]}, options: { filterLayout: 'ohwi', inputLayout: 'nchw', }, - output: {dataType: 'float32', dimensions: [1, 2, 5, 5]} + output: {dataType: 'float32', shape: [1, 2, 5, 5]} }, { name: '[convTranspose2d] Test with inputLayout="nhwc" and filterLayout="iohw".', - input: {dataType: 'float32', dimensions: [1, 3, 3, 1]}, - filter: {dataType: 'float32', dimensions: [1, 2, 3, 3]}, + input: {dataType: 'float32', shape: [1, 3, 3, 1]}, + filter: {dataType: 'float32', shape: [1, 2, 3, 3]}, options: { filterLayout: 'iohw', inputLayout: 'nhwc', }, - output: {dataType: 'float32', dimensions: [1, 5, 5, 2]} + output: {dataType: 'float32', shape: [1, 5, 5, 2]} }, { name: '[convTranspose2d] Test with inputLayout="nhwc" and filterLayout="hwoi".', - input: {dataType: 'float32', dimensions: [1, 3, 3, 1]}, - filter: {dataType: 'float32', dimensions: [3, 3, 2, 1]}, + input: {dataType: 'float32', shape: [1, 3, 3, 1]}, + filter: {dataType: 'float32', shape: [3, 3, 2, 1]}, options: { filterLayout: 'hwoi', inputLayout: 'nhwc', }, - output: {dataType: 'float32', dimensions: [1, 5, 5, 2]} + output: {dataType: 'float32', shape: [1, 5, 5, 2]} }, { name: '[convTranspose2d] Test with inputLayout="nhwc" and filterLayout="ohwi".', - input: {dataType: 'float32', dimensions: [1, 3, 3, 1]}, - filter: {dataType: 'float32', dimensions: [2, 3, 3, 1]}, + input: {dataType: 'float32', shape: [1, 3, 3, 1]}, + filter: {dataType: 'float32', shape: [2, 3, 3, 1]}, options: { filterLayout: 'ohwi', inputLayout: 'nhwc', }, - output: {dataType: 'float32', dimensions: [1, 5, 5, 2]} + output: {dataType: 'float32', shape: [1, 5, 5, 2]} }, { name: '[convTranspose2d] Test with strides=[3, 2], outputSizes=[10, 8].', - input: {dataType: 'float32', dimensions: [1, 1, 3, 3]}, - filter: {dataType: 'float32', dimensions: [1, 2, 3, 3]}, + input: {dataType: 'float32', shape: [1, 1, 3, 3]}, + filter: {dataType: 'float32', shape: [1, 2, 3, 3]}, options: { strides: [3, 2], outputSizes: [10, 8], }, - output: {dataType: 'float32', dimensions: [1, 2, 10, 8]} + output: {dataType: 'float32', shape: [1, 2, 10, 8]} }, { name: '[convTranspose2d] Test with strides=[3, 2], outputPadding=[1, 1].', - input: {dataType: 'float32', dimensions: [1, 1, 3, 3]}, - filter: {dataType: 'float32', dimensions: [1, 2, 3, 3]}, + input: {dataType: 'float32', shape: [1, 1, 3, 3]}, + filter: {dataType: 'float32', shape: [1, 2, 3, 3]}, options: { strides: [3, 2], outputPadding: [1, 1], }, - output: {dataType: 'float32', dimensions: [1, 2, 10, 8]} + output: {dataType: 'float32', shape: [1, 2, 10, 8]} }, { name: '[convTranspose2d] Test with padding=1.', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 3, 3]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 3, 3]}, options: { padding: [1, 1, 1, 1], }, - output: {dataType: 'float32', dimensions: [1, 1, 5, 5]} + output: {dataType: 'float32', shape: [1, 1, 5, 5]} }, { name: '[convTranspose2d] Test with padding=1, groups=3.', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 3, 3]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 3, 3]}, options: { padding: [1, 1, 1, 1], groups: 3, }, - output: {dataType: 'float32', dimensions: [1, 3, 5, 5]} + output: {dataType: 'float32', shape: [1, 3, 5, 5]} }, { name: '[convTranspose2d] Test with strides=2.', - input: {dataType: 'float32', dimensions: [1, 1, 3, 3]}, - filter: {dataType: 'float32', dimensions: [1, 2, 3, 3]}, + input: {dataType: 'float32', shape: [1, 1, 3, 3]}, + filter: {dataType: 'float32', shape: [1, 2, 3, 3]}, options: { strides: [2, 2], }, - output: {dataType: 'float32', dimensions: [1, 2, 7, 7]} + output: {dataType: 'float32', shape: [1, 2, 7, 7]} }, { name: '[convTranspose2d] Test with strides=2 and padding=1.', - input: {dataType: 'float32', dimensions: [1, 1, 3, 3]}, - filter: {dataType: 'float32', dimensions: [1, 1, 3, 3]}, + input: {dataType: 'float32', shape: [1, 1, 3, 3]}, + filter: {dataType: 'float32', shape: [1, 1, 3, 3]}, options: { padding: [1, 1, 1, 1], strides: [2, 2], }, - output: {dataType: 'float32', dimensions: [1, 1, 5, 5]} + output: {dataType: 'float32', shape: [1, 1, 5, 5]} }, { name: '[convTranspose2d] Test when the output sizes are explicitly specified, the output padding values are ignored though padding value is not smaller than stride along the same axis.', - input: {dataType: 'float32', dimensions: [1, 1, 3, 3]}, - filter: {dataType: 'float32', dimensions: [1, 2, 3, 3]}, + input: {dataType: 'float32', shape: [1, 1, 3, 3]}, + filter: {dataType: 'float32', shape: [1, 2, 3, 3]}, options: { outputPadding: [3, 3], strides: [3, 2], outputSizes: [10, 8], }, - output: {dataType: 'float32', dimensions: [1, 2, 10, 8]} + output: {dataType: 'float32', shape: [1, 2, 10, 8]} }, { name: '[convTranspose2d] Throw if the input is not a 4-D tensor.', - input: {dataType: 'float32', dimensions: [1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 2, 2]}, + input: {dataType: 'float32', shape: [1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 2, 2]}, options: {label}, }, { 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]}, + input: {dataType: 'int32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'int32', shape: [1, 1, 2, 2]}, options: {label}, }, { name: '[convTranspose2d] Throw if the filter is not a 4-D tensor.', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [2, 2]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [2, 2]}, options: {label}, }, { name: '[convTranspose2d] Throw if the filter data type doesn\'t match the input data type.', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'int32', dimensions: [1, 1, 2, 2]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'int32', shape: [1, 1, 2, 2]}, options: { label: label, }, }, { name: '[convTranspose2d] Throw if the length of padding is not 4.', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 2, 2]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 2, 2]}, options: { padding: [2, 2], label: label, @@ -223,8 +223,8 @@ const tests = [ }, { name: '[convTranspose2d] Throw if the length of strides is not 2.', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 2, 2]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 2, 2]}, options: { strides: [2], label: label, @@ -232,8 +232,8 @@ const tests = [ }, { name: '[convTranspose2d] Throw if one stride value is smaller than 1.', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 2, 2]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 2, 2]}, options: { strides: [1, 0], label: label, @@ -241,8 +241,8 @@ const tests = [ }, { name: '[convTranspose2d] Throw if the length of dilations is not 2.', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 2, 2]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 2, 2]}, options: { dilations: [1], label: label, @@ -251,8 +251,8 @@ const tests = [ { name: '[convTranspose2d] Throw if the one dilation value is smaller than 1.', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 2, 2]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 2, 2]}, options: { dilations: [1, 0], label: label, @@ -261,8 +261,8 @@ const tests = [ { name: '[convTranspose2d] Throw if the input channels is not equal to the filter input channels with inputLayout="nchw" and filterLayout="iohw".', - input: {dataType: 'float32', dimensions: [1, 3, 3, 3]}, - filter: {dataType: 'float32', dimensions: [1, 1, 3, 3]}, + input: {dataType: 'float32', shape: [1, 3, 3, 3]}, + filter: {dataType: 'float32', shape: [1, 1, 3, 3]}, options: { filterLayout: 'iohw', inputLayout: 'nchw', @@ -273,8 +273,8 @@ const tests = [ { name: '[convTranspose2d] Throw if the input channels is not equal to the filter input channels with inputLayout="nchw" and filterLayout="hwoi".', - input: {dataType: 'float32', dimensions: [1, 3, 3, 3]}, - filter: {dataType: 'float32', dimensions: [3, 1, 2, 1]}, + input: {dataType: 'float32', shape: [1, 3, 3, 3]}, + filter: {dataType: 'float32', shape: [3, 1, 2, 1]}, options: { filterLayout: 'hwoi', inputLayout: 'nchw', @@ -284,8 +284,8 @@ const tests = [ { name: '[convTranspose2d] Throw if the input channels is not equal to the filter input channels with inputLayout="nchw" and filterLayout="ohwi".', - input: {dataType: 'float32', dimensions: [1, 2, 3, 3]}, - filter: {dataType: 'float32', dimensions: [2, 3, 3, 1]}, + input: {dataType: 'float32', shape: [1, 2, 3, 3]}, + filter: {dataType: 'float32', shape: [2, 3, 3, 1]}, options: { filterLayout: 'ohwi', inputLayout: 'nchw', @@ -295,8 +295,8 @@ const tests = [ { name: '[convTranspose2d] Throw if the input channels is not equal to the filter input channels with inputLayout="nhwc" and filterLayout="iohw".', - input: {dataType: 'float32', dimensions: [1, 3, 3, 2]}, - filter: {dataType: 'float32', dimensions: [1, 2, 3, 3]}, + input: {dataType: 'float32', shape: [1, 3, 3, 2]}, + filter: {dataType: 'float32', shape: [1, 2, 3, 3]}, options: { filterLayout: 'iohw', inputLayout: 'nhwc', @@ -306,8 +306,8 @@ const tests = [ { name: '[convTranspose2d] Throw if the input channels is not equal to the filter input channels inputLayout="nhwc" and filterLayout="hwoi".', - input: {dataType: 'float32', dimensions: [1, 3, 3, 2]}, - filter: {dataType: 'float32', dimensions: [3, 3, 2, 1]}, + input: {dataType: 'float32', shape: [1, 3, 3, 2]}, + filter: {dataType: 'float32', shape: [3, 3, 2, 1]}, options: { filterLayout: 'hwoi', inputLayout: 'nhwc', @@ -317,8 +317,8 @@ const tests = [ { name: '[convTranspose2d] Throw if the input channels is not equal to the filter input channels with inputLayout="nhwc" and filterLayout="ohwi".', - input: {dataType: 'float32', dimensions: [1, 3, 3, 2]}, - filter: {dataType: 'float32', dimensions: [2, 3, 3, 1]}, + input: {dataType: 'float32', shape: [1, 3, 3, 2]}, + filter: {dataType: 'float32', shape: [2, 3, 3, 1]}, options: { filterLayout: 'ohwi', inputLayout: 'nhwc', @@ -327,8 +327,8 @@ const tests = [ }, { name: '[convTranspose2d] Throw if output channels is too large.', - input: {dataType: 'float32', dimensions: [1, 4, 5, 5]}, - filter: {dataType: 'float32', dimensions: [4, 2, 2, 2]}, + input: {dataType: 'float32', shape: [1, 4, 5, 5]}, + filter: {dataType: 'float32', shape: [4, 2, 2, 2]}, options: { groups: kMaxUnsignedLong, label: label, @@ -336,8 +336,8 @@ const tests = [ }, { name: '[convTranspose2d] Throw if the groups is smaller than 1.', - input: {dataType: 'float32', dimensions: [1, 4, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 2, 2]}, + input: {dataType: 'float32', shape: [1, 4, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 2, 2]}, options: { groups: 0, label: label, @@ -346,8 +346,8 @@ const tests = [ { name: '[convTranspose2d] Throw due to overflow when calculating the effective filter height.', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 434983, 2]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 434983, 2]}, options: { dilations: [328443, 1], label: label, @@ -356,8 +356,8 @@ const tests = [ { name: '[convTranspose2d] Throw due to overflow when calculating the effective filter width.', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 2, 234545]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 2, 234545]}, options: { dilations: [2, 843452], label: label, @@ -366,8 +366,8 @@ const tests = [ { name: '[convTranspose2d] Throw due to overflow when dilation height is too large.', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 3, 2]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 3, 2]}, options: { dilations: [kMaxUnsignedLong, 1], label: label, @@ -376,8 +376,8 @@ const tests = [ { name: '[convTranspose2d] Throw due to overflow when dilation width is too large.', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 3, 2]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 3, 2]}, options: { dilations: [1, kMaxUnsignedLong], label: label, @@ -385,61 +385,61 @@ const tests = [ }, { name: '[convTranspose2d] Throw if the bias is not a 1-D tensor.', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 2, 2]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 2, 2]}, options: { - bias: {dataType: 'float32', dimensions: [1, 2]}, + bias: {dataType: 'float32', shape: [1, 2]}, label: label, }, }, { name: '[convTranspose2d] Throw if the bias shape is not equal to [output_channels] with filterLayout="iohw".', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 2, 2]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 2, 2]}, options: { filterLayout: 'iohw', - bias: {dataType: 'float32', dimensions: [2]}, + bias: {dataType: 'float32', shape: [2]}, label: label, }, }, { name: '[convTranspose2d] Throw if the bias shape is not equal to [output_channels] with filterLayout="hwoi".', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [2, 2, 1, 1]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [2, 2, 1, 1]}, options: { filterLayout: 'hwoi', - bias: {dataType: 'float32', dimensions: [2]}, + bias: {dataType: 'float32', shape: [2]}, label: label, }, }, { name: '[convTranspose2d] Throw if the bias shape is not equal to [output_channels] with filterLayout="ohwi".', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 2, 2, 1]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 2, 2, 1]}, options: { filterLayout: 'ohwi', - bias: {dataType: 'float32', dimensions: [2]}, + bias: {dataType: 'float32', shape: [2]}, label: label, }, }, { name: '[convTranspose2d] Throw if the bias data type doesn\'t match input data type.', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, - filter: {dataType: 'float32', dimensions: [1, 1, 2, 2]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, + filter: {dataType: 'float32', shape: [1, 1, 2, 2]}, options: { - bias: {dataType: 'int32', dimensions: [1]}, + bias: {dataType: 'int32', shape: [1]}, label: label, }, }, { name: '[convTranspose2d] Throw if the outputPadding is not a sequence of length 2.', - input: {dataType: 'float32', dimensions: [1, 1, 3, 3]}, - filter: {dataType: 'float32', dimensions: [1, 2, 3, 3]}, + input: {dataType: 'float32', shape: [1, 1, 3, 3]}, + filter: {dataType: 'float32', shape: [1, 2, 3, 3]}, options: { strides: [3, 2], outputPadding: [1, 1, 1, 1], @@ -449,8 +449,8 @@ const tests = [ { name: '[convTranspose2d] Throw if the outputPadding is not smaller than stride along the width dimension.', - input: {dataType: 'float32', dimensions: [1, 1, 2, 2]}, - filter: {dataType: 'float32', dimensions: [1, 1, 3, 3]}, + input: {dataType: 'float32', shape: [1, 1, 2, 2]}, + filter: {dataType: 'float32', shape: [1, 1, 3, 3]}, options: { padding: [0, 0, 3, 3], strides: [2, 2], @@ -461,8 +461,8 @@ const tests = [ { name: '[convTranspose2d] Throw if the outputPadding is not smaller than stride along the height dimension.', - input: {dataType: 'float32', dimensions: [1, 1, 2, 2]}, - filter: {dataType: 'float32', dimensions: [1, 1, 3, 3]}, + input: {dataType: 'float32', shape: [1, 1, 2, 2]}, + filter: {dataType: 'float32', shape: [1, 1, 3, 3]}, options: { padding: [0, 0, 3, 3], strides: [2, 2], @@ -473,8 +473,8 @@ const tests = [ { name: '[convTranspose2d] Throw if the outputSizes is not a sequence of length 2.', - input: {dataType: 'float32', dimensions: [1, 1, 3, 3]}, - filter: {dataType: 'float32', dimensions: [1, 2, 3, 3]}, + input: {dataType: 'float32', shape: [1, 1, 3, 3]}, + filter: {dataType: 'float32', shape: [1, 2, 3, 3]}, options: { strides: [3, 2], outputSizes: [1, 2, 10, 8], @@ -483,8 +483,8 @@ const tests = [ }, { name: '[convTranspose2d] Throw if outputSizes[0] is not greater than 0.', - input: {dataType: 'float32', dimensions: [1, 1, 3, 3]}, - filter: {dataType: 'float32', dimensions: [1, 2, 3, 3]}, + input: {dataType: 'float32', shape: [1, 1, 3, 3]}, + filter: {dataType: 'float32', shape: [1, 2, 3, 3]}, options: { strides: [3, 2], outputSizes: [0, 7], @@ -493,8 +493,8 @@ const tests = [ }, { name: '[convTranspose2d] Throw if outputSizes[1] is not greater than 0.', - input: {dataType: 'float32', dimensions: [1, 1, 3, 3]}, - filter: {dataType: 'float32', dimensions: [1, 2, 3, 3]}, + input: {dataType: 'float32', shape: [1, 1, 3, 3]}, + filter: {dataType: 'float32', shape: [1, 2, 3, 3]}, options: { strides: [3, 2], outputSizes: [9, 0], @@ -503,8 +503,8 @@ const tests = [ }, { name: '[convTranspose2d] Throw if the padding height is too large.', - input: {dataType: 'float32', dimensions: [1, 1, 2, 2]}, - filter: {dataType: 'float32', dimensions: [1, 1, 3, 3]}, + input: {dataType: 'float32', shape: [1, 1, 2, 2]}, + filter: {dataType: 'float32', shape: [1, 1, 3, 3]}, options: { padding: [4, 4, 0, 0], strides: [2, 2], @@ -514,8 +514,8 @@ const tests = [ }, { name: '[convTranspose2d] Throw if the padding width is too large.', - input: {dataType: 'float32', dimensions: [1, 1, 2, 2]}, - filter: {dataType: 'float32', dimensions: [1, 1, 3, 3]}, + input: {dataType: 'float32', shape: [1, 1, 2, 2]}, + filter: {dataType: 'float32', shape: [1, 1, 3, 3]}, options: { padding: [0, 0, 4, 4], strides: [2, 2], @@ -526,8 +526,8 @@ const tests = [ { name: '[convTranspose2d] Throw due to outputSizes values are smaller than the output sizes calculated by not using outputPadding.', - input: {dataType: 'float32', dimensions: [1, 1, 3, 3]}, - filter: {dataType: 'float32', dimensions: [1, 1, 3, 3]}, + input: {dataType: 'float32', shape: [1, 1, 3, 3]}, + filter: {dataType: 'float32', shape: [1, 1, 3, 3]}, options: { padding: [1, 1, 1, 1], strides: [2, 2], @@ -539,8 +539,8 @@ const tests = [ { name: '[convTranspose2d] Throw due to outputSizes values are greater than the output sizes calculated by not using outputPadding.', - input: {dataType: 'float32', dimensions: [1, 1, 3, 3]}, - filter: {dataType: 'float32', dimensions: [1, 1, 3, 3]}, + input: {dataType: 'float32', shape: [1, 1, 3, 3]}, + filter: {dataType: 'float32', shape: [1, 1, 3, 3]}, options: { padding: [1, 1, 1, 1], strides: [2, 2], @@ -554,18 +554,11 @@ const tests = [ tests.forEach( test => promise_test(async t => { const builder = new MLGraphBuilder(context); - const input = builder.input( - 'input', - {dataType: test.input.dataType, dimensions: test.input.dimensions}); - const filter = builder.input( - 'filter', - {dataType: test.filter.dataType, dimensions: test.filter.dimensions}); + const input = builder.input('input', test.input); + const filter = builder.input('filter', test.filter); if (test.options && test.options.bias) { - test.options.bias = builder.input('bias', { - dataType: test.options.bias.dataType, - dimensions: test.options.bias.dimensions - }); + test.options.bias = builder.input('bias', test.options.bias); } if (test.output && @@ -573,7 +566,7 @@ tests.forEach( test.input.dataType)) { const output = builder.convTranspose2d(input, filter, test.options); assert_equals(output.dataType(), test.output.dataType); - assert_array_equals(output.shape(), test.output.dimensions); + assert_array_equals(output.shape(), test.output.shape); } else { const regrexp = new RegExp('\\[' + label + '\\]'); assert_throws_with_label( diff --git a/testing/web-platform/tests/webnn/validation_tests/cumulativeSum.https.any.js b/testing/web-platform/tests/webnn/validation_tests/cumulativeSum.https.any.js index 65eef7ed89d1..6381d674ab4e 100644 --- a/testing/web-platform/tests/webnn/validation_tests/cumulativeSum.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/cumulativeSum.https.any.js @@ -10,38 +10,38 @@ const tests = [ { name: '[cumulativeSum] Test with default options', - input: {dataType: 'float32', dimensions: [3, 2, 5]}, + input: {dataType: 'float32', shape: [3, 2, 5]}, axis: 0, - output: {dataType: 'float32', dimensions: [3, 2, 5]} + output: {dataType: 'float32', shape: [3, 2, 5]} }, { name: '[cumulativeSum] Test with axis=1', - input: {dataType: 'float32', dimensions: [3, 2, 5]}, + input: {dataType: 'float32', shape: [3, 2, 5]}, axis: 1, - output: {dataType: 'float32', dimensions: [3, 2, 5]} + output: {dataType: 'float32', shape: [3, 2, 5]} }, { name: '[cumulativeSum] Test with exclusive=true', - input: {dataType: 'float32', dimensions: [3, 2, 5]}, + input: {dataType: 'float32', shape: [3, 2, 5]}, axis: 1, options: {exclusive: true}, - output: {dataType: 'float32', dimensions: [3, 2, 5]} + output: {dataType: 'float32', shape: [3, 2, 5]} }, { name: '[cumulativeSum] Test with reversed=true', - input: {dataType: 'float32', dimensions: [3, 2, 5]}, + input: {dataType: 'float32', shape: [3, 2, 5]}, axis: 1, options: {reversed: true}, - output: {dataType: 'float32', dimensions: [3, 2, 5]} + output: {dataType: 'float32', shape: [3, 2, 5]} }, { name: '[cumulativeSum] Throw if input is a scalar', - input: {dataType: 'float32', dimensions: []}, + input: {dataType: 'float32', shape: []}, axis: 0 }, { name: '[cumulativeSum] Throw if axis is invalid', - input: {dataType: 'float32', dimensions: [1, 2, 3]}, + input: {dataType: 'float32', shape: [1, 2, 3]}, axis: 3 }, ] @@ -63,7 +63,7 @@ tests.forEach( if (test.output) { const output = builder.cumulativeSum(input, test.axis, options); assert_equals(output.dataType(), test.output.dataType); - assert_array_equals(output.shape(), test.output.dimensions); + assert_array_equals(output.shape(), test.output.shape); } else { const label = 'cumulative_sum'; options.label = label; @@ -75,7 +75,7 @@ tests.forEach( multi_builder_test(async (t, builder, otherBuilder) => { const inputFromOtherBuilder = - otherBuilder.input('input', {dataType: 'float32', dimensions: [3, 2, 5]}); + otherBuilder.input('input', {dataType: 'float32', shape: [3, 2, 5]}); assert_throws_js( TypeError, () => builder.cumulativeSum(inputFromOtherBuilder, 0)); }, '[cumulativeSum] throw if input is from another builder'); diff --git a/testing/web-platform/tests/webnn/validation_tests/dequantizeLinear.https.any.js b/testing/web-platform/tests/webnn/validation_tests/dequantizeLinear.https.any.js index 45a3187f65b3..a5e6c8ea50e1 100644 --- a/testing/web-platform/tests/webnn/validation_tests/dequantizeLinear.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/dequantizeLinear.https.any.js @@ -11,87 +11,80 @@ const tests = [ { name: '[dequantizeLinear] Test scale\'s shape = [3, 2, 5] and zeroPoint\'s shape = [3, 2, 5] which is the same as input\'s shape.', - input: {dataType: 'int8', dimensions: [3, 2, 5]}, - scale: {dataType: 'float32', dimensions: [3, 2, 5]}, - zeroPoint: {dataType: 'int8', dimensions: [3, 2, 5]}, - output: {dataType: 'float32', dimensions: [3, 2, 5]}, + input: {dataType: 'int8', shape: [3, 2, 5]}, + scale: {dataType: 'float32', shape: [3, 2, 5]}, + zeroPoint: {dataType: 'int8', shape: [3, 2, 5]}, + output: {dataType: 'float32', shape: [3, 2, 5]}, }, { name: '[dequantizeLinear] Test scale\'s shape = [5] and zeroPoint\'s shape = [5] which is unidirectionally broadcastable to input\'s shape.', - input: {dataType: 'int8', dimensions: [3, 2, 5]}, - scale: {dataType: 'float32', dimensions: [5]}, - zeroPoint: {dataType: 'int8', dimensions: [5]}, - output: {dataType: 'float32', dimensions: [3, 2, 5]}, + input: {dataType: 'int8', shape: [3, 2, 5]}, + scale: {dataType: 'float32', shape: [5]}, + zeroPoint: {dataType: 'int8', shape: [5]}, + output: {dataType: 'float32', shape: [3, 2, 5]}, }, { name: '[dequantizeLinear] Test scale\'s shape = [] and zeroPoint\'s shape = [] which is unidirectionally broadcastable to input\'s shape.', - input: {dataType: 'uint8', dimensions: [3, 2, 5]}, - scale: {dataType: 'float32', dimensions: []}, - zeroPoint: {dataType: 'uint8', dimensions: []}, - output: {dataType: 'float32', dimensions: [3, 2, 5]}, + input: {dataType: 'uint8', shape: [3, 2, 5]}, + scale: {dataType: 'float32', shape: []}, + zeroPoint: {dataType: 'uint8', shape: []}, + output: {dataType: 'float32', shape: [3, 2, 5]}, }, { name: '[dequantizeLinear] Throw if the shape of scale is not broadcastable to the shape of input.', - input: {dataType: 'uint8', dimensions: [3, 2, 5]}, - scale: {dataType: 'float32', dimensions: [2]}, - zeroPoint: {dataType: 'uint8', dimensions: [5]}, + input: {dataType: 'uint8', shape: [3, 2, 5]}, + scale: {dataType: 'float32', shape: [2]}, + zeroPoint: {dataType: 'uint8', shape: [5]}, }, { name: '[dequantizeLinear] Throw if the shape of zero_point is not broadcastable to the shape of input.', - input: {dataType: 'uint8', dimensions: [3, 2, 5]}, - scale: {dataType: 'float32', dimensions: [5]}, - zeroPoint: {dataType: 'uint8', dimensions: [2]}, + input: {dataType: 'uint8', shape: [3, 2, 5]}, + scale: {dataType: 'float32', shape: [5]}, + zeroPoint: {dataType: 'uint8', shape: [2]}, }, { name: '[dequantizeLinear] Throw if the data type of zeroPoint is not the same as the data type of input.', - input: {dataType: 'int8', dimensions: [3, 2, 5]}, - scale: {dataType: 'float32', dimensions: [5]}, - zeroPoint: {dataType: 'uint8', dimensions: [5]}, + input: {dataType: 'int8', shape: [3, 2, 5]}, + scale: {dataType: 'float32', shape: [5]}, + zeroPoint: {dataType: 'uint8', shape: [5]}, }, { name: '[dequantizeLinear] Throw if the data type of input is not int8 or uint8.', - input: {dataType: 'float16', dimensions: [3, 2, 5]}, - scale: {dataType: 'float32', dimensions: [5]}, - zeroPoint: {dataType: 'int8', dimensions: [5]}, + input: {dataType: 'float16', shape: [3, 2, 5]}, + scale: {dataType: 'float32', shape: [5]}, + zeroPoint: {dataType: 'int8', shape: [5]}, }, { name: '[dequantizeLinear] Throw if the data type of zero_point is not int8 or uint8.', - input: {dataType: 'int8', dimensions: [3, 2, 5]}, - scale: {dataType: 'float32', dimensions: [5]}, - zeroPoint: {dataType: 'int32', dimensions: [5]}, + input: {dataType: 'int8', shape: [3, 2, 5]}, + scale: {dataType: 'float32', shape: [5]}, + zeroPoint: {dataType: 'int32', shape: [5]}, }, { name: '[dequantizeLinear] Throw if the data type of scale is float32.', - input: {dataType: 'uint8', dimensions: [3, 2, 5]}, - scale: {dataType: 'int32', dimensions: [5]}, - zeroPoint: {dataType: 'uint8', dimensions: [5]}, + input: {dataType: 'uint8', shape: [3, 2, 5]}, + scale: {dataType: 'int32', shape: [5]}, + zeroPoint: {dataType: 'uint8', shape: [5]}, }, ]; tests.forEach( test => promise_test(async t => { const builder = new MLGraphBuilder(context); - const input = builder.input( - 'input', - {dataType: test.input.dataType, dimensions: test.input.dimensions}); - const scale = builder.input( - 'scale', - {dataType: test.scale.dataType, dimensions: test.scale.dimensions}); - const zeroPoint = builder.input('zeroPoint', { - dataType: test.zeroPoint.dataType, - dimensions: test.zeroPoint.dimensions - }); + const input = builder.input('input', test.input); + const scale = builder.input('scale', test.scale); + const zeroPoint = builder.input('zeroPoint', test.zeroPoint); if (test.output) { const output = builder.dequantizeLinear(input, scale, zeroPoint); assert_equals(output.dataType(), test.output.dataType); - assert_array_equals(output.shape(), test.output.dimensions); + assert_array_equals(output.shape(), test.output.shape); } else { const label = 'dequantize_linear_123'; const options = {label}; @@ -104,11 +97,11 @@ tests.forEach( const kExampleInputDescriptor = { dataType: 'int8', - dimensions: [2, 4] + shape: [2, 4] }; const kExampleScaleDescriptor = { dataType: 'float32', - dimensions: [2, 4] + shape: [2, 4] }; multi_builder_test(async (t, builder, otherBuilder) => { const inputFromOtherBuilder = diff --git a/testing/web-platform/tests/webnn/validation_tests/destroyContext.https.any.js b/testing/web-platform/tests/webnn/validation_tests/destroyContext.https.any.js index 4ec31033a6d3..b4027e23dba0 100644 --- a/testing/web-platform/tests/webnn/validation_tests/destroyContext.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/destroyContext.https.any.js @@ -34,7 +34,7 @@ promise_test(async t => { const builder = new MLGraphBuilder(context); context.destroy(); assert_throws_dom('InvalidStateError', () => { - const operandType = {dataType: 'float32', dimensions: [1]}; + const operandType = {dataType: 'float32', shape: [1]}; builder.input('input', operandType); }); }, 'Destroyed context can not build operator.'); @@ -50,7 +50,7 @@ promise_test(async t => { promise_test(async t => { const context = await navigator.ml.createContext(contextOptions); const builder = new MLGraphBuilder(context); - const operandType = {dataType: 'float32', dimensions: [1]}; + const operandType = {dataType: 'float32', shape: [1]}; const input_operand = builder.input('input', operandType); const const_operand = builder.constant(operandType, Float32Array.from([2])); const output_operand = builder.mul(input_operand, const_operand); @@ -63,7 +63,7 @@ promise_test(async t => { promise_test(async t => { const context = await navigator.ml.createContext(contextOptions); const builder = new MLGraphBuilder(context); - const operandType = {dataType: 'float32', dimensions: [1]}; + const operandType = {dataType: 'float32', shape: [1]}; const input_operand = builder.input('input', operandType); const const_operand = builder.constant(operandType, Float32Array.from([2])); const output_operand = builder.mul(input_operand, const_operand); @@ -79,7 +79,7 @@ promise_test(async t => { promise_test(async t => { const context = await navigator.ml.createContext(contextOptions); const builder = new MLGraphBuilder(context); - const operandType = {dataType: 'float32', dimensions: [1]}; + const operandType = {dataType: 'float32', shape: [1]}; const lhsOperand = builder.input('lhs', operandType); const rhsOperand = builder.input('rhs', operandType); const graph = @@ -103,7 +103,7 @@ promise_test(async t => { promise_test(async t => { const context = await navigator.ml.createContext(contextOptions); const builder = new MLGraphBuilder(context); - const operandType = {dataType: 'float32', dimensions: [1]}; + const operandType = {dataType: 'float32', shape: [1]}; const lhsOperand = builder.input('lhs', operandType); const rhsOperand = builder.input('rhs', operandType); const graph = @@ -127,14 +127,14 @@ promise_test(async t => { context.destroy(); promise_rejects_dom( t, 'InvalidStateError', - context.createTensor({dataType: 'float32', dimensions: [1]})); + context.createTensor({dataType: 'float32', shape: [1]})); }, 'Destroyed context can not create tensor.'); promise_test(async t => { const context = await navigator.ml.createContext(contextOptions); const tensor = await context.createTensor({ dataType: 'float32', - dimensions: [1], + shape: [1], usage: MLTensorUsage.READ, }); context.destroy(); @@ -145,7 +145,7 @@ promise_test(async t => { const context = await navigator.ml.createContext(contextOptions); const tensor = await context.createTensor({ dataType: 'float32', - dimensions: [1], + shape: [1], usage: MLTensorUsage.READ, }); let promise = context.readTensor(tensor); @@ -160,7 +160,7 @@ promise_test(async t => { another_context.destroy(); const tensor = await context.createTensor({ dataType: 'float32', - dimensions: [1], + shape: [1], usage: MLTensorUsage.WRITE, }); let arrayBuffer = new ArrayBuffer(4); diff --git a/testing/web-platform/tests/webnn/validation_tests/destroyGraph.https.any.js b/testing/web-platform/tests/webnn/validation_tests/destroyGraph.https.any.js index 9fd3a9e1ff7e..f7eb01eafef7 100644 --- a/testing/web-platform/tests/webnn/validation_tests/destroyGraph.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/destroyGraph.https.any.js @@ -22,7 +22,7 @@ promise_setup(async () => { promise_test(async t => { const builder = new MLGraphBuilder(context); - const operandType = {dataType: 'float32', dimensions: [1]}; + const operandType = {dataType: 'float32', shape: [1]}; const input_operand = builder.input('input', operandType); const const_operand = builder.constant(operandType, Float32Array.from([2])); const output_operand = builder.mul(input_operand, const_operand); @@ -34,7 +34,7 @@ promise_test(async t => { promise_test(async t => { const builder = new MLGraphBuilder(context); - const operandType = {dataType: 'float32', dimensions: [1]}; + const operandType = {dataType: 'float32', shape: [1]}; const input_operand = builder.input('input', operandType); const const_operand = builder.constant(operandType, Float32Array.from([2])); const output_operand = builder.mul(input_operand, const_operand); @@ -49,7 +49,7 @@ promise_test(async t => { promise_test(async t => { const builder = new MLGraphBuilder(context); - const operandType = {dataType: 'float32', dimensions: [1]}; + const operandType = {dataType: 'float32', shape: [1]}; const input_operand = builder.input('input', operandType); const const_operand = builder.constant(operandType, Float32Array.from([2])); const output_operand = builder.mul(input_operand, const_operand); @@ -63,7 +63,7 @@ promise_test(async t => { promise_test(async t => { const builder = new MLGraphBuilder(context); - const operandType = {dataType: 'float32', dimensions: [1]}; + const operandType = {dataType: 'float32', shape: [1]}; const input_operand = builder.input('input', operandType); const const_operand = builder.constant(operandType, Float32Array.from([2])); const output_operand = builder.mul(input_operand, const_operand); @@ -78,7 +78,7 @@ promise_test(async t => { promise_test(async t => { const builder = new MLGraphBuilder(context); - const operandType = {dataType: 'float32', dimensions: [1]}; + const operandType = {dataType: 'float32', shape: [1]}; const lhsOperand = builder.input('lhs', operandType); const rhsOperand = builder.input('rhs', operandType); const graph = @@ -101,7 +101,7 @@ promise_test(async t => { promise_test(async t => { const builder = new MLGraphBuilder(context); - const operandType = {dataType: 'float32', dimensions: [1]}; + const operandType = {dataType: 'float32', shape: [1]}; const lhsOperand = builder.input('lhs', operandType); const rhsOperand = builder.input('rhs', operandType); const graph = @@ -109,17 +109,17 @@ promise_test(async t => { const lhsTensor = await context.createTensor({ dataType: 'float32', - dimensions: [1], + shape: [1], usage: MLTensorUsage.WRITE, }); const rhsTensor = await context.createTensor({ dataType: 'float32', - dimensions: [1], + shape: [1], usage: MLTensorUsage.WRITE, }); const outputTensor = await context.createTensor({ dataType: 'float32', - dimensions: [1], + shape: [1], usage: MLTensorUsage.READ, }); // Initialize inputs diff --git a/testing/web-platform/tests/webnn/validation_tests/elementwise-binary.https.any.js b/testing/web-platform/tests/webnn/validation_tests/elementwise-binary.https.any.js index fc0616f569b3..e578a343468f 100644 --- a/testing/web-platform/tests/webnn/validation_tests/elementwise-binary.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/elementwise-binary.https.any.js @@ -24,33 +24,33 @@ const tests = [ name: '[binary] Test bidirectionally broadcastable dimensions.', // Both inputs have axes of length one which are expanded // during broadcasting. - a: {dataType: 'float32', dimensions: [8, 1, 6, 1]}, - b: {dataType: 'float32', dimensions: [7, 1, 5]}, - output: {dataType: 'float32', dimensions: [8, 7, 6, 5]} + a: {dataType: 'float32', shape: [8, 1, 6, 1]}, + b: {dataType: 'float32', shape: [7, 1, 5]}, + output: {dataType: 'float32', shape: [8, 7, 6, 5]} }, { name: '[binary] Test unidirectionally broadcastable dimensions.', // Input a has a single axis of length one which is // expanded during broadcasting. - a: {dataType: 'float32', dimensions: [4, 2, 1]}, - b: {dataType: 'float32', dimensions: [4]}, - output: {dataType: 'float32', dimensions: [4, 2, 4]} + a: {dataType: 'float32', shape: [4, 2, 1]}, + b: {dataType: 'float32', shape: [4]}, + output: {dataType: 'float32', shape: [4, 2, 4]} }, { name: '[binary] Test scalar broadcasting.', - a: {dataType: 'float32', dimensions: [4, 2, 4]}, - b: {dataType: 'float32', dimensions: []}, - output: {dataType: 'float32', dimensions: [4, 2, 4]} + a: {dataType: 'float32', shape: [4, 2, 4]}, + b: {dataType: 'float32', shape: []}, + output: {dataType: 'float32', shape: [4, 2, 4]} }, { name: '[binary] Throw if the input shapes are not broadcastable.', - a: {dataType: 'float32', dimensions: [4, 2]}, - b: {dataType: 'float32', dimensions: [4]}, + a: {dataType: 'float32', shape: [4, 2]}, + b: {dataType: 'float32', shape: [4]}, }, { name: '[binary] Throw if the input types don\'t match.', - a: {dataType: 'float32', dimensions: [4, 2]}, - b: {dataType: 'int32', dimensions: [1]}, + a: {dataType: 'float32', shape: [4, 2]}, + b: {dataType: 'int32', shape: [1]}, }, ]; @@ -60,31 +60,21 @@ function runElementWiseBinaryTests(operatorName, tests) { const builder = new MLGraphBuilder(context); if (!context.opSupportLimits().input.dataTypes.includes( test.a.dataType)) { - assert_throws_js( - TypeError, - () => builder.input( - 'a', - {dataType: test.a.dataType, dimensions: test.a.dimensions})); + assert_throws_js(TypeError, () => builder.input('a', test.a)); return; } if (!context.opSupportLimits().input.dataTypes.includes( test.b.dataType)) { - assert_throws_js( - TypeError, - () => builder.input( - 'b', - {dataType: test.b.dataType, dimensions: test.b.dimensions})); + assert_throws_js(TypeError, () => builder.input('b', test.b)); return; } - const a = builder.input( - 'a', {dataType: test.a.dataType, dimensions: test.a.dimensions}); - const b = builder.input( - 'b', {dataType: test.b.dataType, dimensions: test.b.dimensions}); + const a = builder.input('a', test.a); + const b = builder.input('b', test.b); if (test.output) { const output = builder[operatorName](a, b); assert_equals(output.dataType(), test.output.dataType); - assert_array_equals(output.shape(), test.output.dimensions); + assert_array_equals(output.shape(), test.output.shape); } else { const options = {label}; assert_throws_with_label( diff --git a/testing/web-platform/tests/webnn/validation_tests/elu.https.any.js b/testing/web-platform/tests/webnn/validation_tests/elu.https.any.js index 4236925aed18..4fe08b1b0cef 100644 --- a/testing/web-platform/tests/webnn/validation_tests/elu.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/elu.https.any.js @@ -17,8 +17,7 @@ validateSingleInputOperation('elu', label); promise_test(async t => { const builder = new MLGraphBuilder(context); const options = {alpha: 1.0}; - const input = - builder.input('input', {dataType: 'float32', dimensions: [1, 2, 3]}); + const input = builder.input('input', {dataType: 'float32', shape: [1, 2, 3]}); const output = builder.elu(input, options); assert_equals(output.dataType(), 'float32'); assert_array_equals(output.shape(), [1, 2, 3]); @@ -30,8 +29,7 @@ promise_test(async t => { alpha: -1.0, label: label, }; - const input = - builder.input('input', {dataType: 'float32', dimensions: [1, 2, 3]}); + const input = builder.input('input', {dataType: 'float32', shape: [1, 2, 3]}); assert_throws_with_label(() => builder.elu(input, options), regrexp); }, '[elu] Throw if options.alpha < 0'); @@ -41,20 +39,20 @@ promise_test(async t => { alpha: 0, label: label, }; - const input = builder.input('input', {dataType: 'float32', dimensions: [1]}); + const input = builder.input('input', {dataType: 'float32', shape: [1]}); assert_throws_with_label(() => builder.elu(input, options), regrexp); }, '[elu] Throw if options.alpha == 0'); promise_test(async t => { const builder = new MLGraphBuilder(context); const options = {alpha: NaN}; - const input = builder.input('input', {dataType: 'float16', dimensions: []}); + const input = builder.input('input', {dataType: 'float16', shape: []}); assert_throws_js(TypeError, () => builder.elu(input, options)); }, '[elu] Throw if options.alpha is NaN'); promise_test(async t => { const builder = new MLGraphBuilder(context); const options = {alpha: Infinity}; - const input = builder.input('input', {dataType: 'float32', dimensions: [1]}); + const input = builder.input('input', {dataType: 'float32', shape: [1]}); assert_throws_js(TypeError, () => builder.elu(input, options)); }, '[elu] Throw if options.alpha is Infinity'); diff --git a/testing/web-platform/tests/webnn/validation_tests/expand.https.any.js b/testing/web-platform/tests/webnn/validation_tests/expand.https.any.js index 4edc9a718a4f..23fe94aedc1e 100644 --- a/testing/web-platform/tests/webnn/validation_tests/expand.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/expand.https.any.js @@ -9,7 +9,7 @@ multi_builder_test(async (t, builder, otherBuilder) => { const inputFromOtherBuilder = - otherBuilder.input('input', {dataType: 'float32', dimensions: [2, 1, 2]}); + otherBuilder.input('input', {dataType: 'float32', shape: [2, 1, 2]}); const newShape = [2, 2, 2]; assert_throws_js( @@ -21,45 +21,45 @@ const label = 'xxx_expand'; const tests = [ { name: '[expand] Test with 0-D scalar to 3-D tensor.', - input: {dataType: 'float32', dimensions: []}, + input: {dataType: 'float32', shape: []}, newShape: [3, 4, 5], - output: {dataType: 'float32', dimensions: [3, 4, 5]} + output: {dataType: 'float32', shape: [3, 4, 5]} }, { name: '[expand] Test with the new shapes that are the same as input.', - input: {dataType: 'float32', dimensions: [4]}, + input: {dataType: 'float32', shape: [4]}, newShape: [4], - output: {dataType: 'float32', dimensions: [4]} + output: {dataType: 'float32', shape: [4]} }, { name: '[expand] Test with the new shapes that are broadcastable.', - input: {dataType: 'float32', dimensions: [3, 1, 5]}, + input: {dataType: 'float32', shape: [3, 1, 5]}, newShape: [3, 4, 5], - output: {dataType: 'float32', dimensions: [3, 4, 5]} + output: {dataType: 'float32', shape: [3, 4, 5]} }, { name: '[expand] Test with the new shapes that are broadcastable and the rank of new shapes is larger than input.', - input: {dataType: 'float32', dimensions: [2, 5]}, + input: {dataType: 'float32', shape: [2, 5]}, newShape: [3, 2, 5], - output: {dataType: 'float32', dimensions: [3, 2, 5]} + output: {dataType: 'float32', shape: [3, 2, 5]} }, { name: '[expand] Throw if the input shapes are the same rank but not broadcastable.', - input: {dataType: 'float32', dimensions: [3, 6, 2]}, + input: {dataType: 'float32', shape: [3, 6, 2]}, newShape: [4, 3, 5], options: {label} }, { name: '[expand] Throw if the input shapes are not broadcastable.', - input: {dataType: 'float32', dimensions: [5, 4]}, + input: {dataType: 'float32', shape: [5, 4]}, newShape: [5], options: {label} }, { name: '[expand] Throw if the number of new shapes is too large.', - input: {dataType: 'float32', dimensions: [1, 2, 1, 1]}, + input: {dataType: 'float32', shape: [1, 2, 1, 1]}, newShape: [1, 2, kMaxUnsignedLong, kMaxUnsignedLong], }, ]; @@ -67,14 +67,12 @@ const tests = [ tests.forEach( test => promise_test(async t => { const builder = new MLGraphBuilder(context); - const input = builder.input( - 'input', - {dataType: test.input.dataType, dimensions: test.input.dimensions}); + const input = builder.input('input', test.input); if (test.output) { const output = builder.expand(input, test.newShape); assert_equals(output.dataType(), test.output.dataType); - assert_array_equals(output.shape(), test.output.dimensions); + assert_array_equals(output.shape(), test.output.shape); } else { const options = {...test.options}; if (options.label) { @@ -94,9 +92,9 @@ promise_test(async t => { continue; } const builder = new MLGraphBuilder(context); - const dimensions = [1]; + const shape = [1]; const newShape = [1, 2, 3]; - const input = builder.input(`input`, {dataType, dimensions}); + const input = builder.input(`input`, {dataType, shape}); if (context.opSupportLimits().expand.input.dataTypes.includes(dataType)) { const output = builder.expand(input, newShape); assert_equals(output.dataType(), dataType); diff --git a/testing/web-platform/tests/webnn/validation_tests/gather.https.any.js b/testing/web-platform/tests/webnn/validation_tests/gather.https.any.js index ec728314a3c0..dbeacbfc2791 100644 --- a/testing/web-platform/tests/webnn/validation_tests/gather.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/gather.https.any.js @@ -10,66 +10,62 @@ const tests = [ { name: '[gather] Test gather with default options and 0-D indices', - input: {dataType: 'int32', dimensions: [3]}, - indices: {dataType: 'int64', dimensions: []}, - output: {dataType: 'int32', dimensions: []} + input: {dataType: 'int32', shape: [3]}, + indices: {dataType: 'int64', shape: []}, + output: {dataType: 'int32', shape: []} }, { name: '[gather] Test gather with axis = 2', - input: {dataType: 'float32', dimensions: [1, 2, 3, 4]}, - indices: {dataType: 'int64', dimensions: [5, 6]}, + input: {dataType: 'float32', shape: [1, 2, 3, 4]}, + indices: {dataType: 'int64', shape: [5, 6]}, axis: 2, - output: {dataType: 'float32', dimensions: [1, 2, 5, 6, 4]} + output: {dataType: 'float32', shape: [1, 2, 5, 6, 4]} }, { name: '[gather] Test gather with indices\'s dataType = uint32', - input: {dataType: 'float32', dimensions: [1, 2, 3, 4]}, - indices: {dataType: 'uint32', dimensions: [5, 6]}, + input: {dataType: 'float32', shape: [1, 2, 3, 4]}, + indices: {dataType: 'uint32', shape: [5, 6]}, axis: 2, - output: {dataType: 'float32', dimensions: [1, 2, 5, 6, 4]} + output: {dataType: 'float32', shape: [1, 2, 5, 6, 4]} }, { name: '[gather] Test gather with indices\'s dataType = int32', - input: {dataType: 'float32', dimensions: [1, 2, 3, 4]}, - indices: {dataType: 'int32', dimensions: [5, 6]}, + input: {dataType: 'float32', shape: [1, 2, 3, 4]}, + indices: {dataType: 'int32', shape: [5, 6]}, axis: 2, - output: {dataType: 'float32', dimensions: [1, 2, 5, 6, 4]} + output: {dataType: 'float32', shape: [1, 2, 5, 6, 4]} }, { name: '[gather] TypeError is expected if the input is a scalar', - input: {dataType: 'float16', dimensions: []}, - indices: {dataType: 'int64', dimensions: [1]}, + input: {dataType: 'float16', shape: []}, + indices: {dataType: 'int64', shape: [1]}, }, { name: '[gather] TypeError is expected if the axis is greater than the rank of input', - input: {dataType: 'float16', dimensions: [1, 2, 3]}, - indices: {dataType: 'int32', dimensions: [5, 6]}, + input: {dataType: 'float16', shape: [1, 2, 3]}, + indices: {dataType: 'int32', shape: [5, 6]}, axis: 4, }, { name: '[gather] TypeError is expected if the data type of indices is float32 which is invalid', - input: {dataType: 'float16', dimensions: [1, 2, 3, 4]}, - indices: {dataType: 'float32', dimensions: [5, 6]}, + input: {dataType: 'float16', shape: [1, 2, 3, 4]}, + indices: {dataType: 'float32', shape: [5, 6]}, }, { name: '[gather] TypeError is expected if the data type of indices is uint64 which is invalid', - input: {dataType: 'float16', dimensions: [1, 2, 3, 4]}, - indices: {dataType: 'uint64', dimensions: [5, 6]}, + input: {dataType: 'float16', shape: [1, 2, 3, 4]}, + indices: {dataType: 'uint64', shape: [5, 6]}, } ]; tests.forEach( test => promise_test(async t => { const builder = new MLGraphBuilder(context); - const input = builder.input( - 'input', - {dataType: test.input.dataType, dimensions: test.input.dimensions}); - const indices = builder.input( - 'indices', - {dataType: test.indices.dataType, dimensions: test.indices.dimensions}); + const input = builder.input('input', test.input); + const indices = builder.input('indices', test.indices); const options = {}; if (test.axis) { @@ -79,7 +75,7 @@ tests.forEach( if (test.output) { const output = builder.gather(input, indices, options); assert_equals(output.dataType(), test.output.dataType); - assert_array_equals(output.shape(), test.output.dimensions); + assert_array_equals(output.shape(), test.output.shape); } else { const label = 'gather_' options.label = label; @@ -91,20 +87,18 @@ tests.forEach( multi_builder_test(async (t, builder, otherBuilder) => { const inputFromOtherBuilder = - otherBuilder.input('input', {dataType: 'float32', dimensions: [2, 2]}); + otherBuilder.input('input', {dataType: 'float32', shape: [2, 2]}); - const indices = - builder.input('indices', {dataType: 'int64', dimensions: [2, 2]}); + const indices = builder.input('indices', {dataType: 'int64', shape: [2, 2]}); assert_throws_js( TypeError, () => builder.gather(inputFromOtherBuilder, indices)); }, '[gather] throw if input is from another builder'); multi_builder_test(async (t, builder, otherBuilder) => { const indicesFromOtherBuilder = - otherBuilder.input('indices', {dataType: 'int64', dimensions: [2, 2]}); + otherBuilder.input('indices', {dataType: 'int64', shape: [2, 2]}); - const input = - builder.input('input', {dataType: 'float32', dimensions: [2, 2]}); + const input = builder.input('input', {dataType: 'float32', shape: [2, 2]}); assert_throws_js( TypeError, () => builder.gather(input, indicesFromOtherBuilder)); }, '[gather] throw if indices is from another builder'); diff --git a/testing/web-platform/tests/webnn/validation_tests/gatherElements.https.any.js b/testing/web-platform/tests/webnn/validation_tests/gatherElements.https.any.js index ed8af8da3304..4c4b04490e8b 100644 --- a/testing/web-platform/tests/webnn/validation_tests/gatherElements.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/gatherElements.https.any.js @@ -10,43 +10,43 @@ const tests = [ { name: '[gatherElements] Test gatherElements with default options', - input: {dataType: 'float32', dimensions: [1, 2, 3]}, - indices: {dataType: 'int32', dimensions: [2, 2, 3]}, - output: {dataType: 'float32', dimensions: [2, 2, 3]} + input: {dataType: 'float32', shape: [1, 2, 3]}, + indices: {dataType: 'int32', shape: [2, 2, 3]}, + output: {dataType: 'float32', shape: [2, 2, 3]} }, { name: '[gatherElements] Test gatherElements with axis = 2', - input: {dataType: 'float32', dimensions: [1, 2, 3, 4]}, - indices: {dataType: 'int32', dimensions: [1, 2, 1, 4]}, + input: {dataType: 'float32', shape: [1, 2, 3, 4]}, + indices: {dataType: 'int32', shape: [1, 2, 1, 4]}, axis: 2, - output: {dataType: 'float32', dimensions: [1, 2, 1, 4]} + output: {dataType: 'float32', shape: [1, 2, 1, 4]} }, { name: '[gatherElements] Throw if input is a scalar', - input: {dataType: 'float32', dimensions: []}, - indices: {dataType: 'int32', dimensions: []} + input: {dataType: 'float32', shape: []}, + indices: {dataType: 'int32', shape: []} }, { name: '[gatherElements] Throw if the axis is greater than the rank of input', - input: {dataType: 'float32', dimensions: [1, 2, 3]}, - indices: {dataType: 'int32', dimensions: [1, 2, 3]}, + input: {dataType: 'float32', shape: [1, 2, 3]}, + indices: {dataType: 'int32', shape: [1, 2, 3]}, axis: 4 }, { name: '[gatherElements] Throw if indices data type is float32', - input: {dataType: 'float32', dimensions: [1, 2, 3]}, - indices: {dataType: 'float32', dimensions: [1, 2, 3]} + input: {dataType: 'float32', shape: [1, 2, 3]}, + indices: {dataType: 'float32', shape: [1, 2, 3]} }, { name: '[gatherElements] Throw if input rank is not equal to indices rank', - input: {dataType: 'float32', dimensions: [1, 2, 3]}, - indices: {dataType: 'int32', dimensions: [1, 2]} + input: {dataType: 'float32', shape: [1, 2, 3]}, + indices: {dataType: 'int32', shape: [1, 2]} }, { name: '[gatherElements] Throw if indices shape is incorrect', - input: {dataType: 'float32', dimensions: [1, 2, 3, 4]}, - indices: {dataType: 'int32', dimensions: [3, 2, 3, 4]}, + input: {dataType: 'float32', shape: [1, 2, 3, 4]}, + indices: {dataType: 'int32', shape: [3, 2, 3, 4]}, axis: 3 } ]; @@ -54,13 +54,8 @@ const tests = [ tests.forEach( test => promise_test(async t => { const builder = new MLGraphBuilder(context); - const input = builder.input( - 'input', - {dataType: test.input.dataType, dimensions: test.input.dimensions}); - const indices = builder.input('indices', { - dataType: test.indices.dataType, - dimensions: test.indices.dimensions - }); + const input = builder.input('input', test.input); + const indices = builder.input('indices', test.indices); const options = {}; if (test.axis) { @@ -70,7 +65,7 @@ tests.forEach( if (test.output) { const output = builder.gatherElements(input, indices, options); assert_equals(output.dataType(), test.output.dataType); - assert_array_equals(output.shape(), test.output.dimensions); + assert_array_equals(output.shape(), test.output.shape); } else { const label = 'gatherElements_' options.label = label; @@ -82,20 +77,18 @@ tests.forEach( multi_builder_test(async (t, builder, otherBuilder) => { const inputFromOtherBuilder = - otherBuilder.input('input', {dataType: 'float32', dimensions: [2, 2]}); + otherBuilder.input('input', {dataType: 'float32', shape: [2, 2]}); - const indices = - builder.input('indices', {dataType: 'int32', dimensions: [2, 2]}); + const indices = builder.input('indices', {dataType: 'int32', shape: [2, 2]}); assert_throws_js( TypeError, () => builder.gatherElements(inputFromOtherBuilder, indices)); }, '[gatherElements] Throw if input is from another builder'); multi_builder_test(async (t, builder, otherBuilder) => { const indicesFromOtherBuilder = - otherBuilder.input('indices', {dataType: 'int32', dimensions: [2, 2]}); + otherBuilder.input('indices', {dataType: 'int32', shape: [2, 2]}); - const input = - builder.input('input', {dataType: 'float32', dimensions: [2, 2]}); + const input = builder.input('input', {dataType: 'float32', shape: [2, 2]}); assert_throws_js( TypeError, () => builder.gatherElements(input, indicesFromOtherBuilder)); }, '[gatherElements] Throw if indices is from another builder'); diff --git a/testing/web-platform/tests/webnn/validation_tests/gemm.https.any.js b/testing/web-platform/tests/webnn/validation_tests/gemm.https.any.js index 30cddcf5ec5e..cad1806b5ff9 100644 --- a/testing/web-platform/tests/webnn/validation_tests/gemm.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/gemm.https.any.js @@ -9,7 +9,7 @@ const kExampleInputDescriptor = { dataType: 'float32', - dimensions: [2, 2] + shape: [2, 2] }; validateTwoInputsFromMultipleBuilders('gemm'); @@ -28,31 +28,31 @@ const label = 'gemm_xxx'; const tests = [ { name: '[gemm] Test building gemm with default option.', - a: {dataType: 'float32', dimensions: [2, 3]}, - b: {dataType: 'float32', dimensions: [3, 4]}, - output: {dataType: 'float32', dimensions: [2, 4]} + a: {dataType: 'float32', shape: [2, 3]}, + b: {dataType: 'float32', shape: [3, 4]}, + output: {dataType: 'float32', shape: [2, 4]} }, { name: '[gemm] Throw if inputShapeA[1] is not equal to inputShapeB[0] default options.', - a: {dataType: 'float32', dimensions: [2, 3]}, - b: {dataType: 'float32', dimensions: [2, 4]}, + a: {dataType: 'float32', shape: [2, 3]}, + b: {dataType: 'float32', shape: [2, 4]}, options: {label} }, { name: '[gemm] Test building gemm with aTranspose=true.', - a: {dataType: 'float32', dimensions: [2, 3]}, - b: {dataType: 'float32', dimensions: [2, 4]}, + a: {dataType: 'float32', shape: [2, 3]}, + b: {dataType: 'float32', shape: [2, 4]}, options: { aTranspose: true, }, - output: {dataType: 'float32', dimensions: [3, 4]} + output: {dataType: 'float32', shape: [3, 4]} }, { name: '[gemm] Throw if inputShapeA[0] is not equal to inputShapeB[0] with aTranspose=true.', - a: {dataType: 'float32', dimensions: [2, 3]}, - b: {dataType: 'float32', dimensions: [3, 4]}, + a: {dataType: 'float32', shape: [2, 3]}, + b: {dataType: 'float32', shape: [3, 4]}, options: { aTranspose: true, label: label, @@ -60,18 +60,18 @@ const tests = [ }, { name: '[gemm] Test building gemm with bTranspose=true.', - a: {dataType: 'float32', dimensions: [2, 3]}, - b: {dataType: 'float32', dimensions: [4, 3]}, + a: {dataType: 'float32', shape: [2, 3]}, + b: {dataType: 'float32', shape: [4, 3]}, options: { bTranspose: true, }, - output: {dataType: 'float32', dimensions: [2, 4]} + output: {dataType: 'float32', shape: [2, 4]} }, { name: '[gemm] Throw if inputShapeA[0] is not equal to inputShapeB[0] with bTranspose=true.', - a: {dataType: 'float32', dimensions: [2, 3]}, - b: {dataType: 'float32', dimensions: [3, 4]}, + a: {dataType: 'float32', shape: [2, 3]}, + b: {dataType: 'float32', shape: [3, 4]}, options: { bTranspose: true, label: label, @@ -79,63 +79,63 @@ const tests = [ }, { name: '[gemm] Throw if the rank of inputA is not 2.', - a: {dataType: 'float32', dimensions: [2, 3, 1]}, - b: {dataType: 'float32', dimensions: [2, 4]}, + a: {dataType: 'float32', shape: [2, 3, 1]}, + b: {dataType: 'float32', shape: [2, 4]}, options: {label} }, { name: '[gemm] Throw if the rank of inputB is not 2.', - a: {dataType: 'float32', dimensions: [2, 4]}, - b: {dataType: 'float32', dimensions: [2, 3, 1]}, + a: {dataType: 'float32', shape: [2, 4]}, + b: {dataType: 'float32', shape: [2, 3, 1]}, options: {label} }, { name: '[gemm] Throw if data types of two inputs do not match.', - a: {dataType: 'float32', dimensions: [2, 3]}, - b: {dataType: 'float16', dimensions: [3, 4]}, + a: {dataType: 'float32', shape: [2, 3]}, + b: {dataType: 'float16', shape: [3, 4]}, options: {label} }, { name: '[gemm] Test building gemm with inputC.', - a: {dataType: 'float32', dimensions: [2, 3]}, - b: {dataType: 'float32', dimensions: [3, 4]}, + a: {dataType: 'float32', shape: [2, 3]}, + b: {dataType: 'float32', shape: [3, 4]}, options: { - c: {dataType: 'float32', dimensions: [4]}, + c: {dataType: 'float32', shape: [4]}, }, - output: {dataType: 'float32', dimensions: [2, 4]} + output: {dataType: 'float32', shape: [2, 4]} }, { name: '[gemm] Test building gemm with scalar inputC.', - a: {dataType: 'float32', dimensions: [2, 3]}, - b: {dataType: 'float32', dimensions: [3, 4]}, + a: {dataType: 'float32', shape: [2, 3]}, + b: {dataType: 'float32', shape: [3, 4]}, options: { - c: {dataType: 'float32', dimensions: []}, + c: {dataType: 'float32', shape: []}, }, - output: {dataType: 'float32', dimensions: [2, 4]} + output: {dataType: 'float32', shape: [2, 4]} }, { name: '[gemm] Throw if inputShapeC is not unidirectionally broadcastable to the output shape [inputShapeA[0], inputShapeB[1]].', - a: {dataType: 'float32', dimensions: [2, 3]}, - b: {dataType: 'float32', dimensions: [3, 4]}, + a: {dataType: 'float32', shape: [2, 3]}, + b: {dataType: 'float32', shape: [3, 4]}, options: { - c: {dataType: 'float32', dimensions: [2, 3]}, + c: {dataType: 'float32', shape: [2, 3]}, label: label, }, }, { name: '[gemm] Throw if the input data type is not floating point.', - a: {dataType: 'int32', dimensions: [2, 3]}, - b: {dataType: 'int32', dimensions: [3, 4]}, + a: {dataType: 'int32', shape: [2, 3]}, + b: {dataType: 'int32', shape: [3, 4]}, options: {label} }, { name: '[gemm] Throw if data type of inputC does not match ones of inputA and inputB.', - a: {dataType: 'float32', dimensions: [3, 2]}, - b: {dataType: 'float32', dimensions: [4, 3]}, + a: {dataType: 'float32', shape: [3, 2]}, + b: {dataType: 'float32', shape: [4, 3]}, options: { - c: {dataType: 'float16', dimensions: [2, 4]}, + c: {dataType: 'float16', shape: [2, 4]}, aTranspose: true, bTranspose: true, label: label, @@ -143,10 +143,10 @@ const tests = [ }, { name: '[gemm] Throw if the rank of inputC is 3.', - a: {dataType: 'float32', dimensions: [3, 2]}, - b: {dataType: 'float32', dimensions: [4, 3]}, + a: {dataType: 'float32', shape: [3, 2]}, + b: {dataType: 'float32', shape: [4, 3]}, options: { - c: {dataType: 'float32', dimensions: [2, 3, 4]}, + c: {dataType: 'float32', shape: [2, 3, 4]}, aTranspose: true, bTranspose: true, label: label, @@ -157,20 +157,15 @@ const tests = [ tests.forEach( test => promise_test(async t => { const builder = new MLGraphBuilder(context); - const a = builder.input( - 'a', {dataType: test.a.dataType, dimensions: test.a.dimensions}); - const b = builder.input( - 'b', {dataType: test.b.dataType, dimensions: test.b.dimensions}); + const a = builder.input('a', test.a); + const b = builder.input('b', test.b); if (test.options && test.options.c) { - test.options.c = builder.input('c', { - dataType: test.options.c.dataType, - dimensions: test.options.c.dimensions - }); + test.options.c = builder.input('c', test.options.c); } if (test.output) { const output = builder.gemm(a, b, test.options); assert_equals(output.dataType(), test.output.dataType); - assert_array_equals(output.shape(), test.output.dimensions); + assert_array_equals(output.shape(), test.output.shape); } else { const regrexp = new RegExp('\\[' + label + '\\]'); assert_throws_with_label( diff --git a/testing/web-platform/tests/webnn/validation_tests/gru.https.any.js b/testing/web-platform/tests/webnn/validation_tests/gru.https.any.js index 2b168979d075..158384a4b787 100644 --- a/testing/web-platform/tests/webnn/validation_tests/gru.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/gru.https.any.js @@ -11,40 +11,38 @@ const steps = 2, batchSize = 3, inputSize = 4, hiddenSize = 5, oneDirection = 1, bothDirections = 2; // Dimensions required of required inputs. -const kValidInputDimensions = [steps, batchSize, inputSize]; -const kValidWeightDimensions = [oneDirection, 3 * hiddenSize, inputSize]; -const kValidRecurrentWeightDimensions = - [oneDirection, 3 * hiddenSize, hiddenSize]; +const kValidInputShape = [steps, batchSize, inputSize]; +const kValidWeightShape = [oneDirection, 3 * hiddenSize, inputSize]; +const kValidRecurrentWeightShape = [oneDirection, 3 * hiddenSize, hiddenSize]; // Dimensions required of optional inputs. -const kValidBiasDimensions = [oneDirection, 3 * hiddenSize]; -const kValidRecurrentBiasDimensions = [oneDirection, 3 * hiddenSize]; -const kValidInitialHiddenStateDimensions = - [oneDirection, batchSize, hiddenSize]; +const kValidBiasShape = [oneDirection, 3 * hiddenSize]; +const kValidRecurrentBiasShape = [oneDirection, 3 * hiddenSize]; +const kValidInitialHiddenStateShape = [oneDirection, batchSize, hiddenSize]; // Example descriptors which are valid according to the above dimensions. const kExampleInputDescriptor = { dataType: 'float32', - dimensions: kValidInputDimensions + shape: kValidInputShape }; const kExampleWeightDescriptor = { dataType: 'float32', - dimensions: kValidWeightDimensions + shape: kValidWeightShape }; const kExampleRecurrentWeightDescriptor = { dataType: 'float32', - dimensions: kValidRecurrentWeightDimensions + shape: kValidRecurrentWeightShape }; const kExampleBiasDescriptor = { dataType: 'float32', - dimensions: kValidBiasDimensions + shape: kValidBiasShape }; const kExampleRecurrentBiasDescriptor = { dataType: 'float32', - dimensions: kValidRecurrentBiasDimensions + shape: kValidRecurrentBiasShape }; const kExampleInitialHiddenStateDescriptor = { dataType: 'float32', - dimensions: kValidInitialHiddenStateDimensions + shape: kValidInitialHiddenStateShape }; const tests = [ @@ -55,31 +53,28 @@ const tests = [ recurrentWeight: kExampleRecurrentWeightDescriptor, steps: steps, hiddenSize: hiddenSize, - outputs: [ - {dataType: 'float32', dimensions: [oneDirection, batchSize, hiddenSize]} - ] + outputs: + [{dataType: 'float32', shape: [oneDirection, batchSize, hiddenSize]}] }, { name: '[gru] Test with given options', input: kExampleInputDescriptor, weight: { dataType: 'float32', - dimensions: [bothDirections, 3 * hiddenSize, inputSize] + shape: [bothDirections, 3 * hiddenSize, inputSize] }, recurrentWeight: { dataType: 'float32', - dimensions: [bothDirections, 3 * hiddenSize, hiddenSize] + shape: [bothDirections, 3 * hiddenSize, hiddenSize] }, steps: steps, hiddenSize: hiddenSize, options: { - bias: {dataType: 'float32', dimensions: [bothDirections, 3 * hiddenSize]}, + bias: {dataType: 'float32', shape: [bothDirections, 3 * hiddenSize]}, recurrentBias: - {dataType: 'float32', dimensions: [bothDirections, 3 * hiddenSize]}, - initialHiddenState: { - dataType: 'float32', - dimensions: [bothDirections, batchSize, hiddenSize] - }, + {dataType: 'float32', shape: [bothDirections, 3 * hiddenSize]}, + initialHiddenState: + {dataType: 'float32', shape: [bothDirections, batchSize, hiddenSize]}, restAfter: true, returnSequence: true, direction: 'both', @@ -87,26 +82,20 @@ const tests = [ activations: ['sigmoid', 'relu'] }, outputs: [ - { - dataType: 'float32', - dimensions: [bothDirections, batchSize, hiddenSize] - }, - { + {dataType: 'float32', shape: [bothDirections, batchSize, hiddenSize]}, { dataType: 'float32', - dimensions: [steps, bothDirections, batchSize, hiddenSize] + shape: [steps, bothDirections, batchSize, hiddenSize] } ] }, { name: '[gru] TypeError is expected if steps equals to zero', input: kExampleInputDescriptor, - weight: { - dataType: 'float32', - dimensions: [oneDirection, 4 * hiddenSize, inputSize] - }, + weight: + {dataType: 'float32', shape: [oneDirection, 4 * hiddenSize, inputSize]}, recurrentWeight: { dataType: 'float32', - dimensions: [oneDirection, 4 * hiddenSize, hiddenSize] + shape: [oneDirection, 4 * hiddenSize, hiddenSize] }, steps: 0, hiddenSize: hiddenSize, @@ -130,25 +119,23 @@ const tests = [ { name: '[gru] TypeError is expected if the data type of the inputs is not one of the floating point types', - input: {dataType: 'uint32', dimensions: kValidInputDimensions}, - weight: {dataType: 'uint32', dimensions: kValidWeightDimensions}, - recurrentWeight: - {dataType: 'uint32', dimensions: kValidRecurrentWeightDimensions}, + input: {dataType: 'uint32', shape: kValidInputShape}, + weight: {dataType: 'uint32', shape: kValidWeightShape}, + recurrentWeight: {dataType: 'uint32', shape: kValidRecurrentWeightShape}, steps: steps, hiddenSize: hiddenSize }, { name: '[gru] TypeError is expected if the rank of input is not 3', - input: {dataType: 'float32', dimensions: [steps, batchSize]}, + input: {dataType: 'float32', shape: [steps, batchSize]}, weight: kExampleWeightDescriptor, recurrentWeight: kExampleRecurrentWeightDescriptor, steps: steps, hiddenSize: hiddenSize }, { - name: - '[gru] TypeError is expected if input.dimensions[0] is not equal to steps', - input: {dataType: 'float32', dimensions: [1000, batchSize, inputSize]}, + name: '[gru] TypeError is expected if input.shape[0] is not equal to steps', + input: {dataType: 'float32', shape: [1000, batchSize, inputSize]}, weight: kExampleWeightDescriptor, recurrentWeight: kExampleRecurrentWeightDescriptor, steps: steps, @@ -156,12 +143,10 @@ const tests = [ }, { name: - '[gru] TypeError is expected if weight.dimensions[1] is not 3 * hiddenSize', + '[gru] TypeError is expected if weight.shape[1] is not 3 * hiddenSize', input: kExampleInputDescriptor, - weight: { - dataType: 'float32', - dimensions: [oneDirection, 4 * hiddenSize, inputSize] - }, + weight: + {dataType: 'float32', shape: [oneDirection, 4 * hiddenSize, inputSize]}, recurrentWeight: kExampleRecurrentWeightDescriptor, steps: steps, hiddenSize: hiddenSize @@ -171,19 +156,16 @@ const tests = [ input: kExampleInputDescriptor, weight: kExampleWeightDescriptor, recurrentWeight: - {dataType: 'float32', dimensions: [oneDirection, 3 * hiddenSize]}, + {dataType: 'float32', shape: [oneDirection, 3 * hiddenSize]}, steps: steps, hiddenSize: hiddenSize }, { - name: - '[gru] TypeError is expected if the recurrentWeight.dimensions is invalid', + name: '[gru] TypeError is expected if the recurrentWeight.shape is invalid', input: kExampleInputDescriptor, weight: kExampleWeightDescriptor, - recurrentWeight: { - dataType: 'float32', - dimensions: [oneDirection, 4 * hiddenSize, inputSize] - }, + recurrentWeight: + {dataType: 'float32', shape: [oneDirection, 4 * hiddenSize, inputSize]}, steps: steps, hiddenSize: hiddenSize }, @@ -204,77 +186,70 @@ const tests = [ recurrentWeight: kExampleRecurrentWeightDescriptor, steps: steps, hiddenSize: hiddenSize, - options: {bias: {dataType: 'float32', dimensions: [oneDirection]}} + options: {bias: {dataType: 'float32', shape: [oneDirection]}} }, { name: - '[gru] TypeError is expected if options.bias.dimensions[1] is not 3 * hiddenSize', + '[gru] TypeError is expected if options.bias.shape[1] is not 3 * hiddenSize', input: kExampleInputDescriptor, weight: kExampleWeightDescriptor, recurrentWeight: kExampleRecurrentWeightDescriptor, steps: steps, hiddenSize: hiddenSize, - options: - {bias: {dataType: 'float32', dimensions: [oneDirection, hiddenSize]}} + options: {bias: {dataType: 'float32', shape: [oneDirection, hiddenSize]}} }, { name: - '[gru] TypeError is expected if options.recurrentBias.dimensions[1] is not 3 * hiddenSize', - input: {dataType: 'float16', dimensions: kValidInputDimensions}, - weight: {dataType: 'float16', dimensions: kValidWeightDimensions}, - recurrentWeight: - {dataType: 'float16', dimensions: kValidRecurrentWeightDimensions}, + '[gru] TypeError is expected if options.recurrentBias.shape[1] is not 3 * hiddenSize', + input: {dataType: 'float16', shape: kValidInputShape}, + weight: {dataType: 'float16', shape: kValidWeightShape}, + recurrentWeight: {dataType: 'float16', shape: kValidRecurrentWeightShape}, steps: steps, hiddenSize: hiddenSize, options: { recurrentBias: - {dataType: 'float16', dimensions: [oneDirection, 4 * hiddenSize]} + {dataType: 'float16', shape: [oneDirection, 4 * hiddenSize]} } }, { name: '[gru] TypeError is expected if the rank of options.initialHiddenState is not 3', - input: {dataType: 'float16', dimensions: kValidInputDimensions}, - weight: {dataType: 'float16', dimensions: kValidWeightDimensions}, - recurrentWeight: - {dataType: 'float16', dimensions: kValidRecurrentWeightDimensions}, + input: {dataType: 'float16', shape: kValidInputShape}, + weight: {dataType: 'float16', shape: kValidWeightShape}, + recurrentWeight: {dataType: 'float16', shape: kValidRecurrentWeightShape}, steps: steps, hiddenSize: hiddenSize, options: { initialHiddenState: - {dataType: 'float16', dimensions: [oneDirection, batchSize]} + {dataType: 'float16', shape: [oneDirection, batchSize]} } }, { name: - '[gru] TypeError is expected if options.initialHiddenState.dimensions[2] is not inputSize', - input: {dataType: 'float16', dimensions: kValidInputDimensions}, - weight: {dataType: 'float16', dimensions: kValidWeightDimensions}, - recurrentWeight: - {dataType: 'float16', dimensions: kValidRecurrentWeightDimensions}, + '[gru] TypeError is expected if options.initialHiddenState.shape[2] is not inputSize', + input: {dataType: 'float16', shape: kValidInputShape}, + weight: {dataType: 'float16', shape: kValidWeightShape}, + recurrentWeight: {dataType: 'float16', shape: kValidRecurrentWeightShape}, steps: steps, hiddenSize: hiddenSize, options: { initialHiddenState: { dataType: 'float16', - dimensions: [oneDirection, batchSize, 3 * hiddenSize] + shape: [oneDirection, batchSize, 3 * hiddenSize] } } }, { name: '[gru] TypeError is expected if the dataType of options.initialHiddenState is incorrect', - input: {dataType: 'float16', dimensions: kValidInputDimensions}, - weight: {dataType: 'float16', dimensions: kValidWeightDimensions}, - recurrentWeight: - {dataType: 'float16', dimensions: kValidRecurrentWeightDimensions}, + input: {dataType: 'float16', shape: kValidInputShape}, + weight: {dataType: 'float16', shape: kValidWeightShape}, + recurrentWeight: {dataType: 'float16', shape: kValidRecurrentWeightShape}, steps: steps, hiddenSize: hiddenSize, options: { - initialHiddenState: { - dataType: 'uint64', - dimensions: [oneDirection, batchSize, hiddenSize] - } + initialHiddenState: + {dataType: 'uint64', shape: [oneDirection, batchSize, hiddenSize]} } } ]; @@ -282,36 +257,23 @@ const tests = [ tests.forEach( test => promise_test(async t => { const builder = new MLGraphBuilder(context); - const input = builder.input( - 'input', - {dataType: test.input.dataType, dimensions: test.input.dimensions}); - const weight = builder.input( - 'weight', - {dataType: test.weight.dataType, dimensions: test.weight.dimensions}); - const recurrentWeight = builder.input('recurrentWeight', { - dataType: test.recurrentWeight.dataType, - dimensions: test.recurrentWeight.dimensions - }); + const input = builder.input('input', test.input); + const weight = builder.input('weight', test.weight); + const recurrentWeight = + builder.input('recurrentWeight', test.recurrentWeight); const options = {}; if (test.options) { if (test.options.bias) { - options.bias = builder.input('bias', { - dataType: test.options.bias.dataType, - dimensions: test.options.bias.dimensions - }); + options.bias = builder.input('bias', test.options.bias); } if (test.options.recurrentBias) { - options.recurrentBias = builder.input('recurrentBias', { - dataType: test.options.recurrentBias.dataType, - dimensions: test.options.recurrentBias.dimensions - }); + options.recurrentBias = + builder.input('recurrentBias', test.options.recurrentBias); } if (test.options.initialHiddenState) { - options.initialHiddenState = builder.input('initialHiddenState', { - dataType: test.options.initialHiddenState.dataType, - dimensions: test.options.initialHiddenState.dimensions - }); + options.initialHiddenState = builder.input( + 'initialHiddenState', test.options.initialHiddenState); } if (test.options.resetAfter) { options.resetAfter = test.options.resetAfter; @@ -339,7 +301,7 @@ tests.forEach( assert_equals(outputs.length, test.outputs.length); for (let i = 0; i < outputs.length; ++i) { assert_equals(outputs[i].dataType(), test.outputs[i].dataType); - assert_array_equals(outputs[i].shape(), test.outputs[i].dimensions); + assert_array_equals(outputs[i].shape(), test.outputs[i].shape); } } else { const label = 'gru_xxx'; diff --git a/testing/web-platform/tests/webnn/validation_tests/gruCell.https.any.js b/testing/web-platform/tests/webnn/validation_tests/gruCell.https.any.js index 9c0c6d17cc49..7bbb9afcff0e 100644 --- a/testing/web-platform/tests/webnn/validation_tests/gruCell.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/gruCell.https.any.js @@ -10,331 +10,276 @@ const batchSize = 3, inputSize = 4, hiddenSize = 5; // Dimensions required of required inputs. -const kValidInputDimensions = [batchSize, inputSize]; -const kValidWeightDimensions = [3 * hiddenSize, inputSize]; -const kValidRecurrentWeightDimensions = [3 * hiddenSize, hiddenSize]; -const kValidHiddenStateDimensions = [batchSize, hiddenSize]; +const kValidInputShape = [batchSize, inputSize]; +const kValidWeightShape = [3 * hiddenSize, inputSize]; +const kValidRecurrentWeightShape = [3 * hiddenSize, hiddenSize]; +const kValidHiddenStateShape = [batchSize, hiddenSize]; // Dimensions required of optional inputs. -const kValidBiasDimensions = [3 * hiddenSize]; -const kValidRecurrentBiasDimensions = [3 * hiddenSize]; +const kValidBiasShape = [3 * hiddenSize]; +const kValidRecurrentBiasShape = [3 * hiddenSize]; // Dimensions required of required output. -const kValidOutputDimensions = [batchSize, hiddenSize]; +const kValidOutputShape = [batchSize, hiddenSize]; // Example descriptors which are valid according to the above dimensions. const kExampleInputDescriptor = { dataType: 'float32', - dimensions: kValidInputDimensions + shape: kValidInputShape }; const kExampleWeightDescriptor = { dataType: 'float32', - dimensions: kValidWeightDimensions + shape: kValidWeightShape }; const kExampleRecurrentWeightDescriptor = { dataType: 'float32', - dimensions: kValidRecurrentWeightDimensions + shape: kValidRecurrentWeightShape }; const kExampleHiddenStateDescriptor = { dataType: 'float32', - dimensions: kValidHiddenStateDimensions + shape: kValidHiddenStateShape }; const kExampleBiasDescriptor = { dataType: 'float32', - dimensions: kValidBiasDimensions + shape: kValidBiasShape }; const kExampleRecurrentBiasDescriptor = { dataType: 'float32', - dimensions: kValidRecurrentBiasDimensions + shape: kValidRecurrentBiasShape }; const kExampleOutputDescriptor = { - dataType: 'float32', - dimensions: kValidOutputDimensions - }; + dataType: 'float32', + shape: kValidOutputShape +}; const tests = [ - { - name: '[gruCell] Test with default options', - input: kExampleInputDescriptor, - weight: kExampleWeightDescriptor, - recurrentWeight: kExampleRecurrentWeightDescriptor, - hiddenState: kExampleHiddenStateDescriptor, - hiddenSize: hiddenSize, - output: kExampleOutputDescriptor - }, - { - name: '[gruCell] Test with given options', - input: kExampleInputDescriptor, - weight: kExampleWeightDescriptor, - recurrentWeight: kExampleRecurrentWeightDescriptor, - hiddenState: kExampleHiddenStateDescriptor, - hiddenSize: hiddenSize, - options: { - bias: kExampleBiasDescriptor, - recurrentBias: kExampleRecurrentBiasDescriptor, - restAfter: true, - layout: 'rzn', - activations: ['sigmoid', 'relu'] - }, - output: kExampleOutputDescriptor - }, - { - name: '[gruCell] Throw if hiddenSize equals to zero', - input: kExampleInputDescriptor, - weight: kExampleWeightDescriptor, - recurrentWeight: kExampleRecurrentWeightDescriptor, - hiddenState: kExampleHiddenStateDescriptor, - hiddenSize: 0 - }, - { - name: '[gruCell] Throw if hiddenSize is too large', - input: kExampleInputDescriptor, - weight: kExampleWeightDescriptor, - recurrentWeight: kExampleRecurrentWeightDescriptor, - hiddenState: kExampleHiddenStateDescriptor, - hiddenSize: 4294967295, - }, - { - name: - '[gruCell] Throw if the data type of the inputs is not one of the floating point types', - input: { dataType: 'uint32', dimensions: kValidInputDimensions }, - weight: { dataType: 'uint32', dimensions: kValidWeightDimensions }, - recurrentWeight: { - dataType: 'uint32', - dimensions: kValidRecurrentWeightDimensions - }, - hiddenState: { - dataType: 'uint32', - dimensions: kValidHiddenStateDimensions - }, - hiddenSize: hiddenSize - }, - { - name: - '[gruCell] Throw if the rank of input is not 2', - input: { dataType: 'float32', dimensions: [batchSize] }, - weight: kExampleWeightDescriptor, - recurrentWeight: kExampleRecurrentWeightDescriptor, - hiddenState: kExampleHiddenStateDescriptor, - hiddenSize: hiddenSize - }, - { - name: - '[gruCell] Throw if the input.dimensions[1] is incorrect', - input: { dataType: 'float32', dimensions: [inputSize, inputSize] }, - weight: kExampleWeightDescriptor, - recurrentWeight: kExampleRecurrentWeightDescriptor, - hiddenState: kExampleHiddenStateDescriptor, - hiddenSize: hiddenSize - }, - { - name: '[gruCell] Throw if data type of weight is not one of the floating point types', - input: kExampleInputDescriptor, - weight: { - dataType: 'int8', - dimensions: [3 * hiddenSize, inputSize] - }, - recurrentWeight: kExampleRecurrentWeightDescriptor, - hiddenState: kExampleHiddenStateDescriptor, - hiddenSize: hiddenSize - }, - { - name: '[gruCell] Throw if rank of weight is not 2', - input: kExampleInputDescriptor, - weight: { - dataType: 'float32', - dimensions: [3 * hiddenSize] - }, - recurrentWeight: kExampleRecurrentWeightDescriptor, - hiddenState: kExampleHiddenStateDescriptor, - hiddenSize: hiddenSize - }, - { - name: '[gruCell] Throw if weight.dimensions[0] is not 3 * hiddenSize', - input: kExampleInputDescriptor, - weight: { - dataType: 'float32', - dimensions: [4 * hiddenSize, inputSize] - }, - recurrentWeight: kExampleRecurrentWeightDescriptor, - hiddenState: kExampleHiddenStateDescriptor, - hiddenSize: hiddenSize - }, - { - name: '[gruCell] Throw if data type of recurrentWeight is not one of the floating point types', - input: kExampleInputDescriptor, - weight: kExampleWeightDescriptor, - recurrentWeight: { - dataType: 'int32', - dimensions: [3 * hiddenSize, hiddenSize] - }, - hiddenState: kExampleHiddenStateDescriptor, - hiddenSize: hiddenSize - }, - { - name: - '[gruCell] Throw if the rank of recurrentWeight is not 2', - input: kExampleInputDescriptor, - weight: kExampleWeightDescriptor, - recurrentWeight: - { dataType: 'float32', dimensions: [3 * hiddenSize] }, - hiddenState: kExampleHiddenStateDescriptor, - hiddenSize: hiddenSize - }, - { - name: - '[gruCell] Throw if the recurrentWeight.dimensions is invalid', - input: kExampleInputDescriptor, - weight: kExampleWeightDescriptor, - recurrentWeight: - { dataType: 'float32', dimensions: [4 * hiddenSize, inputSize] }, - hiddenState: kExampleHiddenStateDescriptor, - hiddenSize: hiddenSize - }, - { - name: - '[gruCell] Throw if data type of hiddenState is not one of the floating point types', - input: kExampleInputDescriptor, - weight: kExampleWeightDescriptor, - recurrentWeight: - kExampleRecurrentWeightDescriptor, - hiddenState: { - dataType: 'uint32', - dimensions: [batchSize, hiddenSize] - }, - hiddenSize: hiddenSize - }, - { - name: - '[gruCell] Throw if the rank of hiddenState is not 2', - input: kExampleInputDescriptor, - weight: kExampleWeightDescriptor, - recurrentWeight: - kExampleRecurrentWeightDescriptor, - hiddenState: { - dataType: 'float32', - dimensions: [hiddenSize] - }, - hiddenSize: hiddenSize - }, - { - name: - '[gruCell] Throw if the hiddenState.dimensions is invalid', - input: kExampleInputDescriptor, - weight: kExampleWeightDescriptor, - recurrentWeight: kExampleRecurrentWeightDescriptor, - hiddenState: { - dataType: 'float32', - dimensions: [batchSize, 3 * hiddenSize] - }, - hiddenSize: hiddenSize - }, - { - name: - '[gruCell] Throw if the size of options.activations is not 2', - input: kExampleInputDescriptor, - weight: kExampleWeightDescriptor, - recurrentWeight: kExampleRecurrentWeightDescriptor, - hiddenState: kExampleHiddenStateDescriptor, - hiddenSize: hiddenSize, - options: { activations: ['sigmoid', 'tanh', 'relu'] } - }, - { - name: - '[gruCell] Throw if data type of options.bias is not one of the floating point types', - input: kExampleInputDescriptor, - weight: kExampleWeightDescriptor, - recurrentWeight: kExampleRecurrentWeightDescriptor, - hiddenState: kExampleHiddenStateDescriptor, - hiddenSize: hiddenSize, - options: { bias: { dataType: 'uint8', dimensions: [3 * hiddenSize] } } - }, - { - name: - '[gruCell] Throw if the rank of options.bias is not 1', - input: kExampleInputDescriptor, - weight: kExampleWeightDescriptor, - recurrentWeight: kExampleRecurrentWeightDescriptor, - hiddenState: kExampleHiddenStateDescriptor, - hiddenSize: hiddenSize, - options: { bias: { dataType: 'float32', dimensions: [batchSize, 3 * hiddenSize] } } - }, - { - name: - '[gruCell] Throw if options.bias.dimensions[0] is not 3 * hiddenSize', - input: kExampleInputDescriptor, - weight: kExampleWeightDescriptor, - recurrentWeight: kExampleRecurrentWeightDescriptor, - hiddenState: kExampleHiddenStateDescriptor, - hiddenSize: hiddenSize, - options: { bias: { dataType: 'float32', dimensions: [2 * hiddenSize] } } - }, - { - name: - '[gruCell] Throw if data type of options.recurrentBias is not one of the floating point types', - input: kExampleInputDescriptor, - weight: kExampleWeightDescriptor, - recurrentWeight: kExampleRecurrentWeightDescriptor, - hiddenState: kExampleHiddenStateDescriptor, - hiddenSize: hiddenSize, - options: { recurrentBias: { dataType: 'int8', dimensions: [3 * hiddenSize] } } - }, - { - name: - '[gruCell] Throw if the rank of options.recurrentBias is not 1', - input: kExampleInputDescriptor, - weight: kExampleWeightDescriptor, - recurrentWeight: kExampleRecurrentWeightDescriptor, - hiddenState: kExampleHiddenStateDescriptor, - hiddenSize: hiddenSize, - options: { recurrentBias: { dataType: 'float32', dimensions: [batchSize, 3 * hiddenSize] } } + { + name: '[gruCell] Test with default options', + input: kExampleInputDescriptor, + weight: kExampleWeightDescriptor, + recurrentWeight: kExampleRecurrentWeightDescriptor, + hiddenState: kExampleHiddenStateDescriptor, + hiddenSize: hiddenSize, + output: kExampleOutputDescriptor + }, + { + name: '[gruCell] Test with given options', + input: kExampleInputDescriptor, + weight: kExampleWeightDescriptor, + recurrentWeight: kExampleRecurrentWeightDescriptor, + hiddenState: kExampleHiddenStateDescriptor, + hiddenSize: hiddenSize, + options: { + bias: kExampleBiasDescriptor, + recurrentBias: kExampleRecurrentBiasDescriptor, + restAfter: true, + layout: 'rzn', + activations: ['sigmoid', 'relu'] }, - { - name: - '[gruCell] Throw if options.recurrentBias.dimensions[0] is not 3 * hiddenSize', - input: kExampleInputDescriptor, - weight: kExampleWeightDescriptor, - recurrentWeight: kExampleRecurrentWeightDescriptor, - hiddenState: kExampleHiddenStateDescriptor, - hiddenSize: hiddenSize, - options: { - recurrentBias: { dataType: 'float16', dimensions: [4 * hiddenSize] } - } + output: kExampleOutputDescriptor + }, + { + name: '[gruCell] Throw if hiddenSize equals to zero', + input: kExampleInputDescriptor, + weight: kExampleWeightDescriptor, + recurrentWeight: kExampleRecurrentWeightDescriptor, + hiddenState: kExampleHiddenStateDescriptor, + hiddenSize: 0 + }, + { + name: '[gruCell] Throw if hiddenSize is too large', + input: kExampleInputDescriptor, + weight: kExampleWeightDescriptor, + recurrentWeight: kExampleRecurrentWeightDescriptor, + hiddenState: kExampleHiddenStateDescriptor, + hiddenSize: 4294967295, + }, + { + name: + '[gruCell] Throw if the data type of the inputs is not one of the floating point types', + input: {dataType: 'uint32', shape: kValidInputShape}, + weight: {dataType: 'uint32', shape: kValidWeightShape}, + recurrentWeight: {dataType: 'uint32', shape: kValidRecurrentWeightShape}, + hiddenState: {dataType: 'uint32', shape: kValidHiddenStateShape}, + hiddenSize: hiddenSize + }, + { + name: '[gruCell] Throw if the rank of input is not 2', + input: {dataType: 'float32', shape: [batchSize]}, + weight: kExampleWeightDescriptor, + recurrentWeight: kExampleRecurrentWeightDescriptor, + hiddenState: kExampleHiddenStateDescriptor, + hiddenSize: hiddenSize + }, + { + name: '[gruCell] Throw if the input.shape[1] is incorrect', + input: {dataType: 'float32', shape: [inputSize, inputSize]}, + weight: kExampleWeightDescriptor, + recurrentWeight: kExampleRecurrentWeightDescriptor, + hiddenState: kExampleHiddenStateDescriptor, + hiddenSize: hiddenSize + }, + { + name: + '[gruCell] Throw if data type of weight is not one of the floating point types', + input: kExampleInputDescriptor, + weight: {dataType: 'int8', shape: [3 * hiddenSize, inputSize]}, + recurrentWeight: kExampleRecurrentWeightDescriptor, + hiddenState: kExampleHiddenStateDescriptor, + hiddenSize: hiddenSize + }, + { + name: '[gruCell] Throw if rank of weight is not 2', + input: kExampleInputDescriptor, + weight: {dataType: 'float32', shape: [3 * hiddenSize]}, + recurrentWeight: kExampleRecurrentWeightDescriptor, + hiddenState: kExampleHiddenStateDescriptor, + hiddenSize: hiddenSize + }, + { + name: '[gruCell] Throw if weight.shape[0] is not 3 * hiddenSize', + input: kExampleInputDescriptor, + weight: {dataType: 'float32', shape: [4 * hiddenSize, inputSize]}, + recurrentWeight: kExampleRecurrentWeightDescriptor, + hiddenState: kExampleHiddenStateDescriptor, + hiddenSize: hiddenSize + }, + { + name: + '[gruCell] Throw if data type of recurrentWeight is not one of the floating point types', + input: kExampleInputDescriptor, + weight: kExampleWeightDescriptor, + recurrentWeight: {dataType: 'int32', shape: [3 * hiddenSize, hiddenSize]}, + hiddenState: kExampleHiddenStateDescriptor, + hiddenSize: hiddenSize + }, + { + name: '[gruCell] Throw if the rank of recurrentWeight is not 2', + input: kExampleInputDescriptor, + weight: kExampleWeightDescriptor, + recurrentWeight: {dataType: 'float32', shape: [3 * hiddenSize]}, + hiddenState: kExampleHiddenStateDescriptor, + hiddenSize: hiddenSize + }, + { + name: '[gruCell] Throw if the recurrentWeight.shape is invalid', + input: kExampleInputDescriptor, + weight: kExampleWeightDescriptor, + recurrentWeight: {dataType: 'float32', shape: [4 * hiddenSize, inputSize]}, + hiddenState: kExampleHiddenStateDescriptor, + hiddenSize: hiddenSize + }, + { + name: + '[gruCell] Throw if data type of hiddenState is not one of the floating point types', + input: kExampleInputDescriptor, + weight: kExampleWeightDescriptor, + recurrentWeight: kExampleRecurrentWeightDescriptor, + hiddenState: {dataType: 'uint32', shape: [batchSize, hiddenSize]}, + hiddenSize: hiddenSize + }, + { + name: '[gruCell] Throw if the rank of hiddenState is not 2', + input: kExampleInputDescriptor, + weight: kExampleWeightDescriptor, + recurrentWeight: kExampleRecurrentWeightDescriptor, + hiddenState: {dataType: 'float32', shape: [hiddenSize]}, + hiddenSize: hiddenSize + }, + { + name: '[gruCell] Throw if the hiddenState.shape is invalid', + input: kExampleInputDescriptor, + weight: kExampleWeightDescriptor, + recurrentWeight: kExampleRecurrentWeightDescriptor, + hiddenState: {dataType: 'float32', shape: [batchSize, 3 * hiddenSize]}, + hiddenSize: hiddenSize + }, + { + name: '[gruCell] Throw if the size of options.activations is not 2', + input: kExampleInputDescriptor, + weight: kExampleWeightDescriptor, + recurrentWeight: kExampleRecurrentWeightDescriptor, + hiddenState: kExampleHiddenStateDescriptor, + hiddenSize: hiddenSize, + options: {activations: ['sigmoid', 'tanh', 'relu']} + }, + { + name: + '[gruCell] Throw if data type of options.bias is not one of the floating point types', + input: kExampleInputDescriptor, + weight: kExampleWeightDescriptor, + recurrentWeight: kExampleRecurrentWeightDescriptor, + hiddenState: kExampleHiddenStateDescriptor, + hiddenSize: hiddenSize, + options: {bias: {dataType: 'uint8', shape: [3 * hiddenSize]}} + }, + { + name: '[gruCell] Throw if the rank of options.bias is not 1', + input: kExampleInputDescriptor, + weight: kExampleWeightDescriptor, + recurrentWeight: kExampleRecurrentWeightDescriptor, + hiddenState: kExampleHiddenStateDescriptor, + hiddenSize: hiddenSize, + options: {bias: {dataType: 'float32', shape: [batchSize, 3 * hiddenSize]}} + }, + { + name: '[gruCell] Throw if options.bias.shape[0] is not 3 * hiddenSize', + input: kExampleInputDescriptor, + weight: kExampleWeightDescriptor, + recurrentWeight: kExampleRecurrentWeightDescriptor, + hiddenState: kExampleHiddenStateDescriptor, + hiddenSize: hiddenSize, + options: {bias: {dataType: 'float32', shape: [2 * hiddenSize]}} + }, + { + name: + '[gruCell] Throw if data type of options.recurrentBias is not one of the floating point types', + input: kExampleInputDescriptor, + weight: kExampleWeightDescriptor, + recurrentWeight: kExampleRecurrentWeightDescriptor, + hiddenState: kExampleHiddenStateDescriptor, + hiddenSize: hiddenSize, + options: {recurrentBias: {dataType: 'int8', shape: [3 * hiddenSize]}} + }, + { + name: '[gruCell] Throw if the rank of options.recurrentBias is not 1', + input: kExampleInputDescriptor, + weight: kExampleWeightDescriptor, + recurrentWeight: kExampleRecurrentWeightDescriptor, + hiddenState: kExampleHiddenStateDescriptor, + hiddenSize: hiddenSize, + options: { + recurrentBias: {dataType: 'float32', shape: [batchSize, 3 * hiddenSize]} } + }, + { + name: + '[gruCell] Throw if options.recurrentBias.shape[0] is not 3 * hiddenSize', + input: kExampleInputDescriptor, + weight: kExampleWeightDescriptor, + recurrentWeight: kExampleRecurrentWeightDescriptor, + hiddenState: kExampleHiddenStateDescriptor, + hiddenSize: hiddenSize, + options: {recurrentBias: {dataType: 'float16', shape: [4 * hiddenSize]}} + } ]; tests.forEach( test => promise_test(async t => { const builder = new MLGraphBuilder(context); - const input = builder.input('input', { - dataType: test.input.dataType, - dimensions: test.input.dimensions - }); - const weight = builder.input('weight', { - dataType: test.weight.dataType, - dimensions: test.weight.dimensions - }); - const recurrentWeight = builder.input('recurrentWeight', { - dataType: test.recurrentWeight.dataType, - dimensions: test.recurrentWeight.dimensions - }); - const hiddenState = builder.input('hiddenState', { - dataType: test.hiddenState.dataType, - dimensions: test.hiddenState.dimensions - }); + const input = builder.input('input', test.input); + const weight = builder.input('weight', test.weight); + const recurrentWeight = + builder.input('recurrentWeight', test.recurrentWeight); + const hiddenState = builder.input('hiddenState', test.hiddenState); const options = {}; if (test.options) { if (test.options.bias) { - options.bias = builder.input('bias', { - dataType: test.options.bias.dataType, - dimensions: test.options.bias.dimensions - }); + options.bias = builder.input('bias', test.options.bias); } if (test.options.recurrentBias) { - options.recurrentBias = builder.input('recurrentBias', { - dataType: test.options.recurrentBias.dataType, - dimensions: test.options.recurrentBias.dimensions - }); + options.recurrentBias = + builder.input('recurrentBias', test.options.recurrentBias); } if (test.options.resetAfter) { options.resetAfter = test.options.resetAfter; @@ -354,7 +299,7 @@ tests.forEach( input, weight, recurrentWeight, hiddenState, test.hiddenSize, options); assert_equals(output.dataType(), test.output.dataType); - assert_array_equals(output.shape(), test.output.dimensions); + assert_array_equals(output.shape(), test.output.shape); } else { const label = 'gru_cell_xxx'; options.label = label; diff --git a/testing/web-platform/tests/webnn/validation_tests/hardSigmoid.https.any.js b/testing/web-platform/tests/webnn/validation_tests/hardSigmoid.https.any.js index c4ea4e1296ba..8134863a3112 100644 --- a/testing/web-platform/tests/webnn/validation_tests/hardSigmoid.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/hardSigmoid.https.any.js @@ -16,8 +16,7 @@ validateSingleInputOperation('hardSigmoid', label); promise_test(async t => { const builder = new MLGraphBuilder(context); const options = {alpha: 0.5, beta: 1.0}; - const input = - builder.input('input', {dataType: 'float16', dimensions: [1, 2, 3]}); + const input = builder.input('input', {dataType: 'float16', shape: [1, 2, 3]}); const output = builder.hardSigmoid(input, options); assert_equals(output.dataType(), 'float16'); assert_array_equals(output.shape(), [1, 2, 3]); @@ -26,13 +25,13 @@ promise_test(async t => { promise_test(async t => { const builder = new MLGraphBuilder(context); const options = {beta: NaN}; - const input = builder.input('input', {dataType: 'float32', dimensions: []}); + const input = builder.input('input', {dataType: 'float32', shape: []}); assert_throws_js(TypeError, () => builder.hardSigmoid(input, options)); }, '[hardSigmoid] Throw if options.beta is NaN'); promise_test(async t => { const builder = new MLGraphBuilder(context); const options = {alpha: Infinity}; - const input = builder.input('input', {dataType: 'float32', dimensions: [1]}); + const input = builder.input('input', {dataType: 'float32', shape: [1]}); assert_throws_js(TypeError, () => builder.hardSigmoid(input, options)); }, '[hardSigmoid] Throw if options.alpha is Infinity'); diff --git a/testing/web-platform/tests/webnn/validation_tests/input.https.any.js b/testing/web-platform/tests/webnn/validation_tests/input.https.any.js index 07d9185cee6b..0649c67f086e 100644 --- a/testing/web-platform/tests/webnn/validation_tests/input.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/input.https.any.js @@ -14,48 +14,48 @@ const tests = [ '[input] Test building a 0-D scalar input without presenting dimensions', name: 'input', descriptor: {dataType: 'float32'}, - output: {dataType: 'float32', dimensions: []}, + output: {dataType: 'float32', shape: []}, }, { testName: '[input] Test building a 0-D scalar input with empty dimensions', name: 'input', - descriptor: {dataType: 'float32', dimensions: []}, - output: {dataType: 'float32', dimensions: []}, + descriptor: {dataType: 'float32', shape: []}, + output: {dataType: 'float32', shape: []}, }, { testName: '[input] Test building a 1-D input with int64 data type', name: 'input', - descriptor: {dataType: 'int64', dimensions: [3]}, - output: {dataType: 'int64', dimensions: [3]}, + descriptor: {dataType: 'int64', shape: [3]}, + output: {dataType: 'int64', shape: [3]}, }, { testName: '[input] Test building a 2-D input without errors', name: 'input', - descriptor: {dataType: 'float32', dimensions: [3, 4]}, - output: {dataType: 'float32', dimensions: [3, 4]}, + descriptor: {dataType: 'float32', shape: [3, 4]}, + output: {dataType: 'float32', shape: [3, 4]}, }, { testName: '[input] Throw if the name is empty', name: '', - descriptor: {dataType: 'float32', dimensions: [3, 4]} + descriptor: {dataType: 'float32', shape: [3, 4]} }, { testName: '[input] Throw if a dimension size is 0', name: 'input', - descriptor: {dataType: 'float32', dimensions: [3, 0]} + descriptor: {dataType: 'float32', shape: [3, 0]} }, { testName: '[input] Throw if the value of any element in dimensions is outside the \'unsigned long\' value range', name: 'input', - descriptor: {dataType: 'float32', dimensions: [kMaxUnsignedLong + 1]} + descriptor: {dataType: 'float32', shape: [kMaxUnsignedLong + 1]} }, { testName: '[input] Throw if the number of elements is too large', name: 'input', descriptor: { dataType: 'float32', - dimensions: [kMaxUnsignedLong, kMaxUnsignedLong, kMaxUnsignedLong] + shape: [kMaxUnsignedLong, kMaxUnsignedLong, kMaxUnsignedLong] } } ]; @@ -66,7 +66,7 @@ tests.forEach( if (test.output) { const inputOperand = builder.input(test.name, test.descriptor); assert_equals(inputOperand.dataType(), test.output.dataType); - assert_array_equals(inputOperand.shape(), test.output.dimensions); + assert_array_equals(inputOperand.shape(), test.output.shape); } else { assert_throws_js( TypeError, () => builder.input(test.name, test.descriptor)); diff --git a/testing/web-platform/tests/webnn/validation_tests/instanceNormalization.https.any.js b/testing/web-platform/tests/webnn/validation_tests/instanceNormalization.https.any.js index 36652dd7264f..618be23fdec8 100644 --- a/testing/web-platform/tests/webnn/validation_tests/instanceNormalization.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/instanceNormalization.https.any.js @@ -9,12 +9,12 @@ const kExampleInputDescriptor = { dataType: 'float32', - dimensions: [2, 2, 2, 2] + shape: [2, 2, 2, 2] }; // 1D tensor descriptor which may be used for `scale`, or `bias` inputs. const kExample1DTensorDescriptor = { dataType: 'float32', - dimensions: [2] + shape: [2] }; multi_builder_test(async (t, builder, otherBuilder) => { @@ -49,128 +49,128 @@ const label = 'instance_normalization'; const tests = [ { name: '[instanceNormalization] Test with default options for 4-D input.', - input: {dataType: 'float32', dimensions: [1, 2, 3, 4]}, - output: {dataType: 'float32', dimensions: [1, 2, 3, 4]} + input: {dataType: 'float32', shape: [1, 2, 3, 4]}, + output: {dataType: 'float32', shape: [1, 2, 3, 4]} }, { name: '[instanceNormalization] Test with scale, bias and default epsilon value.', - input: {dataType: 'float32', dimensions: [1, 2, 3, 4]}, + input: {dataType: 'float32', shape: [1, 2, 3, 4]}, options: { - scale: {dataType: 'float32', dimensions: [2]}, - bias: {dataType: 'float32', dimensions: [2]}, + scale: {dataType: 'float32', shape: [2]}, + bias: {dataType: 'float32', shape: [2]}, epsilon: 1e-5, }, - output: {dataType: 'float32', dimensions: [1, 2, 3, 4]} + output: {dataType: 'float32', shape: [1, 2, 3, 4]} }, { name: '[instanceNormalization] Test with a non-default epsilon value.', - input: {dataType: 'float32', dimensions: [1, 2, 3, 4]}, + input: {dataType: 'float32', shape: [1, 2, 3, 4]}, options: { epsilon: 1e-4, }, - output: {dataType: 'float32', dimensions: [1, 2, 3, 4]} + output: {dataType: 'float32', shape: [1, 2, 3, 4]} }, { name: '[instanceNormalization] Test with layout=nhwc.', - input: {dataType: 'float32', dimensions: [1, 2, 3, 4]}, + input: {dataType: 'float32', shape: [1, 2, 3, 4]}, options: { layout: 'nhwc', - scale: {dataType: 'float32', dimensions: [4]}, - bias: {dataType: 'float32', dimensions: [4]}, + scale: {dataType: 'float32', shape: [4]}, + bias: {dataType: 'float32', shape: [4]}, }, - output: {dataType: 'float32', dimensions: [1, 2, 3, 4]} + output: {dataType: 'float32', shape: [1, 2, 3, 4]} }, { name: '[instanceNormalization] Test when the input data type is float16.', - input: {dataType: 'float16', dimensions: [1, 2, 3, 4]}, - output: {dataType: 'float16', dimensions: [1, 2, 3, 4]}, + input: {dataType: 'float16', shape: [1, 2, 3, 4]}, + output: {dataType: 'float16', shape: [1, 2, 3, 4]}, options: {label} }, { name: '[instanceNormalization] Throw if the input is not a 4-D tensor.', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5, 2]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5, 2]}, options: {label} }, { name: '[instanceNormalization] Throw if the input data type is not one of floating point types.', - input: {dataType: 'int32', dimensions: [1, 2, 5, 5]}, + input: {dataType: 'int32', shape: [1, 2, 5, 5]}, options: {label} }, { name: '[instanceNormalization] Throw if the scale data type is not the same as the input data type.', - input: {dataType: 'float16', dimensions: [1, 2, 5, 5]}, + input: {dataType: 'float16', shape: [1, 2, 5, 5]}, options: { - scale: {dataType: 'float32', dimensions: [2]}, + scale: {dataType: 'float32', shape: [2]}, label: label, }, }, { name: '[instanceNormalization] Throw if the scale operand is not a 1-D tensor.', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, options: { - scale: {dataType: 'float32', dimensions: [2, 1]}, + scale: {dataType: 'float32', shape: [2, 1]}, label: label, }, }, { name: '[instanceNormalization] Throw if the size of scale operand is not equal to the size of the feature dimension of the input with layout=nhwc.', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, options: { layout: 'nhwc', - scale: {dataType: 'float32', dimensions: [2]}, + scale: {dataType: 'float32', shape: [2]}, label: label, }, }, { name: '[instanceNormalization] Throw if the size of scale operand is not equal to the size of the feature dimension of the input with layout=nchw.', - input: {dataType: 'float32', dimensions: [1, 5, 5, 2]}, + input: {dataType: 'float32', shape: [1, 5, 5, 2]}, options: { layout: 'nchw', - scale: {dataType: 'float32', dimensions: [2]}, + scale: {dataType: 'float32', shape: [2]}, label: label, }, }, { name: '[instanceNormalization] Throw if the bias data type is not the same as the input data type.', - input: {dataType: 'float16', dimensions: [1, 2, 5, 5]}, + input: {dataType: 'float16', shape: [1, 2, 5, 5]}, options: { - bias: {dataType: 'float32', dimensions: [2]}, + bias: {dataType: 'float32', shape: [2]}, label: label, }, }, { name: '[instanceNormalization] Throw if the bias operand is not a 1-D tensor.', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, options: { - scale: {dataType: 'float32', dimensions: [2, 1]}, + scale: {dataType: 'float32', shape: [2, 1]}, label: label, }, }, { name: '[instanceNormalization] Throw if the size of bias operand is not equal to the size of the feature dimension of the input with layout=nhwc.', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, options: { layout: 'nhwc', - bias: {dataType: 'float32', dimensions: [2]}, + bias: {dataType: 'float32', shape: [2]}, label: label, }, }, { name: '[instanceNormalization] Throw if the size of bias operand is not equal to the size of the feature dimension of the input with layout=nchw.', - input: {dataType: 'float32', dimensions: [1, 5, 5, 2]}, + input: {dataType: 'float32', shape: [1, 5, 5, 2]}, options: { layout: 'nchw', - bias: {dataType: 'float32', dimensions: [2]}, + bias: {dataType: 'float32', shape: [2]}, label: label, }, }, @@ -179,21 +179,13 @@ const tests = [ tests.forEach( test => promise_test(async t => { const builder = new MLGraphBuilder(context); - const input = builder.input( - 'input', - {dataType: test.input.dataType, dimensions: test.input.dimensions}); + const input = builder.input('input', test.input); if (test.options && test.options.bias) { - test.options.bias = builder.input('bias', { - dataType: test.options.bias.dataType, - dimensions: test.options.bias.dimensions - }); + test.options.bias = builder.input('bias', test.options.bias); } if (test.options && test.options.scale) { - test.options.scale = builder.input('scale', { - dataType: test.options.scale.dataType, - dimensions: test.options.scale.dimensions - }); + test.options.scale = builder.input('scale', test.options.scale); } if (test.output && @@ -202,7 +194,7 @@ tests.forEach( test.input.dataType)) { const output = builder.instanceNormalization(input, test.options); assert_equals(output.dataType(), test.output.dataType); - assert_array_equals(output.shape(), test.output.dimensions); + assert_array_equals(output.shape(), test.output.shape); } else { const regrexp = new RegExp('\\[' + label + '\\]'); assert_throws_with_label( diff --git a/testing/web-platform/tests/webnn/validation_tests/invalid-rank.https.any.js b/testing/web-platform/tests/webnn/validation_tests/invalid-rank.https.any.js index 59f5ac523375..93dfa105c6bd 100644 --- a/testing/web-platform/tests/webnn/validation_tests/invalid-rank.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/invalid-rank.https.any.js @@ -11,6 +11,6 @@ promise_test(async t => { const shapeWithLargeRank = Array(10).fill(2); assert_throws_js( TypeError, - () => builder.input( - 'a', {dataType: 'float32', dimensions: shapeWithLargeRank})); + () => + builder.input('a', {dataType: 'float32', shape: shapeWithLargeRank})); }, 'Throw if rank is too large'); diff --git a/testing/web-platform/tests/webnn/validation_tests/layerNormalization.https.any.js b/testing/web-platform/tests/webnn/validation_tests/layerNormalization.https.any.js index 2eff16888c29..97bb479f04d4 100644 --- a/testing/web-platform/tests/webnn/validation_tests/layerNormalization.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/layerNormalization.https.any.js @@ -9,7 +9,7 @@ const kExampleInputDescriptor = { dataType: 'float32', - dimensions: [2, 2] + shape: [2, 2] }; validateInputFromAnotherBuilder('layerNormalization'); @@ -36,79 +36,79 @@ const label = 'instance_normalization'; const tests = [ { name: '[layerNormalization] Test with default options for scalar input.', - input: {dataType: 'float32', dimensions: []}, - output: {dataType: 'float32', dimensions: []}, + input: {dataType: 'float32', shape: []}, + output: {dataType: 'float32', shape: []}, }, { name: '[layerNormalization] Test when the input data type is float16.', - input: {dataType: 'float16', dimensions: []}, - output: {dataType: 'float16', dimensions: []}, + input: {dataType: 'float16', shape: []}, + output: {dataType: 'float16', shape: []}, options: {label} }, { name: '[layerNormalization] Test with given axes.', - input: {dataType: 'float32', dimensions: [1, 2, 3, 4]}, + input: {dataType: 'float32', shape: [1, 2, 3, 4]}, options: { axes: [3], }, - output: {dataType: 'float32', dimensions: [1, 2, 3, 4]}, + output: {dataType: 'float32', shape: [1, 2, 3, 4]}, }, { name: '[layerNormalization] Test with given scale.', - input: {dataType: 'float32', dimensions: [1, 2, 3, 4]}, + input: {dataType: 'float32', shape: [1, 2, 3, 4]}, options: { - scale: {dataType: 'float32', dimensions: [2, 3, 4]}, + scale: {dataType: 'float32', shape: [2, 3, 4]}, }, - output: {dataType: 'float32', dimensions: [1, 2, 3, 4]}, + output: {dataType: 'float32', shape: [1, 2, 3, 4]}, }, { name: '[layerNormalization] Test with a non-default epsilon value.', - input: {dataType: 'float32', dimensions: [1, 2, 3, 4]}, + input: {dataType: 'float32', shape: [1, 2, 3, 4]}, options: { epsilon: 1e-4, // default epsilon=1e-5 }, - output: {dataType: 'float32', dimensions: [1, 2, 3, 4]}, + output: {dataType: 'float32', shape: [1, 2, 3, 4]}, }, { name: '[layerNormalization] Test with given axes, scale and bias.', - input: {dataType: 'float32', dimensions: [1, 2, 3, 4]}, + input: {dataType: 'float32', shape: [1, 2, 3, 4]}, options: { - scale: {dataType: 'float32', dimensions: [3, 4]}, - bias: {dataType: 'float32', dimensions: [3, 4]}, + scale: {dataType: 'float32', shape: [3, 4]}, + bias: {dataType: 'float32', shape: [3, 4]}, axes: [2, 3], }, - output: {dataType: 'float32', dimensions: [1, 2, 3, 4]}, + output: {dataType: 'float32', shape: [1, 2, 3, 4]}, }, { name: '[layerNormalization] Test with nonconsecutive axes.', - input: {dataType: 'float32', dimensions: [1, 2, 3, 4, 5, 6]}, + input: {dataType: 'float32', shape: [1, 2, 3, 4, 5, 6]}, options: { - scale: {dataType: 'float32', dimensions: [2, 4, 6]}, - bias: {dataType: 'float32', dimensions: [2, 4, 6]}, + scale: {dataType: 'float32', shape: [2, 4, 6]}, + bias: {dataType: 'float32', shape: [2, 4, 6]}, axes: [1, 3, 5], }, - output: {dataType: 'float32', dimensions: [1, 2, 3, 4, 5, 6]}, + output: {dataType: 'float32', shape: [1, 2, 3, 4, 5, 6]}, }, { name: '[layerNormalization] Test with axes in descending order.', - input: {dataType: 'float32', dimensions: [1, 2, 3, 4, 5, 6]}, + input: {dataType: 'float32', shape: [1, 2, 3, 4, 5, 6]}, options: { - scale: {dataType: 'float32', dimensions: [6, 5, 4, 3, 2]}, - bias: {dataType: 'float32', dimensions: [6, 5, 4, 3, 2]}, + scale: {dataType: 'float32', shape: [6, 5, 4, 3, 2]}, + bias: {dataType: 'float32', shape: [6, 5, 4, 3, 2]}, axes: [5, 4, 3, 2, 1] }, - output: {dataType: 'float32', dimensions: [1, 2, 3, 4, 5, 6]}, + output: {dataType: 'float32', shape: [1, 2, 3, 4, 5, 6]}, }, { name: '[layerNormalization] Throw if the input data type is not one of the floating point types.', - input: {dataType: 'uint32', dimensions: [1, 2, 3, 4]}, + input: {dataType: 'uint32', shape: [1, 2, 3, 4]}, options: {label} }, { name: '[layerNormalization] Throw if the axis is greater than the input rank.', - input: {dataType: 'float32', dimensions: [1, 2, 3, 4]}, + input: {dataType: 'float32', shape: [1, 2, 3, 4]}, options: { axes: [1, 2, 4], label: label, @@ -116,7 +116,7 @@ const tests = [ }, { name: '[layerNormalization] Throw if the axes have duplications.', - input: {dataType: 'float32', dimensions: [1, 2, 3, 4]}, + input: {dataType: 'float32', shape: [1, 2, 3, 4]}, options: { axes: [3, 3], label: label, @@ -125,10 +125,10 @@ const tests = [ { name: '[layerNormalization] Throw if the bias data type doesn\'t match input data type', - input: {dataType: 'float32', dimensions: [1, 2, 3, 4]}, + input: {dataType: 'float32', shape: [1, 2, 3, 4]}, options: { - scale: {dataType: 'float32', dimensions: [3, 4]}, - bias: {dataType: 'float16', dimensions: [3, 4]}, + scale: {dataType: 'float32', shape: [3, 4]}, + bias: {dataType: 'float16', shape: [3, 4]}, axes: [2, 3], label: label, }, @@ -136,10 +136,10 @@ const tests = [ { name: '[layerNormalization] Throw if the scale data type doesn\'t match input data type', - input: {dataType: 'float32', dimensions: [1, 2, 3, 4]}, + input: {dataType: 'float32', shape: [1, 2, 3, 4]}, options: { - scale: {dataType: 'float16', dimensions: [3, 4]}, - bias: {dataType: 'float32', dimensions: [3, 4]}, + scale: {dataType: 'float16', shape: [3, 4]}, + bias: {dataType: 'float32', shape: [3, 4]}, axes: [2, 3], label: label, }, @@ -147,11 +147,11 @@ const tests = [ { name: '[layerNormalization] Throw if the bias dimensions doesn\'t match axis dimensions.', - input: {dataType: 'float32', dimensions: [1, 2, 3, 4]}, + input: {dataType: 'float32', shape: [1, 2, 3, 4]}, options: { bias: { dataType: 'float32', - dimensions: [3, 3, 4] + shape: [3, 3, 4] }, // for 4D input, default axes = [1,2,3] label: label, }, @@ -159,11 +159,11 @@ const tests = [ { name: '[layerNormalization] Throw if the scale dimensions doesn\'t match axis dimensions.', - input: {dataType: 'float32', dimensions: [1, 2, 3, 4]}, + input: {dataType: 'float32', shape: [1, 2, 3, 4]}, options: { scale: { dataType: 'float32', - dimensions: [3, 3, 4] + shape: [3, 3, 4] }, // for 4D input, default axes = [1,2,3] label: label, }, @@ -171,11 +171,11 @@ const tests = [ { name: '[layerNormalization] Throw if the bias rank doesn\'t match axis rank.', - input: {dataType: 'float32', dimensions: [1, 2, 3, 4]}, + input: {dataType: 'float32', shape: [1, 2, 3, 4]}, options: { bias: { dataType: 'float32', - dimensions: [1, 2, 3, 4] + shape: [1, 2, 3, 4] }, // for 4D input, default axes = [1,2,3] label: label, }, @@ -183,11 +183,11 @@ const tests = [ { name: '[layerNormalization] Throw if the scale rank doesn\'t match axis rank.', - input: {dataType: 'float32', dimensions: [1, 2, 3, 4]}, + input: {dataType: 'float32', shape: [1, 2, 3, 4]}, options: { scale: { dataType: 'float32', - dimensions: [1, 2, 3, 4] + shape: [1, 2, 3, 4] }, // for 4D input, default axes = [1,2,3] label: label, }, @@ -197,21 +197,13 @@ const tests = [ tests.forEach( test => promise_test(async t => { const builder = new MLGraphBuilder(context); - const input = builder.input( - 'input', - {dataType: test.input.dataType, dimensions: test.input.dimensions}); + const input = builder.input('input', test.input); if (test.options && test.options.bias) { - test.options.bias = builder.input('bias', { - dataType: test.options.bias.dataType, - dimensions: test.options.bias.dimensions - }); + test.options.bias = builder.input('bias', test.options.bias); } if (test.options && test.options.scale) { - test.options.scale = builder.input('scale', { - dataType: test.options.scale.dataType, - dimensions: test.options.scale.dimensions - }); + test.options.scale = builder.input('scale', test.options.scale); } if (test.output && @@ -219,7 +211,7 @@ tests.forEach( test.input.dataType)) { const output = builder.layerNormalization(input, test.options); assert_equals(output.dataType(), test.output.dataType); - assert_array_equals(output.shape(), test.output.dimensions); + assert_array_equals(output.shape(), test.output.shape); } else { const regrexp = new RegExp('\\[' + label + '\\]'); assert_throws_with_label( diff --git a/testing/web-platform/tests/webnn/validation_tests/leakyRelu.https.any.js b/testing/web-platform/tests/webnn/validation_tests/leakyRelu.https.any.js index 6766763cd749..c49ac659ef4d 100644 --- a/testing/web-platform/tests/webnn/validation_tests/leakyRelu.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/leakyRelu.https.any.js @@ -15,8 +15,7 @@ validateSingleInputOperation('leakyRelu', label); promise_test(async t => { const builder = new MLGraphBuilder(context); const options = {alpha: 0.02}; - const input = - builder.input('input', {dataType: 'float32', dimensions: [1, 2, 3]}); + const input = builder.input('input', {dataType: 'float32', shape: [1, 2, 3]}); const output = builder.leakyRelu(input, options); assert_equals(output.dataType(), 'float32'); assert_array_equals(output.shape(), [1, 2, 3]); @@ -25,13 +24,13 @@ promise_test(async t => { promise_test(async t => { const builder = new MLGraphBuilder(context); const options = {alpha: Infinity}; - const input = builder.input('input', {dataType: 'float16', dimensions: []}); + const input = builder.input('input', {dataType: 'float16', shape: []}); assert_throws_js(TypeError, () => builder.leakyRelu(input, options)); }, '[leakyRelu] Throw if options.alpha is Infinity'); promise_test(async t => { const builder = new MLGraphBuilder(context); const options = {alpha: -NaN}; - const input = builder.input('input', {dataType: 'float32', dimensions: [1]}); + const input = builder.input('input', {dataType: 'float32', shape: [1]}); assert_throws_js(TypeError, () => builder.leakyRelu(input, options)); }, '[leakyRelu] Throw if options.alpha is -NaN'); diff --git a/testing/web-platform/tests/webnn/validation_tests/linear.https.any.js b/testing/web-platform/tests/webnn/validation_tests/linear.https.any.js index e1243bb73fd5..816dad35039a 100644 --- a/testing/web-platform/tests/webnn/validation_tests/linear.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/linear.https.any.js @@ -15,8 +15,7 @@ validateSingleInputOperation('linear', label); promise_test(async t => { const builder = new MLGraphBuilder(context); const options = {alpha: 1.5, beta: 0.3}; - const input = - builder.input('input', {dataType: 'float32', dimensions: [1, 2, 3]}); + const input = builder.input('input', {dataType: 'float32', shape: [1, 2, 3]}); const output = builder.linear(input, options); assert_equals(output.dataType(), 'float32'); assert_array_equals(output.shape(), [1, 2, 3]); @@ -25,13 +24,13 @@ promise_test(async t => { promise_test(async t => { const builder = new MLGraphBuilder(context); const options = {beta: -Infinity}; - const input = builder.input('input', {dataType: 'float32', dimensions: []}); + const input = builder.input('input', {dataType: 'float32', shape: []}); assert_throws_js(TypeError, () => builder.linear(input, options)); }, '[linear] Throw if options.beta is -Infinity'); promise_test(async t => { const builder = new MLGraphBuilder(context); const options = {alpha: NaN}; - const input = builder.input('input', {dataType: 'float32', dimensions: [1]}); + const input = builder.input('input', {dataType: 'float32', shape: [1]}); assert_throws_js(TypeError, () => builder.linear(input, options)); }, '[linear] Throw if options.alpha is NaN'); diff --git a/testing/web-platform/tests/webnn/validation_tests/lstm.https.any.js b/testing/web-platform/tests/webnn/validation_tests/lstm.https.any.js index 5d4f7ee6db28..8cc2a014a7c4 100644 --- a/testing/web-platform/tests/webnn/validation_tests/lstm.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/lstm.https.any.js @@ -11,54 +11,51 @@ const steps = 10, batchSize = 5, inputSize = 3, hiddenSize = 8, numDirections = 1; // Dimensions required of required inputs. -const kValidInputDimensions = [steps, batchSize, inputSize]; -const kValidWeightDimensions = [numDirections, 4 * hiddenSize, inputSize]; -const kValidRecurrentWeightDimensions = - [numDirections, 4 * hiddenSize, hiddenSize]; +const kValidInputShape = [steps, batchSize, inputSize]; +const kValidWeightShape = [numDirections, 4 * hiddenSize, inputSize]; +const kValidRecurrentWeightShape = [numDirections, 4 * hiddenSize, hiddenSize]; // Dimensions required of optional inputs. -const kValidBiasDimensions = [numDirections, 4 * hiddenSize]; -const kValidPeepholeWeightDimensions = [numDirections, 3 * hiddenSize]; -const kValidInitialHiddenStateDimensions = - [numDirections, batchSize, hiddenSize]; +const kValidBiasShape = [numDirections, 4 * hiddenSize]; +const kValidPeepholeWeightShape = [numDirections, 3 * hiddenSize]; +const kValidInitialHiddenStateShape = [numDirections, batchSize, hiddenSize]; // Example descriptors which are valid according to the above dimensions. const kExampleInputDescriptor = { dataType: 'float32', - dimensions: kValidInputDimensions + shape: kValidInputShape }; const kExampleWeightDescriptor = { dataType: 'float32', - dimensions: kValidWeightDimensions + shape: kValidWeightShape }; const kExampleRecurrentWeightDescriptor = { dataType: 'float32', - dimensions: kValidRecurrentWeightDimensions + shape: kValidRecurrentWeightShape }; const kExampleBiasDescriptor = { dataType: 'float32', - dimensions: kValidBiasDimensions + shape: kValidBiasShape }; const kExamplePeepholeWeightDescriptor = { dataType: 'float32', - dimensions: kValidPeepholeWeightDimensions + shape: kValidPeepholeWeightShape }; const kExampleInitialHiddenStateDescriptor = { dataType: 'float32', - dimensions: kValidInitialHiddenStateDimensions + shape: kValidInitialHiddenStateShape }; const tests = [ { name: '[lstm] Test with default options', - input: {dataType: 'float16', dimensions: kValidInputDimensions}, - weight: {dataType: 'float16', dimensions: kValidWeightDimensions}, - recurrentWeight: - {dataType: 'float16', dimensions: kValidRecurrentWeightDimensions}, + input: {dataType: 'float16', shape: kValidInputShape}, + weight: {dataType: 'float16', shape: kValidWeightShape}, + recurrentWeight: {dataType: 'float16', shape: kValidRecurrentWeightShape}, steps: steps, hiddenSize: hiddenSize, outputs: [ - {dataType: 'float16', dimensions: [numDirections, batchSize, hiddenSize]}, - {dataType: 'float16', dimensions: [numDirections, batchSize, hiddenSize]} + {dataType: 'float16', shape: [numDirections, batchSize, hiddenSize]}, + {dataType: 'float16', shape: [numDirections, batchSize, hiddenSize]} ] }, { @@ -66,34 +63,28 @@ const tests = [ input: kExampleInputDescriptor, weight: { dataType: 'float32', - dimensions: [/*numDirections=*/ 2, 4 * hiddenSize, inputSize] + shape: [/*numDirections=*/ 2, 4 * hiddenSize, inputSize] }, recurrentWeight: { dataType: 'float32', - dimensions: [/*numDirections=*/ 2, 4 * hiddenSize, hiddenSize] + shape: [/*numDirections=*/ 2, 4 * hiddenSize, hiddenSize] }, steps: steps, hiddenSize: hiddenSize, options: { - bias: { - dataType: 'float32', - dimensions: [/*numDirections=*/ 2, 4 * hiddenSize] - }, - recurrentBias: { - dataType: 'float32', - dimensions: [/*numDirections=*/ 2, 4 * hiddenSize] - }, - peepholeWeight: { - dataType: 'float32', - dimensions: [/*numDirections=*/ 2, 3 * hiddenSize] - }, + bias: + {dataType: 'float32', shape: [/*numDirections=*/ 2, 4 * hiddenSize]}, + recurrentBias: + {dataType: 'float32', shape: [/*numDirections=*/ 2, 4 * hiddenSize]}, + peepholeWeight: + {dataType: 'float32', shape: [/*numDirections=*/ 2, 3 * hiddenSize]}, initialHiddenState: { dataType: 'float32', - dimensions: [/*numDirections=*/ 2, batchSize, hiddenSize] + shape: [/*numDirections=*/ 2, batchSize, hiddenSize] }, initialCellState: { dataType: 'float32', - dimensions: [/*numDirections=*/ 2, batchSize, hiddenSize] + shape: [/*numDirections=*/ 2, batchSize, hiddenSize] }, returnSequence: true, direction: 'both', @@ -103,15 +94,15 @@ const tests = [ outputs: [ { dataType: 'float32', - dimensions: [/*numDirections=*/ 2, batchSize, hiddenSize] + shape: [/*numDirections=*/ 2, batchSize, hiddenSize] }, { dataType: 'float32', - dimensions: [/*numDirections=*/ 2, batchSize, hiddenSize] + shape: [/*numDirections=*/ 2, batchSize, hiddenSize] }, { dataType: 'float32', - dimensions: [steps, /*numDirections=*/ 2, batchSize, hiddenSize] + shape: [steps, /*numDirections=*/ 2, batchSize, hiddenSize] } ] }, @@ -142,16 +133,15 @@ const tests = [ { name: '[lstm] TypeError is expected if the data type is not one of the floating point types', - input: {dataType: 'uint32', dimensions: kValidInputDimensions}, - weight: {dataType: 'uint32', dimensions: kValidWeightDimensions}, - recurrentWeight: - {dataType: 'uint32', dimensions: kValidRecurrentWeightDimensions}, + input: {dataType: 'uint32', shape: kValidInputShape}, + weight: {dataType: 'uint32', shape: kValidWeightShape}, + recurrentWeight: {dataType: 'uint32', shape: kValidRecurrentWeightShape}, steps: steps, hiddenSize: hiddenSize }, { name: '[lstm] TypeError is expected if the rank of input is not 3', - input: {dataType: 'float32', dimensions: [steps, batchSize]}, + input: {dataType: 'float32', shape: [steps, batchSize]}, weight: kExampleWeightDescriptor, recurrentWeight: kExampleRecurrentWeightDescriptor, steps: steps, @@ -159,8 +149,8 @@ const tests = [ }, { name: - '[lstm] TypeError is expected if input.dimensions[0] is not equal to steps', - input: {dataType: 'float32', dimensions: [1000, batchSize, inputSize]}, + '[lstm] TypeError is expected if input.shape[0] is not equal to steps', + input: {dataType: 'float32', shape: [1000, batchSize, inputSize]}, weight: kExampleWeightDescriptor, recurrentWeight: kExampleRecurrentWeightDescriptor, steps: steps, @@ -169,10 +159,7 @@ const tests = [ { name: '[lstm] TypeError is expected if the shape of weight is incorrect', input: kExampleInputDescriptor, - weight: { - dataType: 'float32', - dimensions: [numDirections, 4 * hiddenSize, 1000] - }, + weight: {dataType: 'float32', shape: [numDirections, 4 * hiddenSize, 1000]}, recurrentWeight: kExampleRecurrentWeightDescriptor, steps: steps, hiddenSize: hiddenSize @@ -183,7 +170,7 @@ const tests = [ input: kExampleInputDescriptor, weight: kExampleWeightDescriptor, recurrentWeight: - {dataType: 'float32', dimensions: [numDirections, 4 * hiddenSize]}, + {dataType: 'float32', shape: [numDirections, 4 * hiddenSize]}, steps: steps, hiddenSize: hiddenSize }, @@ -199,55 +186,48 @@ const tests = [ }, { name: '[lstm] TypeError is expected if the rank of options.bias is not 2', - input: {dataType: 'float16', dimensions: kValidInputDimensions}, - weight: {dataType: 'float16', dimensions: kValidWeightDimensions}, - recurrentWeight: - {dataType: 'float16', dimensions: kValidRecurrentWeightDimensions}, + input: {dataType: 'float16', shape: kValidInputShape}, + weight: {dataType: 'float16', shape: kValidWeightShape}, + recurrentWeight: {dataType: 'float16', shape: kValidRecurrentWeightShape}, steps: steps, hiddenSize: hiddenSize, - options: {bias: {dataType: 'float16', dimensions: [numDirections]}} + options: {bias: {dataType: 'float16', shape: [numDirections]}} }, { name: - '[lstm] TypeError is expected if the shape of options.recurrentBias.dimensions is incorrect', - input: {dataType: 'float16', dimensions: kValidInputDimensions}, - weight: {dataType: 'float16', dimensions: kValidWeightDimensions}, - recurrentWeight: - {dataType: 'float16', dimensions: kValidRecurrentWeightDimensions}, + '[lstm] TypeError is expected if the shape of options.recurrentBias.shape is incorrect', + input: {dataType: 'float16', shape: kValidInputShape}, + weight: {dataType: 'float16', shape: kValidWeightShape}, + recurrentWeight: {dataType: 'float16', shape: kValidRecurrentWeightShape}, steps: steps, hiddenSize: hiddenSize, - options: { - recurrentBias: {dataType: 'float16', dimensions: [numDirections, 1000]} - } + options: + {recurrentBias: {dataType: 'float16', shape: [numDirections, 1000]}} }, { name: '[lstm] TypeError is expected if the dataType of options.peepholeWeight is incorrect', - input: {dataType: 'float16', dimensions: kValidInputDimensions}, - weight: {dataType: 'float16', dimensions: kValidWeightDimensions}, - recurrentWeight: - {dataType: 'float16', dimensions: kValidRecurrentWeightDimensions}, + input: {dataType: 'float16', shape: kValidInputShape}, + weight: {dataType: 'float16', shape: kValidWeightShape}, + recurrentWeight: {dataType: 'float16', shape: kValidRecurrentWeightShape}, steps: steps, hiddenSize: hiddenSize, options: { peepholeWeight: - {dataType: 'float32', dimensions: [numDirections, 3 * hiddenSize]} + {dataType: 'float32', shape: [numDirections, 3 * hiddenSize]} } }, { name: '[lstm] TypeError is expected if the dataType of options.initialHiddenState is incorrect', - input: {dataType: 'float16', dimensions: kValidInputDimensions}, - weight: {dataType: 'float16', dimensions: kValidWeightDimensions}, - recurrentWeight: - {dataType: 'float16', dimensions: kValidRecurrentWeightDimensions}, + input: {dataType: 'float16', shape: kValidInputShape}, + weight: {dataType: 'float16', shape: kValidWeightShape}, + recurrentWeight: {dataType: 'float16', shape: kValidRecurrentWeightShape}, steps: steps, hiddenSize: hiddenSize, options: { - initialHiddenState: { - dataType: 'uint64', - dimensions: [numDirections, batchSize, hiddenSize] - } + initialHiddenState: + {dataType: 'uint64', shape: [numDirections, batchSize, hiddenSize]} } }, { @@ -260,7 +240,7 @@ const tests = [ hiddenSize: hiddenSize, options: { initialCellState: - {dataType: 'float32', dimensions: [numDirections, batchSize, 1000]} + {dataType: 'float32', shape: [numDirections, batchSize, 1000]} } } ]; @@ -268,48 +248,31 @@ const tests = [ tests.forEach( test => promise_test(async t => { const builder = new MLGraphBuilder(context); - const input = builder.input( - 'input', - {dataType: test.input.dataType, dimensions: test.input.dimensions}); - const weight = builder.input( - 'weight', - {dataType: test.weight.dataType, dimensions: test.weight.dimensions}); - const recurrentWeight = builder.input('recurrentWeight', { - dataType: test.recurrentWeight.dataType, - dimensions: test.recurrentWeight.dimensions - }); + const input = builder.input('input', test.input); + const weight = builder.input('weight', test.weight); + const recurrentWeight = + builder.input('recurrentWeight', test.recurrentWeight); const options = {}; if (test.options) { if (test.options.bias) { - options.bias = builder.input('bias', { - dataType: test.options.bias.dataType, - dimensions: test.options.bias.dimensions - }); + options.bias = builder.input('bias', test.options.bias); } if (test.options.recurrentBias) { - options.recurrentBias = builder.input('recurrentBias', { - dataType: test.options.recurrentBias.dataType, - dimensions: test.options.recurrentBias.dimensions - }); + options.recurrentBias = + builder.input('recurrentBias', test.options.recurrentBias); } if (test.options.peepholeWeight) { - options.peepholeWeight = builder.input('peepholeWeight', { - dataType: test.options.peepholeWeight.dataType, - dimensions: test.options.peepholeWeight.dimensions - }); + options.peepholeWeight = + builder.input('peepholeWeight', test.options.peepholeWeight); } if (test.options.initialHiddenState) { - options.initialHiddenState = builder.input('initialHiddenState', { - dataType: test.options.initialHiddenState.dataType, - dimensions: test.options.initialHiddenState.dimensions - }); + options.initialHiddenState = builder.input( + 'initialHiddenState', test.options.initialHiddenState); } if (test.options.initialCellState) { - options.initialCellState = builder.input('initialCellState', { - dataType: test.options.initialCellState.dataType, - dimensions: test.options.initialCellState.dimensions - }); + options.initialCellState = + builder.input('initialCellState', test.options.initialCellState); } if (test.options.returnSequence) { options.returnSequence = test.options.returnSequence; @@ -334,7 +297,7 @@ tests.forEach( assert_equals(outputs.length, test.outputs.length); for (let i = 0; i < outputs.length; ++i) { assert_equals(outputs[i].dataType(), test.outputs[i].dataType); - assert_array_equals(outputs[i].shape(), test.outputs[i].dimensions); + assert_array_equals(outputs[i].shape(), test.outputs[i].shape); } } else { const label = 'lstm_xxx'; diff --git a/testing/web-platform/tests/webnn/validation_tests/lstmCell.https.any.js b/testing/web-platform/tests/webnn/validation_tests/lstmCell.https.any.js index 59f81fa319ae..a739761d56ea 100644 --- a/testing/web-platform/tests/webnn/validation_tests/lstmCell.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/lstmCell.https.any.js @@ -10,43 +10,43 @@ const batchSize = 3, inputSize = 4, hiddenSize = 5; // Dimensions required of required inputs. -const kValidInputDimensions = [batchSize, inputSize]; -const kValidWeightDimensions = [4 * hiddenSize, inputSize]; -const kValidRecurrentWeightDimensions = [4 * hiddenSize, hiddenSize]; -const kValidHiddenStateDimensions = [batchSize, hiddenSize]; -const kValidCellStateDimensions = [batchSize, hiddenSize]; +const kValidInputShape = [batchSize, inputSize]; +const kValidWeightShape = [4 * hiddenSize, inputSize]; +const kValidRecurrentWeightShape = [4 * hiddenSize, hiddenSize]; +const kValidHiddenStateShape = [batchSize, hiddenSize]; +const kValidCellStateShape = [batchSize, hiddenSize]; // Dimensions required of optional inputs. -const kValidBiasDimensions = [4 * hiddenSize]; -const kValidPeepholeWeightDimensions = [3 * hiddenSize]; +const kValidBiasShape = [4 * hiddenSize]; +const kValidPeepholeWeightShape = [3 * hiddenSize]; // Example descriptors which are valid according to the above dimensions. const kExampleInputDescriptor = { dataType: 'float32', - dimensions: kValidInputDimensions + shape: kValidInputShape }; const kExampleWeightDescriptor = { dataType: 'float32', - dimensions: kValidWeightDimensions + shape: kValidWeightShape }; const kExampleRecurrentWeightDescriptor = { dataType: 'float32', - dimensions: kValidRecurrentWeightDimensions + shape: kValidRecurrentWeightShape }; const kExampleHiddenStateDescriptor = { dataType: 'float32', - dimensions: kValidHiddenStateDimensions + shape: kValidHiddenStateShape }; const kExampleCellStateDescriptor = { dataType: 'float32', - dimensions: kValidCellStateDimensions + shape: kValidCellStateShape }; const kExampleBiasDescriptor = { dataType: 'float32', - dimensions: kValidBiasDimensions + shape: kValidBiasShape }; const kExamplePeepholeWeightDescriptor = { dataType: 'float32', - dimensions: kValidPeepholeWeightDimensions + shape: kValidPeepholeWeightShape }; multi_builder_test(async (t, builder, otherBuilder) => { @@ -192,323 +192,293 @@ multi_builder_test(async (t, builder, otherBuilder) => { const tests = [ { name: '[lstmCell] Test with default options', - input: {dataType: 'float16', dimensions: [batchSize, inputSize]}, - weight: {dataType: 'float16', dimensions: [4 * hiddenSize, inputSize]}, - recurrentWeight: - {dataType: 'float16', dimensions: [4 * hiddenSize, hiddenSize]}, - hiddenState: {dataType: 'float16', dimensions: [batchSize, hiddenSize]}, - cellState: {dataType: 'float16', dimensions: [batchSize, hiddenSize]}, + input: {dataType: 'float16', shape: [batchSize, inputSize]}, + weight: {dataType: 'float16', shape: [4 * hiddenSize, inputSize]}, + recurrentWeight: {dataType: 'float16', shape: [4 * hiddenSize, hiddenSize]}, + hiddenState: {dataType: 'float16', shape: [batchSize, hiddenSize]}, + cellState: {dataType: 'float16', shape: [batchSize, hiddenSize]}, hiddenSize: hiddenSize, outputs: [ - {dataType: 'float16', dimensions: [batchSize, hiddenSize]}, - {dataType: 'float16', dimensions: [batchSize, hiddenSize]} + {dataType: 'float16', shape: [batchSize, hiddenSize]}, + {dataType: 'float16', shape: [batchSize, hiddenSize]} ] }, { name: '[lstmCell] Test with given options', - input: {dataType: 'float32', dimensions: [batchSize, inputSize]}, - weight: {dataType: 'float32', dimensions: [4 * hiddenSize, inputSize]}, - recurrentWeight: - {dataType: 'float32', dimensions: [4 * hiddenSize, hiddenSize]}, - hiddenState: {dataType: 'float32', dimensions: [batchSize, hiddenSize]}, - cellState: {dataType: 'float32', dimensions: [batchSize, hiddenSize]}, + input: {dataType: 'float32', shape: [batchSize, inputSize]}, + weight: {dataType: 'float32', shape: [4 * hiddenSize, inputSize]}, + recurrentWeight: {dataType: 'float32', shape: [4 * hiddenSize, hiddenSize]}, + hiddenState: {dataType: 'float32', shape: [batchSize, hiddenSize]}, + cellState: {dataType: 'float32', shape: [batchSize, hiddenSize]}, hiddenSize: hiddenSize, options: { - bias: {dataType: 'float32', dimensions: [4 * hiddenSize]}, - recurrentBias: {dataType: 'float32', dimensions: [4 * hiddenSize]}, - peepholeWeight: {dataType: 'float32', dimensions: [3 * hiddenSize]}, + bias: {dataType: 'float32', shape: [4 * hiddenSize]}, + recurrentBias: {dataType: 'float32', shape: [4 * hiddenSize]}, + peepholeWeight: {dataType: 'float32', shape: [3 * hiddenSize]}, layout: 'ifgo', activations: ['sigmoid', 'relu', 'tanh'] }, outputs: [ - {dataType: 'float32', dimensions: [batchSize, hiddenSize]}, - {dataType: 'float32', dimensions: [batchSize, hiddenSize]} + {dataType: 'float32', shape: [batchSize, hiddenSize]}, + {dataType: 'float32', shape: [batchSize, hiddenSize]} ] }, { name: '[lstmCell] Throw if hiddenSize is equal to zero', - input: {dataType: 'float32', dimensions: [batchSize, inputSize]}, - weight: {dataType: 'float32', dimensions: [4 * hiddenSize, inputSize]}, - recurrentWeight: - {dataType: 'float32', dimensions: [4 * hiddenSize, hiddenSize]}, - hiddenState: {dataType: 'float32', dimensions: [batchSize, hiddenSize]}, - cellState: {dataType: 'float32', dimensions: [batchSize, hiddenSize]}, + input: {dataType: 'float32', shape: [batchSize, inputSize]}, + weight: {dataType: 'float32', shape: [4 * hiddenSize, inputSize]}, + recurrentWeight: {dataType: 'float32', shape: [4 * hiddenSize, hiddenSize]}, + hiddenState: {dataType: 'float32', shape: [batchSize, hiddenSize]}, + cellState: {dataType: 'float32', shape: [batchSize, hiddenSize]}, hiddenSize: 0 }, { name: '[lstmCell] Throw if hiddenSize is too large', - input: {dataType: 'float32', dimensions: [batchSize, inputSize]}, - weight: {dataType: 'float32', dimensions: [4 * hiddenSize, inputSize]}, - recurrentWeight: - {dataType: 'float32', dimensions: [4 * hiddenSize, hiddenSize]}, - hiddenState: {dataType: 'float32', dimensions: [batchSize, hiddenSize]}, - cellState: {dataType: 'float32', dimensions: [batchSize, hiddenSize]}, + input: {dataType: 'float32', shape: [batchSize, inputSize]}, + weight: {dataType: 'float32', shape: [4 * hiddenSize, inputSize]}, + recurrentWeight: {dataType: 'float32', shape: [4 * hiddenSize, hiddenSize]}, + hiddenState: {dataType: 'float32', shape: [batchSize, hiddenSize]}, + cellState: {dataType: 'float32', shape: [batchSize, hiddenSize]}, hiddenSize: 4294967295 }, { name: '[lstmCell] Throw if the input data type is not one of the floating point types', - input: {dataType: 'uint32', dimensions: [batchSize, inputSize]}, - weight: {dataType: 'float32', dimensions: [4 * hiddenSize, inputSize]}, - recurrentWeight: - {dataType: 'float32', dimensions: [4 * hiddenSize, hiddenSize]}, - hiddenState: {dataType: 'float32', dimensions: [batchSize, hiddenSize]}, - cellState: {dataType: 'float32', dimensions: [batchSize, hiddenSize]}, + input: {dataType: 'uint32', shape: [batchSize, inputSize]}, + weight: {dataType: 'float32', shape: [4 * hiddenSize, inputSize]}, + recurrentWeight: {dataType: 'float32', shape: [4 * hiddenSize, hiddenSize]}, + hiddenState: {dataType: 'float32', shape: [batchSize, hiddenSize]}, + cellState: {dataType: 'float32', shape: [batchSize, hiddenSize]}, hiddenSize: hiddenSize }, { name: '[lstmCell] Throw if the rank of input is not 2', - input: {dataType: 'float32', dimensions: [batchSize]}, - weight: {dataType: 'float32', dimensions: [4 * hiddenSize, inputSize]}, - recurrentWeight: - {dataType: 'float32', dimensions: [4 * hiddenSize, hiddenSize]}, - hiddenState: {dataType: 'float32', dimensions: [batchSize, hiddenSize]}, - cellState: {dataType: 'float32', dimensions: [batchSize, hiddenSize]}, + input: {dataType: 'float32', shape: [batchSize]}, + weight: {dataType: 'float32', shape: [4 * hiddenSize, inputSize]}, + recurrentWeight: {dataType: 'float32', shape: [4 * hiddenSize, hiddenSize]}, + hiddenState: {dataType: 'float32', shape: [batchSize, hiddenSize]}, + cellState: {dataType: 'float32', shape: [batchSize, hiddenSize]}, hiddenSize: hiddenSize }, { name: '[lstmCell] Throw if the shape of input is incorrect', - input: {dataType: 'float32', dimensions: [batchSize, 1000]}, - weight: {dataType: 'float32', dimensions: [4 * hiddenSize, inputSize]}, - recurrentWeight: - {dataType: 'float32', dimensions: [4 * hiddenSize, hiddenSize]}, - hiddenState: {dataType: 'float32', dimensions: [batchSize, hiddenSize]}, - cellState: {dataType: 'float32', dimensions: [batchSize, hiddenSize]}, + input: {dataType: 'float32', shape: [batchSize, 1000]}, + weight: {dataType: 'float32', shape: [4 * hiddenSize, inputSize]}, + recurrentWeight: {dataType: 'float32', shape: [4 * hiddenSize, hiddenSize]}, + hiddenState: {dataType: 'float32', shape: [batchSize, hiddenSize]}, + cellState: {dataType: 'float32', shape: [batchSize, hiddenSize]}, hiddenSize: hiddenSize }, { name: '[lstmCell] Throw if the data type of weight is incorrect', - input: {dataType: 'float32', dimensions: [batchSize, inputSize]}, - weight: {dataType: 'float16', dimensions: [4 * hiddenSize, inputSize]}, - recurrentWeight: - {dataType: 'float32', dimensions: [4 * hiddenSize, hiddenSize]}, - hiddenState: {dataType: 'float32', dimensions: [batchSize, hiddenSize]}, - cellState: {dataType: 'float32', dimensions: [batchSize, hiddenSize]}, + input: {dataType: 'float32', shape: [batchSize, inputSize]}, + weight: {dataType: 'float16', shape: [4 * hiddenSize, inputSize]}, + recurrentWeight: {dataType: 'float32', shape: [4 * hiddenSize, hiddenSize]}, + hiddenState: {dataType: 'float32', shape: [batchSize, hiddenSize]}, + cellState: {dataType: 'float32', shape: [batchSize, hiddenSize]}, hiddenSize: hiddenSize }, { name: '[lstmCell] Throw if the rank of weight is not 2', - input: {dataType: 'float32', dimensions: [batchSize, inputSize]}, - weight: - {dataType: 'float32', dimensions: [4 * hiddenSize, inputSize, 1000]}, - recurrentWeight: - {dataType: 'float32', dimensions: [4 * hiddenSize, hiddenSize]}, - hiddenState: {dataType: 'float32', dimensions: [batchSize, hiddenSize]}, - cellState: {dataType: 'float32', dimensions: [batchSize, hiddenSize]}, + input: {dataType: 'float32', shape: [batchSize, inputSize]}, + weight: {dataType: 'float32', shape: [4 * hiddenSize, inputSize, 1000]}, + recurrentWeight: {dataType: 'float32', shape: [4 * hiddenSize, hiddenSize]}, + hiddenState: {dataType: 'float32', shape: [batchSize, hiddenSize]}, + cellState: {dataType: 'float32', shape: [batchSize, hiddenSize]}, hiddenSize: hiddenSize }, { name: '[lstmCell] Throw if the shape of weight is incorrect', - input: {dataType: 'float32', dimensions: [batchSize, inputSize]}, - weight: {dataType: 'float32', dimensions: [1000, inputSize]}, - recurrentWeight: - {dataType: 'float32', dimensions: [4 * hiddenSize, hiddenSize]}, - hiddenState: {dataType: 'float32', dimensions: [batchSize, hiddenSize]}, - cellState: {dataType: 'float32', dimensions: [batchSize, hiddenSize]}, + input: {dataType: 'float32', shape: [batchSize, inputSize]}, + weight: {dataType: 'float32', shape: [1000, inputSize]}, + recurrentWeight: {dataType: 'float32', shape: [4 * hiddenSize, hiddenSize]}, + hiddenState: {dataType: 'float32', shape: [batchSize, hiddenSize]}, + cellState: {dataType: 'float32', shape: [batchSize, hiddenSize]}, hiddenSize: hiddenSize }, { name: '[lstmCell] Throw if the data type of recurrentWeight is incorrect', - input: {dataType: 'float32', dimensions: [batchSize, inputSize]}, - weight: {dataType: 'float32', dimensions: [4 * hiddenSize, inputSize]}, - recurrentWeight: - {dataType: 'float16', dimensions: [4 * hiddenSize, hiddenSize]}, - hiddenState: {dataType: 'float32', dimensions: [batchSize, hiddenSize]}, - cellState: {dataType: 'float32', dimensions: [batchSize, hiddenSize]}, + input: {dataType: 'float32', shape: [batchSize, inputSize]}, + weight: {dataType: 'float32', shape: [4 * hiddenSize, inputSize]}, + recurrentWeight: {dataType: 'float16', shape: [4 * hiddenSize, hiddenSize]}, + hiddenState: {dataType: 'float32', shape: [batchSize, hiddenSize]}, + cellState: {dataType: 'float32', shape: [batchSize, hiddenSize]}, hiddenSize: hiddenSize }, { name: '[lstmCell] Throw if the rank of recurrentWeight is not 2', - input: {dataType: 'float32', dimensions: [batchSize, inputSize]}, - weight: {dataType: 'float32', dimensions: [4 * hiddenSize, inputSize]}, + input: {dataType: 'float32', shape: [batchSize, inputSize]}, + weight: {dataType: 'float32', shape: [4 * hiddenSize, inputSize]}, recurrentWeight: - {dataType: 'float32', dimensions: [1000, 4 * hiddenSize, hiddenSize]}, - hiddenState: {dataType: 'float32', dimensions: [batchSize, hiddenSize]}, - cellState: {dataType: 'float32', dimensions: [batchSize, hiddenSize]}, + {dataType: 'float32', shape: [1000, 4 * hiddenSize, hiddenSize]}, + hiddenState: {dataType: 'float32', shape: [batchSize, hiddenSize]}, + cellState: {dataType: 'float32', shape: [batchSize, hiddenSize]}, hiddenSize: hiddenSize }, { name: '[lstmCell] Throw if the shape of recurrentWeight is incorrect', - input: {dataType: 'float32', dimensions: [batchSize, inputSize]}, - weight: {dataType: 'float32', dimensions: [4 * hiddenSize, inputSize]}, - recurrentWeight: {dataType: 'float32', dimensions: [1000, hiddenSize]}, - hiddenState: {dataType: 'float32', dimensions: [batchSize, hiddenSize]}, - cellState: {dataType: 'float32', dimensions: [batchSize, hiddenSize]}, + input: {dataType: 'float32', shape: [batchSize, inputSize]}, + weight: {dataType: 'float32', shape: [4 * hiddenSize, inputSize]}, + recurrentWeight: {dataType: 'float32', shape: [1000, hiddenSize]}, + hiddenState: {dataType: 'float32', shape: [batchSize, hiddenSize]}, + cellState: {dataType: 'float32', shape: [batchSize, hiddenSize]}, hiddenSize: hiddenSize }, { name: '[lstmCell] Throw if the data type of hiddenState is incorrect', - input: {dataType: 'float16', dimensions: [batchSize, inputSize]}, - weight: {dataType: 'float16', dimensions: [4 * hiddenSize, inputSize]}, - recurrentWeight: - {dataType: 'float16', dimensions: [4 * hiddenSize, hiddenSize]}, - hiddenState: {dataType: 'int64', dimensions: [batchSize, hiddenSize]}, - cellState: {dataType: 'float16', dimensions: [batchSize, hiddenSize]}, + input: {dataType: 'float16', shape: [batchSize, inputSize]}, + weight: {dataType: 'float16', shape: [4 * hiddenSize, inputSize]}, + recurrentWeight: {dataType: 'float16', shape: [4 * hiddenSize, hiddenSize]}, + hiddenState: {dataType: 'int64', shape: [batchSize, hiddenSize]}, + cellState: {dataType: 'float16', shape: [batchSize, hiddenSize]}, hiddenSize: hiddenSize }, { name: '[lstmCell] Throw if the rank of hiddenState is not 2', - input: {dataType: 'float32', dimensions: [batchSize, inputSize]}, - weight: {dataType: 'float32', dimensions: [4 * hiddenSize, inputSize]}, - recurrentWeight: - {dataType: 'float32', dimensions: [4 * hiddenSize, hiddenSize]}, - hiddenState: {dataType: 'float32', dimensions: [batchSize]}, - cellState: {dataType: 'float32', dimensions: [batchSize, hiddenSize]}, + input: {dataType: 'float32', shape: [batchSize, inputSize]}, + weight: {dataType: 'float32', shape: [4 * hiddenSize, inputSize]}, + recurrentWeight: {dataType: 'float32', shape: [4 * hiddenSize, hiddenSize]}, + hiddenState: {dataType: 'float32', shape: [batchSize]}, + cellState: {dataType: 'float32', shape: [batchSize, hiddenSize]}, hiddenSize: hiddenSize }, { name: '[lstmCell] Throw if the shape of hiddenState is incorrect', - input: {dataType: 'float32', dimensions: [batchSize, inputSize]}, - weight: {dataType: 'float32', dimensions: [4 * hiddenSize, inputSize]}, - recurrentWeight: - {dataType: 'float32', dimensions: [4 * hiddenSize, hiddenSize]}, - hiddenState: {dataType: 'float32', dimensions: [batchSize, 1000]}, - cellState: {dataType: 'float32', dimensions: [batchSize, hiddenSize]}, + input: {dataType: 'float32', shape: [batchSize, inputSize]}, + weight: {dataType: 'float32', shape: [4 * hiddenSize, inputSize]}, + recurrentWeight: {dataType: 'float32', shape: [4 * hiddenSize, hiddenSize]}, + hiddenState: {dataType: 'float32', shape: [batchSize, 1000]}, + cellState: {dataType: 'float32', shape: [batchSize, hiddenSize]}, hiddenSize: hiddenSize }, { name: '[lstmCell] Throw if the data type of cellState is incorrect', - input: {dataType: 'float16', dimensions: [batchSize, inputSize]}, - weight: {dataType: 'float16', dimensions: [4 * hiddenSize, inputSize]}, - recurrentWeight: - {dataType: 'float16', dimensions: [4 * hiddenSize, hiddenSize]}, - hiddenState: {dataType: 'float16', dimensions: [batchSize, hiddenSize]}, - cellState: {dataType: 'float32', dimensions: [batchSize, hiddenSize]}, + input: {dataType: 'float16', shape: [batchSize, inputSize]}, + weight: {dataType: 'float16', shape: [4 * hiddenSize, inputSize]}, + recurrentWeight: {dataType: 'float16', shape: [4 * hiddenSize, hiddenSize]}, + hiddenState: {dataType: 'float16', shape: [batchSize, hiddenSize]}, + cellState: {dataType: 'float32', shape: [batchSize, hiddenSize]}, hiddenSize: hiddenSize }, { name: '[lstmCell] Throw if the rank of cellState is not 2', - input: {dataType: 'float32', dimensions: [batchSize, inputSize]}, - weight: {dataType: 'float32', dimensions: [4 * hiddenSize, inputSize]}, - recurrentWeight: - {dataType: 'float32', dimensions: [4 * hiddenSize, hiddenSize]}, - hiddenState: {dataType: 'float32', dimensions: [batchSize, hiddenSize]}, - cellState: {dataType: 'float32', dimensions: [batchSize]}, + input: {dataType: 'float32', shape: [batchSize, inputSize]}, + weight: {dataType: 'float32', shape: [4 * hiddenSize, inputSize]}, + recurrentWeight: {dataType: 'float32', shape: [4 * hiddenSize, hiddenSize]}, + hiddenState: {dataType: 'float32', shape: [batchSize, hiddenSize]}, + cellState: {dataType: 'float32', shape: [batchSize]}, hiddenSize: hiddenSize }, { name: '[lstmCell] Throw if the shape of cellState is incorrect', - input: {dataType: 'float16', dimensions: [batchSize, inputSize]}, - weight: {dataType: 'float16', dimensions: [4 * hiddenSize, inputSize]}, - recurrentWeight: - {dataType: 'float16', dimensions: [4 * hiddenSize, hiddenSize]}, - hiddenState: {dataType: 'float16', dimensions: [batchSize, hiddenSize]}, - cellState: {dataType: 'float16', dimensions: [batchSize, 1000]}, + input: {dataType: 'float16', shape: [batchSize, inputSize]}, + weight: {dataType: 'float16', shape: [4 * hiddenSize, inputSize]}, + recurrentWeight: {dataType: 'float16', shape: [4 * hiddenSize, hiddenSize]}, + hiddenState: {dataType: 'float16', shape: [batchSize, hiddenSize]}, + cellState: {dataType: 'float16', shape: [batchSize, 1000]}, hiddenSize: hiddenSize }, { name: '[lstmCell] Throw if the data type of options.bias is incorrect', - input: {dataType: 'float16', dimensions: [batchSize, inputSize]}, - weight: {dataType: 'float16', dimensions: [4 * hiddenSize, inputSize]}, - recurrentWeight: - {dataType: 'float16', dimensions: [4 * hiddenSize, hiddenSize]}, - hiddenState: {dataType: 'float16', dimensions: [batchSize, hiddenSize]}, - cellState: {dataType: 'float16', dimensions: [batchSize, hiddenSize]}, + input: {dataType: 'float16', shape: [batchSize, inputSize]}, + weight: {dataType: 'float16', shape: [4 * hiddenSize, inputSize]}, + recurrentWeight: {dataType: 'float16', shape: [4 * hiddenSize, hiddenSize]}, + hiddenState: {dataType: 'float16', shape: [batchSize, hiddenSize]}, + cellState: {dataType: 'float16', shape: [batchSize, hiddenSize]}, hiddenSize: hiddenSize, - options: {bias: {dataType: 'int8', dimensions: [4 * hiddenSize]}} + options: {bias: {dataType: 'int8', shape: [4 * hiddenSize]}} }, { name: '[lstmCell] Throw if the rank of options.bias is not 1', - input: {dataType: 'float16', dimensions: [batchSize, inputSize]}, - weight: {dataType: 'float16', dimensions: [4 * hiddenSize, inputSize]}, - recurrentWeight: - {dataType: 'float16', dimensions: [4 * hiddenSize, hiddenSize]}, - hiddenState: {dataType: 'float16', dimensions: [batchSize, hiddenSize]}, - cellState: {dataType: 'float16', dimensions: [batchSize, hiddenSize]}, + input: {dataType: 'float16', shape: [batchSize, inputSize]}, + weight: {dataType: 'float16', shape: [4 * hiddenSize, inputSize]}, + recurrentWeight: {dataType: 'float16', shape: [4 * hiddenSize, hiddenSize]}, + hiddenState: {dataType: 'float16', shape: [batchSize, hiddenSize]}, + cellState: {dataType: 'float16', shape: [batchSize, hiddenSize]}, hiddenSize: hiddenSize, - options: {bias: {dataType: 'float16', dimensions: [4 * hiddenSize, 1000]}} + options: {bias: {dataType: 'float16', shape: [4 * hiddenSize, 1000]}} }, { name: '[lstmCell] Throw if the shape of options.bias is incorrect', - input: {dataType: 'float16', dimensions: [batchSize, inputSize]}, - weight: {dataType: 'float16', dimensions: [4 * hiddenSize, inputSize]}, - recurrentWeight: - {dataType: 'float16', dimensions: [4 * hiddenSize, hiddenSize]}, - hiddenState: {dataType: 'float16', dimensions: [batchSize, hiddenSize]}, - cellState: {dataType: 'float16', dimensions: [batchSize, hiddenSize]}, + input: {dataType: 'float16', shape: [batchSize, inputSize]}, + weight: {dataType: 'float16', shape: [4 * hiddenSize, inputSize]}, + recurrentWeight: {dataType: 'float16', shape: [4 * hiddenSize, hiddenSize]}, + hiddenState: {dataType: 'float16', shape: [batchSize, hiddenSize]}, + cellState: {dataType: 'float16', shape: [batchSize, hiddenSize]}, hiddenSize: hiddenSize, - options: {bias: {dataType: 'float16', dimensions: [1000]}} + options: {bias: {dataType: 'float16', shape: [1000]}} }, { name: '[lstmCell] Throw if the data type of options.recurrentBias is incorrect', - input: {dataType: 'float16', dimensions: [batchSize, inputSize]}, - weight: {dataType: 'float16', dimensions: [4 * hiddenSize, inputSize]}, - recurrentWeight: - {dataType: 'float16', dimensions: [4 * hiddenSize, hiddenSize]}, - hiddenState: {dataType: 'float16', dimensions: [batchSize, hiddenSize]}, - cellState: {dataType: 'float16', dimensions: [batchSize, hiddenSize]}, + input: {dataType: 'float16', shape: [batchSize, inputSize]}, + weight: {dataType: 'float16', shape: [4 * hiddenSize, inputSize]}, + recurrentWeight: {dataType: 'float16', shape: [4 * hiddenSize, hiddenSize]}, + hiddenState: {dataType: 'float16', shape: [batchSize, hiddenSize]}, + cellState: {dataType: 'float16', shape: [batchSize, hiddenSize]}, hiddenSize: hiddenSize, - options: {recurrentBias: {dataType: 'uint8', dimensions: [4 * hiddenSize]}} + options: {recurrentBias: {dataType: 'uint8', shape: [4 * hiddenSize]}} }, { name: '[lstmCell] Throw if the rank of options.recurrentBias is not 1', - input: {dataType: 'float16', dimensions: [batchSize, inputSize]}, - weight: {dataType: 'float16', dimensions: [4 * hiddenSize, inputSize]}, - recurrentWeight: - {dataType: 'float16', dimensions: [4 * hiddenSize, hiddenSize]}, - hiddenState: {dataType: 'float16', dimensions: [batchSize, hiddenSize]}, - cellState: {dataType: 'float16', dimensions: [batchSize, hiddenSize]}, + input: {dataType: 'float16', shape: [batchSize, inputSize]}, + weight: {dataType: 'float16', shape: [4 * hiddenSize, inputSize]}, + recurrentWeight: {dataType: 'float16', shape: [4 * hiddenSize, hiddenSize]}, + hiddenState: {dataType: 'float16', shape: [batchSize, hiddenSize]}, + cellState: {dataType: 'float16', shape: [batchSize, hiddenSize]}, hiddenSize: hiddenSize, - options: { - recurrentBias: {dataType: 'float16', dimensions: [4 * hiddenSize, 1000]} - } + options: + {recurrentBias: {dataType: 'float16', shape: [4 * hiddenSize, 1000]}} }, { name: '[lstmCell] Throw if the shape of options.recurrentBias is incorrect', - input: {dataType: 'float16', dimensions: [batchSize, inputSize]}, - weight: {dataType: 'float16', dimensions: [4 * hiddenSize, inputSize]}, - recurrentWeight: - {dataType: 'float16', dimensions: [4 * hiddenSize, hiddenSize]}, - hiddenState: {dataType: 'float16', dimensions: [batchSize, hiddenSize]}, - cellState: {dataType: 'float16', dimensions: [batchSize, hiddenSize]}, + input: {dataType: 'float16', shape: [batchSize, inputSize]}, + weight: {dataType: 'float16', shape: [4 * hiddenSize, inputSize]}, + recurrentWeight: {dataType: 'float16', shape: [4 * hiddenSize, hiddenSize]}, + hiddenState: {dataType: 'float16', shape: [batchSize, hiddenSize]}, + cellState: {dataType: 'float16', shape: [batchSize, hiddenSize]}, hiddenSize: hiddenSize, - options: {recurrentBias: {dataType: 'float16', dimensions: [1000]}} + options: {recurrentBias: {dataType: 'float16', shape: [1000]}} }, { name: '[lstmCell] Throw if the data type of options.peepholeWeight is incorrect', - input: {dataType: 'float16', dimensions: [batchSize, inputSize]}, - weight: {dataType: 'float16', dimensions: [4 * hiddenSize, inputSize]}, - recurrentWeight: - {dataType: 'float16', dimensions: [4 * hiddenSize, hiddenSize]}, - hiddenState: {dataType: 'float16', dimensions: [batchSize, hiddenSize]}, - cellState: {dataType: 'float16', dimensions: [batchSize, hiddenSize]}, + input: {dataType: 'float16', shape: [batchSize, inputSize]}, + weight: {dataType: 'float16', shape: [4 * hiddenSize, inputSize]}, + recurrentWeight: {dataType: 'float16', shape: [4 * hiddenSize, hiddenSize]}, + hiddenState: {dataType: 'float16', shape: [batchSize, hiddenSize]}, + cellState: {dataType: 'float16', shape: [batchSize, hiddenSize]}, hiddenSize: hiddenSize, - options: - {peepholeWeight: {dataType: 'float32', dimensions: [3 * hiddenSize]}} + options: {peepholeWeight: {dataType: 'float32', shape: [3 * hiddenSize]}} }, { name: '[lstmCell] Throw if the rank of options.peepholeWeight is not 1', - input: {dataType: 'float16', dimensions: [batchSize, inputSize]}, - weight: {dataType: 'float16', dimensions: [4 * hiddenSize, inputSize]}, - recurrentWeight: - {dataType: 'float16', dimensions: [4 * hiddenSize, hiddenSize]}, - hiddenState: {dataType: 'float16', dimensions: [batchSize, hiddenSize]}, - cellState: {dataType: 'float16', dimensions: [batchSize, hiddenSize]}, + input: {dataType: 'float16', shape: [batchSize, inputSize]}, + weight: {dataType: 'float16', shape: [4 * hiddenSize, inputSize]}, + recurrentWeight: {dataType: 'float16', shape: [4 * hiddenSize, hiddenSize]}, + hiddenState: {dataType: 'float16', shape: [batchSize, hiddenSize]}, + cellState: {dataType: 'float16', shape: [batchSize, hiddenSize]}, hiddenSize: hiddenSize, - options: {peepholeWeight: {dataType: 'float16', dimensions: []}} + options: {peepholeWeight: {dataType: 'float16', shape: []}} }, { name: '[lstmCell] Throw if the shape of options.peepholeWeight is incorrect', - input: {dataType: 'float16', dimensions: [batchSize, inputSize]}, - weight: {dataType: 'float16', dimensions: [4 * hiddenSize, inputSize]}, - recurrentWeight: - {dataType: 'float16', dimensions: [4 * hiddenSize, hiddenSize]}, - hiddenState: {dataType: 'float16', dimensions: [batchSize, hiddenSize]}, - cellState: {dataType: 'float16', dimensions: [batchSize, hiddenSize]}, + input: {dataType: 'float16', shape: [batchSize, inputSize]}, + weight: {dataType: 'float16', shape: [4 * hiddenSize, inputSize]}, + recurrentWeight: {dataType: 'float16', shape: [4 * hiddenSize, hiddenSize]}, + hiddenState: {dataType: 'float16', shape: [batchSize, hiddenSize]}, + cellState: {dataType: 'float16', shape: [batchSize, hiddenSize]}, hiddenSize: hiddenSize, - options: {peepholeWeight: {dataType: 'float16', dimensions: [1000]}} + options: {peepholeWeight: {dataType: 'float16', shape: [1000]}} }, { name: '[lstmCell] Throw if the size of options.activations is not 3', - input: {dataType: 'float32', dimensions: [batchSize, inputSize]}, - weight: {dataType: 'float32', dimensions: [4 * hiddenSize, inputSize]}, - recurrentWeight: - {dataType: 'float32', dimensions: [4 * hiddenSize, hiddenSize]}, - hiddenState: {dataType: 'float32', dimensions: [batchSize, hiddenSize]}, - cellState: {dataType: 'float32', dimensions: [batchSize, hiddenSize]}, + input: {dataType: 'float32', shape: [batchSize, inputSize]}, + weight: {dataType: 'float32', shape: [4 * hiddenSize, inputSize]}, + recurrentWeight: {dataType: 'float32', shape: [4 * hiddenSize, hiddenSize]}, + hiddenState: {dataType: 'float32', shape: [batchSize, hiddenSize]}, + cellState: {dataType: 'float32', shape: [batchSize, hiddenSize]}, hiddenSize: hiddenSize, options: {activations: ['sigmoid', 'tanh', 'sigmoid', 'tanh']} } @@ -517,44 +487,25 @@ const tests = [ tests.forEach( test => promise_test(async t => { const builder = new MLGraphBuilder(context); - const input = builder.input( - 'input', - {dataType: test.input.dataType, dimensions: test.input.dimensions}); - const weight = builder.input( - 'weight', - {dataType: test.weight.dataType, dimensions: test.weight.dimensions}); - const recurrentWeight = builder.input('recurrentWeight', { - dataType: test.recurrentWeight.dataType, - dimensions: test.recurrentWeight.dimensions - }); - const hiddenState = builder.input('hiddenState', { - dataType: test.hiddenState.dataType, - dimensions: test.hiddenState.dimensions - }); - const cellState = builder.input('cellState', { - dataType: test.cellState.dataType, - dimensions: test.cellState.dimensions - }); + const input = builder.input('input', test.input); + const weight = builder.input('weight', test.weight); + const recurrentWeight = + builder.input('recurrentWeight', test.recurrentWeight); + const hiddenState = builder.input('hiddenState', test.hiddenState); + const cellState = builder.input('cellState', test.cellState); const options = {}; if (test.options) { if (test.options.bias) { - options.bias = builder.input('bias', { - dataType: test.options.bias.dataType, - dimensions: test.options.bias.dimensions - }); + options.bias = builder.input('bias', test.options.bias); } if (test.options.recurrentBias) { - options.recurrentBias = builder.input('recurrentBias', { - dataType: test.options.recurrentBias.dataType, - dimensions: test.options.recurrentBias.dimensions - }); + options.recurrentBias = + builder.input('recurrentBias', test.options.recurrentBias); } if (test.options.peepholeWeight) { - options.peepholeWeight = builder.input('peepholeWeight', { - dataType: test.options.peepholeWeight.dataType, - dimensions: test.options.peepholeWeight.dimensions - }); + options.peepholeWeight = + builder.input('peepholeWeight', test.options.peepholeWeight); } if (test.options.layout) { options.layout = test.options.layout; @@ -573,7 +524,7 @@ tests.forEach( assert_equals(outputs.length, test.outputs.length); for (let i = 0; i < outputs.length; ++i) { assert_equals(outputs[i].dataType(), test.outputs[i].dataType); - assert_array_equals(outputs[i].shape(), test.outputs[i].dimensions); + assert_array_equals(outputs[i].shape(), test.outputs[i].shape); } } else { const label = 'lstm_cell_xxx'; diff --git a/testing/web-platform/tests/webnn/validation_tests/matmul.https.any.js b/testing/web-platform/tests/webnn/validation_tests/matmul.https.any.js index 981d8f35708d..4f8a1ee59a38 100644 --- a/testing/web-platform/tests/webnn/validation_tests/matmul.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/matmul.https.any.js @@ -13,32 +13,32 @@ const tests = [ { name: '[matmul] Throw if first input\'s rank is less than 2', inputs: { - a: {dataType: 'float32', dimensions: [2]}, - b: {dataType: 'float32', dimensions: [2, 2]} + a: {dataType: 'float32', shape: [2]}, + b: {dataType: 'float32', shape: [2, 2]} } }, { name: '[matmul] Throw if second input\'s rank is less than 2', inputs: { - a: {dataType: 'float32', dimensions: [2, 2]}, - b: {dataType: 'float32', dimensions: [2]} + a: {dataType: 'float32', shape: [2, 2]}, + b: {dataType: 'float32', shape: [2]} } }, { name: '[matmul] Test with 2-D input and 4-D input', inputs: { - a: {dataType: 'float32', dimensions: [1, 4]}, - b: {dataType: 'float32', dimensions: [2, 2, 4, 2]} + a: {dataType: 'float32', shape: [1, 4]}, + b: {dataType: 'float32', shape: [2, 2, 4, 2]} }, - output: {dataType: 'float32', dimensions: [2, 2, 1, 2]} + output: {dataType: 'float32', shape: [2, 2, 1, 2]} }, { name: '[matmul] Test with 2-D input and 2-D input', inputs: { - a: {dataType: 'float32', dimensions: [4, 2]}, - b: {dataType: 'float32', dimensions: [2, 3]} + a: {dataType: 'float32', shape: [4, 2]}, + b: {dataType: 'float32', shape: [2, 3]} }, - output: {dataType: 'float32', dimensions: [4, 3]} + output: {dataType: 'float32', shape: [4, 3]} }, { // batchShape is a clone of inputShape with the spatial dimensions @@ -46,10 +46,10 @@ const tests = [ name: '[matmul] Test with 3-D input and 3-D input of broadcastable batchShape', inputs: { - a: {dataType: 'float32', dimensions: [2, 3, 4]}, - b: {dataType: 'float32', dimensions: [1, 4, 1]} + a: {dataType: 'float32', shape: [2, 3, 4]}, + b: {dataType: 'float32', shape: [1, 4, 1]} }, - output: {dataType: 'float32', dimensions: [2, 3, 1]} + output: {dataType: 'float32', shape: [2, 3, 1]} }, { // batchShape is a clone of inputShape with the spatial dimensions @@ -57,39 +57,39 @@ const tests = [ name: '[matmul] Test with 4-D input and 3-D input of broadcastable batchShape', inputs: { - a: {dataType: 'float32', dimensions: [2, 2, 3, 4]}, - b: {dataType: 'float32', dimensions: [1, 4, 5]} + a: {dataType: 'float32', shape: [2, 2, 3, 4]}, + b: {dataType: 'float32', shape: [1, 4, 5]} }, - output: {dataType: 'float32', dimensions: [2, 2, 3, 5]} + output: {dataType: 'float32', shape: [2, 2, 3, 5]} }, { name: '[matmul] Test with 3-D input and 3-D input', inputs: { - a: {dataType: 'float32', dimensions: [2, 3, 4]}, - b: {dataType: 'float32', dimensions: [2, 4, 5]} + a: {dataType: 'float32', shape: [2, 3, 4]}, + b: {dataType: 'float32', shape: [2, 4, 5]} }, - output: {dataType: 'float32', dimensions: [2, 3, 5]} + output: {dataType: 'float32', shape: [2, 3, 5]} }, { name: '[matmul] Throw if the input data type is not floating point', inputs: { - a: {dataType: 'uint32', dimensions: [2, 3, 4]}, - b: {dataType: 'uint32', dimensions: [2, 4, 5]} + a: {dataType: 'uint32', shape: [2, 3, 4]}, + b: {dataType: 'uint32', shape: [2, 4, 5]} } }, { name: '[matmul] Throw if data type of two inputs don\'t match', inputs: { - a: {dataType: 'float32', dimensions: [2, 3, 4]}, - b: {dataType: 'float16', dimensions: [2, 4, 5]} + a: {dataType: 'float32', shape: [2, 3, 4]}, + b: {dataType: 'float16', shape: [2, 4, 5]} } }, { name: '[matmul] Throw if columns of first input\'s shape doesn\'t match the rows of second input\'s shape', inputs: { - a: {dataType: 'float32', dimensions: /* [rows, columns] */[2, 3]}, - b: {dataType: 'float32', dimensions: /* [rows, columns] */[2, 4]} + a: {dataType: 'float32', shape: /* [rows, columns] */[2, 3]}, + b: {dataType: 'float32', shape: /* [rows, columns] */[2, 4]} }, }, { @@ -97,26 +97,20 @@ const tests = [ // (last 2 items) removed. name: '[matmul] Throw if batchShapes aren\'t bidirectionally broadcastable', inputs: { - a: {dataType: 'float32', dimensions: [3, 3, 4]}, - b: {dataType: 'float32', dimensions: [2, 4, 1]} + a: {dataType: 'float32', shape: [3, 3, 4]}, + b: {dataType: 'float32', shape: [2, 4, 1]} }, }, ]; tests.forEach(test => promise_test(async t => { const builder = new MLGraphBuilder(context); - const inputA = builder.input('a', { - dataType: test.inputs.a.dataType, - dimensions: test.inputs.a.dimensions - }); - const inputB = builder.input('b', { - dataType: test.inputs.b.dataType, - dimensions: test.inputs.b.dimensions - }); + const inputA = builder.input('a', test.inputs.a); + const inputB = builder.input('b', test.inputs.b); if (test.output) { const output = builder.matmul(inputA, inputB); assert_equals(output.dataType(), test.output.dataType); - assert_array_equals(output.shape(), test.output.dimensions); + assert_array_equals(output.shape(), test.output.shape); } else { const label = 'matmul_123'; const options = {label}; diff --git a/testing/web-platform/tests/webnn/validation_tests/pad.https.any.js b/testing/web-platform/tests/webnn/validation_tests/pad.https.any.js index 3f5c30b84cb8..b45f68ab0141 100644 --- a/testing/web-platform/tests/webnn/validation_tests/pad.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/pad.https.any.js @@ -9,7 +9,7 @@ multi_builder_test(async (t, builder, otherBuilder) => { const inputFromOtherBuilder = - otherBuilder.input('input', {dataType: 'float32', dimensions: [2, 2]}); + otherBuilder.input('input', {dataType: 'float32', shape: [2, 2]}); const beginningPadding = [1, 1]; const endingPadding = [1, 1]; @@ -24,18 +24,18 @@ const tests = [ { name: '[pad] Test with default options, beginningPadding=[1, 2] and endingPadding=[1, 2].', - input: {dataType: 'float32', dimensions: [2, 3]}, + input: {dataType: 'float32', shape: [2, 3]}, beginningPadding: [1, 2], endingPadding: [1, 2], options: { mode: 'constant', value: 0, }, - output: {dataType: 'float32', dimensions: [4, 7]} + output: {dataType: 'float32', shape: [4, 7]} }, { name: '[pad] Throw if building pad for scalar input.', - input: {dataType: 'float32', dimensions: []}, + input: {dataType: 'float32', shape: []}, beginningPadding: [], endingPadding: [], options: {label} @@ -43,7 +43,7 @@ const tests = [ { name: '[pad] Throw if the length of beginningPadding is not equal to the input rank.', - input: {dataType: 'float32', dimensions: [2, 3]}, + input: {dataType: 'float32', shape: [2, 3]}, beginningPadding: [1], endingPadding: [1, 2], options: { @@ -55,7 +55,7 @@ const tests = [ { name: '[pad] Throw if the length of endingPadding is not equal to the input rank.', - input: {dataType: 'float32', dimensions: [2, 3]}, + input: {dataType: 'float32', shape: [2, 3]}, beginningPadding: [1, 0], endingPadding: [1, 2, 0], options: { @@ -65,7 +65,7 @@ const tests = [ }, { name: '[pad] Throw if the padding of one dimension is too large.', - input: {dataType: 'float32', dimensions: [2, 3]}, + input: {dataType: 'float32', shape: [2, 3]}, beginningPadding: [2294967295, 0], endingPadding: [3294967295, 2], options: { @@ -78,14 +78,12 @@ const tests = [ tests.forEach( test => promise_test(async t => { const builder = new MLGraphBuilder(context); - const input = builder.input( - 'input', - {dataType: test.input.dataType, dimensions: test.input.dimensions}); + const input = builder.input('input', test.input); if (test.output) { const output = builder.pad( input, test.beginningPadding, test.endingPadding, test.options); assert_equals(output.dataType(), test.output.dataType); - assert_array_equals(output.shape(), test.output.dimensions); + assert_array_equals(output.shape(), test.output.shape); } else { const regrexp = new RegExp('\\[' + label + '\\]'); assert_throws_with_label( diff --git a/testing/web-platform/tests/webnn/validation_tests/pooling-and-reduction-keep-dims.https.any.js b/testing/web-platform/tests/webnn/validation_tests/pooling-and-reduction-keep-dims.https.any.js index 5a30aaf02be4..3beee94cd44d 100644 --- a/testing/web-platform/tests/webnn/validation_tests/pooling-and-reduction-keep-dims.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/pooling-and-reduction-keep-dims.https.any.js @@ -25,16 +25,15 @@ promise_test(async t => { const avgPool2dInputShape = [1, 7, 7, 2048]; const avgPool2dInput = builder.input( - `avgPool2dInput`, {dataType: 'float32', dimensions: avgPool2dInputShape}); + `avgPool2dInput`, {dataType: 'float32', shape: avgPool2dInputShape}); const avgPool2dOutput = builder.averagePool2d(avgPool2dInput, {layout: 'nhwc'}); const conv2dFilterShape = [1001, 1, 1, 2048]; const conv2dFilter = builder.constant( - {dataType: 'float32', dimensions: conv2dFilterShape}, + {dataType: 'float32', shape: conv2dFilterShape}, new Float32Array(sizeOfShape(conv2dFilterShape)).fill(1)); const conv2dBias = builder.constant( - {dataType: 'float32', dimensions: [1001]}, - new Float32Array(1001).fill(0.01)); + {dataType: 'float32', shape: [1001]}, new Float32Array(1001).fill(0.01)); const conv2dOutput = builder.conv2d(avgPool2dOutput, conv2dFilter, { inputLayout: 'nhwc', filterLayout: 'ohwi', @@ -70,17 +69,15 @@ promise_test(async t => { const reduceMeanInputShape = [1, 7, 7, 2048]; const reduceMeanInput = builder.input( - `reduceMeanInput`, - {dataType: 'float32', dimensions: reduceMeanInputShape}); + `reduceMeanInput`, {dataType: 'float32', shape: reduceMeanInputShape}); const reduceMeanOutput = builder.reduceMean(reduceMeanInput, {axes: [1, 2], keepDimensions: true}); const conv2dFilterShape = [1001, 1, 1, 2048]; const conv2dFilter = builder.constant( - {dataType: 'float32', dimensions: conv2dFilterShape}, + {dataType: 'float32', shape: conv2dFilterShape}, new Float32Array(sizeOfShape(conv2dFilterShape)).fill(1)); const conv2dBias = builder.constant( - {dataType: 'float32', dimensions: [1001]}, - new Float32Array(1001).fill(0.01)); + {dataType: 'float32', shape: [1001]}, new Float32Array(1001).fill(0.01)); const conv2dOutput = builder.conv2d(reduceMeanOutput, conv2dFilter, { inputLayout: 'nhwc', filterLayout: 'ohwi', diff --git a/testing/web-platform/tests/webnn/validation_tests/pooling.https.any.js b/testing/web-platform/tests/webnn/validation_tests/pooling.https.any.js index 119132cf638f..d862d807ab44 100644 --- a/testing/web-platform/tests/webnn/validation_tests/pooling.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/pooling.https.any.js @@ -11,87 +11,87 @@ const kPoolingOperators = ['averagePool2d', 'l2Pool2d', 'maxPool2d']; kPoolingOperators.forEach((operatorName) => { validateInputFromAnotherBuilder( - operatorName, {dataType: 'float32', dimensions: [2, 2, 2, 2]}); + operatorName, {dataType: 'float32', shape: [2, 2, 2, 2]}); }); const label = 'pool_2d_xxx'; const tests = [ { name: 'Test pool2d with default options.', - input: {dataType: 'float32', dimensions: [1, 3, 4, 4]}, - output: {dataType: 'float32', dimensions: [1, 3, 1, 1]} + input: {dataType: 'float32', shape: [1, 3, 4, 4]}, + output: {dataType: 'float32', shape: [1, 3, 1, 1]} }, { name: 'Test pool2d with windowDimensions', - input: {dataType: 'float16', dimensions: [1, 3, 4, 4]}, + input: {dataType: 'float16', shape: [1, 3, 4, 4]}, options: { windowDimensions: [3, 3], }, - output: {dataType: 'float16', dimensions: [1, 3, 2, 2]} + output: {dataType: 'float16', shape: [1, 3, 2, 2]} }, { name: 'Test pool2d with padding.', - input: {dataType: 'float32', dimensions: [1, 3, 5, 5]}, + input: {dataType: 'float32', shape: [1, 3, 5, 5]}, options: { windowDimensions: [5, 5], padding: [2, 2, 2, 2], }, - output: {dataType: 'float32', dimensions: [1, 3, 5, 5]} + output: {dataType: 'float32', shape: [1, 3, 5, 5]} }, { name: 'Test pool2d with strides.', - input: {dataType: 'float16', dimensions: [1, 3, 5, 5]}, + input: {dataType: 'float16', shape: [1, 3, 5, 5]}, options: { windowDimensions: [2, 2], strides: [2, 2], }, - output: {dataType: 'float16', dimensions: [1, 3, 2, 2]} + output: {dataType: 'float16', shape: [1, 3, 2, 2]} }, { name: 'Test pool2d with strides and padding.', - input: {dataType: 'float32', dimensions: [1, 3, 5, 5]}, + input: {dataType: 'float32', shape: [1, 3, 5, 5]}, options: { windowDimensions: [3, 3], padding: [1, 1, 1, 1], strides: [2, 2], }, - output: {dataType: 'float32', dimensions: [1, 3, 3, 3]} + output: {dataType: 'float32', shape: [1, 3, 3, 3]} }, { name: 'Test pool2d with strides and asymmetric padding.', - input: {dataType: 'float32', dimensions: [1, 3, 7, 7]}, + input: {dataType: 'float32', shape: [1, 3, 7, 7]}, options: { windowDimensions: [4, 4], padding: [2, 1, 2, 1], strides: [2, 2], }, - output: {dataType: 'float32', dimensions: [1, 3, 4, 4]} + output: {dataType: 'float32', shape: [1, 3, 4, 4]} }, { name: 'Test pool2d with strides, padding and roundingType="floor".', - input: {dataType: 'float32', dimensions: [1, 3, 7, 7]}, + input: {dataType: 'float32', shape: [1, 3, 7, 7]}, options: { windowDimensions: [4, 4], padding: [1, 1, 1, 1], strides: [2, 2], roundingType: 'floor', }, - output: {dataType: 'float32', dimensions: [1, 3, 3, 3]} + output: {dataType: 'float32', shape: [1, 3, 3, 3]} }, { name: 'Test pool2d with strides, padding and roundingType="ceil".', - input: {dataType: 'float16', dimensions: [1, 3, 7, 7]}, + input: {dataType: 'float16', shape: [1, 3, 7, 7]}, options: { windowDimensions: [4, 4], padding: [1, 1, 1, 1], strides: [2, 2], roundingType: 'ceil', }, - output: {dataType: 'float16', dimensions: [1, 3, 4, 4]} + output: {dataType: 'float16', shape: [1, 3, 4, 4]} }, { name: 'Test pool2d with explicit outputSizes ignored roundingType', - input: {dataType: 'float32', dimensions: [1, 3, 7, 7]}, + input: {dataType: 'float32', shape: [1, 3, 7, 7]}, options: { windowDimensions: [4, 4], padding: [1, 1, 1, 1], @@ -99,56 +99,56 @@ const tests = [ roundingType: 'ceil', outputSizes: [3, 3], }, - output: {dataType: 'float32', dimensions: [1, 3, 3, 3]} + output: {dataType: 'float32', shape: [1, 3, 3, 3]} }, { name: 'Test pool2d with strides, padding and outputSizes=[3, 3].', - input: {dataType: 'float32', dimensions: [1, 3, 7, 7]}, + input: {dataType: 'float32', shape: [1, 3, 7, 7]}, options: { windowDimensions: [4, 4], padding: [1, 1, 1, 1], strides: [2, 2], outputSizes: [3, 3], }, - output: {dataType: 'float32', dimensions: [1, 3, 3, 3]} + output: {dataType: 'float32', shape: [1, 3, 3, 3]} }, { name: 'Test pool2d with strides, padding and outputSizes=[4, 4].', - input: {dataType: 'float32', dimensions: [1, 3, 7, 7]}, + input: {dataType: 'float32', shape: [1, 3, 7, 7]}, options: { windowDimensions: [4, 4], padding: [1, 1, 1, 1], strides: [2, 2], outputSizes: [4, 4], }, - output: {dataType: 'float32', dimensions: [1, 3, 4, 4]} + output: {dataType: 'float32', shape: [1, 3, 4, 4]} }, { name: 'Test pool2d with layout="nchw".', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, options: { windowDimensions: [3, 3], layout: 'nchw', }, - output: {dataType: 'float32', dimensions: [1, 2, 3, 3]} + output: {dataType: 'float32', shape: [1, 2, 3, 3]} }, { name: 'Test pool2d with layout="nhwc".', - input: {dataType: 'float16', dimensions: [1, 5, 5, 2]}, + input: {dataType: 'float16', shape: [1, 5, 5, 2]}, options: { windowDimensions: [3, 3], layout: 'nhwc', }, - output: {dataType: 'float16', dimensions: [1, 3, 3, 2]} + output: {dataType: 'float16', shape: [1, 3, 3, 2]} }, { name: 'Throw if the input is not a 4-D tensor.', - input: {dataType: 'float32', dimensions: [1, 5, 5]}, + input: {dataType: 'float32', shape: [1, 5, 5]}, options: {label}, }, { name: 'Throw if the output sizes is incorrect.', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, options: { windowDimensions: [2, 2], padding: [2, 2, 2, 2], @@ -159,7 +159,7 @@ const tests = [ }, { name: 'Throw if the length of output sizes is not 2.', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, options: { windowDimensions: [2, 2], padding: [2, 2, 2, 2], @@ -170,7 +170,7 @@ const tests = [ }, { name: 'Throw if outputSizes[0] is not greater than 0.', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, options: { windowDimensions: [2, 2], padding: [2, 2, 2, 2], @@ -181,7 +181,7 @@ const tests = [ }, { name: 'Throw if outputSizes[1] is not greater than 0.', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, options: { windowDimensions: [2, 2], padding: [2, 2, 2, 2], @@ -192,7 +192,7 @@ const tests = [ }, { name: 'Throw if the length of window dimensions is not 2.', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, options: { windowDimensions: [1, 1, 1, 1], label: label, @@ -200,7 +200,7 @@ const tests = [ }, { name: 'Throw if any window dimension is lesser than 1.', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, options: { windowDimensions: [0, 2], label: label, @@ -209,7 +209,7 @@ const tests = [ { name: 'Throw if the input height is too small to fill the pool window height.', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, options: { windowDimensions: [8, 2], label: label, @@ -218,7 +218,7 @@ const tests = [ { name: 'Throw if the input width is too small to fill the pool window width.', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, options: { windowDimensions: [2, 8], label: label, @@ -226,7 +226,7 @@ const tests = [ }, { name: 'Throw if the calculated output height is equal to 0.', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, options: { windowDimensions: [6, 3], label: label, @@ -234,7 +234,7 @@ const tests = [ }, { name: 'Throw if the calculated output width is equal to 0.', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, options: { windowDimensions: [3, 6], label: label, @@ -242,7 +242,7 @@ const tests = [ }, { name: 'Throw if the length of padding is not 4.', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, options: { padding: [2, 2], label: label, @@ -250,7 +250,7 @@ const tests = [ }, { name: 'Throw if the length of strides is not 2.', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, options: { strides: [2], label: label, @@ -258,7 +258,7 @@ const tests = [ }, { name: 'Throw if one stride value is smaller than 1.', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, options: { strides: [0, 2], label: label, @@ -266,7 +266,7 @@ const tests = [ }, { name: 'Throw if the length of dilations is not 2.', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, options: { dilations: [1, 1, 2], label: label, @@ -274,7 +274,7 @@ const tests = [ }, { name: 'Throw if one dilation value is smaller than 1.', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, options: { dilations: [1, 0], label: label, @@ -282,7 +282,7 @@ const tests = [ }, { name: 'Throw if the padding height value is too large', - input: {dataType: 'float32', dimensions: [1, 3, 5, 5]}, + input: {dataType: 'float32', shape: [1, 3, 5, 5]}, options: { padding: [kMaxUnsignedLong, kMaxUnsignedLong, 0, 0], label: label, @@ -290,7 +290,7 @@ const tests = [ }, { name: 'Throw if the padding width value is too large', - input: {dataType: 'float32', dimensions: [1, 3, 5, 5]}, + input: {dataType: 'float32', shape: [1, 3, 5, 5]}, options: { padding: [0, 0, kMaxUnsignedLong, kMaxUnsignedLong], label: label, @@ -301,14 +301,12 @@ const tests = [ tests.forEach( test => promise_test(async t => { const builder = new MLGraphBuilder(context); - const input = builder.input( - 'input', - {dataType: test.input.dataType, dimensions: test.input.dimensions}); + const input = builder.input('input', test.input); kPoolingOperators.forEach((operatorName) => { if (test.output) { const output = builder[operatorName](input, test.options); assert_equals(output.dataType(), test.output.dataType); - assert_array_equals(output.shape(), test.output.dimensions); + assert_array_equals(output.shape(), test.output.shape); } else { const regrexp = new RegExp('\\[' + label + '\\]'); assert_throws_with_label( @@ -320,8 +318,7 @@ tests.forEach( ['int32', 'uint32', 'int8', 'uint8'].forEach( dataType => promise_test(async t => { const builder = new MLGraphBuilder(context); - const input = builder.input( - 'input', {dataType: dataType, dimensions: [1, 3, 4, 4]}); + const input = builder.input('input', {dataType, shape: [1, 3, 4, 4]}); const output = builder.maxPool2d(input); assert_equals(output.dataType(), dataType); assert_array_equals(output.shape(), [1, 3, 1, 1]); @@ -330,13 +327,13 @@ tests.forEach( promise_test(async t => { const builder = new MLGraphBuilder(context); const input = - builder.input('input', {dataType: 'int64', dimensions: [1, 2, 3, 3]}); + builder.input('input', {dataType: 'int64', shape: [1, 2, 3, 3]}); assert_throws_js(TypeError, () => builder.averagePool2d(input)); }, '[averagePool2d] Throw if the input data type is not floating point'); promise_test(async t => { const builder = new MLGraphBuilder(context); const input = - builder.input('input', {dataType: 'uint8', dimensions: [1, 2, 4, 4]}); + builder.input('input', {dataType: 'uint8', shape: [1, 2, 4, 4]}); assert_throws_js(TypeError, () => builder.l2Pool2d(input)); }, '[l2Pool2d] Throw if the input data type is not floating point'); diff --git a/testing/web-platform/tests/webnn/validation_tests/prelu.https.any.js b/testing/web-platform/tests/webnn/validation_tests/prelu.https.any.js index 9c01d6edae3a..94eb6995374e 100644 --- a/testing/web-platform/tests/webnn/validation_tests/prelu.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/prelu.https.any.js @@ -13,58 +13,54 @@ const tests = [ { name: '[prelu] Test slope\'s shape = [3, 2, 5] which is the same as input\'s shape.', - input: {dataType: 'float32', dimensions: [3, 2, 5]}, - slope: {dataType: 'float32', dimensions: [3, 2, 5]}, - output: {dataType: 'float32', dimensions: [3, 2, 5]}, + input: {dataType: 'float32', shape: [3, 2, 5]}, + slope: {dataType: 'float32', shape: [3, 2, 5]}, + output: {dataType: 'float32', shape: [3, 2, 5]}, }, { name: '[prelu] Test slope\'s shape = [5] which is unidirectionally broadcastable to input\'s shape.', - input: {dataType: 'float32', dimensions: [3, 2, 5]}, - slope: {dataType: 'float32', dimensions: [5]}, - output: {dataType: 'float32', dimensions: [3, 2, 5]}, + input: {dataType: 'float32', shape: [3, 2, 5]}, + slope: {dataType: 'float32', shape: [5]}, + output: {dataType: 'float32', shape: [3, 2, 5]}, }, { name: '[prelu] Test slope\'s shape = [] which is unidirectionally broadcastable to input\'s shape.', - input: {dataType: 'float32', dimensions: [3, 2, 5]}, - slope: {dataType: 'float32', dimensions: []}, - output: {dataType: 'float32', dimensions: [3, 2, 5]}, + input: {dataType: 'float32', shape: [3, 2, 5]}, + slope: {dataType: 'float32', shape: []}, + output: {dataType: 'float32', shape: [3, 2, 5]}, }, { name: '[prelu] Test slope\'s shape = [2, 5] which is unidirectionally broadcastable to input\'s shape.', - input: {dataType: 'float32', dimensions: [3, 2, 5]}, - slope: {dataType: 'float32', dimensions: [2, 5]}, - output: {dataType: 'float32', dimensions: [3, 2, 5]}, + input: {dataType: 'float32', shape: [3, 2, 5]}, + slope: {dataType: 'float32', shape: [2, 5]}, + output: {dataType: 'float32', shape: [3, 2, 5]}, }, { name: '[prelu] Throw if the shape of slope is not broadcastable to the shape of input.', - input: {dataType: 'float32', dimensions: [3, 2, 5]}, - slope: {dataType: 'float32', dimensions: [2]}, + input: {dataType: 'float32', shape: [3, 2, 5]}, + slope: {dataType: 'float32', shape: [2]}, }, { name: '[prelu] Throw if the data type of slope does not match the data type of input.', - input: {dataType: 'float32', dimensions: [3, 2, 5]}, - slope: {dataType: 'int32', dimensions: [3, 2, 5]}, + input: {dataType: 'float32', shape: [3, 2, 5]}, + slope: {dataType: 'int32', shape: [3, 2, 5]}, }, ]; tests.forEach( test => promise_test(async t => { const builder = new MLGraphBuilder(context); - const input = builder.input( - 'input', - {dataType: test.input.dataType, dimensions: test.input.dimensions}); - const slope = builder.input( - 'input', - {dataType: test.slope.dataType, dimensions: test.slope.dimensions}); + const input = builder.input('input', test.input); + const slope = builder.input('input', test.slope); if (test.output) { const output = builder.prelu(input, slope); assert_equals(output.dataType(), test.output.dataType); - assert_array_equals(output.shape(), test.output.dimensions); + assert_array_equals(output.shape(), test.output.shape); } else { const label = 'prelu_123'; const options = {label}; @@ -80,12 +76,12 @@ promise_test(async t => { continue; } const builder = new MLGraphBuilder(context); - const dimensions = [1]; - const input = builder.input(`input`, {dataType, dimensions}); + const shape = [1]; + const input = builder.input(`input`, {dataType, shape}); if (context.opSupportLimits().prelu.input.dataTypes.includes(dataType)) { const output = builder.prelu(input, input); assert_equals(output.dataType(), dataType); - assert_array_equals(output.shape(), dimensions); + assert_array_equals(output.shape(), shape); } else { assert_throws_js(TypeError, () => builder.prelu(input, input)); } diff --git a/testing/web-platform/tests/webnn/validation_tests/quantizeLinear.https.any.js b/testing/web-platform/tests/webnn/validation_tests/quantizeLinear.https.any.js index 154f455a4921..2f0b21d225a8 100644 --- a/testing/web-platform/tests/webnn/validation_tests/quantizeLinear.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/quantizeLinear.https.any.js @@ -11,86 +11,79 @@ const tests = [ { name: '[quantizeLinear] Test scale\'s shape = [3, 2, 5] and zeroPoint\'s shape = [3, 2, 5] which is the same as input\'s shape.', - input: {dataType: 'float32', dimensions: [3, 2, 5]}, - scale: {dataType: 'float32', dimensions: [3, 2, 5]}, - zeroPoint: {dataType: 'int8', dimensions: [3, 2, 5]}, - output: {dataType: 'int8', dimensions: [3, 2, 5]}, + input: {dataType: 'float32', shape: [3, 2, 5]}, + scale: {dataType: 'float32', shape: [3, 2, 5]}, + zeroPoint: {dataType: 'int8', shape: [3, 2, 5]}, + output: {dataType: 'int8', shape: [3, 2, 5]}, }, { name: '[quantizeLinear] Test scale\'s shape = [5] and zeroPoint\'s shape = [5] which is unidirectionally broadcastable to input\'s shape.', - input: {dataType: 'float32', dimensions: [3, 2, 5]}, - scale: {dataType: 'float32', dimensions: [5]}, - zeroPoint: {dataType: 'int8', dimensions: [5]}, - output: {dataType: 'int8', dimensions: [3, 2, 5]}, + input: {dataType: 'float32', shape: [3, 2, 5]}, + scale: {dataType: 'float32', shape: [5]}, + zeroPoint: {dataType: 'int8', shape: [5]}, + output: {dataType: 'int8', shape: [3, 2, 5]}, }, { name: '[quantizeLinear] Test scale\'s shape = [] and zeroPoint\'s shape = [] which is unidirectionally broadcastable to input\'s shape.', - input: {dataType: 'float32', dimensions: [3, 2, 5]}, - scale: {dataType: 'float32', dimensions: []}, - zeroPoint: {dataType: 'int8', dimensions: []}, - output: {dataType: 'int8', dimensions: [3, 2, 5]}, + input: {dataType: 'float32', shape: [3, 2, 5]}, + scale: {dataType: 'float32', shape: []}, + zeroPoint: {dataType: 'int8', shape: []}, + output: {dataType: 'int8', shape: [3, 2, 5]}, }, { name: '[quantizeLinear] Throw if the shape of scale is not broadcastable to the shape of input.', - input: {dataType: 'float32', dimensions: [3, 2, 5]}, - scale: {dataType: 'float32', dimensions: [2]}, - zeroPoint: {dataType: 'int8', dimensions: [5]}, + input: {dataType: 'float32', shape: [3, 2, 5]}, + scale: {dataType: 'float32', shape: [2]}, + zeroPoint: {dataType: 'int8', shape: [5]}, }, { name: '[quantizeLinear] Throw if the shape of zero_point is not broadcastable to the shape of input.', - input: {dataType: 'float32', dimensions: [3, 2, 5]}, - scale: {dataType: 'float32', dimensions: [5]}, - zeroPoint: {dataType: 'int8', dimensions: [2]}, + input: {dataType: 'float32', shape: [3, 2, 5]}, + scale: {dataType: 'float32', shape: [5]}, + zeroPoint: {dataType: 'int8', shape: [2]}, }, { name: '[quantizeLinear] Throw if the data type of input is not the same as scale.', - input: {dataType: 'float32', dimensions: [3, 2, 5]}, - scale: {dataType: 'float16', dimensions: [5]}, - zeroPoint: {dataType: 'int8', dimensions: [5]}, + input: {dataType: 'float32', shape: [3, 2, 5]}, + scale: {dataType: 'float16', shape: [5]}, + zeroPoint: {dataType: 'int8', shape: [5]}, }, { name: '[quantizeLinear] Throw if the data type of input is not float32.', - input: {dataType: 'int32', dimensions: [3, 2, 5]}, - scale: {dataType: 'float32', dimensions: [5]}, - zeroPoint: {dataType: 'int8', dimensions: [5]}, + input: {dataType: 'int32', shape: [3, 2, 5]}, + scale: {dataType: 'float32', shape: [5]}, + zeroPoint: {dataType: 'int8', shape: [5]}, }, { name: '[quantizeLinear] Throw if the data type of scale is not float32.', - input: {dataType: 'float32', dimensions: [3, 2, 5]}, - scale: {dataType: 'int32', dimensions: [5]}, - zeroPoint: {dataType: 'uint8', dimensions: [5]}, + input: {dataType: 'float32', shape: [3, 2, 5]}, + scale: {dataType: 'int32', shape: [5]}, + zeroPoint: {dataType: 'uint8', shape: [5]}, }, { name: '[dequantizeLinear] Throw if the data type of zeroPoint is not int8 or uint8.', - input: {dataType: 'float32', dimensions: [3, 2, 5]}, - scale: {dataType: 'float32', dimensions: [5]}, - zeroPoint: {dataType: 'float16', dimensions: [5]}, + input: {dataType: 'float32', shape: [3, 2, 5]}, + scale: {dataType: 'float32', shape: [5]}, + zeroPoint: {dataType: 'float16', shape: [5]}, }, ]; tests.forEach( test => promise_test(async t => { const builder = new MLGraphBuilder(context); - const input = builder.input( - 'input', - {dataType: test.input.dataType, dimensions: test.input.dimensions}); - const scale = builder.input( - 'scale', - {dataType: test.scale.dataType, dimensions: test.scale.dimensions}); - const zeroPoint = builder.input('zeroPoint', { - dataType: test.zeroPoint.dataType, - dimensions: test.zeroPoint.dimensions - }); + const input = builder.input('input', test.input); + const scale = builder.input('scale', test.scale); + const zeroPoint = builder.input('zeroPoint', test.zeroPoint); if (test.output) { const output = builder.quantizeLinear(input, scale, zeroPoint); assert_equals(output.dataType(), test.output.dataType); - assert_array_equals(output.shape(), test.output.dimensions); + assert_array_equals(output.shape(), test.output.shape); } else { const label = 'quantize_linear_123'; const options = {label}; @@ -103,11 +96,11 @@ tests.forEach( const kExampleInputDescriptor = { dataType: 'float32', - dimensions: [2, 4] + shape: [2, 4] }; const kExampleZeroPointDescriptor = { dataType: 'int8', - dimensions: [2, 4] + shape: [2, 4] }; multi_builder_test(async (t, builder, otherBuilder) => { const inputFromOtherBuilder = diff --git a/testing/web-platform/tests/webnn/validation_tests/reduction.https.any.js b/testing/web-platform/tests/webnn/validation_tests/reduction.https.any.js index cb0d344b4f12..b56306351f05 100644 --- a/testing/web-platform/tests/webnn/validation_tests/reduction.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/reduction.https.any.js @@ -25,21 +25,21 @@ const label = 'reduce_op_xxx'; const allReductionOperatorsTests = [ { name: '[reduce] Test reduce with keepDimensions=true.', - input: {dataType: 'float32', dimensions: [1, 3, 4, 4]}, + input: {dataType: 'float32', shape: [1, 3, 4, 4]}, options: { keepDimensions: true, }, - output: {dataType: 'float32', dimensions: [1, 1, 1, 1]} + output: {dataType: 'float32', shape: [1, 1, 1, 1]} }, { name: '[reduce] Test reduce with axes=[0, 1] and keep_dimensions=false.', - input: {dataType: 'float32', dimensions: [1, 3, 5, 5]}, + input: {dataType: 'float32', shape: [1, 3, 5, 5]}, options: {axes: [0, 1]}, - output: {dataType: 'float32', dimensions: [5, 5]} + output: {dataType: 'float32', shape: [5, 5]} }, { name: '[reduce] Throw if a value in axes is out of range of [0, N-1].', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, options: { axes: [4], label: label, @@ -47,7 +47,7 @@ const allReductionOperatorsTests = [ }, { name: '[reduce] Throw if the two values are same in axes sequence.', - input: {dataType: 'float32', dimensions: [1, 2, 5, 5]}, + input: {dataType: 'float32', shape: [1, 2, 5, 5]}, options: { axes: [0, 1, 1], label: label, @@ -59,14 +59,12 @@ function runReductionTests(operatorName, tests) { tests.forEach(test => { promise_test(async t => { const builder = new MLGraphBuilder(context); - const input = builder.input( - 'input', - {dataType: test.input.dataType, dimensions: test.input.dimensions}); + const input = builder.input('input', test.input); if (test.output) { const output = builder[operatorName](input, test.options); assert_equals(output.dataType(), test.output.dataType); - assert_array_equals(output.shape(), test.output.dimensions); + assert_array_equals(output.shape(), test.output.shape); } else { const regrexp = new RegExp('\\[' + label + '\\]'); assert_throws_with_label( @@ -88,7 +86,7 @@ kReductionOperators.forEach((operatorName) => { continue; } const builder = new MLGraphBuilder(context); - const input = builder.input(`input`, {dataType, dimensions3D}); + const input = builder.input(`input`, {dataType, shape: shape3D}); if (context.opSupportLimits()[operatorName].input.dataTypes.includes( dataType)) { const output = builder[operatorName](input); diff --git a/testing/web-platform/tests/webnn/validation_tests/resample2d.https.any.js b/testing/web-platform/tests/webnn/validation_tests/resample2d.https.any.js index dd9916aefe09..df2b85d02de2 100644 --- a/testing/web-platform/tests/webnn/validation_tests/resample2d.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/resample2d.https.any.js @@ -12,73 +12,73 @@ const label = 'resample-2d'; const tests = [ { name: '[resample2d] Test building resample2d with default options', - input: {dataType: 'float32', dimensions: [1, 1, 2, 4]}, - output: {dataType: 'float32', dimensions: [1, 1, 2, 4]}, + input: {dataType: 'float32', shape: [1, 1, 2, 4]}, + output: {dataType: 'float32', shape: [1, 1, 2, 4]}, }, { name: '[resample2d] Test building resample2d with scales=[2.0, 2.0]', - input: {dataType: 'float32', dimensions: [1, 1, 2, 4]}, + input: {dataType: 'float32', shape: [1, 1, 2, 4]}, options: {scales: [2.0, 2.0]}, - output: {dataType: 'float32', dimensions: [1, 1, 4, 8]}, + output: {dataType: 'float32', shape: [1, 1, 4, 8]}, }, { name: '[resample2d] Test building resample2d with scales=[0.5, 0.5]', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, options: {scales: [0.5, 0.5]}, - output: {dataType: 'float32', dimensions: [1, 1, 2, 2]}, + output: {dataType: 'float32', shape: [1, 1, 2, 2]}, }, { name: '[resample2d] Test building resample2d with scales=[0.5, 0.5] and explicit axes=[2, 3]', - input: {dataType: 'float32', dimensions: [1, 1, 5, 5]}, + input: {dataType: 'float32', shape: [1, 1, 5, 5]}, options: {scales: [0.5, 0.5], axes: [2, 3]}, - output: {dataType: 'float32', dimensions: [1, 1, 2, 2]}, + output: {dataType: 'float32', shape: [1, 1, 2, 2]}, }, { name: '[resample2d] Test building resample2d with scales=[1.0, 2.0] and axes=[0, 1]', - input: {dataType: 'float32', dimensions: [1, 1, 2, 4]}, + input: {dataType: 'float32', shape: [1, 1, 2, 4]}, options: {scales: [1.0, 2.0], axes: [0, 1]}, - output: {dataType: 'float32', dimensions: [1, 2, 2, 4]}, + output: {dataType: 'float32', shape: [1, 2, 2, 4]}, }, { name: '[resample2d] Test building resample2d with scales=[2.0, 2.0] and axes=[1, 2]', - input: {dataType: 'float32', dimensions: [1, 1, 2, 4]}, + input: {dataType: 'float32', shape: [1, 1, 2, 4]}, options: {scales: [2.0, 2.0], axes: [1, 2]}, - output: {dataType: 'float32', dimensions: [1, 2, 4, 4]}, + output: {dataType: 'float32', shape: [1, 2, 4, 4]}, }, { name: '[resample2d] Test building resample2d with sizes=[3, 6] ignored scales', - input: {dataType: 'float32', dimensions: [1, 1, 2, 4]}, + input: {dataType: 'float32', shape: [1, 1, 2, 4]}, options: {scales: [2.0, 2.0], sizes: [3, 6]}, - output: {dataType: 'float32', dimensions: [1, 1, 3, 6]}, + output: {dataType: 'float32', shape: [1, 1, 3, 6]}, }, { name: '[resample2d] Test building resample2d with non consecutive axes=[0,2]', - input: {dataType: 'float32', dimensions: [1, 1, 2, 4]}, + input: {dataType: 'float32', shape: [1, 1, 2, 4]}, options: { axes: [0, 2], label: label, }, - output: {dataType: 'float32', dimensions: [1, 1, 2, 4]}, + output: {dataType: 'float32', shape: [1, 1, 2, 4]}, }, { name: '[resample2d] Throw if the dataType of input is not float32 or float16', - input: {dataType: 'int32', dimensions: [2, 4]}, + input: {dataType: 'int32', shape: [2, 4]}, options: {label}, }, { name: '[resample2d] Throw if the rank of input is not 4', - input: {dataType: 'float32', dimensions: [2, 4]}, + input: {dataType: 'float32', shape: [2, 4]}, options: {label}, }, { name: '[resample2d] Throw if the length of scales is not 2', - input: {dataType: 'float32', dimensions: [1, 1, 2, 4]}, + input: {dataType: 'float32', shape: [1, 1, 2, 4]}, options: { scales: [1.0, 1.0, 2.0, 2.0], label: label, @@ -86,7 +86,7 @@ const tests = [ }, { name: '[resample2d] Throw if any scale value is negative', - input: {dataType: 'float32', dimensions: [1, 1, 2, 4]}, + input: {dataType: 'float32', shape: [1, 1, 2, 4]}, options: { scales: [1.0, -2.0], label: label, @@ -94,7 +94,7 @@ const tests = [ }, { name: '[resample2d] Throw if any scale value is 0', - input: {dataType: 'float32', dimensions: [1, 1, 2, 4]}, + input: {dataType: 'float32', shape: [1, 1, 2, 4]}, options: { scales: [0, 2.0], label: label, @@ -102,7 +102,7 @@ const tests = [ }, { name: '[resample2d] Throw if the length of sizes is not 2', - input: {dataType: 'float32', dimensions: [1, 1, 2, 4]}, + input: {dataType: 'float32', shape: [1, 1, 2, 4]}, options: { sizes: [1, 1, 4, 6], label: label, @@ -110,7 +110,7 @@ const tests = [ }, { name: '[resample2d] Throw if sizes[0] is not a valid dimension', - input: {dataType: 'float32', dimensions: [1, 1, 2, 4]}, + input: {dataType: 'float32', shape: [1, 1, 2, 4]}, options: { sizes: [0, 1], label: label, @@ -118,7 +118,7 @@ const tests = [ }, { name: '[resample2d] Throw if sizes[1] is not a valid dimension', - input: {dataType: 'float32', dimensions: [1, 1, 2, 4]}, + input: {dataType: 'float32', shape: [1, 1, 2, 4]}, options: { sizes: [1, 0], label: label, @@ -127,13 +127,13 @@ const tests = [ { name: '[resample2d] Throw if any size value is out of \'unsigned long\' value range', - input: {dataType: 'float32', dimensions: [1, 1, 2, 4]}, + input: {dataType: 'float32', shape: [1, 1, 2, 4]}, options: {sizes: [kMaxUnsignedLong + 1, kMaxUnsignedLong + 1]}, }, { name: '[resample2d] Throw if outputHeight being floor(scaleHeight*inputHeight) is too large', - input: {dataType: 'float32', dimensions: [1, 1, 2, 4]}, + input: {dataType: 'float32', shape: [1, 1, 2, 4]}, // The maximum dimension size is kMaxUnsignedLong (2 ** 32 - 1). // Here scaleHeight=kMaxUnsignedLong and inputHeight=2, // so outputHeight being kMaxUnsignedLong*2 > kMaxUnsignedLong . @@ -141,7 +141,7 @@ const tests = [ }, { name: '[resample2d] Throw if scaleHeight is too small', - input: {dataType: 'float32', dimensions: [1, 1, 2, 4]}, + input: {dataType: 'float32', shape: [1, 1, 2, 4]}, // Here scaleHeight=0.02 and inputHeight=2, // so outputHeight would be 0. // Link to https://github.com/webmachinelearning/webnn/issues/391. @@ -153,7 +153,7 @@ const tests = [ { name: '[resample2d] Throw if outputWidth being floor(scaleWidth*inputWidth) is too large', - input: {dataType: 'float32', dimensions: [1, 1, 4, 2]}, + input: {dataType: 'float32', shape: [1, 1, 4, 2]}, // The maximum dimension size is kMaxUnsignedLong (2 ** 32 - 1). // Here scaleWidth=kMaxUnsignedLong and inputWidth=2, // so outputWidth being kMaxUnsignedLong*2 > kMaxUnsignedLong . @@ -161,7 +161,7 @@ const tests = [ }, { name: '[resample2d] Throw if scaleWidth is too small', - input: {dataType: 'float32', dimensions: [1, 1, 2, 4]}, + input: {dataType: 'float32', shape: [1, 1, 2, 4]}, // Here scaleWidth=0.1 and inputWidth=4, // so outputWidth would be 0. // Link to https://github.com/webmachinelearning/webnn/issues/391. @@ -172,7 +172,7 @@ const tests = [ }, { name: '[resample2d] Throw if the length of axes is not 2', - input: {dataType: 'float32', dimensions: [1, 1, 2, 4]}, + input: {dataType: 'float32', shape: [1, 1, 2, 4]}, options: { axes: [0, 1, 2], label: label, @@ -181,7 +181,7 @@ const tests = [ { name: '[resample2d] Throw if any axis value is greater than or equal to the input rank', - input: {dataType: 'float32', dimensions: [1, 1, 2, 4]}, + input: {dataType: 'float32', shape: [1, 1, 2, 4]}, options: { axes: [3, 4], label: label, @@ -189,7 +189,7 @@ const tests = [ }, { name: '[resample2d] Throw if the values of axes are same', - input: {dataType: 'float32', dimensions: [1, 1, 2, 4]}, + input: {dataType: 'float32', shape: [1, 1, 2, 4]}, options: { axes: [0, 0], label: label, @@ -200,14 +200,12 @@ const tests = [ tests.forEach( test => promise_test(async t => { const builder = new MLGraphBuilder(context); - const input = builder.input( - 'input', - {dataType: test.input.dataType, dimensions: test.input.dimensions}); + const input = builder.input('input', test.input); const options = test.options ?? {}; if (test.output) { const output = builder.resample2d(input, options); assert_equals(output.dataType(), test.output.dataType); - assert_array_equals(output.shape(), test.output.dimensions); + assert_array_equals(output.shape(), test.output.shape); } else { const options = {...test.options}; if (options.label) { @@ -221,7 +219,7 @@ tests.forEach( }, test.name)); validateInputFromAnotherBuilder( - 'resample2d', {dataType: 'float32', dimensions: [2, 2, 2, 2]}); + 'resample2d', {dataType: 'float32', shape: [2, 2, 2, 2]}); promise_test(async t => { for (let dataType of allWebNNOperandDataTypes) { @@ -229,13 +227,13 @@ promise_test(async t => { continue; } const builder = new MLGraphBuilder(context); - const dimensions = [1, 1, 2, 4]; - const input = builder.input(`input`, {dataType, dimensions}); + const shape = [1, 1, 2, 4]; + const input = builder.input(`input`, {dataType, shape}); if (context.opSupportLimits().resample2d.input.dataTypes.includes( dataType)) { const output = builder.resample2d(input); assert_equals(output.dataType(), dataType); - assert_array_equals(output.shape(), dimensions); + assert_array_equals(output.shape(), shape); } else { assert_throws_js(TypeError, () => builder.resample2d(input)); } diff --git a/testing/web-platform/tests/webnn/validation_tests/reshape.https.any.js b/testing/web-platform/tests/webnn/validation_tests/reshape.https.any.js index 7bf4a523c28f..7e49cada67a2 100644 --- a/testing/web-platform/tests/webnn/validation_tests/reshape.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/reshape.https.any.js @@ -9,7 +9,7 @@ multi_builder_test(async (t, builder, otherBuilder) => { const inputFromOtherBuilder = - otherBuilder.input('input', {dataType: 'float32', dimensions: [1, 2, 3]}); + otherBuilder.input('input', {dataType: 'float32', shape: [1, 2, 3]}); const newShape = [3, 2, 1]; assert_throws_js( @@ -19,49 +19,49 @@ multi_builder_test(async (t, builder, otherBuilder) => { const tests = [ { name: '[reshape] Test with new shape=[3, 8].', - input: {dataType: 'float32', dimensions: [2, 3, 4]}, + input: {dataType: 'float32', shape: [2, 3, 4]}, newShape: [3, 8], - output: {dataType: 'float32', dimensions: [3, 8]} + output: {dataType: 'float32', shape: [3, 8]} }, { name: '[reshape] Test with new shape=[24], src shape=[2, 3, 4].', - input: {dataType: 'float32', dimensions: [2, 3, 4]}, + input: {dataType: 'float32', shape: [2, 3, 4]}, newShape: [24], - output: {dataType: 'float32', dimensions: [24]} + output: {dataType: 'float32', shape: [24]} }, { name: '[reshape] Test with new shape=[1], src shape=[1].', - input: {dataType: 'float32', dimensions: [1]}, + input: {dataType: 'float32', shape: [1]}, newShape: [1], - output: {dataType: 'float32', dimensions: [1]} + output: {dataType: 'float32', shape: [1]} }, { name: '[reshape] Test reshaping a 1-D 1-element tensor to scalar.', - input: {dataType: 'float32', dimensions: [1]}, + input: {dataType: 'float32', shape: [1]}, newShape: [], - output: {dataType: 'float32', dimensions: []} + output: {dataType: 'float32', shape: []} }, { name: '[reshape] Test reshaping a scalar to 1-D 1-element tensor.', - input: {dataType: 'float32', dimensions: []}, + input: {dataType: 'float32', shape: []}, newShape: [1], - output: {dataType: 'float32', dimensions: [1]} + output: {dataType: 'float32', shape: [1]} }, { name: '[reshape] Throw if one value of new shape is 0.', - input: {dataType: 'float32', dimensions: [2, 4]}, + input: {dataType: 'float32', shape: [2, 4]}, newShape: [2, 4, 0], }, { name: '[reshape] Throw if the number of elements implied by new shape is not equal to the number of elements in the input tensor when new shape=[].', - input: {dataType: 'float32', dimensions: [2, 3, 4]}, + input: {dataType: 'float32', shape: [2, 3, 4]}, newShape: [], }, { name: '[reshape] Throw if the number of elements implied by new shape is not equal to the number of elements in the input tensor.', - input: {dataType: 'float32', dimensions: [2, 3, 4]}, + input: {dataType: 'float32', shape: [2, 3, 4]}, newShape: [3, 9], }, ]; @@ -69,13 +69,11 @@ const tests = [ tests.forEach( test => promise_test(async t => { const builder = new MLGraphBuilder(context); - const input = builder.input( - 'input', - {dataType: test.input.dataType, dimensions: test.input.dimensions}); + const input = builder.input('input', test.input); if (test.output) { const output = builder.reshape(input, test.newShape); assert_equals(output.dataType(), test.output.dataType); - assert_array_equals(output.shape(), test.output.dimensions); + assert_array_equals(output.shape(), test.output.shape); } else { const label = 'reshape_xxx'; const options = {label}; diff --git a/testing/web-platform/tests/webnn/validation_tests/scatterND.https.any.js b/testing/web-platform/tests/webnn/validation_tests/scatterND.https.any.js index 18fcb40e892e..5e28471fffa4 100644 --- a/testing/web-platform/tests/webnn/validation_tests/scatterND.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/scatterND.https.any.js @@ -10,43 +10,43 @@ const tests = [ { name: '[scatterND] Test scatterND with valid tensors', - input: {dataType: 'float32', dimensions: [4, 4, 4]}, - indices: {dataType: 'int32', dimensions: [2, 1]}, - updates: {dataType: 'float32', dimensions: [2, 4, 4]}, - output: {dataType: 'float32', dimensions: [4, 4, 4]} + input: {dataType: 'float32', shape: [4, 4, 4]}, + indices: {dataType: 'int32', shape: [2, 1]}, + updates: {dataType: 'float32', shape: [2, 4, 4]}, + output: {dataType: 'float32', shape: [4, 4, 4]} }, { name: '[scatterND] Throw if updates tensor data type is not the same as input data type', - input: {dataType: 'float32', dimensions: [4, 4, 4]}, - indices: {dataType: 'int32', dimensions: [2, 1]}, - updates: {dataType: 'float16', dimensions: [2, 4, 4]}, + input: {dataType: 'float32', shape: [4, 4, 4]}, + indices: {dataType: 'int32', shape: [2, 1]}, + updates: {dataType: 'float16', shape: [2, 4, 4]}, }, { name: '[scatterND] Throw if input is a scalar', - input: {dataType: 'float32', dimensions: []}, - indices: {dataType: 'int32', dimensions: [2, 1]}, - updates: {dataType: 'float32', dimensions: [2, 4, 4]}, + input: {dataType: 'float32', shape: []}, + indices: {dataType: 'int32', shape: [2, 1]}, + updates: {dataType: 'float32', shape: [2, 4, 4]}, }, { name: '[scatterND] Throw if indices is a scalar', - input: {dataType: 'float32', dimensions: [4, 4, 4]}, - indices: {dataType: 'int32', dimensions: []}, - updates: {dataType: 'float32', dimensions: [2, 4, 4]}, + input: {dataType: 'float32', shape: [4, 4, 4]}, + indices: {dataType: 'int32', shape: []}, + updates: {dataType: 'float32', shape: [2, 4, 4]}, }, { name: '[scatterND] Throw if the size of last dimension of indices tensor is greater than input rank', - input: {dataType: 'float32', dimensions: [4, 4, 4]}, - indices: {dataType: 'int32', dimensions: [2, 4]}, - updates: {dataType: 'float32', dimensions: [2, 4, 4]}, + input: {dataType: 'float32', shape: [4, 4, 4]}, + indices: {dataType: 'int32', shape: [2, 4]}, + updates: {dataType: 'float32', shape: [2, 4, 4]}, }, { name: '[scatterND] Throw if updates tensor shape is invalid.', - input: {dataType: 'float32', dimensions: [4, 4, 4]}, - indices: {dataType: 'int32', dimensions: [2, 1]}, + input: {dataType: 'float32', shape: [4, 4, 4]}, + indices: {dataType: 'int32', shape: [2, 1]}, // Updates tensor shape should be [2, 4, 4]. - updates: {dataType: 'float32', dimensions: [2, 3, 4]}, + updates: {dataType: 'float32', shape: [2, 3, 4]}, } ]; @@ -59,7 +59,7 @@ tests.forEach(test => promise_test(async t => { if (test.output) { const output = builder.scatterND(input, indices, updates); assert_equals(output.dataType(), test.output.dataType); - assert_array_equals(output.shape(), test.output.dimensions); + assert_array_equals(output.shape(), test.output.shape); } else { const label = 'a_scatter_nd' const options = {label}; @@ -71,32 +71,27 @@ tests.forEach(test => promise_test(async t => { }, test.name)); multi_builder_test(async (t, builder, otherBuilder) => { - const input = - otherBuilder.input('input', {dataType: 'float32', dimensions: [8]}); - const indices = - builder.input('indices', {dataType: 'int32', dimensions: [4, 1]}); - const updates = - builder.input('indices', {dataType: 'int32', dimensions: [4]}); + const input = otherBuilder.input('input', {dataType: 'float32', shape: [8]}); + const indices = builder.input('indices', {dataType: 'int32', shape: [4, 1]}); + const updates = builder.input('indices', {dataType: 'int32', shape: [4]}); assert_throws_js(TypeError, () => builder.scatterND(input, indices, updates)); }, '[scatterND] Throw if input is from another builder'); multi_builder_test(async (t, builder, otherBuilder) => { - const input = builder.input('input', {dataType: 'float32', dimensions: [8]}); + const input = builder.input('input', {dataType: 'float32', shape: [8]}); const indices = - otherBuilder.input('indices', {dataType: 'int32', dimensions: [4, 1]}); - const updates = - builder.input('indices', {dataType: 'int32', dimensions: [4]}); + otherBuilder.input('indices', {dataType: 'int32', shape: [4, 1]}); + const updates = builder.input('indices', {dataType: 'int32', shape: [4]}); assert_throws_js(TypeError, () => builder.scatterND(input, indices, updates)); }, '[scatterND] Throw if indcies is from another builder'); multi_builder_test(async (t, builder, otherBuilder) => { - const input = builder.input('input', {dataType: 'float32', dimensions: [8]}); - const indices = - builder.input('indices', {dataType: 'int32', dimensions: [4, 1]}); + const input = builder.input('input', {dataType: 'float32', shape: [8]}); + const indices = builder.input('indices', {dataType: 'int32', shape: [4, 1]}); const updates = - otherBuilder.input('indices', {dataType: 'int32', dimensions: [4]}); + otherBuilder.input('indices', {dataType: 'int32', shape: [4]}); assert_throws_js(TypeError, () => builder.scatterND(input, indices, updates)); }, '[scatterND] Throw if updates is from another builder'); diff --git a/testing/web-platform/tests/webnn/validation_tests/slice.https.any.js b/testing/web-platform/tests/webnn/validation_tests/slice.https.any.js index d2ca2c678f06..3fb3cdcd6f67 100644 --- a/testing/web-platform/tests/webnn/validation_tests/slice.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/slice.https.any.js @@ -9,7 +9,7 @@ multi_builder_test(async (t, builder, otherBuilder) => { const inputFromOtherBuilder = - otherBuilder.input('input', {dataType: 'float32', dimensions: [2, 2]}); + otherBuilder.input('input', {dataType: 'float32', shape: [2, 2]}); const starts = [1, 1]; const sizes = [1, 1]; @@ -20,48 +20,48 @@ multi_builder_test(async (t, builder, otherBuilder) => { const tests = [ { name: '[slice] Test with starts=[0, 1, 2] and sizes=[1, 2, 3].', - input: {dataType: 'float32', dimensions: [3, 4, 5]}, + input: {dataType: 'float32', shape: [3, 4, 5]}, starts: [0, 1, 2], sizes: [1, 2, 3], - output: {dataType: 'float32', dimensions: [1, 2, 3]} + output: {dataType: 'float32', shape: [1, 2, 3]} }, { name: '[slice] Throw if input is a scalar.', - input: {dataType: 'float32', dimensions: []}, + input: {dataType: 'float32', shape: []}, starts: [0], sizes: [1] }, { name: '[slice] Throw if the length of sizes is not equal to the rank of the input tensor.', - input: {dataType: 'float32', dimensions: [3, 4, 5]}, + input: {dataType: 'float32', shape: [3, 4, 5]}, starts: [1, 2, 3], sizes: [1, 1] }, { name: '[slice] Throw if the length of starts is not equal to the rank of the input tensor.', - input: {dataType: 'float32', dimensions: [3, 4, 5]}, + input: {dataType: 'float32', shape: [3, 4, 5]}, starts: [1, 2, 1, 3], sizes: [1, 1, 1] }, { name: '[slice] Throw if the starting index is equal to or greater than input size in the same dimension.', - input: {dataType: 'float32', dimensions: [3, 4, 5]}, + input: {dataType: 'float32', shape: [3, 4, 5]}, starts: [0, 4, 4], sizes: [1, 1, 1] }, { name: '[slice] Throw if the number of elements to slice is equal to 0.', - input: {dataType: 'float32', dimensions: [3, 4, 5]}, + input: {dataType: 'float32', shape: [3, 4, 5]}, starts: [1, 2, 3], sizes: [1, 0, 1] }, { name: '[slice] Throw if the ending index to slice is greater than input size in the same dimension.', - input: {dataType: 'float32', dimensions: [3, 4, 5]}, + input: {dataType: 'float32', shape: [3, 4, 5]}, starts: [0, 1, 2], sizes: [3, 4, 1] }, @@ -70,14 +70,12 @@ const tests = [ tests.forEach( test => promise_test(async t => { const builder = new MLGraphBuilder(context); - const input = builder.input( - 'input', - {dataType: test.input.dataType, dimensions: test.input.dimensions}); + const input = builder.input('input', test.input); if (test.output) { const output = builder.slice(input, test.starts, test.sizes); assert_equals(output.dataType(), test.output.dataType); - assert_array_equals(output.shape(), test.output.dimensions); + assert_array_equals(output.shape(), test.output.shape); } else { const label = 'slice_xxx'; const options = {label}; diff --git a/testing/web-platform/tests/webnn/validation_tests/softmax.https.any.js b/testing/web-platform/tests/webnn/validation_tests/softmax.https.any.js index 8c9e65f6eee6..4a5ee563070f 100644 --- a/testing/web-platform/tests/webnn/validation_tests/softmax.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/softmax.https.any.js @@ -8,36 +8,34 @@ 'use strict'; const tests_without_axis = [ - { - name: '[softmax] Test building Softmax with float32 input without axis.', - input: { dataType: 'float32', dimensions: [4, 3] }, - output: { dataType: 'float32', dimensions: [4, 3] } - }, - { - name: '[softmax] Test building Softmax with float16 input without axis.', - input: { dataType: 'float16', dimensions: [3, 5] }, - output: { dataType: 'float16', dimensions: [3, 5] } - }, - { - name: '[softmax] Throw if the input is not a non-floating point data.', - input: { dataType: 'int32', dimensions: [3, 2] } - }, - { - name: '[softmax] Throw if the input dimensions is not 2.', - input: { dataType: 'float32', dimensions: [1, 4, 3] } - } + { + name: '[softmax] Test building Softmax with float32 input without axis.', + input: {dataType: 'float32', shape: [4, 3]}, + output: {dataType: 'float32', shape: [4, 3]} + }, + { + name: '[softmax] Test building Softmax with float16 input without axis.', + input: {dataType: 'float16', shape: [3, 5]}, + output: {dataType: 'float16', shape: [3, 5]} + }, + { + name: '[softmax] Throw if the input is not a non-floating point data.', + input: {dataType: 'int32', shape: [3, 2]} + }, + { + name: '[softmax] Throw if the input dimensions is not 2.', + input: {dataType: 'float32', shape: [1, 4, 3]} + } ]; tests_without_axis.forEach( test => promise_test(async t => { const builder = new MLGraphBuilder(context); - let input = builder.input( - `input`, - {dataType: test.input.dataType, dimensions: test.input.dimensions}); + let input = builder.input(`input`, test.input); if (test.output) { const output = builder.softmax(input); assert_equals(output.dataType(), test.output.dataType); - assert_array_equals(output.shape(), test.output.dimensions); + assert_array_equals(output.shape(), test.output.shape); } else { const options = { label: 'softmax_xxx', @@ -54,49 +52,45 @@ tests_without_axis.forEach( }, test.name)); multi_builder_test(async (t, builder, otherBuilder) => { - const operandDescriptor = { dataType: 'float32', dimensions: [2, 3] }; - const inputFromOtherBuilder = otherBuilder.input('input', operandDescriptor); + const operandDescriptor = {dataType: 'float32', shape: [2, 3]}; + const inputFromOtherBuilder = otherBuilder.input('input', operandDescriptor); - assert_throws_js( - TypeError, - () => builder.softmax(inputFromOtherBuilder)); + assert_throws_js(TypeError, () => builder.softmax(inputFromOtherBuilder)); }, '[softmax without axis] throw if any input is from another builder'); const tests = [ - { - name: '[softmax] Test building Softmax with float32 input.', - input: { dataType: 'float32', dimensions: [4, 4, 3] }, - axis: 1, - output: { dataType: 'float32', dimensions: [4, 4, 3] } - }, - { - name: '[softmax] Test building Softmax with float16 input.', - input: { dataType: 'float16', dimensions: [3, 1, 5, 2] }, - axis: 2, - output: { dataType: 'float16', dimensions: [3, 1, 5, 2] } - }, - { - name: '[softmax] Throw if the input is not a non-floating-point data.', - input: { dataType: 'int32', dimensions: [3, 1, 5, 2] }, - axis: 3 - }, - { - name: '[softmax] Throw if the axis is greater than input rank - 1.', - input: { dataType: 'float16', dimensions: [3, 1, 5, 2] }, - axis: 4 - } + { + name: '[softmax] Test building Softmax with float32 input.', + input: {dataType: 'float32', shape: [4, 4, 3]}, + axis: 1, + output: {dataType: 'float32', shape: [4, 4, 3]} + }, + { + name: '[softmax] Test building Softmax with float16 input.', + input: {dataType: 'float16', shape: [3, 1, 5, 2]}, + axis: 2, + output: {dataType: 'float16', shape: [3, 1, 5, 2]} + }, + { + name: '[softmax] Throw if the input is not a non-floating-point data.', + input: {dataType: 'int32', shape: [3, 1, 5, 2]}, + axis: 3 + }, + { + name: '[softmax] Throw if the axis is greater than input rank - 1.', + input: {dataType: 'float16', shape: [3, 1, 5, 2]}, + axis: 4 + } ]; tests.forEach( test => promise_test(async t => { const builder = new MLGraphBuilder(context); - let input = builder.input( - `input`, - {dataType: test.input.dataType, dimensions: test.input.dimensions}); + let input = builder.input(`input`, test.input); if (test.output) { const output = builder.softmax(input, test.axis); assert_equals(output.dataType(), test.output.dataType); - assert_array_equals(output.shape(), test.output.dimensions); + assert_array_equals(output.shape(), test.output.shape); } else { const label = 'softmax_xxx'; const options = {label}; @@ -107,11 +101,10 @@ tests.forEach( }, test.name)); multi_builder_test(async (t, builder, otherBuilder) => { - const operandDescriptor = { dataType: 'float32', dimensions: [1, 2, 3] }; - const inputFromOtherBuilder = otherBuilder.input('input', operandDescriptor); - const axis = 1; + const operandDescriptor = {dataType: 'float32', shape: [1, 2, 3]}; + const inputFromOtherBuilder = otherBuilder.input('input', operandDescriptor); + const axis = 1; - assert_throws_js( - TypeError, - () => builder.softmax(inputFromOtherBuilder, axis)); + assert_throws_js( + TypeError, () => builder.softmax(inputFromOtherBuilder, axis)); }, '[softmax] throw if any input is from another builder'); diff --git a/testing/web-platform/tests/webnn/validation_tests/split.https.any.js b/testing/web-platform/tests/webnn/validation_tests/split.https.any.js index 31b0c449385f..c25f839168d3 100644 --- a/testing/web-platform/tests/webnn/validation_tests/split.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/split.https.any.js @@ -9,7 +9,7 @@ multi_builder_test(async (t, builder, otherBuilder) => { const inputFromOtherBuilder = - otherBuilder.input('input', {dataType: 'float32', dimensions: [4, 4]}); + otherBuilder.input('input', {dataType: 'float32', shape: [4, 4]}); const splits = 2; assert_throws_js( @@ -20,33 +20,33 @@ const label = 'xxx-split'; const tests = [ { name: '[split] Test with default options.', - input: {dataType: 'float32', dimensions: [2, 6]}, + input: {dataType: 'float32', shape: [2, 6]}, splits: [2], outputs: [ - {dataType: 'float32', dimensions: [2, 6]}, + {dataType: 'float32', shape: [2, 6]}, ] }, { name: '[split] Test with a sequence of unsigned long splits and with options.axis = 1.', - input: {dataType: 'float32', dimensions: [2, 6]}, + input: {dataType: 'float32', shape: [2, 6]}, splits: [1, 2, 3], options: {axis: 1}, outputs: [ - {dataType: 'float32', dimensions: [2, 1]}, - {dataType: 'float32', dimensions: [2, 2]}, - {dataType: 'float32', dimensions: [2, 3]}, + {dataType: 'float32', shape: [2, 1]}, + {dataType: 'float32', shape: [2, 2]}, + {dataType: 'float32', shape: [2, 3]}, ] }, { name: '[split] Throw if splitting a scalar.', - input: {dataType: 'float32', dimensions: []}, + input: {dataType: 'float32', shape: []}, splits: [2], options: {label} }, { name: '[split] Throw if axis is larger than input rank.', - input: {dataType: 'float32', dimensions: [2, 6]}, + input: {dataType: 'float32', shape: [2, 6]}, splits: [2], options: { axis: 2, @@ -55,7 +55,7 @@ const tests = [ }, { name: '[split] Throw if splits is equal to 0.', - input: {dataType: 'float32', dimensions: [2, 6]}, + input: {dataType: 'float32', shape: [2, 6]}, splits: [0], options: { axis: 0, @@ -64,7 +64,7 @@ const tests = [ }, { name: '[split] Throw if splits (scalar) is equal to 0.', - input: {dataType: 'float32', dimensions: [2, 6]}, + input: {dataType: 'float32', shape: [2, 6]}, splits: 0, options: { axis: 0, @@ -74,7 +74,7 @@ const tests = [ { name: '[split] Throw if the splits can not evenly divide the dimension size of input along options.axis.', - input: {dataType: 'float32', dimensions: [2, 5]}, + input: {dataType: 'float32', shape: [2, 5]}, splits: [2], options: { axis: 1, @@ -84,7 +84,7 @@ const tests = [ { name: '[split] Throw if splits (scalar) can not evenly divide the dimension size of input along options.axis.', - input: {dataType: 'float32', dimensions: [2, 5]}, + input: {dataType: 'float32', shape: [2, 5]}, splits: 2, options: { axis: 1, @@ -94,7 +94,7 @@ const tests = [ { name: '[split] Throw if the sum of splits sizes not equal to the dimension size of input along options.axis.', - input: {dataType: 'float32', dimensions: [2, 6]}, + input: {dataType: 'float32', shape: [2, 6]}, splits: [2, 2, 3], options: { axis: 1, @@ -106,15 +106,13 @@ const tests = [ tests.forEach( test => promise_test(async t => { const builder = new MLGraphBuilder(context); - const input = builder.input( - 'input', - {dataType: test.input.dataType, dimensions: test.input.dimensions}); + const input = builder.input('input', test.input); if (test.outputs) { const outputs = builder.split(input, test.splits, test.options); assert_equals(outputs.length, test.outputs.length); for (let i = 0; i < outputs.length; ++i) { assert_equals(outputs[i].dataType(), test.outputs[i].dataType); - assert_array_equals(outputs[i].shape(), test.outputs[i].dimensions); + assert_array_equals(outputs[i].shape(), test.outputs[i].shape); } } else { const regrexp = new RegExp('\\[' + label + '\\]'); diff --git a/testing/web-platform/tests/webnn/validation_tests/tile.https.any.js b/testing/web-platform/tests/webnn/validation_tests/tile.https.any.js index d6b24b6c3892..6ad81cba4beb 100644 --- a/testing/web-platform/tests/webnn/validation_tests/tile.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/tile.https.any.js @@ -14,9 +14,9 @@ const tests = [ { name: '[tile] Test building tile with repetitions=[1, 1, 1, 1], float32 data type.', - input: {dataType: 'float32', dimensions: [1, 2, 3, 4]}, + input: {dataType: 'float32', shape: [1, 2, 3, 4]}, repetitions: [1, 1, 1, 1], - output: {dataType: 'float32', dimensions: [1, 2, 3, 4]}, + output: {dataType: 'float32', shape: [1, 2, 3, 4]}, options: { label: label, }, @@ -24,30 +24,30 @@ const tests = [ { name: '[tile] Test building tile with repetitions=[1, 2, 3, 4], uint32 data type.', - input: {dataType: 'uint32', dimensions: [1, 2, 3, 4]}, + input: {dataType: 'uint32', shape: [1, 2, 3, 4]}, repetitions: [1, 2, 3, 4], - output: {dataType: 'uint32', dimensions: [1, 4, 9, 16]}, + output: {dataType: 'uint32', shape: [1, 4, 9, 16]}, }, { name: '[tile] Throw if repetitions\'s size is not the same as input\'s rank.', - input: {dataType: 'int32', dimensions: [1, 2, 4]}, + input: {dataType: 'int32', shape: [1, 2, 4]}, repetitions: [1, 2, 3, 4], }, { name: '[tile] Throw if any value in repetitions is zero.', - input: {dataType: 'int32', dimensions: [1, 2, 3, 4]}, + input: {dataType: 'int32', shape: [1, 2, 3, 4]}, repetitions: [0, 1, 2, 3], }, { name: '[tile] Throw if any value in repetitions is negative.', - input: {dataType: 'int32', dimensions: [1, 2, 3, 4]}, + input: {dataType: 'int32', shape: [1, 2, 3, 4]}, repetitions: [-1, 1, 2, 3], }, { name: '[tile] Throw if any value in repetitions causes tiled dimension size overflow.', - input: {dataType: 'int32', dimensions: [1, 2, 3, 4]}, + input: {dataType: 'int32', shape: [1, 2, 3, 4]}, repetitions: [1, 1, kMaxUnsignedLong, 3], } ]; @@ -55,13 +55,11 @@ const tests = [ tests.forEach( test => promise_test(async t => { const builder = new MLGraphBuilder(context); - const input = builder.input( - 'input', - {dataType: test.input.dataType, dimensions: test.input.dimensions}); + const input = builder.input('input', test.input); if (test.output) { const output = builder.tile(input, test.repetitions, test.options); assert_equals(output.dataType(), test.output.dataType); - assert_array_equals(output.shape(), test.output.dimensions); + assert_array_equals(output.shape(), test.output.shape); } else { const options = {...test.options}; if (options.label) { diff --git a/testing/web-platform/tests/webnn/validation_tests/transpose.https.any.js b/testing/web-platform/tests/webnn/validation_tests/transpose.https.any.js index d6d250d79222..a79e14008a6a 100644 --- a/testing/web-platform/tests/webnn/validation_tests/transpose.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/transpose.https.any.js @@ -13,14 +13,14 @@ const label = 'transpose-2'; const tests = [ { name: '[transpose] Test building transpose with permutation=[0, 2, 3, 1].', - input: {dataType: 'float32', dimensions: [1, 2, 3, 4]}, + input: {dataType: 'float32', shape: [1, 2, 3, 4]}, options: {permutation: [0, 2, 3, 1]}, - output: {dataType: 'float32', dimensions: [1, 3, 4, 2]} + output: {dataType: 'float32', shape: [1, 3, 4, 2]} }, { name: '[transpose] Throw if permutation\'s size is not the same as input\'s rank.', - input: {dataType: 'int32', dimensions: [1, 2, 4]}, + input: {dataType: 'int32', shape: [1, 2, 4]}, options: { permutation: [0, 2, 3, 1], label: label, @@ -28,7 +28,7 @@ const tests = [ }, { name: '[transpose] Throw if two values in permutation are same.', - input: {dataType: 'int32', dimensions: [1, 2, 3, 4]}, + input: {dataType: 'int32', shape: [1, 2, 3, 4]}, options: { permutation: [0, 2, 3, 2], label: label, @@ -37,7 +37,7 @@ const tests = [ { name: '[transpose] Throw if any value in permutation is not in the range [0,input\'s rank).', - input: {dataType: 'int32', dimensions: [1, 2, 3, 4]}, + input: {dataType: 'int32', shape: [1, 2, 3, 4]}, options: { permutation: [0, 1, 2, 4], label: label, @@ -45,7 +45,7 @@ const tests = [ }, { name: '[transpose] Throw if any value in permutation is negative.', - input: {dataType: 'int32', dimensions: [1, 2, 3, 4]}, + input: {dataType: 'int32', shape: [1, 2, 3, 4]}, options: { permutation: [0, -1, 2, 3], }, @@ -55,13 +55,11 @@ const tests = [ tests.forEach( test => promise_test(async t => { const builder = new MLGraphBuilder(context); - const input = builder.input( - 'input', - {dataType: test.input.dataType, dimensions: test.input.dimensions}); + const input = builder.input('input', test.input); if (test.output) { const output = builder.transpose(input, test.options); assert_equals(output.dataType(), test.output.dataType); - assert_array_equals(output.shape(), test.output.dimensions); + assert_array_equals(output.shape(), test.output.shape); } else { const options = {...test.options}; if (options.label) { @@ -80,8 +78,8 @@ promise_test(async t => { continue; } const builder = new MLGraphBuilder(context); - const dimensions = [1, 2, 3, 4]; - const input = builder.input(`input`, {dataType, dimensions}); + const shape = [1, 2, 3, 4]; + const input = builder.input(`input`, {dataType, shape}); if (context.opSupportLimits().transpose.input.dataTypes.includes( dataType)) { const output = builder.transpose(input); diff --git a/testing/web-platform/tests/webnn/validation_tests/triangular.https.any.js b/testing/web-platform/tests/webnn/validation_tests/triangular.https.any.js index 0995d21d692b..bfeb716f9c4a 100644 --- a/testing/web-platform/tests/webnn/validation_tests/triangular.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/triangular.https.any.js @@ -11,12 +11,12 @@ promise_test(async t => { const builder = new MLGraphBuilder(context); // The input tensor which is at least 2-D. - for (let dimensions of allWebNNDimensionsArray.slice(0, 2)) { + for (let shape of allWebNNShapesArray.slice(0, 2)) { for (let dataType of allWebNNOperandDataTypes) { if (!context.opSupportLimits().input.dataTypes.includes(dataType)) { continue; } - const input = builder.input(`input${++inputIndex}`, {dataType, dimensions}); + const input = builder.input(`input${++inputIndex}`, {dataType, shape}); const label = 'triangular_3'; const options = {label}; const regrexp = new RegExp('\\[' + label + '\\]'); diff --git a/testing/web-platform/tests/webnn/validation_tests/where.https.any.js b/testing/web-platform/tests/webnn/validation_tests/where.https.any.js index 884b4857317f..2f1941556b1c 100644 --- a/testing/web-platform/tests/webnn/validation_tests/where.https.any.js +++ b/testing/web-platform/tests/webnn/validation_tests/where.https.any.js @@ -9,71 +9,71 @@ const kExampleConditionDescriptor = { dataType: 'uint8', - dimensions: [2, 4] + shape: [2, 4] }; const kExampleInputDescriptor = { dataType: 'float32', - dimensions: [2, 4] + shape: [2, 4] }; const tests = [ { name: '[where] Throw if the condition data type is not uint8.', - condition: {dataType: 'float32', dimensions: [2, 4]}, - trueValue: {dataType: 'float32', dimensions: [2, 4]}, - falseValue: {dataType: 'float32', dimensions: [2, 4]}, + condition: {dataType: 'float32', shape: [2, 4]}, + trueValue: {dataType: 'float32', shape: [2, 4]}, + falseValue: {dataType: 'float32', shape: [2, 4]}, }, { name: '[where] Throw if the data types of trueValue and falseValue do not match', - condition: {dataType: 'uint8', dimensions: [2, 4]}, - trueValue: {dataType: 'float16', dimensions: [2, 4]}, - falseValue: {dataType: 'float32', dimensions: [2, 4]}, + condition: {dataType: 'uint8', shape: [2, 4]}, + trueValue: {dataType: 'float16', shape: [2, 4]}, + falseValue: {dataType: 'float32', shape: [2, 4]}, }, { name: '[where] Throw if the shapes of trueValue and falseValue are not broadcastable', - condition: {dataType: 'uint8', dimensions: [2, 4]}, - trueValue: {dataType: 'float32', dimensions: [2, 4]}, - falseValue: {dataType: 'float32', dimensions: [2, 3]}, + condition: {dataType: 'uint8', shape: [2, 4]}, + trueValue: {dataType: 'float32', shape: [2, 4]}, + falseValue: {dataType: 'float32', shape: [2, 3]}, }, { name: '[where] Throw if the condition shape is not broadcastable', - condition: {dataType: 'uint8', dimensions: [2, 4]}, - trueValue: {dataType: 'float32', dimensions: [2, 3]}, - falseValue: {dataType: 'float32', dimensions: [2, 1]}, + condition: {dataType: 'uint8', shape: [2, 4]}, + trueValue: {dataType: 'float32', shape: [2, 3]}, + falseValue: {dataType: 'float32', shape: [2, 1]}, }, { name: '[where] Test building where with 2-D condition, 2-D trueValue and 2-D falseValue using broadcast', - condition: {dataType: 'uint8', dimensions: [2, 1]}, - trueValue: {dataType: 'float32', dimensions: [2, 4]}, - falseValue: {dataType: 'float32', dimensions: [2, 4]}, - output: {dataType: 'float32', dimensions: [2, 4]}, + condition: {dataType: 'uint8', shape: [2, 1]}, + trueValue: {dataType: 'float32', shape: [2, 4]}, + falseValue: {dataType: 'float32', shape: [2, 4]}, + output: {dataType: 'float32', shape: [2, 4]}, }, { name: '[where] Test building where with 2-D condition, 2-D trueValue and 3-D falseValue using broadcast', - condition: {dataType: 'uint8', dimensions: [1, 4]}, - trueValue: {dataType: 'float16', dimensions: [3, 4]}, - falseValue: {dataType: 'float16', dimensions: [2, 3, 4]}, - output: {dataType: 'float16', dimensions: [2, 3, 4]}, + condition: {dataType: 'uint8', shape: [1, 4]}, + trueValue: {dataType: 'float16', shape: [3, 4]}, + falseValue: {dataType: 'float16', shape: [2, 3, 4]}, + output: {dataType: 'float16', shape: [2, 3, 4]}, }, { name: '[where] Test building where with 3-D condition, 3-D trueValue and 2-D falseValue using broadcast', - condition: {dataType: 'uint8', dimensions: [2, 1, 4]}, - trueValue: {dataType: 'int32', dimensions: [2, 3, 4]}, - falseValue: {dataType: 'int32', dimensions: [1, 4]}, - output: {dataType: 'int32', dimensions: [2, 3, 4]}, + condition: {dataType: 'uint8', shape: [2, 1, 4]}, + trueValue: {dataType: 'int32', shape: [2, 3, 4]}, + falseValue: {dataType: 'int32', shape: [1, 4]}, + output: {dataType: 'int32', shape: [2, 3, 4]}, }, { name: '[where] Test building where with 4-D condition, 3-D trueValue and 2-D falseValue using broadcast', - condition: {dataType: 'uint8', dimensions: [2, 3, 4, 5]}, - trueValue: {dataType: 'uint32', dimensions: [3, 4, 5]}, - falseValue: {dataType: 'uint32', dimensions: [4, 5]}, - output: {dataType: 'uint32', dimensions: [2, 3, 4, 5]}, + condition: {dataType: 'uint8', shape: [2, 3, 4, 5]}, + trueValue: {dataType: 'uint32', shape: [3, 4, 5]}, + falseValue: {dataType: 'uint32', shape: [4, 5]}, + output: {dataType: 'uint32', shape: [2, 3, 4, 5]}, } ]; @@ -83,26 +83,14 @@ tests.forEach( for (let operand of [test.condition, test.trueValue, test.falseValue]) { if (!context.opSupportLimits().input.dataTypes.includes( operand.dataType)) { - assert_throws_js(TypeError, () => builder.input('input', { - dataType: operand.dataType, - dimensions: operand.dimensions - })); + assert_throws_js(TypeError, () => builder.input('input', operand)); return; } } - const condition = builder.input('condition', { - dataType: test.condition.dataType, - dimensions: test.condition.dimensions - }); - const trueValue = builder.input('trueValue', { - dataType: test.trueValue.dataType, - dimensions: test.trueValue.dimensions - }); - const falseValue = builder.input('falseValue', { - dataType: test.falseValue.dataType, - dimensions: test.falseValue.dimensions - }); + const condition = builder.input('condition', test.condition); + const trueValue = builder.input('trueValue', test.trueValue); + const falseValue = builder.input('falseValue', test.falseValue); if (test.output && context.opSupportLimits().where.condition.dataTypes.includes( test.condition.dataType) && @@ -112,7 +100,7 @@ tests.forEach( test.falseValue.dataType)) { const output = builder.where(condition, trueValue, falseValue); assert_equals(output.dataType(), test.output.dataType); - assert_array_equals(output.shape(), test.output.dimensions); + assert_array_equals(output.shape(), test.output.shape); } else { const label = 'where_123'; const options = {label};