summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/webnn/resources/test_data/softmax.json
blob: ebb12114fc6e08ed51b1f9dd3ff820d3664e8f2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
{
  "tests": [
    {
      "name": "softmax float32 2D constant tensor all positive",
      "inputs": {
        "x": {
          "shape": [4, 6],
          "data": [
            7.903734730203054,
            6.358251623091922,
            4.833756774572475,
            9.579165187926348,
            0.21071856783621445,
            4.554958961778823,
            7.150174113718282,
            8.330297576341172,
            1.535985791562966,
            6.633619497318013,
            1.45393689965033,
            0.21341864769940821,
            5.257819475802503,
            8.1921378632378,
            8.161730206898543,
            2.8744343334015565,
            8.950733525100087,
            6.111632812590415,
            1.6371468489476149,
            0.2762612074523485,
            5.028227187056009,
            3.898326029997037,
            2.8967114227178836,
            6.8894703393234575
          ],
          "type": "float32",
          "constant": true
        }
      },
      "expected": {
        "name": "output",
        "shape": [4, 6],
        "data": [
          0.15068615972995758,
          0.03212761878967285,
          0.006995180621743202,
          0.8048291206359863,
          0.00006871300138300285,
          0.005293202120810747,
          0.2057899534702301,
          0.6698001027107239,
          0.0007502624066546559,
          0.1227685883641243,
          0.0006911618984304368,
          0.00019990770670119673,
          0.012398251332342625,
          0.23319464921951294,
          0.22621041536331177,
          0.0011435872875154018,
          0.4979347288608551,
          0.029118351638317108,
          0.004253828432410955,
          0.001090824487619102,
          0.12633030116558075,
          0.040812913328409195,
          0.014990009367465973,
          0.8125221133232117
        ],
        "type": "float32"
      }
    },
    {
      "name": "softmax float32 2D tensor all positive",
      "inputs": {
        "x": {
          "shape": [4, 6],
          "data": [
            7.903734730203054,
            6.358251623091922,
            4.833756774572475,
            9.579165187926348,
            0.21071856783621445,
            4.554958961778823,
            7.150174113718282,
            8.330297576341172,
            1.535985791562966,
            6.633619497318013,
            1.45393689965033,
            0.21341864769940821,
            5.257819475802503,
            8.1921378632378,
            8.161730206898543,
            2.8744343334015565,
            8.950733525100087,
            6.111632812590415,
            1.6371468489476149,
            0.2762612074523485,
            5.028227187056009,
            3.898326029997037,
            2.8967114227178836,
            6.8894703393234575
          ],
          "type": "float32"
        }
      },
      "expected": {
        "name": "output",
        "shape": [4, 6],
        "data": [
          0.15068615972995758,
          0.03212761878967285,
          0.006995180621743202,
          0.8048291206359863,
          0.00006871300138300285,
          0.005293202120810747,
          0.2057899534702301,
          0.6698001027107239,
          0.0007502624066546559,
          0.1227685883641243,
          0.0006911618984304368,
          0.00019990770670119673,
          0.012398251332342625,
          0.23319464921951294,
          0.22621041536331177,
          0.0011435872875154018,
          0.4979347288608551,
          0.029118351638317108,
          0.004253828432410955,
          0.001090824487619102,
          0.12633030116558075,
          0.040812913328409195,
          0.014990009367465973,
          0.8125221133232117
        ],
        "type": "float32"
      }
    },
    {
      "name": "softmax float32 2D tensor all negative",
      "inputs": {
        "x": {
          "shape": [4, 6],
          "data": [
            -3.3118434934513763,
            -3.338954812269648,
            -3.4102789638525355,
            -6.697192980301335,
            -7.896223320202411,
            -3.3081689006635866,
            -3.2309720485303473,
            -4.315771351061817,
            -9.311088112018716,
            -3.9236627720798856,
            -3.7807213277512064,
            -6.034926915403203,
            -3.9196677453714273,
            -2.223484249593408,
            -9.326531526135806,
            -1.4882492282868132,
            -6.302842393071306,
            -5.531475594479687,
            -1.8421411696525603,
            -4.994808274460977,
            -9.527291818875955,
            -4.985682906583053,
            -8.421041200931548,
            -6.235629579015209
          ],
          "type": "float32"
        }
      },
      "expected": {
        "name": "output",
        "shape": [4, 6],
        "data": [
          0.2546302080154419,
          0.24781952798366547,
          0.2307596504688263,
          0.008623254485428333,
          0.002599793951958418,
          0.2555675804615021,
          0.40352678298950195,
          0.13637976348400116,
          0.0009232329903170466,
          0.20185552537441254,
          0.23287305235862732,
          0.024441635236144066,
          0.0551743283867836,
          0.3008708655834198,
          0.0002474947541486472,
          0.6276082992553711,
          0.0050902292132377625,
          0.011008745059370995,
          0.9090295433998108,
          0.0388500951230526,
          0.00041779119055718184,
          0.039206232875585556,
          0.0012629841221496463,
          0.011233373545110226
        ],
        "type": "float32"
      }
    }
  ]
}