commit 42d675951bce60840489fbe32c0c852845c8e05a
parent 731a91bca835ba6b9c01932781549223e7ff013a
Author: junwei <junwei.fu@intel.com>
Date: Wed, 15 Oct 2025 08:21:55 +0000
Bug 1993489 [wpt PR 55127] - webnn: Enable mxbai_rerank_base_v1_fp32 model on TFLite backend, a=testonly
Automatic update from web-platform-tests
webnn: Enable mxbai_rerank_base_v1_fp32 model on TFLite backend
GatherElements is emulated by GatherND that will always output a tensor
with one dimension because the shape of the indices tensor is 2
[flat_indices_size, input_rank], so we need to reshape the output tensor
to the expected shape.
For example, if the input shape is [4, 2, 2], the indices are [1, 2, 2]
and axis = 0, then the output shape of gatherND will be [4] that is
calculated with ResizeTensor. The shape needs to be reshaped to [1, 2,
2].
Bug: 446463978
Change-Id: If3cbada6a46822ec4b44b60dec831caa4bc174f0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6987334
Reviewed-by: Reilly Grant <reillyg@chromium.org>
Commit-Queue: Junwei Fu <junwei.fu@intel.com>
Reviewed-by: ningxin hu <ningxin.hu@intel.com>
Cr-Commit-Position: refs/heads/main@{#1527269}
--
wpt-commits: b7561965c86f42353cd619180fa3419726babe82
wpt-pr: 55127
Diffstat:
1 file changed, 52 insertions(+), 0 deletions(-)
diff --git a/testing/web-platform/tests/webnn/conformance_tests/subgraph.https.any.js b/testing/web-platform/tests/webnn/conformance_tests/subgraph.https.any.js
@@ -2524,6 +2524,58 @@ const subgraphTests = [
}
},
{
+ 'name': 'gatherElements + matmul',
+ 'graph': {
+ 'inputs': {
+ 'gatherElementsInput': {
+ 'data': [
+ -66.05901336669922, -68.9197006225586, -77.02045440673828,
+ -26.158037185668945, 89.0337142944336, -45.89653396606445,
+ 43.84803771972656, 48.81806945800781, 51.79948425292969
+ ],
+ 'descriptor': {shape: [3, 3], dataType: 'float32'}
+ },
+ 'gatherElementsIndices': {
+ 'data': [1, 0, 2, 2, 1, 0],
+ 'descriptor': {shape: [2, 3], dataType: 'int32'},
+ 'constant': true
+ },
+ 'matmulB': {
+ 'data': [
+ 56.46701431274414, 99.86045837402344, 71.054931640625,
+ 32.454383850097656, 17.310747146606445, 2.586275100708008,
+ ],
+ 'descriptor': {shape: [3, 2], dataType: 'float32'}
+ },
+ },
+ 'operators': [
+ {
+ 'name': 'gatherElements',
+ 'arguments': [
+ {'input': 'gatherElementsInput'}, {'indices': 'gatherElementsIndices'}
+ ],
+ 'outputs': 'gatherElementsOutput'
+ },
+ {
+ 'name': 'matmul',
+ 'arguments': [
+ {'a': 'gatherElementsOutput'}, {'b': 'matmulB'}
+ ],
+ 'outputs': 'matmulOutput'
+ }
+ ],
+ 'expectedOutputs': {
+ 'matmulOutput': {
+ 'data': [
+ -5477.462890625, -4714.93212890625,
+ 7468.97021484375, 7069.02294921875
+ ],
+ 'descriptor': {shape: [2, 2], dataType: 'float32'}
+ }
+ }
+ }
+ },
+ {
'name': 'float16 graph with float32 input and output',
'graph': {
'inputs': {