From 43a97878ce14b72f0981164f87f2e35e14151312 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 7 Apr 2024 11:22:09 +0200 Subject: Adding upstream version 110.0.1. Signed-off-by: Daniel Baumann --- .../web-platform/tests/webnn/split.https.any.js | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 testing/web-platform/tests/webnn/split.https.any.js (limited to 'testing/web-platform/tests/webnn/split.https.any.js') diff --git a/testing/web-platform/tests/webnn/split.https.any.js b/testing/web-platform/tests/webnn/split.https.any.js new file mode 100644 index 0000000000..54314d7b7f --- /dev/null +++ b/testing/web-platform/tests/webnn/split.https.any.js @@ -0,0 +1,24 @@ +// META: title=test WebNN API split operation +// META: global=window,dedicatedworker +// META: script=./resources/utils.js +// META: timeout=long + +'use strict'; + +// https://webmachinelearning.github.io/webnn/#api-mlgraphbuilder-split + +const buildSplit = (operationName, builder, resources) => { + // sequence split(MLOperand input, + // (unsigned long or sequence) splits, + // optional MLSplitOptions options = {}); + const namedOutputOperand = {}; + const inputOperand = createSingleInputOperand(builder, resources); + // invoke builder.split() + const outputOperands = builder[operationName](inputOperand, resources.splits, resources.options); + resources.expected.forEach((resourceDict, index) => { + namedOutputOperand[resourceDict.name] = outputOperands[index]; + }); + return namedOutputOperand; +}; + +testWebNNOperation('split', '/webnn/resources/test_data/split.json', buildSplit); \ No newline at end of file -- cgit v1.2.3