Skip to content

Commit

Permalink
Bug 1914186 [wpt PR 47711] - webnn: Set a max operand rank of 8, a=te…
Browse files Browse the repository at this point in the history
…stonly

Automatic update from web-platform-tests
webnn: Set a max operand rank of 8

We likely eventually want this to be part of MLOpSupportsLimits, but
for now this allows us to replace some checked-casts in favor of
static-casts, and not need to worry about tensors with absurd ranks

See webmachinelearning/webnn#456

Bug: 329482489
Cq-Include-Trybots: luci.chromium.try​:win11-blink-rel,mac14-blink-rel,mac14.arm64-blink-rel
Change-Id: I021d3b30ea1b8f5f3bef1725130fd2e4c569f494
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5639505
Reviewed-by: ningxin hu <ningxin.hu@intel.com>
Reviewed-by: Phillis Tang <phillis@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Austin Sullivan <asully@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1344800}

--

wpt-commits: 3897cad3ad9f133db0c92269004109b95bec59ee
wpt-pr: 47711
  • Loading branch information
a-sully authored and moz-wptsync-bot committed Aug 23, 2024
1 parent ec28015 commit 86c8ae6
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// META: title=ensure an MLOperand cannot be created with an invalid rank
// META: global=window,dedicatedworker
// META: variant=?cpu
// META: variant=?gpu
// META: variant=?npu
// META: script=../resources/utils_validation.js

promise_test(async t => {
const builder = new MLGraphBuilder(context);

const shapeWithLargeRank = Array(10).fill(2);
assert_throws_js(
TypeError,
() => builder.input(
'a', {dataType: 'float32', dimensions: shapeWithLargeRank}));
}, 'Throw if rank is too large');

0 comments on commit 86c8ae6

Please sign in to comment.