Skip to content

Commit

Permalink
webnn: allow negative alpha value for elu operator
Browse files Browse the repository at this point in the history
This CL removes the restriction of alpha value for elu operator
according to the discussion of this spec issue[1].

[1]:  webmachinelearning/webnn#383

Bug: 382108345
Change-Id: I78429de7630a37e71bdfc0fdacedde6e1c7d3879
Cq-Include-Trybots: luci.chromium.try:mac14.arm64-blink-rel, mac14-blink-rel, mac15.arm64-blink-rel, mac15-blink-rel, linux-blink-rel
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6081404
Reviewed-by: Austin Sullivan <asully@chromium.org>
Commit-Queue: Lisha Guo <lisha.guo@intel.com>
Reviewed-by: ningxin hu <ningxin.hu@intel.com>
Cr-Commit-Position: refs/heads/main@{#1396572}
  • Loading branch information
lisa0314 authored and chromium-wpt-export-bot committed Dec 16, 2024
1 parent 38623a5 commit 5091556
Showing 1 changed file with 0 additions and 20 deletions.
20 changes: 0 additions & 20 deletions webnn/validation_tests/elu.https.any.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,26 +23,6 @@ promise_test(async t => {
assert_array_equals(output.shape, [1, 2, 3]);
}, '[elu] Build with options');

promise_test(async t => {
const builder = new MLGraphBuilder(context);
const options = {
alpha: -1.0,
label: label,
};
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');

promise_test(async t => {
const builder = new MLGraphBuilder(context);
const options = {
alpha: 0,
label: label,
};
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};
Expand Down

0 comments on commit 5091556

Please sign in to comment.