Source code

Revision control

Copy as Markdown

Other Tools

{
"tests": [
{
"name": "reduceL2 float32 1D constant tensor all positive default options", // default options: {axes: null, keepDimensions: false}
"inputs": {
"input": {
"shape": [24],
"data": [
4.860227954324237,
88.23184532015614,
54.489688892595865,
64.75027573238448,
6.855991445231058,
91.3987084155092,
41.888577644260664,
73.65445188651776,
35.31573479319383,
48.345430062443896,
82.3919051922353,
77.86200561022456,
93.31141688733462,
62.486883544675194,
60.292898644959706,
13.23059966965019,
20.535988317971942,
53.451616950541414,
11.32008585820996,
64.75763553379184,
43.65894603418228,
0.8374307376408652,
0.6848266407317727,
33.504704671527506
],
"type": "float32",
"constant": true
}
},
"expected": {
"name": "output",
"data": 272.0996398925781,
"type": "float32"
}
},
{
"name": "reduceL2 float32 1D tensor all positive default options", // default options: {axes: null, keepDimensions: false}
"inputs": {
"input": {
"shape": [24],
"data": [
4.860227954324237,
88.23184532015614,
54.489688892595865,
64.75027573238448,
6.855991445231058,
91.3987084155092,
41.888577644260664,
73.65445188651776,
35.31573479319383,
48.345430062443896,
82.3919051922353,
77.86200561022456,
93.31141688733462,
62.486883544675194,
60.292898644959706,
13.23059966965019,
20.535988317971942,
53.451616950541414,
11.32008585820996,
64.75763553379184,
43.65894603418228,
0.8374307376408652,
0.6848266407317727,
33.504704671527506
],
"type": "float32"
}
},
"expected": {
"name": "output",
"data": 272.0996398925781,
"type": "float32"
}
},
{
"name": "reduceL2 float32 1D tensor all negative default options",
"inputs": {
"input": {
"shape": [24],
"data": [
-66.80042739154972,
-53.00005108985402,
-59.58587770117833,
-46.14393008028177,
-49.60613922872308,
-12.832738832929593,
-88.05061277508285,
-75.56246522621561,
-50.767774970060664,
-36.96630141451547,
-26.34404432713906,
-58.905464928590476,
-94.28752832403735,
-22.780279721601616,
-84.34877530084705,
-60.477345782692815,
-41.45580712299912,
-92.84781353832356,
-85.0544854150549,
-30.23526041853337,
-47.33807956591096,
-25.26842900087003,
-78.1195878278582,
-28.3309437256642
],
"type": "float32"
}
},
"expected": {
"name": "output",
"data": 292.57574462890625,
"type": "float32"
}
},
{
"name": "reduceL2 float32 1D tensor all positive integers default options", // test with float32 values which are equivalent to integers
"inputs": {
"input": {
"shape": [24],
"data": [
4,
29,
8,
56,
42,
78,
89,
64,
56,
81,
85,
18,
6,
39,
35,
63,
87,
50,
81,
89,
5,
8,
37,
37
],
"type": "float32"
}
},
"expected": {
"name": "output",
"data": 274.4029846191406,
"type": "float32"
}
},
{
"name": "reduceL2 float32 1D tensor all negative integers default options", // test with float32 values which are equivalent to integers
"inputs": {
"input": {
"shape": [24],
"data": [
-70,
-78,
-65,
-77,
-25,
-47,
-63,
-67,
-66,
-15,
-28,
-75,
-88,
-54,
-13,
-27,
-5,
-18,
-68,
-71,
-50,
-56,
-99,
-99
],
"type": "float32"
}
},
"expected": {
"name": "output",
"data": 300.3830871582031,
"type": "float32"
}
},
{
"name": "reduceL2 float32 2D tensor default options",
"inputs": {
"input": {
"shape": [4, 6],
"data": [
4.860227954324237,
88.23184532015614,
54.489688892595865,
64.75027573238448,
6.855991445231058,
91.3987084155092,
41.888577644260664,
73.65445188651776,
35.31573479319383,
48.345430062443896,
82.3919051922353,
77.86200561022456,
93.31141688733462,
62.486883544675194,
60.292898644959706,
13.23059966965019,
20.535988317971942,
53.451616950541414,
11.32008585820996,
64.75763553379184,
43.65894603418228,
0.8374307376408652,
0.6848266407317727,
33.504704671527506
],
"type": "float32"
}
},
"expected": {
"name": "output",
"data": 272.0996398925781,
"type": "float32"
}
},
{
"name": "reduceL2 float32 3D tensor default options",
"inputs": {
"input": {
"shape": [2, 3, 4],
"data": [
4.860227954324237,
88.23184532015614,
54.489688892595865,
64.75027573238448,
6.855991445231058,
91.3987084155092,
41.888577644260664,
73.65445188651776,
35.31573479319383,
48.345430062443896,
82.3919051922353,
77.86200561022456,
93.31141688733462,
62.486883544675194,
60.292898644959706,
13.23059966965019,
20.535988317971942,
53.451616950541414,
11.32008585820996,
64.75763553379184,
43.65894603418228,
0.8374307376408652,
0.6848266407317727,
33.504704671527506
],
"type": "float32"
}
},
"expected": {
"name": "output",
"data": 272.0996398925781,
"type": "float32"
}
},
{
"name": "reduceL2 float32 4D tensor default options",
"inputs": {
"input": {
"shape": [2, 2, 2, 3],
"data": [
4.860227954324237,
88.23184532015614,
54.489688892595865,
64.75027573238448,
6.855991445231058,
91.3987084155092,
41.888577644260664,
73.65445188651776,
35.31573479319383,
48.345430062443896,
82.3919051922353,
77.86200561022456,
93.31141688733462,
62.486883544675194,
60.292898644959706,
13.23059966965019,
20.535988317971942,
53.451616950541414,
11.32008585820996,
64.75763553379184,
43.65894603418228,
0.8374307376408652,
0.6848266407317727,
33.504704671527506
],
"type": "float32"
}
},
"expected": {
"name": "output",
"data": 272.0996398925781,
"type": "float32"
}
},
{
"name": "reduceL2 float32 5D tensor default options",
"inputs": {
"input": {
"shape": [2, 1, 4, 1, 3],
"data": [
4.860227954324237,
88.23184532015614,
54.489688892595865,
64.75027573238448,
6.855991445231058,
91.3987084155092,
41.888577644260664,
73.65445188651776,
35.31573479319383,
48.345430062443896,
82.3919051922353,
77.86200561022456,
93.31141688733462,
62.486883544675194,
60.292898644959706,
13.23059966965019,
20.535988317971942,
53.451616950541414,
11.32008585820996,
64.75763553379184,
43.65894603418228,
0.8374307376408652,
0.6848266407317727,
33.504704671527506
],
"type": "float32"
}
},
"expected": {
"name": "output",
"data": 272.0996398925781,
"type": "float32"
}
},
{
"name": "reduceL2 float32 3D tensor options.axes",
"inputs": {
"input": {
"shape": [2, 3, 4],
"data": [
4.860227954324237,
88.23184532015614,
54.489688892595865,
64.75027573238448,
6.855991445231058,
91.3987084155092,
41.888577644260664,
73.65445188651776,
35.31573479319383,
48.345430062443896,
82.3919051922353,
77.86200561022456,
93.31141688733462,
62.486883544675194,
60.292898644959706,
13.23059966965019,
20.535988317971942,
53.451616950541414,
11.32008585820996,
64.75763553379184,
43.65894603418228,
0.8374307376408652,
0.6848266407317727,
33.504704671527506
],
"type": "float32"
}
},
"options": {
"axes": [2]
},
"expected": {
"name": "output",
"shape": [2, 3],
"data": [
122.352783203125,
124.8213119506836,
128.20062255859375,
128.14801025390625,
87.18083953857422,
55.043975830078125
],
"type": "float32"
}
},
{
"name": "reduceL2 float32 4D tensor options.axes",
"inputs": {
"input": {
"shape": [2, 2, 2, 3],
"data": [
4.860227954324237,
88.23184532015614,
54.489688892595865,
64.75027573238448,
6.855991445231058,
91.3987084155092,
41.888577644260664,
73.65445188651776,
35.31573479319383,
48.345430062443896,
82.3919051922353,
77.86200561022456,
93.31141688733462,
62.486883544675194,
60.292898644959706,
13.23059966965019,
20.535988317971942,
53.451616950541414,
11.32008585820996,
64.75763553379184,
43.65894603418228,
0.8374307376408652,
0.6848266407317727,
33.504704671527506
],
"type": "float32"
}
},
"options": {
"axes": [0, 2]
},
"expected": {
"name": "output",
"shape": [2, 3],
"data": [
114.44775390625,
110.26422882080078,
133.47344970703125,
64.96752166748047,
128.0914764404297,
101.677734375
],
"type": "float32"
}
},
{
"name": "reduceL2 float32 3D tensor options.keepDimensions=false",
"inputs": {
"input": {
"shape": [2, 3, 4],
"data": [
4.860227954324237,
88.23184532015614,
54.489688892595865,
64.75027573238448,
6.855991445231058,
91.3987084155092,
41.888577644260664,
73.65445188651776,
35.31573479319383,
48.345430062443896,
82.3919051922353,
77.86200561022456,
93.31141688733462,
62.486883544675194,
60.292898644959706,
13.23059966965019,
20.535988317971942,
53.451616950541414,
11.32008585820996,
64.75763553379184,
43.65894603418228,
0.8374307376408652,
0.6848266407317727,
33.504704671527506
],
"type": "float32"
}
},
"options": {
"keepDimensions": false
},
"expected": {
"name": "output",
"data": 272.0996398925781,
"type": "float32"
}
},
{
"name": "reduceL2 float32 3D tensor options.keepDimensions=true",
"inputs": {
"input": {
"shape": [2, 3, 4],
"data": [
4.860227954324237,
88.23184532015614,
54.489688892595865,
64.75027573238448,
6.855991445231058,
91.3987084155092,
41.888577644260664,
73.65445188651776,
35.31573479319383,
48.345430062443896,
82.3919051922353,
77.86200561022456,
93.31141688733462,
62.486883544675194,
60.292898644959706,
13.23059966965019,
20.535988317971942,
53.451616950541414,
11.32008585820996,
64.75763553379184,
43.65894603418228,
0.8374307376408652,
0.6848266407317727,
33.504704671527506
],
"type": "float32"
}
},
"options": {
"keepDimensions": true
},
"expected": {
"name": "output",
"shape": [1, 1, 1],
"data": [
272.0996398925781
],
"type": "float32"
}
},
{
"name": "reduceL2 float32 4D tensor options.keepDimensions=false",
"inputs": {
"input": {
"shape": [2, 2, 2, 3],
"data": [
4.860227954324237,
88.23184532015614,
54.489688892595865,
64.75027573238448,
6.855991445231058,
91.3987084155092,
41.888577644260664,
73.65445188651776,
35.31573479319383,
48.345430062443896,
82.3919051922353,
77.86200561022456,
93.31141688733462,
62.486883544675194,
60.292898644959706,
13.23059966965019,
20.535988317971942,
53.451616950541414,
11.32008585820996,
64.75763553379184,
43.65894603418228,
0.8374307376408652,
0.6848266407317727,
33.504704671527506
],
"type": "float32"
}
},
"options": {
"keepDimensions": false
},
"expected": {
"name": "output",
"data": 272.0996398925781,
"type": "float32"
}
},
{
"name": "reduceL2 float32 4D tensor options.keepDimensions=true",
"inputs": {
"input": {
"shape": [2, 2, 2, 3],
"data": [
4.860227954324237,
88.23184532015614,
54.489688892595865,
64.75027573238448,
6.855991445231058,
91.3987084155092,
41.888577644260664,
73.65445188651776,
35.31573479319383,
48.345430062443896,
82.3919051922353,
77.86200561022456,
93.31141688733462,
62.486883544675194,
60.292898644959706,
13.23059966965019,
20.535988317971942,
53.451616950541414,
11.32008585820996,
64.75763553379184,
43.65894603418228,
0.8374307376408652,
0.6848266407317727,
33.504704671527506
],
"type": "float32"
}
},
"options": {
"keepDimensions": true
},
"expected": {
"name": "output",
"shape": [1, 1, 1, 1],
"data": [
272.0996398925781
],
"type": "float32"
}
},
{
"name": "reduceL2 float32 4D tensor options.axes with options.keepDimensions=false",
"inputs": {
"input": {
"shape": [2, 2, 2, 3],
"data": [
4.860227954324237,
88.23184532015614,
54.489688892595865,
64.75027573238448,
6.855991445231058,
91.3987084155092,
41.888577644260664,
73.65445188651776,
35.31573479319383,
48.345430062443896,
82.3919051922353,
77.86200561022456,
93.31141688733462,
62.486883544675194,
60.292898644959706,
13.23059966965019,
20.535988317971942,
53.451616950541414,
11.32008585820996,
64.75763553379184,
43.65894603418228,
0.8374307376408652,
0.6848266407317727,
33.504704671527506
],
"type": "float32"
}
},
"options": {
"axes": [1, 3],
"keepDimensions": false
},
"expected": {
"name": "output",
"shape": [2, 2],
"data": [
138.580078125,
166.67791748046875,
149.91552734375,
67.6578598022461
],
"type": "float32"
}
},
{
"name": "reduceL2 float32 4D tensor options.axes with options.keepDimensions=true",
"inputs": {
"input": {
"shape": [2, 2, 2, 3],
"data": [
4.860227954324237,
88.23184532015614,
54.489688892595865,
64.75027573238448,
6.855991445231058,
91.3987084155092,
41.888577644260664,
73.65445188651776,
35.31573479319383,
48.345430062443896,
82.3919051922353,
77.86200561022456,
93.31141688733462,
62.486883544675194,
60.292898644959706,
13.23059966965019,
20.535988317971942,
53.451616950541414,
11.32008585820996,
64.75763553379184,
43.65894603418228,
0.8374307376408652,
0.6848266407317727,
33.504704671527506
],
"type": "float32"
}
},
"options": {
"axes": [1, 3],
"keepDimensions": true
},
"expected": {
"name": "output",
"shape": [2, 1, 2, 1],
"data": [
138.580078125,
166.67791748046875,
149.91552734375,
67.6578598022461
],
"type": "float32"
}
}
]
}