From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../tests/webnn/resources/test_data/softplus.json | 539 +++++++++++++++++++++ 1 file changed, 539 insertions(+) create mode 100644 testing/web-platform/tests/webnn/resources/test_data/softplus.json (limited to 'testing/web-platform/tests/webnn/resources/test_data/softplus.json') diff --git a/testing/web-platform/tests/webnn/resources/test_data/softplus.json b/testing/web-platform/tests/webnn/resources/test_data/softplus.json new file mode 100644 index 0000000000..eb05b7b281 --- /dev/null +++ b/testing/web-platform/tests/webnn/resources/test_data/softplus.json @@ -0,0 +1,539 @@ +{ // softplus: The calculation follows the expression ln(1 + exp(steepness * x)) / steepness. + "tests": [ + { + "name": "softplus float32 1D constant tensor default options", // default options: {steepness: 1} + "inputs": { + "x": { + "shape": [24], + "data": [ + 5.626614582460632, + 5.167487045486892, + 4.0146356193402655, + 9.48003299650489, + 9.989938045769978, + 7.0654412821434125, + 2.132681001794825, + 8.187151346059956, + 5.169976220175496, + 2.1044997879382077, + 3.523329401138895, + 4.136340646976668, + 1.7418719794295656, + 5.145224066290767, + 5.015515309165462, + 0.045903935074711466, + 2.9570898924917377, + 3.959244712098706, + 5.517926978255181, + 7.192322388417094, + 8.76492480390928, + 1.3734704039113388, + 8.930669016709397, + 8.660283210871246 + ], + "type": "float32", + "constant": true + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + 5.630208969116211, + 5.1731696128845215, + 4.032524108886719, + 9.480109214782715, + 9.989983558654785, + 7.0662946701049805, + 2.2446866035461426, + 8.187429428100586, + 5.175644874572754, + 2.219529390335083, + 3.552403688430786, + 4.152195453643799, + 1.903303623199463, + 5.151034355163574, + 5.022127628326416, + 0.7163625359535217, + 3.007754325866699, + 3.978142499923706, + 5.521933078765869, + 7.1930742263793945, + 8.765081405639648, + 1.5991919040679932, + 8.930801391601562, + 8.660456657409668 + ], + "type": "float32" + } + }, + { + "name": "softplus float32 1D tensor default options", // default options: {steepness: 1} + "inputs": { + "x": { + "shape": [24], + "data": [ + 5.626614582460632, + 5.167487045486892, + 4.0146356193402655, + 9.48003299650489, + 9.989938045769978, + 7.0654412821434125, + 2.132681001794825, + 8.187151346059956, + 5.169976220175496, + 2.1044997879382077, + 3.523329401138895, + 4.136340646976668, + 1.7418719794295656, + 5.145224066290767, + 5.015515309165462, + 0.045903935074711466, + 2.9570898924917377, + 3.959244712098706, + 5.517926978255181, + 7.192322388417094, + 8.76492480390928, + 1.3734704039113388, + 8.930669016709397, + 8.660283210871246 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape": [24], + "data": [ + 5.630208969116211, + 5.1731696128845215, + 4.032524108886719, + 9.480109214782715, + 9.989983558654785, + 7.0662946701049805, + 2.2446866035461426, + 8.187429428100586, + 5.175644874572754, + 2.219529390335083, + 3.552403688430786, + 4.152195453643799, + 1.903303623199463, + 5.151034355163574, + 5.022127628326416, + 0.7163625359535217, + 3.007754325866699, + 3.978142499923706, + 5.521933078765869, + 7.1930742263793945, + 8.765081405639648, + 1.5991919040679932, + 8.930801391601562, + 8.660456657409668 + ], + "type": "float32" + } + }, + { + "name": "softplus float32 2D tensor default options", + "inputs": { + "x": { + "shape": [4, 6], + "data": [ + 5.626614582460632, + 5.167487045486892, + 4.0146356193402655, + 9.48003299650489, + 9.989938045769978, + 7.0654412821434125, + 2.132681001794825, + 8.187151346059956, + 5.169976220175496, + 2.1044997879382077, + 3.523329401138895, + 4.136340646976668, + 1.7418719794295656, + 5.145224066290767, + 5.015515309165462, + 0.045903935074711466, + 2.9570898924917377, + 3.959244712098706, + 5.517926978255181, + 7.192322388417094, + 8.76492480390928, + 1.3734704039113388, + 8.930669016709397, + 8.660283210871246 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape": [4, 6], + "data": [ + 5.630208969116211, + 5.1731696128845215, + 4.032524108886719, + 9.480109214782715, + 9.989983558654785, + 7.0662946701049805, + 2.2446866035461426, + 8.187429428100586, + 5.175644874572754, + 2.219529390335083, + 3.552403688430786, + 4.152195453643799, + 1.903303623199463, + 5.151034355163574, + 5.022127628326416, + 0.7163625359535217, + 3.007754325866699, + 3.978142499923706, + 5.521933078765869, + 7.1930742263793945, + 8.765081405639648, + 1.5991919040679932, + 8.930801391601562, + 8.660456657409668 + ], + "type": "float32" + } + }, + { + "name": "softplus float32 3D tensor default options", + "inputs": { + "x": { + "shape": [2, 3, 4], + "data": [ + 5.626614582460632, + 5.167487045486892, + 4.0146356193402655, + 9.48003299650489, + 9.989938045769978, + 7.0654412821434125, + 2.132681001794825, + 8.187151346059956, + 5.169976220175496, + 2.1044997879382077, + 3.523329401138895, + 4.136340646976668, + 1.7418719794295656, + 5.145224066290767, + 5.015515309165462, + 0.045903935074711466, + 2.9570898924917377, + 3.959244712098706, + 5.517926978255181, + 7.192322388417094, + 8.76492480390928, + 1.3734704039113388, + 8.930669016709397, + 8.660283210871246 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape": [2, 3, 4], + "data": [ + 5.630208969116211, + 5.1731696128845215, + 4.032524108886719, + 9.480109214782715, + 9.989983558654785, + 7.0662946701049805, + 2.2446866035461426, + 8.187429428100586, + 5.175644874572754, + 2.219529390335083, + 3.552403688430786, + 4.152195453643799, + 1.903303623199463, + 5.151034355163574, + 5.022127628326416, + 0.7163625359535217, + 3.007754325866699, + 3.978142499923706, + 5.521933078765869, + 7.1930742263793945, + 8.765081405639648, + 1.5991919040679932, + 8.930801391601562, + 8.660456657409668 + ], + "type": "float32" + } + }, + { + "name": "softplus float32 4D tensor default options", + "inputs": { + "x": { + "shape": [1, 2, 3, 4], + "data": [ + 5.626614582460632, + 5.167487045486892, + 4.0146356193402655, + 9.48003299650489, + 9.989938045769978, + 7.0654412821434125, + 2.132681001794825, + 8.187151346059956, + 5.169976220175496, + 2.1044997879382077, + 3.523329401138895, + 4.136340646976668, + 1.7418719794295656, + 5.145224066290767, + 5.015515309165462, + 0.045903935074711466, + 2.9570898924917377, + 3.959244712098706, + 5.517926978255181, + 7.192322388417094, + 8.76492480390928, + 1.3734704039113388, + 8.930669016709397, + 8.660283210871246 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape": [1, 2, 3, 4], + "data": [ + 5.630208969116211, + 5.1731696128845215, + 4.032524108886719, + 9.480109214782715, + 9.989983558654785, + 7.0662946701049805, + 2.2446866035461426, + 8.187429428100586, + 5.175644874572754, + 2.219529390335083, + 3.552403688430786, + 4.152195453643799, + 1.903303623199463, + 5.151034355163574, + 5.022127628326416, + 0.7163625359535217, + 3.007754325866699, + 3.978142499923706, + 5.521933078765869, + 7.1930742263793945, + 8.765081405639648, + 1.5991919040679932, + 8.930801391601562, + 8.660456657409668 + ], + "type": "float32" + } + }, + { + "name": "softplus float32 5D tensor default options", + "inputs": { + "x": { + "shape": [1, 2, 1, 3, 4], + "data": [ + 5.626614582460632, + 5.167487045486892, + 4.0146356193402655, + 9.48003299650489, + 9.989938045769978, + 7.0654412821434125, + 2.132681001794825, + 8.187151346059956, + 5.169976220175496, + 2.1044997879382077, + 3.523329401138895, + 4.136340646976668, + 1.7418719794295656, + 5.145224066290767, + 5.015515309165462, + 0.045903935074711466, + 2.9570898924917377, + 3.959244712098706, + 5.517926978255181, + 7.192322388417094, + 8.76492480390928, + 1.3734704039113388, + 8.930669016709397, + 8.660283210871246 + ], + "type": "float32" + } + }, + "expected": { + "name": "output", + "shape": [1, 2, 1, 3, 4], + "data": [ + 5.630208969116211, + 5.1731696128845215, + 4.032524108886719, + 9.480109214782715, + 9.989983558654785, + 7.0662946701049805, + 2.2446866035461426, + 8.187429428100586, + 5.175644874572754, + 2.219529390335083, + 3.552403688430786, + 4.152195453643799, + 1.903303623199463, + 5.151034355163574, + 5.022127628326416, + 0.7163625359535217, + 3.007754325866699, + 3.978142499923706, + 5.521933078765869, + 7.1930742263793945, + 8.765081405639648, + 1.5991919040679932, + 8.930801391601562, + 8.660456657409668 + ], + "type": "float32" + } + }, + { + "name": "softplus both positive float32 4D tensor and options.steepness", + "inputs": { + "x": { + "shape": [1, 2, 3, 4], + "data": [ + 5.626614582460632, + 5.167487045486892, + 4.0146356193402655, + 9.48003299650489, + 9.989938045769978, + 7.0654412821434125, + 2.132681001794825, + 8.187151346059956, + 5.169976220175496, + 2.1044997879382077, + 3.523329401138895, + 4.136340646976668, + 1.7418719794295656, + 5.145224066290767, + 5.015515309165462, + 0.045903935074711466, + 2.9570898924917377, + 3.959244712098706, + 5.517926978255181, + 7.192322388417094, + 8.76492480390928, + 1.3734704039113388, + 8.930669016709397, + 8.660283210871246 + ], + "type": "float32" + } + }, + "options": { + "steepness": 1.5104469060897827 + }, + "expected": { + "name": "output", + "shape": [1, 2, 3, 4], + "data": [ + 5.626749515533447, + 5.167757034301758, + 4.016173362731934, + 9.480032920837402, + 9.989937782287598, + 7.065456390380859, + 2.158585548400879, + 8.187153816223145, + 5.170245170593262, + 2.1315081119537354, + 3.526555061340332, + 4.137620449066162, + 1.7879058122634888, + 5.145503044128418, + 5.015854835510254, + 0.4822517931461334, + 2.964651584625244, + 3.960916519165039, + 5.518085956573486, + 7.19233512878418, + 8.764925956726074, + 1.4518096446990967, + 8.930669784545898, + 8.660284042358398 + ], + "type": "float32" + } + }, + { + "name": "softplus both negative float32 4D tensor and options.steepness", + "inputs": { + "x": { + "shape": [1, 2, 3, 4], + "data": [ + -5.584833476104802, + -8.188738740810354, + -8.981280004134987, + -1.7315531899284586, + -0.7266543578958906, + -0.0034800119290885334, + -7.378389455552106, + -8.907525953796949, + -6.0483786568116304, + -6.328561142365743, + -2.6006513567654626, + -5.02005264196455, + -2.0647716093484414, + -1.5499896740695434, + -2.221591675966657, + -1.1088025713211636, + -2.7854626064634385, + -2.105037489961294, + -5.144277741727352, + -5.081219916574497, + -7.499426297617635, + -2.4305558382286545, + -8.390520024268328, + -0.07117499202643174 + ], + "type": "float32" + } + }, + "options": { + "steepness": -1.2985155767552126 + }, + "expected": { + "name": "output", + "shape": [1, 2, 3, 4], + "data": [ + -5.585379123687744, + -8.188756942749023, + -8.981287002563477, + -1.8088372945785522, + -0.9798305630683899, + -0.5355416536331177, + -7.378442287445068, + -8.907533645629883, + -6.048677444458008, + -6.328769207000732, + -2.626511573791504, + -5.021188259124756, + -2.1157851219177246, + -1.6465802192687988, + -2.2634570598602295, + -1.2725814580917358, + -2.805877923965454, + -2.1535322666168213, + -5.145244121551514, + -5.082269191741943, + -7.499471664428711, + -2.4626762866973877, + -8.390534400939941, + -0.5702091455459595 + ], + "type": "float32" + } + } + ] +} \ No newline at end of file -- cgit v1.2.3