matmul.https.any.js (47667B)
1 // META: title=test WebNN API matmul operation 2 // META: global=window 3 // META: variant=?cpu 4 // META: variant=?gpu 5 // META: variant=?npu 6 // META: script=../resources/utils.js 7 // META: timeout=long 8 9 'use strict'; 10 11 // https://www.w3.org/TR/webnn/#api-mlgraphbuilder-matmul 12 // Compute the matrix product of two input tensors. 13 // MLOperand matmul(MLOperand a, MLOperand b); 14 15 16 const matmulTests = [ 17 { 18 'name': 'matmul float32 2D and 2D tensors', 19 'graph': { 20 'inputs': { 21 'inputA': { 22 'data': [ 23 10.43066120147705, 24.467519760131836, 55.887577056884766, 24 3.2410826683044434, 87.58891296386719, 22.40154457092285, 25 79.85144805908203, 99.64449310302734, 24.740541458129883, 26 65.9624252319336, 38.136077880859375, 87.11140441894531 27 ], 28 'descriptor': {shape: [3, 4], dataType: 'float32'} 29 }, 30 'inputB': { 31 'data': [ 32 88.1700439453125, 78.4012680053711, 14.819003105163574, 33 3.6923038959503174, 45.906429290771484, 43.083919525146484, 34 47.199466705322266, 60.92521667480469, 8.162760734558105, 35 20.333263397216797, 20.438398361206055, 27.0194091796875, 36 15.601424217224121, 87.46969604492188, 65.79554748535156, 37 69.31697082519531, 31.984439849853516, 12.291812896728516, 38 13.304834365844727, 85.26705169677734 39 ], 40 'descriptor': {shape: [4, 5], dataType: 'float32'} 41 } 42 }, 43 'operators': [{ 44 'name': 'matmul', 45 'arguments': [{'a': 'inputA'}, {'b': 'inputB'}], 46 'outputs': 'output' 47 }], 48 'expectedOutputs': { 49 'output': { 50 'data': [ 51 3340.7431640625, 3586.344482421875, 2557.025634765625, 52 5169.8271484375, 4929.85009765625, 17226.955078125, 13269.03515625, 53 5133.4072265625, 8816.5986328125, 18226.65234375, 11841.033203125, 54 8869.705078125, 6051.1396484375, 5124.5390625, 12413.8984375 55 ], 56 'descriptor': {shape: [3, 5], dataType: 'float32'} 57 } 58 } 59 } 60 }, 61 { 62 'name': 'matmul float32 3D and 3D tensors', 63 'graph': { 64 'inputs': { 65 'inputA': { 66 'data': [ 67 56.46701431274414, 99.86045837402344, 71.054931640625, 68 32.454383850097656, 17.310747146606445, 2.586275100708008, 69 92.31499481201172, 96.9758529663086, 26.472131729125977, 70 77.67031860351562, 29.278789520263672, 82.12142181396484, 71 89.89308166503906, 82.49795532226562, 64.36865997314453, 72 23.75928497314453, 6.670266628265381, 81.55583190917969, 73 16.142963409423828, 57.45134735107422, 26.826417922973633, 74 85.02970123291016, 36.1988639831543, 89.60960388183594 75 ], 76 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} 77 }, 78 'inputB': { 79 'data': [ 80 70.38780212402344, 25.48917579650879, 28.254196166992188, 81 84.5148696899414, 58.873416900634766, 46.252838134765625, 82 24.897335052490234, 44.0944938659668, 51.86564636230469, 83 1.123237133026123, 4.187554836273193, 71.24649810791016, 84 16.034526824951172, 23.677297592163086, 61.27727508544922, 85 65.15946197509766, 58.39249801635742, 70.12741088867188, 86 9.11972713470459, 24.179977416992188, 84.4263687133789, 87 78.55551147460938, 38.48297119140625, 80.6541519165039, 88 57.152122497558594, 46.109710693359375, 28.41227912902832, 89 90.92566680908203, 94.66068267822266, 61.77287673950195, 90 60.324859619140625, 70.97433471679688, 10.631051063537598, 91 55.61628341674805, 35.052310943603516, 22.12839126586914, 92 38.19757843017578, 78.17564392089844, 62.57684326171875, 93 88.35256958007812 94 ], 95 'descriptor': {shape: [2, 4, 5], dataType: 'float32'} 96 } 97 }, 98 'operators': [{ 99 'name': 'matmul', 100 'arguments': [{'a': 'inputA'}, {'b': 'inputB'}], 101 'outputs': 'output' 102 }], 103 'expectedOutputs': { 104 'output': { 105 'data': [ 106 11005.6748046875, 10883.064453125, 9414.0009765625, 107 11929.9931640625, 8575.3720703125, 8043.556640625, 108 12745.41015625, 8884.0341796875, 4667.3173828125, 109 9023.7333984375, 10929.3818359375, 9489.8232421875, 110 10401.216796875, 7707.87744140625, 5425.5654296875, 111 15802.0888671875, 14881.6220703125, 13502.23828125, 112 20126.2890625, 14589.1806640625, 6568.7900390625, 113 6181.41162109375, 12335.123046875, 12751.05078125, 114 11060.98046875, 10352.16015625, 10515.310546875, 115 16153.86328125, 17833.36328125, 15971.80859375 116 ], 117 'descriptor': {shape: [2, 3, 5], dataType: 'float32'} 118 } 119 } 120 } 121 }, 122 { 123 'name': 'matmul float32 4D and 4D tensors', 124 'graph': { 125 'inputs': { 126 'inputA': { 127 'data': [ 128 56.46701431274414, 99.86045837402344, 71.054931640625, 129 32.454383850097656, 17.310747146606445, 2.586275100708008, 130 92.31499481201172, 96.9758529663086, 26.472131729125977, 131 77.67031860351562, 29.278789520263672, 82.12142181396484, 132 89.89308166503906, 82.49795532226562, 64.36865997314453, 133 23.75928497314453, 6.670266628265381, 81.55583190917969, 134 16.142963409423828, 57.45134735107422, 26.826417922973633, 135 85.02970123291016, 36.1988639831543, 89.60960388183594 136 ], 137 'descriptor': {shape: [2, 1, 3, 4], dataType: 'float32'} 138 }, 139 'inputB': { 140 'data': [ 141 70.38780212402344, 25.48917579650879, 28.254196166992188, 142 84.5148696899414, 58.873416900634766, 46.252838134765625, 143 24.897335052490234, 44.0944938659668, 51.86564636230469, 144 1.123237133026123, 4.187554836273193, 71.24649810791016, 145 16.034526824951172, 23.677297592163086, 61.27727508544922, 146 65.15946197509766, 58.39249801635742, 70.12741088867188, 147 9.11972713470459, 24.179977416992188, 84.4263687133789, 148 78.55551147460938, 38.48297119140625, 80.6541519165039, 149 57.152122497558594, 46.109710693359375, 28.41227912902832, 150 90.92566680908203, 94.66068267822266, 61.77287673950195, 151 60.324859619140625, 70.97433471679688, 10.631051063537598, 152 55.61628341674805, 35.052310943603516, 22.12839126586914, 153 38.19757843017578, 78.17564392089844, 62.57684326171875, 154 88.35256958007812 155 ], 156 'descriptor': {shape: [2, 1, 4, 5], dataType: 'float32'} 157 } 158 }, 159 'operators': [{ 160 'name': 'matmul', 161 'arguments': [{'a': 'inputA'}, {'b': 'inputB'}], 162 'outputs': 'output' 163 }], 164 'expectedOutputs': { 165 'output': { 166 'data': [ 167 11005.6748046875, 10883.064453125, 9414.0009765625, 168 11929.9931640625, 8575.3720703125, 8043.556640625, 169 12745.41015625, 8884.0341796875, 4667.3173828125, 170 9023.7333984375, 10929.3818359375, 9489.8232421875, 171 10401.216796875, 7707.87744140625, 5425.5654296875, 172 15802.0888671875, 14881.6220703125, 13502.23828125, 173 20126.2890625, 14589.1806640625, 6568.7900390625, 174 6181.41162109375, 12335.123046875, 12751.05078125, 175 11060.98046875, 10352.16015625, 10515.310546875, 176 16153.86328125, 17833.36328125, 15971.80859375 177 ], 178 'descriptor': {shape: [2, 1, 3, 5], dataType: 'float32'} 179 } 180 } 181 } 182 }, 183 { 184 'name': 'matmul float32 3D and 3D (broadcast) tensors', 185 'graph': { 186 'inputs': { 187 'inputA': { 188 'data': [ 189 56.46701431274414, 99.86045837402344, 71.054931640625, 190 32.454383850097656, 17.310747146606445, 2.586275100708008, 191 92.31499481201172, 96.9758529663086, 26.472131729125977, 192 77.67031860351562, 29.278789520263672, 82.12142181396484, 193 89.89308166503906, 82.49795532226562, 64.36865997314453, 194 23.75928497314453, 6.670266628265381, 81.55583190917969, 195 16.142963409423828, 57.45134735107422, 26.826417922973633, 196 85.02970123291016, 36.1988639831543, 89.60960388183594 197 ], 198 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} 199 }, 200 'inputB': { 201 'data': [ 202 27.829805374145508, 83.1454849243164, 34.41289520263672, 203 83.20379638671875 204 ], 205 'descriptor': {shape: [1, 4, 1], dataType: 'float32'} 206 } 207 }, 208 'operators': [{ 209 'name': 'matmul', 210 'arguments': [{'a': 'inputA'}, {'b': 'inputB'}], 211 'outputs': 'output' 212 }], 213 'expectedOutputs': { 214 'output': { 215 'data': [ 216 15019.9462890625, 11942.376953125, 15035.0322265625, 217 13553.013671875, 12302.328125, 16517.9765625 218 ], 219 'descriptor': {shape: [2, 3, 1], dataType: 'float32'} 220 } 221 } 222 } 223 }, 224 { 225 'name': 'matmul float32 3D and 2D tensors', 226 'graph': { 227 'inputs': { 228 'inputA': { 229 'data': [ 230 56.46701431274414, 99.86045837402344, 71.054931640625, 231 32.454383850097656, 17.310747146606445, 2.586275100708008, 232 92.31499481201172, 96.9758529663086, 26.472131729125977, 233 77.67031860351562, 29.278789520263672, 82.12142181396484, 234 89.89308166503906, 82.49795532226562, 64.36865997314453, 235 23.75928497314453, 6.670266628265381, 81.55583190917969, 236 16.142963409423828, 57.45134735107422, 26.826417922973633, 237 85.02970123291016, 36.1988639831543, 89.60960388183594 238 ], 239 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} 240 }, 241 'inputB': { 242 'data': [ 243 27.829805374145508, 83.1454849243164, 34.41289520263672, 244 83.20379638671875 245 ], 246 'descriptor': {shape: [4, 1], dataType: 'float32'} 247 } 248 }, 249 'operators': [{ 250 'name': 'matmul', 251 'arguments': [{'a': 'inputA'}, {'b': 'inputB'}], 252 'outputs': 'output' 253 }], 254 'expectedOutputs': { 255 'output': { 256 'data': [ 257 15019.9462890625, 11942.376953125, 15035.0322265625, 258 13553.013671875, 12302.328125, 16517.9765625 259 ], 260 'descriptor': {shape: [2, 3, 1], dataType: 'float32'} 261 } 262 } 263 } 264 }, 265 { 266 'name': 'matmul float32 4D and 4D (broadcast) tensors', 267 'graph': { 268 'inputs': { 269 'inputA': { 270 'data': [ 271 33.75957107543945, 97.24552917480469, 83.7085189819336, 272 64.53984069824219, 29.57938003540039, 17.19923973083496, 273 67.94749450683594, 97.45838165283203, 54.449283599853516, 274 29.552200317382812, 51.99970245361328, 36.03101348876953, 275 9.701058387756348, 27.04842185974121, 6.020919322967529, 276 22.940902709960938, 53.1243896484375, 15.292234420776367, 277 48.21302795410156, 87.40799713134766, 51.34442138671875, 278 21.1557559967041, 27.589487075805664, 58.412384033203125, 279 5.963276386260986, 84.74938201904297, 55.45738220214844, 280 50.858699798583984, 23.763574600219727, 62.330928802490234, 281 35.774959564208984, 17.340242385864258, 29.16901397705078, 282 23.191360473632812, 27.060928344726562, 1.2828527688980103, 283 8.720425605773926, 48.45281219482422, 99.0130386352539, 284 65.86412048339844, 92.69683074951172, 85.43540954589844, 285 37.49127960205078, 51.397132873535156, 53.19015121459961, 286 38.33119201660156, 75.20586395263672, 3.8537938594818115 287 ], 288 'descriptor': {shape: [2, 2, 3, 4], dataType: 'float32'} 289 }, 290 'inputB': { 291 'data': [ 292 88.1700439453125, 78.4012680053711, 14.819003105163574, 293 3.6923038959503174, 45.906429290771484, 43.083919525146484, 294 47.199466705322266, 60.92521667480469, 8.162760734558105, 295 20.333263397216797, 20.438398361206055, 27.0194091796875, 296 15.601424217224121, 87.46969604492188, 65.79554748535156, 297 69.31697082519531, 31.984439849853516, 12.291812896728516, 298 13.304834365844727, 85.26705169677734 299 ], 300 'descriptor': {shape: [1, 1, 4, 5], dataType: 'float32'} 301 } 302 }, 303 'operators': [{ 304 'name': 'matmul', 305 'arguments': [{'a': 'inputA'}, {'b': 'inputB'}], 306 'outputs': 'output' 307 }], 308 'expectedOutputs': { 309 'output': { 310 'data': [ 311 13350.8759765625, 11562.755859375, 8524.271484375, 312 9099.0927734375, 14537.8701171875, 11493.283203125, 313 8083.90869140625, 3744.22216796875, 7489.62353515625, 314 14488.2314453125, 9634.3720703125, 8221.173828125, 315 3861.51416015625, 5470.0556640625, 9594.072265625, 316 3733.946533203125, 2933.679931640625, 2167.611083984375, 317 1088.48193359375, 3347.576416015625, 12387.083984375, 318 8985.1884765625, 3545.52783203125, 5701.10595703125, 319 13374.9169921875, 10051.3671875, 7637.7470703125, 320 3198.221435546875, 3552.6796875, 9583.1220703125, 321 8835.94921875, 7592.7666015625, 6742.10400390625, 322 6241.31396484375, 9982.404296875, 6713.85205078125, 323 6326.3173828125, 4920.9609375, 3956.46875, 324 6190.67626953125, 4213.013671875, 4153.708984375, 325 2283.152099609375, 2681.085693359375, 3700.47509765625, 326 9445.5869140625, 7752.5400390625, 5435.56005859375, 327 9964.6591796875, 13516.18359375, 16182.931640625, 328 13956.9560546875, 7795.52685546875, 5002.8349609375, 329 12841.802734375, 8145.45654296875, 8134.66650390625, 330 4344.25, 7138.79052734375, 8497.98046875 331 ], 332 'descriptor': {shape: [2, 2, 3, 5], dataType: 'float32'} 333 } 334 } 335 } 336 }, 337 { 338 'name': 'matmul float32 4D and 3D tensors', 339 'graph': { 340 'inputs': { 341 'inputA': { 342 'data': [ 343 33.75957107543945, 97.24552917480469, 83.7085189819336, 344 64.53984069824219, 29.57938003540039, 17.19923973083496, 345 67.94749450683594, 97.45838165283203, 54.449283599853516, 346 29.552200317382812, 51.99970245361328, 36.03101348876953, 347 9.701058387756348, 27.04842185974121, 6.020919322967529, 348 22.940902709960938, 53.1243896484375, 15.292234420776367, 349 48.21302795410156, 87.40799713134766, 51.34442138671875, 350 21.1557559967041, 27.589487075805664, 58.412384033203125, 351 5.963276386260986, 84.74938201904297, 55.45738220214844, 352 50.858699798583984, 23.763574600219727, 62.330928802490234, 353 35.774959564208984, 17.340242385864258, 29.16901397705078, 354 23.191360473632812, 27.060928344726562, 1.2828527688980103, 355 8.720425605773926, 48.45281219482422, 99.0130386352539, 356 65.86412048339844, 92.69683074951172, 85.43540954589844, 357 37.49127960205078, 51.397132873535156, 53.19015121459961, 358 38.33119201660156, 75.20586395263672, 3.8537938594818115 359 ], 360 'descriptor': {shape: [2, 2, 3, 4], dataType: 'float32'} 361 }, 362 'inputB': { 363 'data': [ 364 70.38780212402344, 25.48917579650879, 28.254196166992188, 365 84.5148696899414, 58.873416900634766, 46.252838134765625, 366 24.897335052490234, 44.0944938659668, 51.86564636230469, 367 1.123237133026123, 4.187554836273193, 71.24649810791016, 368 16.034526824951172, 23.677297592163086, 61.27727508544922, 369 65.15946197509766, 58.39249801635742, 70.12741088867188, 370 9.11972713470459, 24.179977416992188, 84.4263687133789, 371 78.55551147460938, 38.48297119140625, 80.6541519165039, 372 57.152122497558594, 46.109710693359375, 28.41227912902832, 373 90.92566680908203, 94.66068267822266, 61.77287673950195, 374 60.324859619140625, 70.97433471679688, 10.631051063537598, 375 55.61628341674805, 35.052310943603516, 22.12839126586914, 376 38.19757843017578, 78.17564392089844, 62.57684326171875, 377 88.35256958007812 378 ], 379 'descriptor': {shape: [2, 4, 5], dataType: 'float32'} 380 } 381 }, 382 'operators': [{ 383 'name': 'matmul', 384 'arguments': [{'a': 'inputA'}, {'b': 'inputB'}], 385 'outputs': 'output' 386 }], 387 'expectedOutputs': { 388 'output': { 389 'data': [ 390 11430.05859375, 13014.2392578125, 11110.080078125, 391 10467.46484375, 8786.7724609375, 9512.4111328125, 392 11714.0283203125, 9518.1435546875, 5889.55419921875, 393 8280.9365234375, 7764.95166015625, 7932.3759765625, 394 6202.0625, 7694.32373046875, 7296.4384765625, 395 2937.076416015625, 2834.196533203125, 4690.14990234375, 396 5113.283203125, 4463.22998046875, 10032.8623046875, 397 11368.3623046875, 10780.572265625, 13883.421875, 398 13393.5166015625, 8267.212890625, 8823.828125, 399 8759.2177734375, 11333.4462890625, 10369.25390625, 400 7885.7978515625, 9182.943359375, 8361.2900390625, 401 6676.46533203125, 5074.3115234375, 5835.33837890625, 402 5718.96875, 5209.5322265625, 6246.40185546875, 403 4080.533935546875, 3322.71826171875, 3323.802490234375, 404 2370.630615234375, 4320.47900390625, 3432.568115234375, 405 10400.7939453125, 11604.9267578125, 10942.7744140625, 406 14918.220703125, 12781.3603515625, 15164.451171875, 407 14333.4267578125, 15752.0966796875, 20865.154296875, 408 16430.63671875, 10880.1533203125, 10752.34765625, 409 6632.99462890625, 12342.2919921875, 8384.3896484375 410 ], 411 'descriptor': {shape: [2, 2, 3, 5], dataType: 'float32'} 412 } 413 } 414 } 415 }, 416 { 417 'name': 418 'matmul float32 5D and 5D tensors, broadcast the two leftmost dimensions of inputB', 419 'graph': { 420 'inputs': { 421 'inputA': { 422 'data': [ 423 33.75957107543945, 97.24552917480469, 83.7085189819336, 424 64.53984069824219, 29.57938003540039, 17.19923973083496, 425 67.94749450683594, 97.45838165283203, 54.449283599853516, 426 29.552200317382812, 51.99970245361328, 36.03101348876953, 427 9.701058387756348, 27.04842185974121, 6.020919322967529, 428 22.940902709960938, 53.1243896484375, 15.292234420776367, 429 48.21302795410156, 87.40799713134766, 51.34442138671875, 430 21.1557559967041, 27.589487075805664, 58.412384033203125, 431 5.963276386260986, 84.74938201904297, 55.45738220214844, 432 50.858699798583984, 23.763574600219727, 62.330928802490234, 433 35.774959564208984, 17.340242385864258, 29.16901397705078, 434 23.191360473632812, 27.060928344726562, 1.2828527688980103, 435 8.720425605773926, 48.45281219482422, 99.0130386352539, 436 65.86412048339844, 92.69683074951172, 85.43540954589844, 437 37.49127960205078, 51.397132873535156, 53.19015121459961, 438 38.33119201660156, 75.20586395263672, 3.8537938594818115 439 ], 440 'descriptor': {shape: [2, 2, 1, 3, 4], dataType: 'float32'} 441 }, 442 'inputB': { 443 'data': [ 444 88.1700439453125, 78.4012680053711, 14.819003105163574, 445 3.6923038959503174, 45.906429290771484, 43.083919525146484, 446 47.199466705322266, 60.92521667480469, 8.162760734558105, 447 20.333263397216797, 20.438398361206055, 27.0194091796875, 448 15.601424217224121, 87.46969604492188, 65.79554748535156, 449 69.31697082519531, 31.984439849853516, 12.291812896728516, 450 13.304834365844727, 85.26705169677734 451 ], 452 'descriptor': {shape: [1, 1, 1, 4, 5], dataType: 'float32'} 453 } 454 }, 455 'operators': [{ 456 'name': 'matmul', 457 'arguments': [{'a': 'inputA'}, {'b': 'inputB'}], 458 'outputs': 'output' 459 }], 460 'expectedOutputs': { 461 'output': { 462 'data': [ 463 13350.8759765625, 11562.755859375, 8524.271484375, 464 9099.0927734375, 14537.8701171875, 11493.283203125, 465 8083.90869140625, 3744.22216796875, 7489.62353515625, 466 14488.2314453125, 9634.3720703125, 8221.173828125, 467 3861.51416015625, 5470.0556640625, 9594.072265625, 468 3733.946533203125, 2933.679931640625, 2167.611083984375, 469 1088.48193359375, 3347.576416015625, 12387.083984375, 470 8985.1884765625, 3545.52783203125, 5701.10595703125, 471 13374.9169921875, 10051.3671875, 7637.7470703125, 472 3198.221435546875, 3552.6796875, 9583.1220703125, 473 8835.94921875, 7592.7666015625, 6742.10400390625, 474 6241.31396484375, 9982.404296875, 6713.85205078125, 475 6326.3173828125, 4920.9609375, 3956.46875, 476 6190.67626953125, 4213.013671875, 4153.708984375, 477 2283.152099609375, 2681.085693359375, 3700.47509765625, 478 9445.5869140625, 7752.5400390625, 5435.56005859375, 479 9964.6591796875, 13516.18359375, 16182.931640625, 480 13956.9560546875, 7795.52685546875, 5002.8349609375, 481 12841.802734375, 8145.45654296875, 8134.66650390625, 482 4344.25, 7138.79052734375, 8497.98046875 483 ], 484 'descriptor': {shape: [2, 2, 1, 3, 5], dataType: 'float32'} 485 } 486 } 487 } 488 }, 489 { 490 'name': 491 'matmul float32 5D and 5D tensors, broadcast the leftmost dimensions of inputB', 492 'graph': { 493 'inputs': { 494 'inputA': { 495 'data': [ 496 33.75957107543945, 97.24552917480469, 83.7085189819336, 497 64.53984069824219, 29.57938003540039, 17.19923973083496, 498 67.94749450683594, 97.45838165283203, 54.449283599853516, 499 29.552200317382812, 51.99970245361328, 36.03101348876953, 500 9.701058387756348, 27.04842185974121, 6.020919322967529, 501 22.940902709960938, 53.1243896484375, 15.292234420776367, 502 48.21302795410156, 87.40799713134766, 51.34442138671875, 503 21.1557559967041, 27.589487075805664, 58.412384033203125, 504 5.963276386260986, 84.74938201904297, 55.45738220214844, 505 50.858699798583984, 23.763574600219727, 62.330928802490234, 506 35.774959564208984, 17.340242385864258, 29.16901397705078, 507 23.191360473632812, 27.060928344726562, 1.2828527688980103, 508 8.720425605773926, 48.45281219482422, 99.0130386352539, 509 65.86412048339844, 92.69683074951172, 85.43540954589844, 510 37.49127960205078, 51.397132873535156, 53.19015121459961, 511 38.33119201660156, 75.20586395263672, 3.8537938594818115 512 ], 513 'descriptor': {shape: [2, 2, 1, 3, 4], dataType: 'float32'} 514 }, 515 'inputB': { 516 'data': [ 517 88.1700439453125, 78.4012680053711, 14.819003105163574, 518 3.6923038959503174, 45.906429290771484, 43.083919525146484, 519 47.199466705322266, 60.92521667480469, 8.162760734558105, 520 20.333263397216797, 20.438398361206055, 27.0194091796875, 521 15.601424217224121, 87.46969604492188, 65.79554748535156, 522 69.31697082519531, 31.984439849853516, 12.291812896728516, 523 13.304834365844727, 85.26705169677734, 88.1700439453125, 524 78.4012680053711, 14.819003105163574, 3.6923038959503174, 525 45.906429290771484, 43.083919525146484, 47.199466705322266, 526 60.92521667480469, 8.162760734558105, 20.333263397216797, 527 20.438398361206055, 27.0194091796875, 15.601424217224121, 528 87.46969604492188, 65.79554748535156, 69.31697082519531, 529 31.984439849853516, 12.291812896728516, 13.304834365844727, 530 85.26705169677734 531 ], 532 'descriptor': {shape: [1, 2, 1, 4, 5], dataType: 'float32'} 533 } 534 }, 535 'operators': [{ 536 'name': 'matmul', 537 'arguments': [{'a': 'inputA'}, {'b': 'inputB'}], 538 'outputs': 'output' 539 }], 540 'expectedOutputs': { 541 'output': { 542 'data': [ 543 13350.8759765625, 11562.755859375, 8524.271484375, 544 9099.0927734375, 14537.8701171875, 11493.283203125, 545 8083.90869140625, 3744.22216796875, 7489.62353515625, 546 14488.2314453125, 9634.3720703125, 8221.173828125, 547 3861.51416015625, 5470.0556640625, 9594.072265625, 548 3733.946533203125, 2933.679931640625, 2167.611083984375, 549 1088.48193359375, 3347.576416015625, 12387.083984375, 550 8985.1884765625, 3545.52783203125, 5701.10595703125, 551 13374.9169921875, 10051.3671875, 7637.7470703125, 552 3198.221435546875, 3552.6796875, 9583.1220703125, 553 8835.94921875, 7592.7666015625, 6742.10400390625, 554 6241.31396484375, 9982.404296875, 6713.85205078125, 555 6326.3173828125, 4920.9609375, 3956.46875, 556 6190.67626953125, 4213.013671875, 4153.708984375, 557 2283.152099609375, 2681.085693359375, 3700.47509765625, 558 9445.5869140625, 7752.5400390625, 5435.56005859375, 559 9964.6591796875, 13516.18359375, 16182.931640625, 560 13956.9560546875, 7795.52685546875, 5002.8349609375, 561 12841.802734375, 8145.45654296875, 8134.66650390625, 562 4344.25, 7138.79052734375, 8497.98046875 563 ], 564 'descriptor': {shape: [2, 2, 1, 3, 5], dataType: 'float32'} 565 } 566 } 567 } 568 }, 569 { 570 'name': 'matmul float32 5D and 2D tensors', 571 'graph': { 572 'inputs': { 573 'inputA': { 574 'data': [ 575 33.75957107543945, 97.24552917480469, 83.7085189819336, 576 64.53984069824219, 29.57938003540039, 17.19923973083496, 577 67.94749450683594, 97.45838165283203, 54.449283599853516, 578 29.552200317382812, 51.99970245361328, 36.03101348876953, 579 9.701058387756348, 27.04842185974121, 6.020919322967529, 580 22.940902709960938, 53.1243896484375, 15.292234420776367, 581 48.21302795410156, 87.40799713134766, 51.34442138671875, 582 21.1557559967041, 27.589487075805664, 58.412384033203125, 583 5.963276386260986, 84.74938201904297, 55.45738220214844, 584 50.858699798583984, 23.763574600219727, 62.330928802490234, 585 35.774959564208984, 17.340242385864258, 29.16901397705078, 586 23.191360473632812, 27.060928344726562, 1.2828527688980103, 587 8.720425605773926, 48.45281219482422, 99.0130386352539, 588 65.86412048339844, 92.69683074951172, 85.43540954589844, 589 37.49127960205078, 51.397132873535156, 53.19015121459961, 590 38.33119201660156, 75.20586395263672, 3.8537938594818115 591 ], 592 'descriptor': {shape: [2, 2, 1, 3, 4], dataType: 'float32'} 593 }, 594 'inputB': { 595 'data': [ 596 88.1700439453125, 78.4012680053711, 14.819003105163574, 597 3.6923038959503174, 45.906429290771484, 43.083919525146484, 598 47.199466705322266, 60.92521667480469, 8.162760734558105, 599 20.333263397216797, 20.438398361206055, 27.0194091796875, 600 15.601424217224121, 87.46969604492188, 65.79554748535156, 601 69.31697082519531, 31.984439849853516, 12.291812896728516, 602 13.304834365844727, 85.26705169677734 603 ], 604 'descriptor': {shape: [4, 5], dataType: 'float32'} 605 } 606 }, 607 'operators': [{ 608 'name': 'matmul', 609 'arguments': [{'a': 'inputA'}, {'b': 'inputB'}], 610 'outputs': 'output' 611 }], 612 'expectedOutputs': { 613 'output': { 614 'data': [ 615 13350.8759765625, 11562.755859375, 8524.271484375, 616 9099.0927734375, 14537.8701171875, 11493.283203125, 617 8083.90869140625, 3744.22216796875, 7489.62353515625, 618 14488.2314453125, 9634.3720703125, 8221.173828125, 619 3861.51416015625, 5470.0556640625, 9594.072265625, 620 3733.946533203125, 2933.679931640625, 2167.611083984375, 621 1088.48193359375, 3347.576416015625, 12387.083984375, 622 8985.1884765625, 3545.52783203125, 5701.10595703125, 623 13374.9169921875, 10051.3671875, 7637.7470703125, 624 3198.221435546875, 3552.6796875, 9583.1220703125, 625 8835.94921875, 7592.7666015625, 6742.10400390625, 626 6241.31396484375, 9982.404296875, 6713.85205078125, 627 6326.3173828125, 4920.9609375, 3956.46875, 628 6190.67626953125, 4213.013671875, 4153.708984375, 629 2283.152099609375, 2681.085693359375, 3700.47509765625, 630 9445.5869140625, 7752.5400390625, 5435.56005859375, 631 9964.6591796875, 13516.18359375, 16182.931640625, 632 13956.9560546875, 7795.52685546875, 5002.8349609375, 633 12841.802734375, 8145.45654296875, 8134.66650390625, 634 4344.25, 7138.79052734375, 8497.98046875 635 ], 636 'descriptor': {shape: [2, 2, 1, 3, 5], dataType: 'float32'} 637 } 638 } 639 } 640 }, 641 642 // float16 tests 643 { 644 'name': 'matmul float16 2D and 2D tensors', 645 'graph': { 646 'inputs': { 647 'inputA': { 648 'data': [ 649 10.4296875, 24.46875, 55.875, 3.240234375, 87.5625, 22.40625, 650 79.875, 99.625, 24.734375, 65.9375, 38.125, 87.125 651 ], 652 'descriptor': {shape: [3, 4], dataType: 'float16'} 653 }, 654 'inputB': { 655 'data': [ 656 88.1875, 78.375, 14.8203125, 3.69140625, 45.90625, 657 43.09375, 47.1875, 60.9375, 8.1640625, 20.328125, 658 20.4375, 27.015625, 15.6015625, 87.5, 65.8125, 659 69.3125, 31.984375, 12.2890625, 13.3046875, 85.25 660 ], 661 'descriptor': {shape: [4, 5], dataType: 'float16'} 662 } 663 }, 664 'operators': [{ 665 'name': 'matmul', 666 'arguments': [{'a': 'inputA'}, {'b': 'inputB'}], 667 'outputs': 'output' 668 }], 669 'expectedOutputs': { 670 'output': { 671 'data': [ 672 3340, 3586, 2558, 5172, 4928, 17232, 13264, 5132, 8824, 18224, 673 11840, 8864, 6052, 5124, 12416 674 ], 675 'descriptor': {shape: [3, 5], dataType: 'float16'} 676 } 677 } 678 } 679 }, 680 { 681 'name': 'matmul float16 3D and 3D tensors', 682 'graph': { 683 'inputs': { 684 'inputA': { 685 'data': [ 686 56.46875, 99.875, 71.0625, 32.46875, 17.3125, 2.5859375, 687 92.3125, 97, 26.46875, 77.6875, 29.28125, 82.125, 688 89.875, 82.5, 64.375, 23.765625, 6.671875, 81.5625, 689 16.140625, 57.4375, 26.828125, 85, 36.1875, 89.625 690 ], 691 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} 692 }, 693 'inputB': { 694 'data': [ 695 70.375, 25.484375, 28.25, 84.5, 58.875, 46.25, 696 24.890625, 44.09375, 51.875, 1.123046875, 4.1875, 71.25, 697 16.03125, 23.671875, 61.28125, 65.1875, 58.40625, 70.125, 698 9.1171875, 24.1875, 84.4375, 78.5625, 38.46875, 80.625, 699 57.15625, 46.125, 28.40625, 90.9375, 94.6875, 61.78125, 700 60.3125, 71, 10.6328125, 55.625, 35.0625, 22.125, 701 38.1875, 78.1875, 62.5625, 88.375 702 ], 703 'descriptor': {shape: [2, 4, 5], dataType: 'float16'} 704 } 705 }, 706 'operators': [{ 707 'name': 'matmul', 708 'arguments': [{'a': 'inputA'}, {'b': 'inputB'}], 709 'outputs': 'output' 710 }], 711 'expectedOutputs': { 712 'output': { 713 'data': [ 714 11008, 10888, 9416, 11928, 8576, 8048, 12752, 8888, 715 4668, 9024, 10928, 9488, 10400, 7708, 5428, 15800, 716 14880, 13504, 20128, 14592, 6568, 6180, 12336, 12752, 717 11064, 10352, 10512, 16152, 17824, 15976 718 ], 719 'descriptor': {shape: [2, 3, 5], dataType: 'float16'} 720 } 721 } 722 } 723 }, 724 { 725 'name': 'matmul float16 4D and 4D tensors', 726 'graph': { 727 'inputs': { 728 'inputA': { 729 'data': [ 730 56.46875, 99.875, 71.0625, 32.46875, 17.3125, 2.5859375, 731 92.3125, 97, 26.46875, 77.6875, 29.28125, 82.125, 732 89.875, 82.5, 64.375, 23.765625, 6.671875, 81.5625, 733 16.140625, 57.4375, 26.828125, 85, 36.1875, 89.625 734 ], 735 'descriptor': {shape: [2, 1, 3, 4], dataType: 'float16'} 736 }, 737 'inputB': { 738 'data': [ 739 70.375, 25.484375, 28.25, 84.5, 58.875, 46.25, 740 24.890625, 44.09375, 51.875, 1.123046875, 4.1875, 71.25, 741 16.03125, 23.671875, 61.28125, 65.1875, 58.40625, 70.125, 742 9.1171875, 24.1875, 84.4375, 78.5625, 38.46875, 80.625, 743 57.15625, 46.125, 28.40625, 90.9375, 94.6875, 61.78125, 744 60.3125, 71, 10.6328125, 55.625, 35.0625, 22.125, 745 38.1875, 78.1875, 62.5625, 88.375 746 ], 747 'descriptor': {shape: [2, 1, 4, 5], dataType: 'float16'} 748 } 749 }, 750 'operators': [{ 751 'name': 'matmul', 752 'arguments': [{'a': 'inputA'}, {'b': 'inputB'}], 753 'outputs': 'output' 754 }], 755 'expectedOutputs': { 756 'output': { 757 'data': [ 758 11008, 10888, 9416, 11928, 8576, 8048, 12752, 8888, 759 4668, 9024, 10928, 9488, 10400, 7708, 5428, 15800, 760 14880, 13504, 20128, 14592, 6568, 6180, 12336, 12752, 761 11064, 10352, 10512, 16152, 17824, 15976 762 ], 763 'descriptor': {shape: [2, 1, 3, 5], dataType: 'float16'} 764 } 765 } 766 } 767 }, 768 { 769 'name': 'matmul float16 3D and 3D (broadcast) tensors', 770 'graph': { 771 'inputs': { 772 'inputA': { 773 'data': [ 774 56.46875, 99.875, 71.0625, 32.46875, 17.3125, 2.5859375, 775 92.3125, 97, 26.46875, 77.6875, 29.28125, 82.125, 776 89.875, 82.5, 64.375, 23.765625, 6.671875, 81.5625, 777 16.140625, 57.4375, 26.828125, 85, 36.1875, 89.625 778 ], 779 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} 780 }, 781 'inputB': { 782 'data': [27.828125, 83.125, 34.40625, 83.1875], 783 'descriptor': {shape: [1, 4, 1], dataType: 'float16'} 784 } 785 }, 786 'operators': [{ 787 'name': 'matmul', 788 'arguments': [{'a': 'inputA'}, {'b': 'inputB'}], 789 'outputs': 'output' 790 }], 791 'expectedOutputs': { 792 'output': { 793 'data': [15016, 11944, 15032, 13552, 12296, 16512], 794 'descriptor': {shape: [2, 3, 1], dataType: 'float16'} 795 } 796 } 797 } 798 }, 799 { 800 'name': 'matmul float16 3D and 2D tensors', 801 'graph': { 802 'inputs': { 803 'inputA': { 804 'data': [ 805 56.46875, 99.875, 71.0625, 32.46875, 17.3125, 2.5859375, 806 92.3125, 97, 26.46875, 77.6875, 29.28125, 82.125, 807 89.875, 82.5, 64.375, 23.765625, 6.671875, 81.5625, 808 16.140625, 57.4375, 26.828125, 85, 36.1875, 89.625 809 ], 810 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} 811 }, 812 'inputB': { 813 'data': [27.828125, 83.125, 34.40625, 83.1875], 814 'descriptor': {shape: [4, 1], dataType: 'float16'} 815 } 816 }, 817 'operators': [{ 818 'name': 'matmul', 819 'arguments': [{'a': 'inputA'}, {'b': 'inputB'}], 820 'outputs': 'output' 821 }], 822 'expectedOutputs': { 823 'output': { 824 'data': [15016, 11944, 15032, 13552, 12296, 16512], 825 'descriptor': {shape: [2, 3, 1], dataType: 'float16'} 826 } 827 } 828 } 829 }, 830 { 831 'name': 'matmul float16 4D and 4D (broadcast) tensors', 832 'graph': { 833 'inputs': { 834 'inputA': { 835 'data': [ 836 33.75, 97.25, 83.6875, 64.5625, 29.578125, 837 17.203125, 67.9375, 97.4375, 54.4375, 29.546875, 838 52, 36.03125, 9.703125, 27.046875, 6.01953125, 839 22.9375, 53.125, 15.2890625, 48.21875, 87.4375, 840 51.34375, 21.15625, 27.59375, 58.40625, 5.96484375, 841 84.75, 55.46875, 50.84375, 23.765625, 62.34375, 842 35.78125, 17.34375, 29.171875, 23.1875, 27.0625, 843 1.283203125, 8.71875, 48.4375, 99, 65.875, 844 92.6875, 85.4375, 37.5, 51.40625, 53.1875, 845 38.34375, 75.1875, 3.853515625 846 ], 847 'descriptor': {shape: [2, 2, 3, 4], dataType: 'float16'} 848 }, 849 'inputB': { 850 'data': [ 851 88.1875, 78.375, 14.8203125, 3.69140625, 45.90625, 852 43.09375, 47.1875, 60.9375, 8.1640625, 20.328125, 853 20.4375, 27.015625, 15.6015625, 87.5, 65.8125, 854 69.3125, 31.984375, 12.2890625, 13.3046875, 85.25 855 ], 856 'descriptor': {shape: [1, 1, 4, 5], dataType: 'float16'} 857 } 858 }, 859 'operators': [{ 860 'name': 'matmul', 861 'arguments': [{'a': 'inputA'}, {'b': 'inputB'}], 862 'outputs': 'output' 863 }], 864 'expectedOutputs': { 865 'output': { 866 'data': [ 867 13352, 11560, 8528, 9104, 14536, 11488, 8080, 3744, 7492, 14488, 868 9632, 8216, 3862, 5472, 9592, 3734, 2934, 2168, 1089, 3346, 869 12392, 8984, 3546, 5704, 13376, 10048, 7636, 3198, 3554, 9584, 870 8832, 7592, 6744, 6244, 9984, 6716, 6324, 4924, 3958, 6192, 871 4212, 4152, 2284, 2682, 3700, 9448, 7752, 5436, 9968, 13520, 872 16184, 13952, 7796, 5004, 12840, 8148, 8132, 4344, 7140, 8496 873 ], 874 'descriptor': {shape: [2, 2, 3, 5], dataType: 'float16'} 875 } 876 } 877 } 878 }, 879 { 880 'name': 'matmul float16 4D and 3D tensors', 881 'graph': { 882 'inputs': { 883 'inputA': { 884 'data': [ 885 33.75, 97.25, 83.6875, 64.5625, 29.578125, 886 17.203125, 67.9375, 97.4375, 54.4375, 29.546875, 887 52, 36.03125, 9.703125, 27.046875, 6.01953125, 888 22.9375, 53.125, 15.2890625, 48.21875, 87.4375, 889 51.34375, 21.15625, 27.59375, 58.40625, 5.96484375, 890 84.75, 55.46875, 50.84375, 23.765625, 62.34375, 891 35.78125, 17.34375, 29.171875, 23.1875, 27.0625, 892 1.283203125, 8.71875, 48.4375, 99, 65.875, 893 92.6875, 85.4375, 37.5, 51.40625, 53.1875, 894 38.34375, 75.1875, 3.853515625 895 ], 896 'descriptor': {shape: [2, 2, 3, 4], dataType: 'float16'} 897 }, 898 'inputB': { 899 'data': [ 900 70.375, 25.484375, 28.25, 84.5, 58.875, 46.25, 901 24.890625, 44.09375, 51.875, 1.123046875, 4.1875, 71.25, 902 16.03125, 23.671875, 61.28125, 65.1875, 58.40625, 70.125, 903 9.1171875, 24.1875, 84.4375, 78.5625, 38.46875, 80.625, 904 57.15625, 46.125, 28.40625, 90.9375, 94.6875, 61.78125, 905 60.3125, 71, 10.6328125, 55.625, 35.0625, 22.125, 906 38.1875, 78.1875, 62.5625, 88.375 907 ], 908 'descriptor': {shape: [2, 4, 5], dataType: 'float16'} 909 } 910 }, 911 'operators': [{ 912 'name': 'matmul', 913 'arguments': [{'a': 'inputA'}, {'b': 'inputB'}], 914 'outputs': 'output' 915 }], 916 'expectedOutputs': { 917 'output': { 918 'data': [ 919 11432, 13016, 11112, 10464, 8784, 9512, 11712, 9520, 5888, 920 8280, 7764, 7932, 6200, 7692, 7296, 2938, 2834, 4692, 921 5112, 4464, 10032, 11368, 10784, 13880, 13400, 8264, 8824, 922 8760, 11328, 10368, 7888, 9184, 8360, 6676, 5076, 5836, 923 5720, 5212, 6248, 4082, 3322, 3324, 2370, 4320, 3432, 924 10400, 11608, 10944, 14920, 12784, 15168, 14336, 15752, 20864, 925 16432, 10880, 10752, 6632, 12344, 8384 926 ], 927 'descriptor': {shape: [2, 2, 3, 5], dataType: 'float16'} 928 } 929 } 930 } 931 }, 932 { 933 'name': 934 'matmul float16 5D and 5D tensors, broadcast the two leftmost dimensions of inputB', 935 'graph': { 936 'inputs': { 937 'inputA': { 938 'data': [ 939 33.75, 97.25, 83.6875, 64.5625, 29.578125, 940 17.203125, 67.9375, 97.4375, 54.4375, 29.546875, 941 52, 36.03125, 9.703125, 27.046875, 6.01953125, 942 22.9375, 53.125, 15.2890625, 48.21875, 87.4375, 943 51.34375, 21.15625, 27.59375, 58.40625, 5.96484375, 944 84.75, 55.46875, 50.84375, 23.765625, 62.34375, 945 35.78125, 17.34375, 29.171875, 23.1875, 27.0625, 946 1.283203125, 8.71875, 48.4375, 99, 65.875, 947 92.6875, 85.4375, 37.5, 51.40625, 53.1875, 948 38.34375, 75.1875, 3.853515625 949 ], 950 'descriptor': {shape: [2, 2, 1, 3, 4], dataType: 'float16'} 951 }, 952 'inputB': { 953 'data': [ 954 88.1875, 78.375, 14.8203125, 3.69140625, 45.90625, 955 43.09375, 47.1875, 60.9375, 8.1640625, 20.328125, 956 20.4375, 27.015625, 15.6015625, 87.5, 65.8125, 957 69.3125, 31.984375, 12.2890625, 13.3046875, 85.25 958 ], 959 'descriptor': {shape: [1, 1, 1, 4, 5], dataType: 'float16'} 960 } 961 }, 962 'operators': [{ 963 'name': 'matmul', 964 'arguments': [{'a': 'inputA'}, {'b': 'inputB'}], 965 'outputs': 'output' 966 }], 967 'expectedOutputs': { 968 'output': { 969 'data': [ 970 13352, 11560, 8528, 9104, 14536, 11488, 8080, 3744, 7492, 14488, 971 9632, 8216, 3862, 5472, 9592, 3734, 2934, 2168, 1089, 3346, 972 12392, 8984, 3546, 5704, 13376, 10048, 7636, 3198, 3554, 9584, 973 8832, 7592, 6744, 6244, 9984, 6716, 6324, 4924, 3958, 6192, 974 4212, 4152, 2284, 2682, 3700, 9448, 7752, 5436, 9968, 13520, 975 16184, 13952, 7796, 5004, 12840, 8148, 8132, 4344, 7140, 8496 976 ], 977 'descriptor': {shape: [2, 2, 1, 3, 5], dataType: 'float16'} 978 } 979 } 980 } 981 }, 982 { 983 'name': 984 'matmul float16 5D and 5D tensors, broadcast the leftmost dimensions of inputB', 985 'graph': { 986 'inputs': { 987 'inputA': { 988 'data': [ 989 33.75, 97.25, 83.6875, 64.5625, 29.578125, 990 17.203125, 67.9375, 97.4375, 54.4375, 29.546875, 991 52, 36.03125, 9.703125, 27.046875, 6.01953125, 992 22.9375, 53.125, 15.2890625, 48.21875, 87.4375, 993 51.34375, 21.15625, 27.59375, 58.40625, 5.96484375, 994 84.75, 55.46875, 50.84375, 23.765625, 62.34375, 995 35.78125, 17.34375, 29.171875, 23.1875, 27.0625, 996 1.283203125, 8.71875, 48.4375, 99, 65.875, 997 92.6875, 85.4375, 37.5, 51.40625, 53.1875, 998 38.34375, 75.1875, 3.853515625 999 ], 1000 'descriptor': {shape: [2, 2, 1, 3, 4], dataType: 'float16'} 1001 }, 1002 'inputB': { 1003 'data': [ 1004 88.1875, 78.375, 14.8203125, 3.69140625, 45.90625, 1005 43.09375, 47.1875, 60.9375, 8.1640625, 20.328125, 1006 20.4375, 27.015625, 15.6015625, 87.5, 65.8125, 1007 69.3125, 31.984375, 12.2890625, 13.3046875, 85.25, 1008 88.1875, 78.375, 14.8203125, 3.69140625, 45.90625, 1009 43.09375, 47.1875, 60.9375, 8.1640625, 20.328125, 1010 20.4375, 27.015625, 15.6015625, 87.5, 65.8125, 1011 69.3125, 31.984375, 12.2890625, 13.3046875, 85.25 1012 ], 1013 'descriptor': {shape: [1, 2, 1, 4, 5], dataType: 'float16'} 1014 } 1015 }, 1016 'operators': [{ 1017 'name': 'matmul', 1018 'arguments': [{'a': 'inputA'}, {'b': 'inputB'}], 1019 'outputs': 'output' 1020 }], 1021 'expectedOutputs': { 1022 'output': { 1023 'data': [ 1024 13352, 11560, 8528, 9104, 14536, 11488, 8080, 3744, 7492, 14488, 1025 9632, 8216, 3862, 5472, 9592, 3734, 2934, 2168, 1089, 3346, 1026 12392, 8984, 3546, 5704, 13376, 10048, 7636, 3198, 3554, 9584, 1027 8832, 7592, 6744, 6244, 9984, 6716, 6324, 4924, 3958, 6192, 1028 4212, 4152, 2284, 2682, 3700, 9448, 7752, 5436, 9968, 13520, 1029 16184, 13952, 7796, 5004, 12840, 8148, 8132, 4344, 7140, 8496 1030 ], 1031 'descriptor': {shape: [2, 2, 1, 3, 5], dataType: 'float16'} 1032 } 1033 } 1034 } 1035 }, 1036 { 1037 'name': 'matmul float16 5D and 2D tensors', 1038 'graph': { 1039 'inputs': { 1040 'inputA': { 1041 'data': [ 1042 33.75, 97.25, 83.6875, 64.5625, 29.578125, 1043 17.203125, 67.9375, 97.4375, 54.4375, 29.546875, 1044 52, 36.03125, 9.703125, 27.046875, 6.01953125, 1045 22.9375, 53.125, 15.2890625, 48.21875, 87.4375, 1046 51.34375, 21.15625, 27.59375, 58.40625, 5.96484375, 1047 84.75, 55.46875, 50.84375, 23.765625, 62.34375, 1048 35.78125, 17.34375, 29.171875, 23.1875, 27.0625, 1049 1.283203125, 8.71875, 48.4375, 99, 65.875, 1050 92.6875, 85.4375, 37.5, 51.40625, 53.1875, 1051 38.34375, 75.1875, 3.853515625 1052 ], 1053 'descriptor': {shape: [2, 2, 1, 3, 4], dataType: 'float16'} 1054 }, 1055 'inputB': { 1056 'data': [ 1057 88.1875, 78.375, 14.8203125, 3.69140625, 45.90625, 1058 43.09375, 47.1875, 60.9375, 8.1640625, 20.328125, 1059 20.4375, 27.015625, 15.6015625, 87.5, 65.8125, 1060 69.3125, 31.984375, 12.2890625, 13.3046875, 85.25 1061 ], 1062 'descriptor': {shape: [4, 5], dataType: 'float16'} 1063 } 1064 }, 1065 'operators': [{ 1066 'name': 'matmul', 1067 'arguments': [{'a': 'inputA'}, {'b': 'inputB'}], 1068 'outputs': 'output' 1069 }], 1070 'expectedOutputs': { 1071 'output': { 1072 'data': [ 1073 13352, 11560, 8528, 9104, 14536, 11488, 8080, 3744, 7492, 14488, 1074 9632, 8216, 3862, 5472, 9592, 3734, 2934, 2168, 1089, 3346, 1075 12392, 8984, 3546, 5704, 13376, 10048, 7636, 3198, 3554, 9584, 1076 8832, 7592, 6744, 6244, 9984, 6716, 6324, 4924, 3958, 6192, 1077 4212, 4152, 2284, 2682, 3700, 9448, 7752, 5436, 9968, 13520, 1078 16184, 13952, 7796, 5004, 12840, 8148, 8132, 4344, 7140, 8496 1079 ], 1080 'descriptor': {shape: [2, 2, 1, 3, 5], dataType: 'float16'} 1081 } 1082 } 1083 } 1084 } 1085 ]; 1086 1087 webnn_conformance_test( 1088 matmulTests, buildAndExecuteGraph, getPrecisionTolerance);