File size: 25,340 Bytes
d70fea3 | 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 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 | {
"op": "ai.onnx.Sum",
"cases": [
{
"name": "max_arity_float16_positions",
"provenance": {
"notes": "Synthetic four-input float16 Sum contract fixture; element-varying operands make every bounded input position contribute to a non-constant exact sum."
},
"inputs": {
"a": { "dtype": "float16", "shape": [5], "data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0] } },
"b": { "dtype": "float16", "shape": [5], "data": { "kind": "values", "values": [2.0, 4.0, 6.0, 8.0, 10.0] } },
"c": { "dtype": "float16", "shape": [5], "data": { "kind": "values", "values": [4.0, 1.0, 3.0, 2.0, 5.0] } },
"d": { "dtype": "float16", "shape": [5], "data": { "kind": "values", "values": [8.0, 2.0, 1.0, 4.0, 3.0] } }
},
"outputs": {
"y": {
"dtype": "float16",
"shape": [5],
"tolerance": 0,
"data": { "kind": "values", "values": [15.0, 9.0, 13.0, 18.0, 23.0] }
}
}
},
{
"name": "same_shape",
"inputs": {
"a": {
"dtype": "float32",
"shape": [2, 3],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29 }
},
"b": {
"dtype": "float32",
"shape": [2, 3],
"data": { "kind": "fillFloat32", "sinStep": 0.31, "cosStep": 0.07 }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [2, 3], "tolerance": 0.000001 } }
},
{
"name": "f32_subnormal_three_input_sum_gpu_gap",
"skipGpu": {
"category": "permanent",
"reason": "Portable WGSL floating-point semantics do not guarantee preservation of the subnormal values required by this fixture. Backend evidence: Metal flushes float32 subnormals to zero; the subnormal addends/sum cannot be reproduced on GPU."
},
"provenance": {
"source": "onnxruntime/test/providers/cpu/math/element_wise_ops_test.cc",
"test": "MathOpTest.Sum_8_Test1",
"notes": "Variadic Sum must preserve finite subnormal totals; a flush-to-zero path erases residual-like lanes before downstream scaling can amplify them."
},
"inputs": {
"a": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [1e-40, -1e-40, 0.0] } },
"b": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [1e-40, -1e-40, 1e-40] } },
"c": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [1e-40, -1e-40, -1e-40] } }
},
"outputs": {
"y": {
"dtype": "float32",
"shape": [3],
"tolerance": 2e-45,
"data": { "kind": "values", "values": [3e-40, -3e-40, 0.0] }
}
}
},
{
"name": "f32_subnormal_three_input_sum_vec4_gpu_gap",
"skipGpu": {
"category": "permanent",
"reason": "Portable WGSL floating-point semantics do not guarantee preservation of the subnormal values required by this fixture. Backend evidence: Metal flushes float32 subnormals to zero; the subnormal addends/sum cannot be reproduced on GPU."
},
"provenance": {
"source": "onnxruntime/test/providers/cpu/math/element_wise_ops_test.cc",
"test": "MathOpTest.Sum_8_Test1",
"notes": "Vec4 companion: variadic Sum must preserve finite subnormal totals in the vectorized path."
},
"inputs": {
"a": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [1e-40, -1e-40, 0.0, 1e-39] } },
"b": {
"dtype": "float32",
"shape": [4],
"data": { "kind": "values", "values": [1e-40, -1e-40, 1e-40, -1e-39] }
},
"c": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [1e-40, -1e-40, -1e-40, 0.0] } }
},
"outputs": {
"y": {
"dtype": "float32",
"shape": [4],
"tolerance": 2e-45,
"data": { "kind": "values", "values": [3e-40, -3e-40, 0.0, 0.0] }
}
}
},
{
"name": "float16_vec4_same_shape",
"inputs": {
"a": {
"dtype": "float16",
"shape": [8],
"data": { "kind": "values", "values": [1.0, -2.0, 3.5, -4.0, 0.25, 10.0, -100.0, 0.001] }
},
"b": {
"dtype": "float16",
"shape": [8],
"data": { "kind": "values", "values": [0.5, 2.0, -1.5, 4.0, 0.75, -5.0, 100.0, -0.001] }
}
},
"outputs": {
"y": {
"dtype": "float16",
"shape": [8],
"tolerance": 0.001,
"data": { "kind": "values", "values": [1.5, 0.0, 2.0, 0.0, 1.0, 5.0, 0.0, 0.0] }
}
}
},
{
"name": "same_shape_vec4_three_input",
"inputs": {
"a": {
"dtype": "float32",
"shape": [8],
"data": { "kind": "values", "values": [1.0, 5.0, -2.0, 4.0, 0.0, 6.0, 10.0, -10.0] }
},
"b": {
"dtype": "float32",
"shape": [8],
"data": { "kind": "values", "values": [3.0, 2.0, -4.0, 8.0, 1.0, 1.0, 9.0, -9.0] }
},
"c": {
"dtype": "float32",
"shape": [8],
"data": { "kind": "values", "values": [0.0, 7.0, -3.0, 2.0, -1.0, 8.0, 11.0, -11.0] }
}
},
"outputs": {
"y": {
"dtype": "float32",
"shape": [8],
"tolerance": 0.000001,
"data": { "kind": "values", "values": [4.0, 14.0, -9.0, 14.0, 0.0, 15.0, 30.0, -30.0] }
}
}
},
{
"name": "float16_vec4_three_input",
"provenance": {
"notes": "The float16 three-input vec4 path widens each operand to f32 before the extra-operand fold. Every operand and partial sum is an exactly representable dyadic float16 value, so dropping or double-counting C changes an exact zero-tolerance result."
},
"inputs": {
"a": {
"dtype": "float16",
"shape": [8],
"data": { "kind": "values", "values": [1.0, -2.0, 0.5, 16.0, -0.25, 6.0, -32.0, 0.125] }
},
"b": {
"dtype": "float16",
"shape": [8],
"data": { "kind": "values", "values": [2.0, -1.5, -1.0, 8.0, 0.125, 3.0, -8.0, 0.375] }
},
"c": {
"dtype": "float16",
"shape": [8],
"data": { "kind": "values", "values": [0.5, -4.0, 3.0, -4.0, -0.5, 12.0, 24.0, 0.5] }
}
},
"outputs": {
"y": {
"dtype": "float16",
"shape": [8],
"tolerance": 0,
"data": { "kind": "values", "values": [3.5, -7.5, 2.5, 20.0, -0.625, 21.0, -16.0, 1.0] }
}
}
},
{
"name": "broadcast_rank4",
"inputs": {
"a": {
"dtype": "float32",
"shape": [2, 3, 4, 5],
"data": { "kind": "fillFloat32", "sinStep": 0.13, "cosStep": 0.29 }
},
"b": {
"dtype": "float32",
"shape": [1, 3, 1, 5],
"data": { "kind": "fillFloat32", "sinStep": 0.31, "cosStep": 0.07 }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [2, 3, 4, 5], "tolerance": 0.000001 } }
},
{
"name": "rank0_rhs_scalar_broadcast",
"inputs": {
"a": {
"dtype": "float32",
"shape": [2, 3],
"data": { "kind": "values", "values": [1.0, 2.0, 3.0, 4.0, 5.0, 6.0] }
},
"b": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [-1.5] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [2, 3], "tolerance": 0.000001 } }
},
{
"name": "ort_two_inputs_no_broadcasting_3d",
"provenance": {
"source": "onnxruntime/test/providers/cpu/math/element_wise_ops_test.cc",
"test": "MathOpTest.SumMultipleInputsNoBroadcasting(num_inputs=2)"
},
"inputs": {
"a": { "dtype": "float32", "shape": [3, 3, 3], "data": { "kind": "constant", "value": 1.0 } },
"b": { "dtype": "float32", "shape": [3, 3, 3], "data": { "kind": "constant", "value": 1.0 } }
},
"outputs": { "y": { "dtype": "float32", "shape": [3, 3, 3], "tolerance": 0.000001 } }
},
{
"name": "ort_four_inputs_no_broadcasting_3d_variadic",
"provenance": {
"source": "onnxruntime/test/providers/cpu/math/element_wise_ops_test.cc",
"test": "MathOpTest.SumMultipleInputsNoBroadcasting(num_inputs=4)",
"notes": "ONNX Sum is variadic; this catches implementations capped at three inputs."
},
"inputs": {
"a": { "dtype": "float32", "shape": [3, 3, 3], "data": { "kind": "constant", "value": 1.0 } },
"b": { "dtype": "float32", "shape": [3, 3, 3], "data": { "kind": "constant", "value": 1.0 } },
"c": { "dtype": "float32", "shape": [3, 3, 3], "data": { "kind": "constant", "value": 1.0 } },
"d": { "dtype": "float32", "shape": [3, 3, 3], "data": { "kind": "constant", "value": 1.0 } }
},
"outputs": {
"y": { "dtype": "float32", "shape": [3, 3, 3], "tolerance": 0, "data": { "kind": "constant", "value": 4.0 } }
}
},
{
"name": "ort_four_inputs_nan_infinity_variadic",
"provenance": {
"source": "onnxruntime/test/providers/cpu/math/element_wise_ops_test.cc",
"test": "MathOpTest.SumMultipleInputsNoBroadcasting(num_inputs=4)",
"notes": "Extends ORT's four-input Sum coverage with NaN propagation and inf-minus-inf cancellation."
},
"inputs": {
"a": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [1.0, "Infinity", 1.0, 8.0] } },
"b": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [3.0, "-Infinity", 5.0, 4.0] } },
"c": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [5.0, 2.0, "NaN", -4.0] } },
"d": { "dtype": "float32", "shape": [4], "data": { "kind": "values", "values": [7.0, 6.0, 9.0, "NaN"] } }
},
"outputs": {
"y": {
"dtype": "float32",
"shape": [4],
"tolerance": 0,
"allowNaN": true,
"data": { "kind": "values", "values": [16.0, "NaN", "NaN", "NaN"] }
}
}
},
{
"name": "ort_fifteen_inputs_no_broadcasting_3d_variadic_gpu_gap",
"skipGpu": {
"category": "todo",
"reason": "A single-pass implementation needs 15 input bindings plus one output binding, which exceeds WebGPU's guaranteed storage-buffer limit. A multi-pass in-place accumulator can implement this portable high-arity route but is not yet available."
},
"provenance": {
"source": "onnxruntime/test/providers/cpu/math/element_wise_ops_test.cc",
"test": "MathOpTest.SumMultipleInputsNoBroadcasting(num_inputs=15)",
"notes": "ORT explicitly covers high-arity no-broadcast Sum paths; this catches implementations capped at a small fixed arity."
},
"inputs": {
"a": { "dtype": "float32", "shape": [3, 3, 3], "data": { "kind": "constant", "value": 1.0 } },
"b": { "dtype": "float32", "shape": [3, 3, 3], "data": { "kind": "constant", "value": 1.0 } },
"c": { "dtype": "float32", "shape": [3, 3, 3], "data": { "kind": "constant", "value": 1.0 } },
"d": { "dtype": "float32", "shape": [3, 3, 3], "data": { "kind": "constant", "value": 1.0 } },
"e": { "dtype": "float32", "shape": [3, 3, 3], "data": { "kind": "constant", "value": 1.0 } },
"f": { "dtype": "float32", "shape": [3, 3, 3], "data": { "kind": "constant", "value": 1.0 } },
"g": { "dtype": "float32", "shape": [3, 3, 3], "data": { "kind": "constant", "value": 1.0 } },
"h": { "dtype": "float32", "shape": [3, 3, 3], "data": { "kind": "constant", "value": 1.0 } },
"i": { "dtype": "float32", "shape": [3, 3, 3], "data": { "kind": "constant", "value": 1.0 } },
"j": { "dtype": "float32", "shape": [3, 3, 3], "data": { "kind": "constant", "value": 1.0 } },
"k": { "dtype": "float32", "shape": [3, 3, 3], "data": { "kind": "constant", "value": 1.0 } },
"l": { "dtype": "float32", "shape": [3, 3, 3], "data": { "kind": "constant", "value": 1.0 } },
"m": { "dtype": "float32", "shape": [3, 3, 3], "data": { "kind": "constant", "value": 1.0 } },
"n": { "dtype": "float32", "shape": [3, 3, 3], "data": { "kind": "constant", "value": 1.0 } },
"o": { "dtype": "float32", "shape": [3, 3, 3], "data": { "kind": "constant", "value": 1.0 } }
},
"outputs": {
"y": { "dtype": "float32", "shape": [3, 3, 3], "tolerance": 0, "data": { "kind": "constant", "value": 15.0 } }
}
},
{
"name": "ort_opset6_two_input_same_shape_projection",
"provenance": {
"source": "onnxruntime/test/providers/cpu/math/element_wise_ops_test.cc",
"test": "MathOpTest.Sum_6",
"notes": "Two-input projection of ORT's same-shape three-input case."
},
"inputs": {
"a": {
"dtype": "float32",
"shape": [3, 3],
"data": { "kind": "values", "values": [1.0, 0.0, 1.0, -1.0, 1.1, -100.0, -5.4, 0.01, -10000.0] }
},
"b": {
"dtype": "float32",
"shape": [3, 3],
"data": { "kind": "values", "values": [1.0, 0.0, 2.0, -2.0, 2.2, 64.0, -1.0, 0.02, 0.25] }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [3, 3], "tolerance": 0.000001 } }
},
{
"name": "ort_opset6_three_input_same_shape_exact",
"provenance": {
"source": "onnxruntime/test/providers/cpu/math/element_wise_ops_test.cc",
"test": "MathOpTest.Sum_6"
},
"inputs": {
"a": {
"dtype": "float32",
"shape": [3, 3],
"data": { "kind": "values", "values": [1.0, 0.0, 1.0, -1.0, 1.1, -100.0, -5.4, 0.01, -10000.0] }
},
"b": {
"dtype": "float32",
"shape": [3, 3],
"data": { "kind": "values", "values": [1.0, 0.0, 2.0, -2.0, 2.2, 64.0, -1.0, 0.02, 0.25] }
},
"c": {
"dtype": "float32",
"shape": [3, 3],
"data": { "kind": "values", "values": [1.0, 0.0, 3.0, -3.0, 3.3, 64.0, 5.4, 0.03, 10000.0] }
}
},
"outputs": {
"y": {
"dtype": "float32",
"shape": [3, 3],
"tolerance": 0.000001,
"data": { "kind": "values", "values": [3.0, 0.0, 6.0, -6.0, 6.6, 28.0, -1.0, 0.06, 0.25] }
}
}
},
{
"name": "ort_opset8_vector_column_broadcast_projection",
"provenance": {
"source": "onnxruntime/test/providers/cpu/math/element_wise_ops_test.cc",
"test": "MathOpTest.Sum_8_Test1",
"notes": "Two-input projection exercising vector plus column multidirectional broadcasting."
},
"inputs": {
"a": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [1.0, 2.0, 3.0] } },
"b": { "dtype": "float32", "shape": [3, 1], "data": { "kind": "values", "values": [10.0, 20.0, 30.0] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [3, 3], "tolerance": 0.000001 } }
},
{
"name": "ort_opset8_three_input_vector_column_depth_broadcast_exact",
"provenance": {
"source": "onnxruntime/test/providers/cpu/math/element_wise_ops_test.cc",
"test": "MathOpTest.Sum_8_Test1"
},
"inputs": {
"a": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [1.0, 2.0, 3.0] } },
"b": { "dtype": "float32", "shape": [3, 1], "data": { "kind": "values", "values": [10.0, 20.0, 30.0] } },
"c": { "dtype": "float32", "shape": [3, 1, 1], "data": { "kind": "values", "values": [100.0, 200.0, 300.0] } }
},
"outputs": {
"y": {
"dtype": "float32",
"shape": [3, 3, 3],
"tolerance": 0,
"data": {
"kind": "values",
"values": [111.0, 112.0, 113.0, 121.0, 122.0, 123.0, 131.0, 132.0, 133.0, 211.0, 212.0, 213.0, 221.0, 222.0, 223.0, 231.0, 232.0, 233.0, 311.0, 312.0, 313.0, 321.0, 322.0, 323.0, 331.0, 332.0, 333.0]
}
}
}
},
{
"name": "ort_opset8_four_input_vector_column_depth_broadcast",
"provenance": {
"source": "onnxruntime/test/providers/cpu/math/element_wise_ops_test.cc",
"test": "MathOpTest.Sum_8_Test1",
"notes": "Extends ORT's multidirectional broadcast case to a valid four-input ONNX variadic Sum node."
},
"inputs": {
"a": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [1.0, 2.0, 3.0] } },
"b": { "dtype": "float32", "shape": [3, 1], "data": { "kind": "values", "values": [10.0, 20.0, 30.0] } },
"c": { "dtype": "float32", "shape": [3, 1, 1], "data": { "kind": "values", "values": [100.0, 200.0, 300.0] } },
"d": {
"dtype": "float32",
"shape": [1, 1, 3],
"data": { "kind": "values", "values": [1000.0, 2000.0, 3000.0] }
}
},
"outputs": {
"y": {
"dtype": "float32",
"shape": [3, 3, 3],
"tolerance": 0,
"data": {
"kind": "values",
"values": [1111.0, 2112.0, 3113.0, 1121.0, 2122.0, 3123.0, 1131.0, 2132.0, 3133.0, 1211.0, 2212.0, 3213.0, 1221.0, 2222.0, 3223.0, 1231.0, 2232.0, 3233.0, 1311.0, 2312.0, 3313.0, 1321.0, 2322.0, 3323.0, 1331.0, 2332.0, 3333.0]
}
}
}
},
{
"name": "ort_opset8_matrix_vector_broadcast_projection",
"provenance": {
"source": "onnxruntime/test/providers/cpu/math/element_wise_ops_test.cc",
"test": "MathOpTest.Sum_8_Test2",
"notes": "Two-input projection of ORT's matrix plus trailing-vector broadcast case."
},
"inputs": {
"a": {
"dtype": "float32",
"shape": [3, 3],
"data": { "kind": "values", "values": [1.0, 0.0, 1.0, -1.0, 1.1, -100.0, -5.4, 0.01, -74.0] }
},
"b": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [1.0, 0.0, 2.0] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [3, 3], "tolerance": 0.000001 } }
},
{
"name": "onnx_backend_sum_two_inputs",
"provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_sum_two_inputs" },
"inputs": {
"a": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [3.0, 0.0, 2.0] } },
"b": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [1.0, 3.0, 4.0] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [3], "tolerance": 0 } }
},
{
"name": "onnx_backend_sum_one_input_identity",
"provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_sum_one_input" },
"inputs": { "a": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [3.0, 0.0, 2.0] } } },
"outputs": { "y": { "dtype": "float32", "shape": [3], "tolerance": 0 } }
},
{
"name": "onnx_backend_sum_example_three_inputs",
"provenance": { "source": "cmake/external/onnx/onnx/backend/test/data/node/test_sum_example" },
"inputs": {
"a": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [3.0, 0.0, 2.0] } },
"b": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [1.0, 3.0, 4.0] } },
"c": { "dtype": "float32", "shape": [3], "data": { "kind": "values", "values": [2.0, 6.0, 6.0] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [3], "tolerance": 0 } }
},
{
"name": "ort_dim_zero_equal_rank",
"provenance": {
"source": "onnxruntime/test/providers/cpu/math/element_wise_ops_test.cc",
"test": "MathOpTest.DimWithZeroHandling",
"notes": "Projected from ORT's binary elementwise zero-dimension Add coverage to generic ONNX multidirectional broadcasting."
},
"inputs": {
"a": { "dtype": "float32", "shape": [3, 1], "data": { "kind": "values", "values": [1.0, 2.0, 3.0] } },
"b": { "dtype": "float32", "shape": [3, 0], "data": { "kind": "values", "values": [] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [3, 0], "tolerance": 0 } }
},
{
"name": "ort_dim_zero_scalar_broadcast",
"provenance": {
"source": "onnxruntime/test/providers/cpu/math/element_wise_ops_test.cc",
"test": "MathOpTest.DimWithZeroHandling",
"notes": "Projected from ORT's binary elementwise zero-dimension Add coverage to generic ONNX multidirectional broadcasting."
},
"inputs": {
"a": { "dtype": "float32", "shape": [], "data": { "kind": "values", "values": [1.0] } },
"b": { "dtype": "float32", "shape": [0], "data": { "kind": "values", "values": [] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [0], "tolerance": 0 } }
},
{
"name": "single_input_empty_shape",
"inputs": { "a": { "dtype": "float32", "shape": [0], "data": { "kind": "values", "values": [] } } },
"outputs": { "y": { "dtype": "float32", "shape": [0], "tolerance": 0 } }
},
{
"name": "f16_broadcast_differing_shapes",
"inputs": {
"a": { "dtype": "float16", "shape": [1, 4], "data": { "kind": "values", "values": [1.0, 2.0, 4.0, 8.0] } },
"b": {
"dtype": "float16",
"shape": [4, 4],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.41 }
}
},
"outputs": { "y": { "dtype": "float16", "shape": [4, 4], "tolerance": 0.001 } }
},
{
"name": "rank7_broadcast_two_input",
"inputs": {
"a": {
"dtype": "float32",
"shape": [1, 2, 1, 2, 1, 2, 3],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.23 }
},
"b": {
"dtype": "float32",
"shape": [2, 1, 2, 1, 2, 1, 3],
"data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.19 }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [2, 2, 2, 2, 2, 2, 3], "tolerance": 0.000001 } }
},
{
"name": "three_input_empty_dim_broadcast",
"inputs": {
"a": { "dtype": "float32", "shape": [2, 1], "data": { "kind": "values", "values": [1.0, 2.0] } },
"b": { "dtype": "float32", "shape": [2, 0], "data": { "kind": "values", "values": [] } },
"c": { "dtype": "float32", "shape": [1, 0], "data": { "kind": "values", "values": [] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [2, 0], "tolerance": 0 } }
},
{
"name": "four_input_mixed_broadcast_vec4",
"provenance": {
"notes": "Route lock for mixed four-input vec4 broadcasting: A and C retain the eight-wide innermost dimension, while B broadcasts channel scalars and D broadcasts one scalar across every output lane."
},
"inputs": {
"a": {
"dtype": "float32",
"shape": [2, 3, 2, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.23, "scale": 0.25 }
},
"b": { "dtype": "float32", "shape": [1, 3, 1, 1], "data": { "kind": "values", "values": [1.0, 2.0, 4.0] } },
"c": {
"dtype": "float32",
"shape": [2, 1, 2, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.29, "scale": 0.125 }
},
"d": { "dtype": "float32", "shape": [1], "data": { "kind": "values", "values": [0.5] } }
},
"outputs": { "y": { "dtype": "float32", "shape": [2, 3, 2, 8], "tolerance": 0.000001, "relTolerance": 0.000001 } }
},
{
"name": "three_input_mixed_broadcast_vec4_candidate",
"provenance": {
"notes": "Three-input mixed-broadcast lock: A is dense, B varies over channel and the penultimate axis but broadcasts its innermost scalar, and C retains vector lanes while broadcasting both middle axes."
},
"inputs": {
"a": {
"dtype": "float32",
"shape": [2, 3, 2, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.23, "scale": 0.25 }
},
"b": {
"dtype": "float32",
"shape": [1, 3, 2, 1],
"data": { "kind": "values", "values": [1.0, 2.0, 4.0, 8.0, 16.0, 32.0] }
},
"c": {
"dtype": "float32",
"shape": [2, 1, 1, 8],
"data": { "kind": "fillFloat32", "sinStep": 0.17, "cosStep": 0.29, "scale": 0.125 }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [2, 3, 2, 8], "tolerance": 0.000001, "relTolerance": 0.000001 } }
},
{
"name": "rank8_broadcast_two_input",
"inputs": {
"a": {
"dtype": "float32",
"shape": [1, 2, 1, 2, 1, 2, 2, 3],
"data": { "kind": "fillFloat32", "sinStep": 0.11, "cosStep": 0.23 }
},
"b": {
"dtype": "float32",
"shape": [2, 1, 2, 1, 2, 1, 2, 3],
"data": { "kind": "fillFloat32", "sinStep": 0.37, "cosStep": 0.19 }
}
},
"outputs": { "y": { "dtype": "float32", "shape": [2, 2, 2, 2, 2, 2, 2, 3], "tolerance": 0.000001 } }
}
]
}
|