Skip to content

Commit 4a8ce8a

Browse files
committed
Bug 1935024 [wpt PR 49504] - webnn: Fix WPT data type compatibility matching for constants, a=testonly
Automatic update from web-platform-tests webnn: Fix WPT data type compatibility matching for constants The existing code assumes that the supported data types for the input() and constant() methods are the same. This is not true on some platforms Cq-Include-Trybots: luci.chromium.try​:win11-blink-rel,mac14-blink-rel,mac14.arm64-blink-rel Change-Id: Id0365b623500f9bdb815e3332c3e9cfe4689bf11 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6064547 Auto-Submit: Austin Sullivan <asullychromium.org> Commit-Queue: Phillis Tang <phillischromium.org> Reviewed-by: Phillis Tang <phillischromium.org> Cr-Commit-Position: refs/heads/main{#1391227} -- wpt-commits: 48178346fe87222856812842fb7af7b01baa1530 wpt-pr: 49504 UltraBlame original commit: 2675ff0492bd5c0d1a345e0c187fef2b52352cd2
1 parent 1659e43 commit 4a8ce8a

File tree

1 file changed

+6
-3
lines changed
  • testing/web-platform/tests/webnn/resources

1 file changed

+6
-3
lines changed

testing/web-platform/tests/webnn/resources/utils.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -440,11 +440,14 @@ const createOperand = (context, builder, operandName, resources) => {
440440
const descriptor = resources.descriptor;
441441
const dataType = descriptor.dataType;
442442

443+
const supportedDataTypes = resources.constant ?
444+
context.opSupportLimits().constant.dataTypes :
445+
context.opSupportLimits().input.dataTypes;
446+
443447

444448

445-
if (!context.opSupportLimits().input.dataTypes.includes(dataType)) {
446-
const compatibleType =
447-
findCompatibleType(dataType, context.opSupportLimits().input.dataTypes);
449+
if (!supportedDataTypes.includes(dataType)) {
450+
const compatibleType = findCompatibleType(dataType, supportedDataTypes);
448451
if (compatibleType) {
449452
descriptor.castedType = compatibleType;
450453
descriptor.dataType = compatibleType;

0 commit comments

Comments
 (0)