Commit 521cf5e
committed
Fix aten_unbind for torch >= 2.7 dynamo export
Replace Split op with explicit Slice operations to fix TypeError when
unbind is called during ONNX export with dynamo=True. The Split op
with num_outputs parameter returns a non-iterable SymbolicTensor
instead of a sequence, causing the list comprehension to fail.
The fix uses individual Slice + Squeeze operations for each output,
which properly handles symbolic tensors during graph construction.
Fixes pytorch/pytorch#1689691 parent 9dbf685 commit 521cf5e
File tree
2 files changed
+90
-9
lines changed- onnxscript/function_libs/torch_lib/ops
- tests/function_libs/torch_lib
2 files changed
+90
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9200 | 9200 | | |
9201 | 9201 | | |
9202 | 9202 | | |
9203 | | - | |
9204 | | - | |
9205 | | - | |
| 9203 | + | |
9206 | 9204 | | |
9207 | | - | |
9208 | | - | |
9209 | | - | |
9210 | | - | |
9211 | | - | |
9212 | | - | |
| 9205 | + | |
| 9206 | + | |
| 9207 | + | |
| 9208 | + | |
| 9209 | + | |
| 9210 | + | |
| 9211 | + | |
| 9212 | + | |
| 9213 | + | |
| 9214 | + | |
| 9215 | + | |
| 9216 | + | |
| 9217 | + | |
9213 | 9218 | | |
9214 | 9219 | | |
9215 | 9220 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
520 | 520 | | |
521 | 521 | | |
522 | 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 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
523 | 599 | | |
524 | 600 | | |
525 | 601 | | |
0 commit comments