reduce_log_sum.https.any.js (38850B)
1 // META: title=test WebNN API reduction operations 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/#dom-mlgraphbuilder-reducelogsum 12 // Reduce the input tensor along all dimensions, or along the axes specified in 13 // the axes array parameter. 14 // 15 // dictionary MLReduceOptions { 16 // sequence<[EnforceRange] unsigned long> axes; 17 // boolean keepDimensions = false; 18 // }; 19 // 20 // MLOperand reduceLogSum(MLOperand input, optional MLReduceOptions options 21 // = {}); 22 23 const reduceLogSumTests = [ 24 { 25 'name': 'reduceLogSum float32 0D constant tensor default options', 26 'graph': { 27 'inputs': { 28 'reduceLogSumInput': { 29 'data': [64.54827117919922], 30 'descriptor': {shape: [], dataType: 'float32'}, 31 'constant': true 32 } 33 }, 34 'operators': [{ 35 'name': 'reduceLogSum', 36 'arguments': [{'input': 'reduceLogSumInput'}], 37 'outputs': 'reduceLogSumOutput' 38 }], 39 'expectedOutputs': { 40 'reduceLogSumOutput': { 41 'data': 4.167413234710693, 42 'descriptor': {shape: [], dataType: 'float32'} 43 } 44 } 45 } 46 }, 47 { 48 'name': 'reduceLogSum float32 0D tensor default options', 49 'graph': { 50 'inputs': { 51 'reduceLogSumInput': { 52 'data': [64.54827117919922], 53 'descriptor': {shape: [], dataType: 'float32'}, 54 'constant': false 55 } 56 }, 57 'operators': [{ 58 'name': 'reduceLogSum', 59 'arguments': [{'input': 'reduceLogSumInput'}], 60 'outputs': 'reduceLogSumOutput' 61 }], 62 'expectedOutputs': { 63 'reduceLogSumOutput': { 64 'data': 4.167413234710693, 65 'descriptor': {shape: [], dataType: 'float32'} 66 } 67 } 68 } 69 }, 70 { 71 'name': 'reduceLogSum float32 0D constant tensor empty axes', 72 'graph': { 73 'inputs': { 74 'reduceLogSumInput': { 75 'data': [64.54827117919922], 76 'descriptor': {shape: [], dataType: 'float32'}, 77 'constant': true 78 } 79 }, 80 'operators': [{ 81 'name': 'reduceLogSum', 82 'arguments': 83 [{'input': 'reduceLogSumInput'}, {'options': {'axes': []}}], 84 'outputs': 'reduceLogSumOutput' 85 }], 86 'expectedOutputs': { 87 'reduceLogSumOutput': { 88 'data': 4.167413234710693, 89 'descriptor': {shape: [], dataType: 'float32'} 90 } 91 } 92 } 93 }, 94 { 95 'name': 'reduceLogSum float32 0D tensor empty axes', 96 'graph': { 97 'inputs': { 98 'reduceLogSumInput': { 99 'data': [64.54827117919922], 100 'descriptor': {shape: [], dataType: 'float32'}, 101 'constant': false 102 } 103 }, 104 'operators': [{ 105 'name': 'reduceLogSum', 106 'arguments': 107 [{'input': 'reduceLogSumInput'}, {'options': {'axes': []}}], 108 'outputs': 'reduceLogSumOutput' 109 }], 110 'expectedOutputs': { 111 'reduceLogSumOutput': { 112 'data': 4.167413234710693, 113 'descriptor': {shape: [], dataType: 'float32'} 114 } 115 } 116 } 117 }, 118 { 119 'name': 'reduceLogSum float32 1D constant tensor empty axes', 120 'graph': { 121 'inputs': { 122 'reduceLogSumInput': { 123 'data': [64.54827117919922, 64.54827117919922], 124 'descriptor': {shape: [2], dataType: 'float32'}, 125 'constant': true 126 } 127 }, 128 'operators': [{ 129 'name': 'reduceLogSum', 130 'arguments': 131 [{'input': 'reduceLogSumInput'}, {'options': {'axes': []}}], 132 'outputs': 'reduceLogSumOutput' 133 }], 134 'expectedOutputs': { 135 'reduceLogSumOutput': { 136 'data': [4.167413234710693, 4.167413234710693], 137 'descriptor': {shape: [2], dataType: 'float32'} 138 } 139 } 140 } 141 }, 142 { 143 'name': 144 'reduceLogSum float32 1D constant tensor all non-negative default options', 145 'graph': { 146 'inputs': { 147 'reduceLogSumInput': { 148 'data': [ 149 64.54827117919922, 97.87423706054688, 26.529027938842773, 150 79.79046630859375, 50.394989013671875, 14.578407287597656, 151 20.866817474365234, 32.43873596191406, 64.91233825683594, 152 71.54029846191406, 11.137068748474121, 55.079307556152344, 153 43.791351318359375, 13.831947326660156, 97.39019775390625, 154 35.507755279541016, 52.27586364746094, 82.83865356445312, 155 8.568099021911621, 0.8337112069129944, 69.23146057128906, 156 3.8541641235351562, 70.5567398071289, 71.99264526367188 157 ], 158 'descriptor': {shape: [24], dataType: 'float32'}, 159 'constant': true 160 } 161 }, 162 'operators': [{ 163 'name': 'reduceLogSum', 164 'arguments': [{'input': 'reduceLogSumInput'}], 165 'outputs': 'reduceLogSumOutput' 166 }], 167 'expectedOutputs': { 168 'reduceLogSumOutput': { 169 'data': 7.039101600646973, 170 'descriptor': {shape: [], dataType: 'float32'} 171 } 172 } 173 } 174 }, 175 { 176 'name': 'reduceLogSum float32 1D tensor all non-negative default options', 177 'graph': { 178 'inputs': { 179 'reduceLogSumInput': { 180 'data': [ 181 64.54827117919922, 97.87423706054688, 26.529027938842773, 182 79.79046630859375, 50.394989013671875, 14.578407287597656, 183 20.866817474365234, 32.43873596191406, 64.91233825683594, 184 71.54029846191406, 11.137068748474121, 55.079307556152344, 185 43.791351318359375, 13.831947326660156, 97.39019775390625, 186 35.507755279541016, 52.27586364746094, 82.83865356445312, 187 8.568099021911621, 0.8337112069129944, 69.23146057128906, 188 3.8541641235351562, 70.5567398071289, 71.99264526367188 189 ], 190 'descriptor': {shape: [24], dataType: 'float32'} 191 } 192 }, 193 'operators': [{ 194 'name': 'reduceLogSum', 195 'arguments': [{'input': 'reduceLogSumInput'}], 196 'outputs': 'reduceLogSumOutput' 197 }], 198 'expectedOutputs': { 199 'reduceLogSumOutput': { 200 'data': 7.039101600646973, 201 'descriptor': {shape: [], dataType: 'float32'} 202 } 203 } 204 } 205 }, 206 { 207 'name': 208 'reduceLogSum float32 1D tensor all non-negative integers default options', 209 'graph': { 210 'inputs': { 211 'reduceLogSumInput': { 212 'data': [ 213 63, 82, 49, 23, 98, 67, 15, 9, 89, 7, 69, 61, 214 47, 50, 41, 39, 58, 52, 35, 83, 81, 7, 34, 9 215 ], 216 'descriptor': {shape: [24], dataType: 'float32'} 217 } 218 }, 219 'operators': [{ 220 'name': 'reduceLogSum', 221 'arguments': [{'input': 'reduceLogSumInput'}], 222 'outputs': 'reduceLogSumOutput' 223 }], 224 'expectedOutputs': { 225 'reduceLogSumOutput': { 226 'data': 7.063048362731934, 227 'descriptor': {shape: [], dataType: 'float32'} 228 } 229 } 230 } 231 }, 232 { 233 'name': 'reduceLogSum float32 2D tensor default options', 234 'graph': { 235 'inputs': { 236 'reduceLogSumInput': { 237 'data': [ 238 64.54827117919922, 97.87423706054688, 26.529027938842773, 239 79.79046630859375, 50.394989013671875, 14.578407287597656, 240 20.866817474365234, 32.43873596191406, 64.91233825683594, 241 71.54029846191406, 11.137068748474121, 55.079307556152344, 242 43.791351318359375, 13.831947326660156, 97.39019775390625, 243 35.507755279541016, 52.27586364746094, 82.83865356445312, 244 8.568099021911621, 0.8337112069129944, 69.23146057128906, 245 3.8541641235351562, 70.5567398071289, 71.99264526367188 246 ], 247 'descriptor': {shape: [4, 6], dataType: 'float32'} 248 } 249 }, 250 'operators': [{ 251 'name': 'reduceLogSum', 252 'arguments': [{'input': 'reduceLogSumInput'}], 253 'outputs': 'reduceLogSumOutput' 254 }], 255 'expectedOutputs': { 256 'reduceLogSumOutput': { 257 'data': 7.039101600646973, 258 'descriptor': {shape: [], dataType: 'float32'} 259 } 260 } 261 } 262 }, 263 { 264 'name': 'reduceLogSum float32 3D tensor default options', 265 'graph': { 266 'inputs': { 267 'reduceLogSumInput': { 268 'data': [ 269 64.54827117919922, 97.87423706054688, 26.529027938842773, 270 79.79046630859375, 50.394989013671875, 14.578407287597656, 271 20.866817474365234, 32.43873596191406, 64.91233825683594, 272 71.54029846191406, 11.137068748474121, 55.079307556152344, 273 43.791351318359375, 13.831947326660156, 97.39019775390625, 274 35.507755279541016, 52.27586364746094, 82.83865356445312, 275 8.568099021911621, 0.8337112069129944, 69.23146057128906, 276 3.8541641235351562, 70.5567398071289, 71.99264526367188 277 ], 278 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} 279 } 280 }, 281 'operators': [{ 282 'name': 'reduceLogSum', 283 'arguments': [{'input': 'reduceLogSumInput'}], 284 'outputs': 'reduceLogSumOutput' 285 }], 286 'expectedOutputs': { 287 'reduceLogSumOutput': { 288 'data': 7.039101600646973, 289 'descriptor': {shape: [], dataType: 'float32'} 290 } 291 } 292 } 293 }, 294 { 295 'name': 'reduceLogSum float32 4D tensor default options', 296 'graph': { 297 'inputs': { 298 'reduceLogSumInput': { 299 'data': [ 300 64.54827117919922, 97.87423706054688, 26.529027938842773, 301 79.79046630859375, 50.394989013671875, 14.578407287597656, 302 20.866817474365234, 32.43873596191406, 64.91233825683594, 303 71.54029846191406, 11.137068748474121, 55.079307556152344, 304 43.791351318359375, 13.831947326660156, 97.39019775390625, 305 35.507755279541016, 52.27586364746094, 82.83865356445312, 306 8.568099021911621, 0.8337112069129944, 69.23146057128906, 307 3.8541641235351562, 70.5567398071289, 71.99264526367188 308 ], 309 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} 310 } 311 }, 312 'operators': [{ 313 'name': 'reduceLogSum', 314 'arguments': [{'input': 'reduceLogSumInput'}], 315 'outputs': 'reduceLogSumOutput' 316 }], 317 'expectedOutputs': { 318 'reduceLogSumOutput': { 319 'data': 7.039101600646973, 320 'descriptor': {shape: [], dataType: 'float32'} 321 } 322 } 323 } 324 }, 325 { 326 'name': 'reduceLogSum float32 5D tensor default options', 327 'graph': { 328 'inputs': { 329 'reduceLogSumInput': { 330 'data': [ 331 64.54827117919922, 97.87423706054688, 26.529027938842773, 332 79.79046630859375, 50.394989013671875, 14.578407287597656, 333 20.866817474365234, 32.43873596191406, 64.91233825683594, 334 71.54029846191406, 11.137068748474121, 55.079307556152344, 335 43.791351318359375, 13.831947326660156, 97.39019775390625, 336 35.507755279541016, 52.27586364746094, 82.83865356445312, 337 8.568099021911621, 0.8337112069129944, 69.23146057128906, 338 3.8541641235351562, 70.5567398071289, 71.99264526367188 339 ], 340 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float32'} 341 } 342 }, 343 'operators': [{ 344 'name': 'reduceLogSum', 345 'arguments': [{'input': 'reduceLogSumInput'}], 346 'outputs': 'reduceLogSumOutput' 347 }], 348 'expectedOutputs': { 349 'reduceLogSumOutput': { 350 'data': 7.039101600646973, 351 'descriptor': {shape: [], dataType: 'float32'} 352 } 353 } 354 } 355 }, 356 { 357 'name': 'reduceLogSum float32 3D tensor options.axes', 358 'graph': { 359 'inputs': { 360 'reduceLogSumInput': { 361 'data': [ 362 64.54827117919922, 97.87423706054688, 26.529027938842773, 363 79.79046630859375, 50.394989013671875, 14.578407287597656, 364 20.866817474365234, 32.43873596191406, 64.91233825683594, 365 71.54029846191406, 11.137068748474121, 55.079307556152344, 366 43.791351318359375, 13.831947326660156, 97.39019775390625, 367 35.507755279541016, 52.27586364746094, 82.83865356445312, 368 8.568099021911621, 0.8337112069129944, 69.23146057128906, 369 3.8541641235351562, 70.5567398071289, 71.99264526367188 370 ], 371 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} 372 } 373 }, 374 'operators': [{ 375 'name': 'reduceLogSum', 376 'arguments': 377 [{'input': 'reduceLogSumInput'}, {'options': {'axes': [2]}}], 378 'outputs': 'reduceLogSumOutput' 379 }], 380 'expectedOutputs': { 381 'reduceLogSumOutput': { 382 'data': [ 383 5.593751907348633, 4.773046016693115, 5.3115739822387695, 384 5.2497639656066895, 4.973392486572266, 5.373587131500244 385 ], 386 'descriptor': {shape: [2, 3], dataType: 'float32'} 387 } 388 } 389 } 390 }, 391 { 392 'name': 'reduceLogSum float32 4D tensor options.axes', 393 'graph': { 394 'inputs': { 395 'reduceLogSumInput': { 396 'data': [ 397 64.54827117919922, 97.87423706054688, 26.529027938842773, 398 79.79046630859375, 50.394989013671875, 14.578407287597656, 399 20.866817474365234, 32.43873596191406, 64.91233825683594, 400 71.54029846191406, 11.137068748474121, 55.079307556152344, 401 43.791351318359375, 13.831947326660156, 97.39019775390625, 402 35.507755279541016, 52.27586364746094, 82.83865356445312, 403 8.568099021911621, 0.8337112069129944, 69.23146057128906, 404 3.8541641235351562, 70.5567398071289, 71.99264526367188 405 ], 406 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} 407 } 408 }, 409 'operators': [{ 410 'name': 'reduceLogSum', 411 'arguments': 412 [{'input': 'reduceLogSumInput'}, {'options': {'axes': [0, 2]}}], 413 'outputs': 'reduceLogSumOutput' 414 }], 415 'expectedOutputs': { 416 'reduceLogSumOutput': { 417 'data': [ 418 5.410027980804443, 5.367736339569092, 5.399682998657227, 419 4.652334213256836, 4.744638442993164, 5.565346717834473 420 ], 421 'descriptor': {shape: [2, 3], dataType: 'float32'} 422 } 423 } 424 } 425 }, 426 { 427 'name': 'reduceLogSum float32 3D tensor options.keepDimensions=false', 428 'graph': { 429 'inputs': { 430 'reduceLogSumInput': { 431 'data': [ 432 64.54827117919922, 97.87423706054688, 26.529027938842773, 433 79.79046630859375, 50.394989013671875, 14.578407287597656, 434 20.866817474365234, 32.43873596191406, 64.91233825683594, 435 71.54029846191406, 11.137068748474121, 55.079307556152344, 436 43.791351318359375, 13.831947326660156, 97.39019775390625, 437 35.507755279541016, 52.27586364746094, 82.83865356445312, 438 8.568099021911621, 0.8337112069129944, 69.23146057128906, 439 3.8541641235351562, 70.5567398071289, 71.99264526367188 440 ], 441 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} 442 } 443 }, 444 'operators': [{ 445 'name': 'reduceLogSum', 446 'arguments': [ 447 {'input': 'reduceLogSumInput'}, {'options': {'keepDimensions': false}} 448 ], 449 'outputs': 'reduceLogSumOutput' 450 }], 451 'expectedOutputs': { 452 'reduceLogSumOutput': { 453 'data': 7.039101600646973, 454 'descriptor': {shape: [], dataType: 'float32'} 455 } 456 } 457 } 458 }, 459 { 460 'name': 'reduceLogSum float32 3D tensor options.keepDimensions=true', 461 'graph': { 462 'inputs': { 463 'reduceLogSumInput': { 464 'data': [ 465 64.54827117919922, 97.87423706054688, 26.529027938842773, 466 79.79046630859375, 50.394989013671875, 14.578407287597656, 467 20.866817474365234, 32.43873596191406, 64.91233825683594, 468 71.54029846191406, 11.137068748474121, 55.079307556152344, 469 43.791351318359375, 13.831947326660156, 97.39019775390625, 470 35.507755279541016, 52.27586364746094, 82.83865356445312, 471 8.568099021911621, 0.8337112069129944, 69.23146057128906, 472 3.8541641235351562, 70.5567398071289, 71.99264526367188 473 ], 474 'descriptor': {shape: [2, 3, 4], dataType: 'float32'} 475 } 476 }, 477 'operators': [{ 478 'name': 'reduceLogSum', 479 'arguments': [ 480 {'input': 'reduceLogSumInput'}, {'options': {'keepDimensions': true}} 481 ], 482 'outputs': 'reduceLogSumOutput' 483 }], 484 'expectedOutputs': { 485 'reduceLogSumOutput': { 486 'data': [7.039101600646973], 487 'descriptor': {shape: [1, 1, 1], dataType: 'float32'} 488 } 489 } 490 } 491 }, 492 { 493 'name': 'reduceLogSum float32 4D tensor options.keepDimensions=false', 494 'graph': { 495 'inputs': { 496 'reduceLogSumInput': { 497 'data': [ 498 64.54827117919922, 97.87423706054688, 26.529027938842773, 499 79.79046630859375, 50.394989013671875, 14.578407287597656, 500 20.866817474365234, 32.43873596191406, 64.91233825683594, 501 71.54029846191406, 11.137068748474121, 55.079307556152344, 502 43.791351318359375, 13.831947326660156, 97.39019775390625, 503 35.507755279541016, 52.27586364746094, 82.83865356445312, 504 8.568099021911621, 0.8337112069129944, 69.23146057128906, 505 3.8541641235351562, 70.5567398071289, 71.99264526367188 506 ], 507 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} 508 } 509 }, 510 'operators': [{ 511 'name': 'reduceLogSum', 512 'arguments': [ 513 {'input': 'reduceLogSumInput'}, {'options': {'keepDimensions': false}} 514 ], 515 'outputs': 'reduceLogSumOutput' 516 }], 517 'expectedOutputs': { 518 'reduceLogSumOutput': { 519 'data': 7.039101600646973, 520 'descriptor': {shape: [], dataType: 'float32'} 521 } 522 } 523 } 524 }, 525 { 526 'name': 'reduceLogSum float32 4D tensor options.keepDimensions=true', 527 'graph': { 528 'inputs': { 529 'reduceLogSumInput': { 530 'data': [ 531 64.54827117919922, 97.87423706054688, 26.529027938842773, 532 79.79046630859375, 50.394989013671875, 14.578407287597656, 533 20.866817474365234, 32.43873596191406, 64.91233825683594, 534 71.54029846191406, 11.137068748474121, 55.079307556152344, 535 43.791351318359375, 13.831947326660156, 97.39019775390625, 536 35.507755279541016, 52.27586364746094, 82.83865356445312, 537 8.568099021911621, 0.8337112069129944, 69.23146057128906, 538 3.8541641235351562, 70.5567398071289, 71.99264526367188 539 ], 540 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} 541 } 542 }, 543 'operators': [{ 544 'name': 'reduceLogSum', 545 'arguments': [ 546 {'input': 'reduceLogSumInput'}, {'options': {'keepDimensions': true}} 547 ], 548 'outputs': 'reduceLogSumOutput' 549 }], 550 'expectedOutputs': { 551 'reduceLogSumOutput': { 552 'data': [7.039101600646973], 553 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float32'} 554 } 555 } 556 } 557 }, 558 { 559 'name': 560 'reduceLogSum float32 4D tensor options.axes with options.keepDimensions=false', 561 'graph': { 562 'inputs': { 563 'reduceLogSumInput': { 564 'data': [ 565 64.54827117919922, 97.87423706054688, 26.529027938842773, 566 79.79046630859375, 50.394989013671875, 14.578407287597656, 567 20.866817474365234, 32.43873596191406, 64.91233825683594, 568 71.54029846191406, 11.137068748474121, 55.079307556152344, 569 43.791351318359375, 13.831947326660156, 97.39019775390625, 570 35.507755279541016, 52.27586364746094, 82.83865356445312, 571 8.568099021911621, 0.8337112069129944, 69.23146057128906, 572 3.8541641235351562, 70.5567398071289, 71.99264526367188 573 ], 574 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} 575 } 576 }, 577 'operators': [{ 578 'name': 'reduceLogSum', 579 'arguments': [ 580 {'input': 'reduceLogSumInput'}, 581 {'options': {'axes': [1, 3], 'keepDimensions': false}} 582 ], 583 'outputs': 'reduceLogSumOutput' 584 }], 585 'expectedOutputs': { 586 'reduceLogSumOutput': { 587 'data': [ 588 5.7273993492126465, 5.64375114440918, 5.453810214996338, 589 5.758983135223389 590 ], 591 'descriptor': {shape: [2, 2], dataType: 'float32'} 592 } 593 } 594 } 595 }, 596 { 597 'name': 598 'reduceLogSum float32 4D tensor options.axes with options.keepDimensions=true', 599 'graph': { 600 'inputs': { 601 'reduceLogSumInput': { 602 'data': [ 603 64.54827117919922, 97.87423706054688, 26.529027938842773, 604 79.79046630859375, 50.394989013671875, 14.578407287597656, 605 20.866817474365234, 32.43873596191406, 64.91233825683594, 606 71.54029846191406, 11.137068748474121, 55.079307556152344, 607 43.791351318359375, 13.831947326660156, 97.39019775390625, 608 35.507755279541016, 52.27586364746094, 82.83865356445312, 609 8.568099021911621, 0.8337112069129944, 69.23146057128906, 610 3.8541641235351562, 70.5567398071289, 71.99264526367188 611 ], 612 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float32'} 613 } 614 }, 615 'operators': [{ 616 'name': 'reduceLogSum', 617 'arguments': [ 618 {'input': 'reduceLogSumInput'}, 619 {'options': {'axes': [1, 3], 'keepDimensions': true}} 620 ], 621 'outputs': 'reduceLogSumOutput' 622 }], 623 'expectedOutputs': { 624 'reduceLogSumOutput': { 625 'data': [ 626 5.7273993492126465, 5.64375114440918, 5.453810214996338, 627 5.758983135223389 628 ], 629 'descriptor': {shape: [2, 1, 2, 1], dataType: 'float32'} 630 } 631 } 632 } 633 }, 634 635 // float16 tests 636 { 637 'name': 'reduceLogSum float16 0D constant tensor default options', 638 'graph': { 639 'inputs': { 640 'reduceLogSumInput': { 641 'data': [64.5625], 642 'descriptor': {shape: [], dataType: 'float16'}, 643 'constant': true 644 } 645 }, 646 'operators': [{ 647 'name': 'reduceLogSum', 648 'arguments': [{'input': 'reduceLogSumInput'}], 649 'outputs': 'reduceLogSumOutput' 650 }], 651 'expectedOutputs': { 652 'reduceLogSumOutput': { 653 'data': [4.16796875], 654 'descriptor': {shape: [], dataType: 'float16'} 655 } 656 } 657 } 658 }, 659 { 660 'name': 'reduceLogSum float16 0D tensor default options', 661 'graph': { 662 'inputs': { 663 'reduceLogSumInput': { 664 'data': [64.5625], 665 'descriptor': {shape: [], dataType: 'float16'}, 666 'constant': false 667 } 668 }, 669 'operators': [{ 670 'name': 'reduceLogSum', 671 'arguments': [{'input': 'reduceLogSumInput'}], 672 'outputs': 'reduceLogSumOutput' 673 }], 674 'expectedOutputs': { 675 'reduceLogSumOutput': { 676 'data': [4.16796875], 677 'descriptor': {shape: [], dataType: 'float16'} 678 } 679 } 680 } 681 }, 682 { 683 'name': 'reduceLogSum float16 0D constant tensor empty axes', 684 'graph': { 685 'inputs': { 686 'reduceLogSumInput': { 687 'data': [64.5625], 688 'descriptor': {shape: [], dataType: 'float16'}, 689 'constant': true 690 } 691 }, 692 'operators': [{ 693 'name': 'reduceLogSum', 694 'arguments': 695 [{'input': 'reduceLogSumInput'}, {'options': {'axes': []}}], 696 'outputs': 'reduceLogSumOutput' 697 }], 698 'expectedOutputs': { 699 'reduceLogSumOutput': { 700 'data': [4.16796875], 701 'descriptor': {shape: [], dataType: 'float16'} 702 } 703 } 704 } 705 }, 706 { 707 'name': 'reduceLogSum float16 0D tensor empty axes', 708 'graph': { 709 'inputs': { 710 'reduceLogSumInput': { 711 'data': [64.5625], 712 'descriptor': {shape: [], dataType: 'float16'}, 713 'constant': false 714 } 715 }, 716 'operators': [{ 717 'name': 'reduceLogSum', 718 'arguments': 719 [{'input': 'reduceLogSumInput'}, {'options': {'axes': []}}], 720 'outputs': 'reduceLogSumOutput' 721 }], 722 'expectedOutputs': { 723 'reduceLogSumOutput': { 724 'data': [4.16796875], 725 'descriptor': {shape: [], dataType: 'float16'} 726 } 727 } 728 } 729 }, 730 { 731 'name': 732 'reduceLogSum float16 1D constant tensor all non-negative default options', 733 'graph': { 734 'inputs': { 735 'reduceLogSumInput': { 736 'data': [ 737 64.5625, 97.875, 26.53125, 79.8125, 50.40625, 738 14.578125, 20.859375, 32.4375, 64.9375, 71.5625, 739 11.140625, 55.09375, 43.78125, 13.828125, 97.375, 740 35.5, 52.28125, 82.8125, 8.5703125, 0.83349609375, 741 69.25, 3.853515625, 70.5625, 72 742 ], 743 'descriptor': {shape: [24], dataType: 'float16'}, 744 'constant': true 745 } 746 }, 747 'operators': [{ 748 'name': 'reduceLogSum', 749 'arguments': [{'input': 'reduceLogSumInput'}], 750 'outputs': 'reduceLogSumOutput' 751 }], 752 'expectedOutputs': { 753 'reduceLogSumOutput': { 754 'data': [7.0390625], 755 'descriptor': {shape: [], dataType: 'float16'} 756 } 757 } 758 } 759 }, 760 { 761 'name': 'reduceLogSum float16 1D tensor all non-negative default options', 762 'graph': { 763 'inputs': { 764 'reduceLogSumInput': { 765 'data': [ 766 64.5625, 97.875, 26.53125, 79.8125, 50.40625, 767 14.578125, 20.859375, 32.4375, 64.9375, 71.5625, 768 11.140625, 55.09375, 43.78125, 13.828125, 97.375, 769 35.5, 52.28125, 82.8125, 8.5703125, 0.83349609375, 770 69.25, 3.853515625, 70.5625, 72 771 ], 772 'descriptor': {shape: [24], dataType: 'float16'} 773 } 774 }, 775 'operators': [{ 776 'name': 'reduceLogSum', 777 'arguments': [{'input': 'reduceLogSumInput'}], 778 'outputs': 'reduceLogSumOutput' 779 }], 780 'expectedOutputs': { 781 'reduceLogSumOutput': { 782 'data': [7.0390625], 783 'descriptor': {shape: [], dataType: 'float16'} 784 } 785 } 786 } 787 }, 788 { 789 'name': 790 'reduceLogSum float16 1D tensor all non-negative integers default options', 791 'graph': { 792 'inputs': { 793 'reduceLogSumInput': { 794 'data': [ 795 63, 82, 49, 23, 98, 67, 15, 9, 89, 7, 69, 61, 796 47, 50, 41, 39, 58, 52, 35, 83, 81, 7, 34, 9 797 ], 798 'descriptor': {shape: [24], dataType: 'float16'} 799 } 800 }, 801 'operators': [{ 802 'name': 'reduceLogSum', 803 'arguments': [{'input': 'reduceLogSumInput'}], 804 'outputs': 'reduceLogSumOutput' 805 }], 806 'expectedOutputs': { 807 'reduceLogSumOutput': 808 {'data': [7.0625], 'descriptor': {shape: [], dataType: 'float16'}} 809 } 810 } 811 }, 812 { 813 'name': 'reduceLogSum float16 2D tensor default options', 814 'graph': { 815 'inputs': { 816 'reduceLogSumInput': { 817 'data': [ 818 64.5625, 97.875, 26.53125, 79.8125, 50.40625, 819 14.578125, 20.859375, 32.4375, 64.9375, 71.5625, 820 11.140625, 55.09375, 43.78125, 13.828125, 97.375, 821 35.5, 52.28125, 82.8125, 8.5703125, 0.83349609375, 822 69.25, 3.853515625, 70.5625, 72 823 ], 824 'descriptor': {shape: [4, 6], dataType: 'float16'} 825 } 826 }, 827 'operators': [{ 828 'name': 'reduceLogSum', 829 'arguments': [{'input': 'reduceLogSumInput'}], 830 'outputs': 'reduceLogSumOutput' 831 }], 832 'expectedOutputs': { 833 'reduceLogSumOutput': { 834 'data': [7.0390625], 835 'descriptor': {shape: [], dataType: 'float16'} 836 } 837 } 838 } 839 }, 840 { 841 'name': 'reduceLogSum float16 3D tensor default options', 842 'graph': { 843 'inputs': { 844 'reduceLogSumInput': { 845 'data': [ 846 64.5625, 97.875, 26.53125, 79.8125, 50.40625, 847 14.578125, 20.859375, 32.4375, 64.9375, 71.5625, 848 11.140625, 55.09375, 43.78125, 13.828125, 97.375, 849 35.5, 52.28125, 82.8125, 8.5703125, 0.83349609375, 850 69.25, 3.853515625, 70.5625, 72 851 ], 852 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} 853 } 854 }, 855 'operators': [{ 856 'name': 'reduceLogSum', 857 'arguments': [{'input': 'reduceLogSumInput'}], 858 'outputs': 'reduceLogSumOutput' 859 }], 860 'expectedOutputs': { 861 'reduceLogSumOutput': { 862 'data': [7.0390625], 863 'descriptor': {shape: [], dataType: 'float16'} 864 } 865 } 866 } 867 }, 868 { 869 'name': 'reduceLogSum float16 4D tensor default options', 870 'graph': { 871 'inputs': { 872 'reduceLogSumInput': { 873 'data': [ 874 64.5625, 97.875, 26.53125, 79.8125, 50.40625, 875 14.578125, 20.859375, 32.4375, 64.9375, 71.5625, 876 11.140625, 55.09375, 43.78125, 13.828125, 97.375, 877 35.5, 52.28125, 82.8125, 8.5703125, 0.83349609375, 878 69.25, 3.853515625, 70.5625, 72 879 ], 880 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} 881 } 882 }, 883 'operators': [{ 884 'name': 'reduceLogSum', 885 'arguments': [{'input': 'reduceLogSumInput'}], 886 'outputs': 'reduceLogSumOutput' 887 }], 888 'expectedOutputs': { 889 'reduceLogSumOutput': { 890 'data': [7.0390625], 891 'descriptor': {shape: [], dataType: 'float16'} 892 } 893 } 894 } 895 }, 896 { 897 'name': 'reduceLogSum float16 5D tensor default options', 898 'graph': { 899 'inputs': { 900 'reduceLogSumInput': { 901 'data': [ 902 64.5625, 97.875, 26.53125, 79.8125, 50.40625, 903 14.578125, 20.859375, 32.4375, 64.9375, 71.5625, 904 11.140625, 55.09375, 43.78125, 13.828125, 97.375, 905 35.5, 52.28125, 82.8125, 8.5703125, 0.83349609375, 906 69.25, 3.853515625, 70.5625, 72 907 ], 908 'descriptor': {shape: [2, 1, 4, 1, 3], dataType: 'float16'} 909 } 910 }, 911 'operators': [{ 912 'name': 'reduceLogSum', 913 'arguments': [{'input': 'reduceLogSumInput'}], 914 'outputs': 'reduceLogSumOutput' 915 }], 916 'expectedOutputs': { 917 'reduceLogSumOutput': { 918 'data': [7.0390625], 919 'descriptor': {shape: [], dataType: 'float16'} 920 } 921 } 922 } 923 }, 924 { 925 'name': 'reduceLogSum float16 3D tensor options.axes', 926 'graph': { 927 'inputs': { 928 'reduceLogSumInput': { 929 'data': [ 930 64.5625, 97.875, 26.53125, 79.8125, 50.40625, 931 14.578125, 20.859375, 32.4375, 64.9375, 71.5625, 932 11.140625, 55.09375, 43.78125, 13.828125, 97.375, 933 35.5, 52.28125, 82.8125, 8.5703125, 0.83349609375, 934 69.25, 3.853515625, 70.5625, 72 935 ], 936 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} 937 } 938 }, 939 'operators': [{ 940 'name': 'reduceLogSum', 941 'arguments': 942 [{'input': 'reduceLogSumInput'}, {'options': {'axes': [2]}}], 943 'outputs': 'reduceLogSumOutput' 944 }], 945 'expectedOutputs': { 946 'reduceLogSumOutput': { 947 'data': [5.59375, 4.7734375, 5.3125, 5.25, 4.97265625, 5.375], 948 'descriptor': {shape: [2, 3], dataType: 'float16'} 949 } 950 } 951 } 952 }, 953 { 954 'name': 'reduceLogSum float16 4D tensor options.axes', 955 'graph': { 956 'inputs': { 957 'reduceLogSumInput': { 958 'data': [ 959 64.5625, 97.875, 26.53125, 79.8125, 50.40625, 960 14.578125, 20.859375, 32.4375, 64.9375, 71.5625, 961 11.140625, 55.09375, 43.78125, 13.828125, 97.375, 962 35.5, 52.28125, 82.8125, 8.5703125, 0.83349609375, 963 69.25, 3.853515625, 70.5625, 72 964 ], 965 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} 966 } 967 }, 968 'operators': [{ 969 'name': 'reduceLogSum', 970 'arguments': 971 [{'input': 'reduceLogSumInput'}, {'options': {'axes': [0, 2]}}], 972 'outputs': 'reduceLogSumOutput' 973 }], 974 'expectedOutputs': { 975 'reduceLogSumOutput': { 976 'data': [ 977 5.41015625, 5.3671875, 5.3984375, 4.65234375, 4.74609375, 5.56640625 978 ], 979 'descriptor': {shape: [2, 3], dataType: 'float16'} 980 } 981 } 982 } 983 }, 984 { 985 'name': 'reduceLogSum float16 3D tensor options.keepDimensions=false', 986 'graph': { 987 'inputs': { 988 'reduceLogSumInput': { 989 'data': [ 990 64.5625, 97.875, 26.53125, 79.8125, 50.40625, 991 14.578125, 20.859375, 32.4375, 64.9375, 71.5625, 992 11.140625, 55.09375, 43.78125, 13.828125, 97.375, 993 35.5, 52.28125, 82.8125, 8.5703125, 0.83349609375, 994 69.25, 3.853515625, 70.5625, 72 995 ], 996 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} 997 } 998 }, 999 'operators': [{ 1000 'name': 'reduceLogSum', 1001 'arguments': [ 1002 {'input': 'reduceLogSumInput'}, {'options': {'keepDimensions': false}} 1003 ], 1004 'outputs': 'reduceLogSumOutput' 1005 }], 1006 'expectedOutputs': { 1007 'reduceLogSumOutput': { 1008 'data': [7.0390625], 1009 'descriptor': {shape: [], dataType: 'float16'} 1010 } 1011 } 1012 } 1013 }, 1014 { 1015 'name': 'reduceLogSum float16 3D tensor options.keepDimensions=true', 1016 'graph': { 1017 'inputs': { 1018 'reduceLogSumInput': { 1019 'data': [ 1020 64.5625, 97.875, 26.53125, 79.8125, 50.40625, 1021 14.578125, 20.859375, 32.4375, 64.9375, 71.5625, 1022 11.140625, 55.09375, 43.78125, 13.828125, 97.375, 1023 35.5, 52.28125, 82.8125, 8.5703125, 0.83349609375, 1024 69.25, 3.853515625, 70.5625, 72 1025 ], 1026 'descriptor': {shape: [2, 3, 4], dataType: 'float16'} 1027 } 1028 }, 1029 'operators': [{ 1030 'name': 'reduceLogSum', 1031 'arguments': [ 1032 {'input': 'reduceLogSumInput'}, {'options': {'keepDimensions': true}} 1033 ], 1034 'outputs': 'reduceLogSumOutput' 1035 }], 1036 'expectedOutputs': { 1037 'reduceLogSumOutput': { 1038 'data': [7.0390625], 1039 'descriptor': {shape: [1, 1, 1], dataType: 'float16'} 1040 } 1041 } 1042 } 1043 }, 1044 { 1045 'name': 'reduceLogSum float16 4D tensor options.keepDimensions=false', 1046 'graph': { 1047 'inputs': { 1048 'reduceLogSumInput': { 1049 'data': [ 1050 64.5625, 97.875, 26.53125, 79.8125, 50.40625, 1051 14.578125, 20.859375, 32.4375, 64.9375, 71.5625, 1052 11.140625, 55.09375, 43.78125, 13.828125, 97.375, 1053 35.5, 52.28125, 82.8125, 8.5703125, 0.83349609375, 1054 69.25, 3.853515625, 70.5625, 72 1055 ], 1056 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} 1057 } 1058 }, 1059 'operators': [{ 1060 'name': 'reduceLogSum', 1061 'arguments': [ 1062 {'input': 'reduceLogSumInput'}, {'options': {'keepDimensions': false}} 1063 ], 1064 'outputs': 'reduceLogSumOutput' 1065 }], 1066 'expectedOutputs': { 1067 'reduceLogSumOutput': { 1068 'data': [7.0390625], 1069 'descriptor': {shape: [], dataType: 'float16'} 1070 } 1071 } 1072 } 1073 }, 1074 { 1075 'name': 'reduceLogSum float16 4D tensor options.keepDimensions=true', 1076 'graph': { 1077 'inputs': { 1078 'reduceLogSumInput': { 1079 'data': [ 1080 64.5625, 97.875, 26.53125, 79.8125, 50.40625, 1081 14.578125, 20.859375, 32.4375, 64.9375, 71.5625, 1082 11.140625, 55.09375, 43.78125, 13.828125, 97.375, 1083 35.5, 52.28125, 82.8125, 8.5703125, 0.83349609375, 1084 69.25, 3.853515625, 70.5625, 72 1085 ], 1086 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} 1087 } 1088 }, 1089 'operators': [{ 1090 'name': 'reduceLogSum', 1091 'arguments': [ 1092 {'input': 'reduceLogSumInput'}, {'options': {'keepDimensions': true}} 1093 ], 1094 'outputs': 'reduceLogSumOutput' 1095 }], 1096 'expectedOutputs': { 1097 'reduceLogSumOutput': { 1098 'data': [7.0390625], 1099 'descriptor': {shape: [1, 1, 1, 1], dataType: 'float16'} 1100 } 1101 } 1102 } 1103 }, 1104 { 1105 'name': 1106 'reduceLogSum float16 4D tensor options.axes with options.keepDimensions=false', 1107 'graph': { 1108 'inputs': { 1109 'reduceLogSumInput': { 1110 'data': [ 1111 64.5625, 97.875, 26.53125, 79.8125, 50.40625, 1112 14.578125, 20.859375, 32.4375, 64.9375, 71.5625, 1113 11.140625, 55.09375, 43.78125, 13.828125, 97.375, 1114 35.5, 52.28125, 82.8125, 8.5703125, 0.83349609375, 1115 69.25, 3.853515625, 70.5625, 72 1116 ], 1117 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} 1118 } 1119 }, 1120 'operators': [{ 1121 'name': 'reduceLogSum', 1122 'arguments': [ 1123 {'input': 'reduceLogSumInput'}, 1124 {'options': {'axes': [1, 3], 'keepDimensions': false}} 1125 ], 1126 'outputs': 'reduceLogSumOutput' 1127 }], 1128 'expectedOutputs': { 1129 'reduceLogSumOutput': { 1130 'data': [5.7265625, 5.64453125, 5.453125, 5.7578125], 1131 'descriptor': {shape: [2, 2], dataType: 'float16'} 1132 } 1133 } 1134 } 1135 }, 1136 { 1137 'name': 1138 'reduceLogSum float16 4D tensor options.axes with options.keepDimensions=true', 1139 'graph': { 1140 'inputs': { 1141 'reduceLogSumInput': { 1142 'data': [ 1143 64.5625, 97.875, 26.53125, 79.8125, 50.40625, 1144 14.578125, 20.859375, 32.4375, 64.9375, 71.5625, 1145 11.140625, 55.09375, 43.78125, 13.828125, 97.375, 1146 35.5, 52.28125, 82.8125, 8.5703125, 0.83349609375, 1147 69.25, 3.853515625, 70.5625, 72 1148 ], 1149 'descriptor': {shape: [2, 2, 2, 3], dataType: 'float16'} 1150 } 1151 }, 1152 'operators': [{ 1153 'name': 'reduceLogSum', 1154 'arguments': [ 1155 {'input': 'reduceLogSumInput'}, 1156 {'options': {'axes': [1, 3], 'keepDimensions': true}} 1157 ], 1158 'outputs': 'reduceLogSumOutput' 1159 }], 1160 'expectedOutputs': { 1161 'reduceLogSumOutput': { 1162 'data': [5.7265625, 5.64453125, 5.453125, 5.7578125], 1163 'descriptor': {shape: [2, 1, 2, 1], dataType: 'float16'} 1164 } 1165 } 1166 } 1167 } 1168 ]; 1169 1170 webnn_conformance_test( 1171 reduceLogSumTests, buildAndExecuteGraph, getPrecisionTolerance);