summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/webnn/resources/test_data/reduce_sum.json
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/webnn/resources/test_data/reduce_sum.json')
-rw-r--r--testing/web-platform/tests/webnn/resources/test_data/reduce_sum.json735
1 files changed, 735 insertions, 0 deletions
diff --git a/testing/web-platform/tests/webnn/resources/test_data/reduce_sum.json b/testing/web-platform/tests/webnn/resources/test_data/reduce_sum.json
new file mode 100644
index 0000000000..df47a1a2b2
--- /dev/null
+++ b/testing/web-platform/tests/webnn/resources/test_data/reduce_sum.json
@@ -0,0 +1,735 @@
+{
+ "tests": [
+ {
+ "name": "reduceSum float32 1D constant tensor all positive default options",
+ "inputs": {
+ "input": {
+ "shape": [24],
+ "data": [
+ 69.6038605453285,
+ 99.1748548274599,
+ 32.782341359545676,
+ 8.881362932730319,
+ 16.094296257493014,
+ 11.806894918510213,
+ 32.64223805640243,
+ 43.998363476438975,
+ 77.01777099153088,
+ 79.79425759062173,
+ 45.007949804090174,
+ 24.39779644056914,
+ 57.50268541631618,
+ 57.60172895173401,
+ 80.26985885745457,
+ 43.65110628848945,
+ 87.50368667545843,
+ 94.50203768533922,
+ 35.54289690580114,
+ 42.856416416096344,
+ 88.58631651618441,
+ 98.85772999308332,
+ 25.62685451963782,
+ 60.17613590317996
+ ],
+ "type": "float32",
+ "constant": true
+ }
+ },
+ "expected": {
+ "name": "output",
+ "data": 1313.87939453125,
+ "type": "float32"
+ }
+ },
+ {
+ "name": "reduceSum float32 1D tensor all positive default options",
+ "inputs": {
+ "input": {
+ "shape": [24],
+ "data": [
+ 69.6038605453285,
+ 99.1748548274599,
+ 32.782341359545676,
+ 8.881362932730319,
+ 16.094296257493014,
+ 11.806894918510213,
+ 32.64223805640243,
+ 43.998363476438975,
+ 77.01777099153088,
+ 79.79425759062173,
+ 45.007949804090174,
+ 24.39779644056914,
+ 57.50268541631618,
+ 57.60172895173401,
+ 80.26985885745457,
+ 43.65110628848945,
+ 87.50368667545843,
+ 94.50203768533922,
+ 35.54289690580114,
+ 42.856416416096344,
+ 88.58631651618441,
+ 98.85772999308332,
+ 25.62685451963782,
+ 60.17613590317996
+ ],
+ "type": "float32"
+ }
+ },
+ "expected": {
+ "name": "output",
+ "data": 1313.87939453125,
+ "type": "float32"
+ }
+ },
+ {
+ "name": "reduceSum float32 1D tensor all negative default options",
+ "inputs": {
+ "input": {
+ "shape": [24],
+ "data": [
+ -51.77016701194195,
+ -34.46467785404002,
+ -40.983506494422414,
+ -83.34922667410298,
+ -67.67525749941849,
+ -18.703119061215574,
+ -20.281060841405974,
+ -20.123054810748656,
+ -83.63451764199297,
+ -23.651085471445683,
+ -10.20843911447325,
+ -36.212902987180804,
+ -76.26201536868358,
+ -9.094745329540757,
+ -53.88933855716023,
+ -67.52341028201596,
+ -71.14580362299527,
+ -82.04484921713924,
+ -96.29924980334548,
+ -68.46700365583722,
+ -26.107193300700942,
+ -68.01821308673175,
+ -4.833076925370335,
+ -48.90069809349882
+ ],
+ "type": "float32"
+ }
+ },
+ "expected": {
+ "name": "output",
+ "data": -1163.642578125,
+ "type": "float32"
+ }
+ },
+ {
+ "name": "reduceSum float32 1D tensor all positive integers default options", // test with float32 values which are equivalent to integers
+ "inputs": {
+ "input": {
+ "shape": [24],
+ "data": [
+ 56,
+ 90,
+ 67,
+ 33,
+ 20,
+ 58,
+ 22,
+ 15,
+ 86,
+ 79,
+ 59,
+ 99,
+ 16,
+ 95,
+ 67,
+ 11,
+ 60,
+ 89,
+ 50,
+ 57,
+ 77,
+ 89,
+ 10,
+ 2
+ ],
+ "type": "float32"
+ }
+ },
+ "expected": {
+ "name": "output",
+ "data": 1307,
+ "type": "float32"
+ }
+ },
+ {
+ "name": "reduceSum float32 1D tensor all negative integers default options", // test with float32 values which are equivalent to integers
+ "inputs": {
+ "input": {
+ "shape": [24],
+ "data": [
+ -55,
+ -36,
+ -74,
+ -17,
+ -67,
+ -95,
+ -3,
+ -67,
+ -95,
+ -13,
+ -45,
+ -9,
+ -33,
+ -98,
+ -86,
+ -11,
+ -70,
+ -44,
+ -31,
+ -68,
+ -79,
+ -24,
+ -60,
+ -36
+ ],
+ "type": "float32"
+ }
+ },
+ "expected": {
+ "name": "output",
+ "data": -1216,
+ "type": "float32"
+ }
+ },
+ {
+ "name": "reduceSum float32 2D tensor default options",
+ "inputs": {
+ "input": {
+ "shape": [4, 6],
+ "data": [
+ 69.6038605453285,
+ 99.1748548274599,
+ 32.782341359545676,
+ 8.881362932730319,
+ 16.094296257493014,
+ 11.806894918510213,
+ 32.64223805640243,
+ 43.998363476438975,
+ 77.01777099153088,
+ 79.79425759062173,
+ 45.007949804090174,
+ 24.39779644056914,
+ 57.50268541631618,
+ 57.60172895173401,
+ 80.26985885745457,
+ 43.65110628848945,
+ 87.50368667545843,
+ 94.50203768533922,
+ 35.54289690580114,
+ 42.856416416096344,
+ 88.58631651618441,
+ 98.85772999308332,
+ 25.62685451963782,
+ 60.17613590317996
+ ],
+ "type": "float32"
+ }
+ },
+ "expected": {
+ "name": "output",
+ "data": 1313.87939453125,
+ "type": "float32"
+ }
+ },
+ {
+ "name": "reduceSum float32 3D tensor default options",
+ "inputs": {
+ "input": {
+ "shape": [2, 3, 4],
+ "data": [
+ 69.6038605453285,
+ 99.1748548274599,
+ 32.782341359545676,
+ 8.881362932730319,
+ 16.094296257493014,
+ 11.806894918510213,
+ 32.64223805640243,
+ 43.998363476438975,
+ 77.01777099153088,
+ 79.79425759062173,
+ 45.007949804090174,
+ 24.39779644056914,
+ 57.50268541631618,
+ 57.60172895173401,
+ 80.26985885745457,
+ 43.65110628848945,
+ 87.50368667545843,
+ 94.50203768533922,
+ 35.54289690580114,
+ 42.856416416096344,
+ 88.58631651618441,
+ 98.85772999308332,
+ 25.62685451963782,
+ 60.17613590317996
+ ],
+ "type": "float32"
+ }
+ },
+ "expected": {
+ "name": "output",
+ "data": 1313.87939453125,
+ "type": "float32"
+ }
+ },
+ {
+ "name": "reduceSum float32 4D tensor default options",
+ "inputs": {
+ "input": {
+ "shape": [2, 2, 2, 3],
+ "data": [
+ 69.6038605453285,
+ 99.1748548274599,
+ 32.782341359545676,
+ 8.881362932730319,
+ 16.094296257493014,
+ 11.806894918510213,
+ 32.64223805640243,
+ 43.998363476438975,
+ 77.01777099153088,
+ 79.79425759062173,
+ 45.007949804090174,
+ 24.39779644056914,
+ 57.50268541631618,
+ 57.60172895173401,
+ 80.26985885745457,
+ 43.65110628848945,
+ 87.50368667545843,
+ 94.50203768533922,
+ 35.54289690580114,
+ 42.856416416096344,
+ 88.58631651618441,
+ 98.85772999308332,
+ 25.62685451963782,
+ 60.17613590317996
+ ],
+ "type": "float32"
+ }
+ },
+ "expected": {
+ "name": "output",
+ "data": 1313.87939453125,
+ "type": "float32"
+ }
+ },
+ {
+ "name": "reduceSum float32 5D tensor default options",
+ "inputs": {
+ "input": {
+ "shape": [2, 1, 4, 1, 3],
+ "data": [
+ 69.6038605453285,
+ 99.1748548274599,
+ 32.782341359545676,
+ 8.881362932730319,
+ 16.094296257493014,
+ 11.806894918510213,
+ 32.64223805640243,
+ 43.998363476438975,
+ 77.01777099153088,
+ 79.79425759062173,
+ 45.007949804090174,
+ 24.39779644056914,
+ 57.50268541631618,
+ 57.60172895173401,
+ 80.26985885745457,
+ 43.65110628848945,
+ 87.50368667545843,
+ 94.50203768533922,
+ 35.54289690580114,
+ 42.856416416096344,
+ 88.58631651618441,
+ 98.85772999308332,
+ 25.62685451963782,
+ 60.17613590317996
+ ],
+ "type": "float32"
+ }
+ },
+ "expected": {
+ "name": "output",
+ "data": 1313.87939453125,
+ "type": "float32"
+ }
+ },
+ {
+ "name": "reduceSum float32 3D tensor options.axes",
+ "inputs": {
+ "input": {
+ "shape": [2, 3, 4],
+ "data": [
+ 69.6038605453285,
+ 99.1748548274599,
+ 32.782341359545676,
+ 8.881362932730319,
+ 16.094296257493014,
+ 11.806894918510213,
+ 32.64223805640243,
+ 43.998363476438975,
+ 77.01777099153088,
+ 79.79425759062173,
+ 45.007949804090174,
+ 24.39779644056914,
+ 57.50268541631618,
+ 57.60172895173401,
+ 80.26985885745457,
+ 43.65110628848945,
+ 87.50368667545843,
+ 94.50203768533922,
+ 35.54289690580114,
+ 42.856416416096344,
+ 88.58631651618441,
+ 98.85772999308332,
+ 25.62685451963782,
+ 60.17613590317996
+ ],
+ "type": "float32"
+ }
+ },
+ "options": {
+ "axes": [2]
+ },
+ "expected": {
+ "shape": [2, 3],
+ "data": [
+ 210.44241333007812,
+ 104.54179382324219,
+ 226.2177734375,
+ 239.025390625,
+ 260.405029296875,
+ 273.2470397949219
+ ],
+ "type": "float32"
+ }
+ },
+ {
+ "name": "reduceSum float32 4D tensor options.axes",
+ "inputs": {
+ "input": {
+ "shape": [2, 2, 2, 3],
+ "data": [
+ 69.6038605453285,
+ 99.1748548274599,
+ 32.782341359545676,
+ 8.881362932730319,
+ 16.094296257493014,
+ 11.806894918510213,
+ 32.64223805640243,
+ 43.998363476438975,
+ 77.01777099153088,
+ 79.79425759062173,
+ 45.007949804090174,
+ 24.39779644056914,
+ 57.50268541631618,
+ 57.60172895173401,
+ 80.26985885745457,
+ 43.65110628848945,
+ 87.50368667545843,
+ 94.50203768533922,
+ 35.54289690580114,
+ 42.856416416096344,
+ 88.58631651618441,
+ 98.85772999308332,
+ 25.62685451963782,
+ 60.17613590317996
+ ],
+ "type": "float32"
+ }
+ },
+ "options": {
+ "axes": [0, 2]
+ },
+ "expected": {
+ "shape": [2, 3],
+ "data": [
+ 179.63900756835938,
+ 260.37457275390625,
+ 219.3611297607422,
+ 246.83712768554688,
+ 157.4895782470703,
+ 250.1780242919922
+ ],
+ "type": "float32"
+ }
+ },
+ {
+ "name": "reduceSum float32 3D tensor options.keepDimensions=false",
+ "inputs": {
+ "input": {
+ "shape": [2, 3, 4],
+ "data": [
+ 69.6038605453285,
+ 99.1748548274599,
+ 32.782341359545676,
+ 8.881362932730319,
+ 16.094296257493014,
+ 11.806894918510213,
+ 32.64223805640243,
+ 43.998363476438975,
+ 77.01777099153088,
+ 79.79425759062173,
+ 45.007949804090174,
+ 24.39779644056914,
+ 57.50268541631618,
+ 57.60172895173401,
+ 80.26985885745457,
+ 43.65110628848945,
+ 87.50368667545843,
+ 94.50203768533922,
+ 35.54289690580114,
+ 42.856416416096344,
+ 88.58631651618441,
+ 98.85772999308332,
+ 25.62685451963782,
+ 60.17613590317996
+ ],
+ "type": "float32"
+ }
+ },
+ "options": {
+ "keepDimensions": false
+ },
+ "expected": {
+ "data": 1313.87939453125,
+ "type": "float32"
+ }
+ },
+ {
+ "name": "reduceSum float32 3D tensor options.keepDimensions=true",
+ "inputs": {
+ "input": {
+ "shape": [2, 3, 4],
+ "data": [
+ 69.6038605453285,
+ 99.1748548274599,
+ 32.782341359545676,
+ 8.881362932730319,
+ 16.094296257493014,
+ 11.806894918510213,
+ 32.64223805640243,
+ 43.998363476438975,
+ 77.01777099153088,
+ 79.79425759062173,
+ 45.007949804090174,
+ 24.39779644056914,
+ 57.50268541631618,
+ 57.60172895173401,
+ 80.26985885745457,
+ 43.65110628848945,
+ 87.50368667545843,
+ 94.50203768533922,
+ 35.54289690580114,
+ 42.856416416096344,
+ 88.58631651618441,
+ 98.85772999308332,
+ 25.62685451963782,
+ 60.17613590317996
+ ],
+ "type": "float32"
+ }
+ },
+ "options": {
+ "keepDimensions": true
+ },
+ "expected": {
+ "shape": [1, 1, 1],
+ "data": [
+ 1313.87939453125
+ ],
+ "type": "float32"
+ }
+ },
+ {
+ "name": "reduceSum float32 4D tensor options.keepDimensions=false",
+ "inputs": {
+ "input": {
+ "shape": [2, 2, 2, 3],
+ "data": [
+ 69.6038605453285,
+ 99.1748548274599,
+ 32.782341359545676,
+ 8.881362932730319,
+ 16.094296257493014,
+ 11.806894918510213,
+ 32.64223805640243,
+ 43.998363476438975,
+ 77.01777099153088,
+ 79.79425759062173,
+ 45.007949804090174,
+ 24.39779644056914,
+ 57.50268541631618,
+ 57.60172895173401,
+ 80.26985885745457,
+ 43.65110628848945,
+ 87.50368667545843,
+ 94.50203768533922,
+ 35.54289690580114,
+ 42.856416416096344,
+ 88.58631651618441,
+ 98.85772999308332,
+ 25.62685451963782,
+ 60.17613590317996
+ ],
+ "type": "float32"
+ }
+ },
+ "options": {
+ "keepDimensions": false
+ },
+ "expected": {
+ "data": 1313.87939453125,
+ "type": "float32"
+ }
+ },
+ {
+ "name": "reduceSum float32 4D tensor options.keepDimensions=true",
+ "inputs": {
+ "input": {
+ "shape": [2, 2, 2, 3],
+ "data": [
+ 69.6038605453285,
+ 99.1748548274599,
+ 32.782341359545676,
+ 8.881362932730319,
+ 16.094296257493014,
+ 11.806894918510213,
+ 32.64223805640243,
+ 43.998363476438975,
+ 77.01777099153088,
+ 79.79425759062173,
+ 45.007949804090174,
+ 24.39779644056914,
+ 57.50268541631618,
+ 57.60172895173401,
+ 80.26985885745457,
+ 43.65110628848945,
+ 87.50368667545843,
+ 94.50203768533922,
+ 35.54289690580114,
+ 42.856416416096344,
+ 88.58631651618441,
+ 98.85772999308332,
+ 25.62685451963782,
+ 60.17613590317996
+ ],
+ "type": "float32"
+ }
+ },
+ "options": {
+ "keepDimensions": true
+ },
+ "expected": {
+ "shape": [1, 1, 1, 1],
+ "data": [
+ 1313.87939453125
+ ],
+ "type": "float32"
+ }
+ },
+ {
+ "name": "reduceSum float32 4D tensor options.axes with options.keepDimensions=false",
+ "inputs": {
+ "input": {
+ "shape": [2, 2, 2, 3],
+ "data": [
+ 69.6038605453285,
+ 99.1748548274599,
+ 32.782341359545676,
+ 8.881362932730319,
+ 16.094296257493014,
+ 11.806894918510213,
+ 32.64223805640243,
+ 43.998363476438975,
+ 77.01777099153088,
+ 79.79425759062173,
+ 45.007949804090174,
+ 24.39779644056914,
+ 57.50268541631618,
+ 57.60172895173401,
+ 80.26985885745457,
+ 43.65110628848945,
+ 87.50368667545843,
+ 94.50203768533922,
+ 35.54289690580114,
+ 42.856416416096344,
+ 88.58631651618441,
+ 98.85772999308332,
+ 25.62685451963782,
+ 60.17613590317996
+ ],
+ "type": "float32"
+ }
+ },
+ "options": {
+ "axes": [1, 3]
+ },
+ "expected": {
+ "shape": [2, 2],
+ "data": [
+ 355.21942138671875,
+ 185.98255920410156,
+ 362.3598937988281,
+ 410.3175354003906
+ ],
+ "type": "float32"
+ }
+ },
+ {
+ "name": "reduceSum float32 4D tensor options.axes with options.keepDimensions=true",
+ "inputs": {
+ "input": {
+ "shape": [2, 2, 2, 3],
+ "data": [
+ 69.6038605453285,
+ 99.1748548274599,
+ 32.782341359545676,
+ 8.881362932730319,
+ 16.094296257493014,
+ 11.806894918510213,
+ 32.64223805640243,
+ 43.998363476438975,
+ 77.01777099153088,
+ 79.79425759062173,
+ 45.007949804090174,
+ 24.39779644056914,
+ 57.50268541631618,
+ 57.60172895173401,
+ 80.26985885745457,
+ 43.65110628848945,
+ 87.50368667545843,
+ 94.50203768533922,
+ 35.54289690580114,
+ 42.856416416096344,
+ 88.58631651618441,
+ 98.85772999308332,
+ 25.62685451963782,
+ 60.17613590317996
+ ],
+ "type": "float32"
+ }
+ },
+ "options": {
+ "axes": [1, 3]
+ },
+ "expected": {
+ "shape": [1, 2, 2, 1],
+ "data": [
+ 355.21942138671875,
+ 185.98255920410156,
+ 362.3598937988281,
+ 410.3175354003906
+ ],
+ "type": "float32"
+ }
+ }
+ ]
+} \ No newline at end of file