Source code

Revision control

Copy as Markdown

Other Tools

{ // softplus: The calculation follows the expression ln(1 + exp(x)).
"tests": [
{
"name": "softplus float32 1D constant tensor",
"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",
"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",
"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",
"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",
"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",
"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"
}
}
]
}