tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

triangular.https.any.js (977B)


      1 // META: title=validation tests for WebNN API triangular operation
      2 // META: global=window
      3 // META: variant=?cpu
      4 // META: variant=?gpu
      5 // META: variant=?npu
      6 // META: script=../resources/utils_validation.js
      7 
      8 'use strict';
      9 
     10 promise_test(async t => {
     11  const builder = new MLGraphBuilder(context);
     12 
     13  // The input tensor which is at least 2-D.
     14  for (let shape of allWebNNShapesArray.slice(0, 2)) {
     15    for (let dataType of allWebNNOperandDataTypes) {
     16      if (!context.opSupportLimits().input.dataTypes.includes(dataType)) {
     17        continue;
     18      }
     19      const input = builder.input(`input${++inputIndex}`, {dataType, shape});
     20      const label = 'triangular_3';
     21      const options = {label};
     22      const regrexp = new RegExp('\\[' + label + '\\]');
     23      assert_throws_with_label(
     24          () => builder.triangular(input, options), regrexp);
     25    }
     26  }
     27 }, '[triangular] TypeError is expected if input\'s rank is less than 2');
     28 
     29 validateInputFromAnotherBuilder('triangular');