diff --git a/webnn/validation_tests/lstm.https.any.js b/webnn/validation_tests/lstm.https.any.js index c7d341a9d5aa29a..2a3eaa1c20258b9 100644 --- a/webnn/validation_tests/lstm.https.any.js +++ b/webnn/validation_tests/lstm.https.any.js @@ -113,7 +113,7 @@ const tests = [ ] }, { - name: '[lstm] DataError is expected if hiddenSize equals to zero', + name: '[lstm] TypeError is expected if hiddenSize equals to zero', input: kExampleInputDescriptor, weight: kExampleWeightDescriptor, recurrentWeight: kExampleRecurrentWeightDescriptor, @@ -121,7 +121,7 @@ const tests = [ hiddenSize: 0 }, { - name: '[lstm] DataError is expected if hiddenSize is too large', + name: '[lstm] TypeError is expected if hiddenSize is too large', input: kExampleInputDescriptor, weight: kExampleWeightDescriptor, recurrentWeight: kExampleRecurrentWeightDescriptor, @@ -129,7 +129,7 @@ const tests = [ hiddenSize: 4294967295, }, { - name: '[lstm] DataError is expected if steps equals to zero', + name: '[lstm] TypeError is expected if steps equals to zero', input: kExampleInputDescriptor, weight: kExampleWeightDescriptor, recurrentWeight: kExampleRecurrentWeightDescriptor, @@ -138,7 +138,7 @@ const tests = [ }, { name: - '[lstm] DataError is expected if the data type is not one of the floating point types', + '[lstm] TypeError is expected if the data type is not one of the floating point types', input: {dataType: 'uint32', dimensions: kValidInputDimensions}, weight: {dataType: 'uint32', dimensions: kValidWeightDimensions}, recurrentWeight: @@ -147,7 +147,7 @@ const tests = [ hiddenSize: hiddenSize }, { - name: '[lstm] DataError is expected if the rank of input is not 3', + name: '[lstm] TypeError is expected if the rank of input is not 3', input: {dataType: 'float32', dimensions: [steps, batchSize]}, weight: kExampleWeightDescriptor, recurrentWeight: kExampleRecurrentWeightDescriptor, @@ -156,7 +156,7 @@ const tests = [ }, { name: - '[lstm] DataError is expected if input.dimensions[0] is not equal to steps', + '[lstm] TypeError is expected if input.dimensions[0] is not equal to steps', input: {dataType: 'float32', dimensions: [1000, batchSize, inputSize]}, weight: kExampleWeightDescriptor, recurrentWeight: kExampleRecurrentWeightDescriptor, @@ -164,7 +164,7 @@ const tests = [ hiddenSize: hiddenSize }, { - name: '[lstm] DataError is expected if the shape of weight is incorrect', + name: '[lstm] TypeError is expected if the shape of weight is incorrect', input: kExampleInputDescriptor, weight: { dataType: 'float32', @@ -176,7 +176,7 @@ const tests = [ }, { name: - '[lstm] DataError is expected if the rank of recurrentWeight is not 3', + '[lstm] TypeError is expected if the rank of recurrentWeight is not 3', input: kExampleInputDescriptor, weight: kExampleWeightDescriptor, recurrentWeight: @@ -186,7 +186,7 @@ const tests = [ }, { name: - '[lstm] DataError is expected if the size of options.activations is not 3', + '[lstm] TypeError is expected if the size of options.activations is not 3', input: kExampleInputDescriptor, weight: kExampleWeightDescriptor, recurrentWeight: kExampleRecurrentWeightDescriptor, @@ -195,7 +195,7 @@ const tests = [ options: {activations: ['sigmoid', 'tanh']} }, { - name: '[lstm] DataError is expected if the rank of options.bias is not 2', + name: '[lstm] TypeError is expected if the rank of options.bias is not 2', input: {dataType: 'float16', dimensions: kValidInputDimensions}, weight: {dataType: 'float16', dimensions: kValidWeightDimensions}, recurrentWeight: @@ -206,7 +206,7 @@ const tests = [ }, { name: - '[lstm] DataError is expected if the shape of options.recurrentBias.dimensions is incorrect', + '[lstm] TypeError is expected if the shape of options.recurrentBias.dimensions is incorrect', input: {dataType: 'float16', dimensions: kValidInputDimensions}, weight: {dataType: 'float16', dimensions: kValidWeightDimensions}, recurrentWeight: @@ -219,7 +219,7 @@ const tests = [ }, { name: - '[lstm] DataError is expected if the dataType of options.peepholeWeight is incorrect', + '[lstm] TypeError is expected if the dataType of options.peepholeWeight is incorrect', input: {dataType: 'float16', dimensions: kValidInputDimensions}, weight: {dataType: 'float16', dimensions: kValidWeightDimensions}, recurrentWeight: @@ -233,7 +233,7 @@ const tests = [ }, { name: - '[lstm] DataError is expected if the dataType of options.initialHiddenState is incorrect', + '[lstm] TypeError is expected if the dataType of options.initialHiddenState is incorrect', input: {dataType: 'float16', dimensions: kValidInputDimensions}, weight: {dataType: 'float16', dimensions: kValidWeightDimensions}, recurrentWeight: @@ -249,7 +249,7 @@ const tests = [ }, { name: - '[lstm] DataError is expected if the shape of options.initialCellState is incorrect', + '[lstm] TypeError is expected if the shape of options.initialCellState is incorrect', input: kExampleInputDescriptor, weight: kExampleWeightDescriptor, recurrentWeight: kExampleRecurrentWeightDescriptor, @@ -333,8 +333,8 @@ tests.forEach( assert_array_equals(outputs[i].shape(), test.outputs[i].dimensions); } } else { - assert_throws_dom( - 'DataError', + assert_throws_js( + TypeError, () => builder.lstm( input, weight, recurrentWeight, test.steps, test.hiddenSize, options)); diff --git a/webnn/validation_tests/triangular.https.any.js b/webnn/validation_tests/triangular.https.any.js index ee8958659c74529..59694a426036aba 100644 --- a/webnn/validation_tests/triangular.https.any.js +++ b/webnn/validation_tests/triangular.https.any.js @@ -12,6 +12,6 @@ promise_test(async t => { assert_throws_js(TypeError, () => builder.triangular(input)); } } -}, "[triangular] DataError is expected if input's rank is less than 2"); +}, "[triangular] TypeError is expected if input's rank is less than 2"); validateInputFromAnotherBuilder('triangular');