summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/webnn/validation_tests/gather.https.any.js
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/webnn/validation_tests/gather.https.any.js')
-rw-r--r--testing/web-platform/tests/webnn/validation_tests/gather.https.any.js21
1 files changed, 20 insertions, 1 deletions
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 67ac7d7be3..184e8033e6 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
@@ -1,7 +1,6 @@
// META: title=validation tests for WebNN API gather operation
// META: global=window,dedicatedworker
// META: script=../resources/utils_validation.js
-// META: timeout=long
'use strict';
@@ -60,3 +59,23 @@ tests.forEach(
TypeError, () => builder.gather(input, indices, options));
}
}, test.name));
+
+multi_builder_test(async (t, builder, otherBuilder) => {
+ const inputFromOtherBuilder =
+ otherBuilder.input('input', {dataType: 'float32', dimensions: [2, 2]});
+
+ const indices =
+ builder.input('indices', {dataType: 'int64', dimensions: [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]});
+
+ const input =
+ builder.input('input', {dataType: 'float32', dimensions: [2, 2]});
+ assert_throws_js(
+ TypeError, () => builder.gather(input, indicesFromOtherBuilder));
+}, '[gather] throw if indices is from another builder');