Commit ed82c3b
authored
Squeeze Reshape Identity optimization (#2083)
A recent fix to the translation of pytorch symints introduces a
Squeeze=>Reshape pattern that can be optimized away. This PR introduces
a rewrite-rule to do this optimization.
TODO (in a separate PR): for now, this optimization needs to be
explicitly invoked. This should be done by default. (But there are
several other such optimizations that need to be collected and included
in the default-rule list.)1 parent 89dd454 commit ed82c3b
3 files changed
Lines changed: 63 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
15 | 35 | | |
16 | 36 | | |
17 | 37 | | |
| |||
259 | 279 | | |
260 | 280 | | |
261 | 281 | | |
| 282 | + | |
262 | 283 | | |
263 | 284 | | |
264 | 285 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
452 | 452 | | |
453 | 453 | | |
454 | 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 | + | |
455 | 492 | | |
456 | 493 | | |
457 | 494 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1627 | 1627 | | |
1628 | 1628 | | |
1629 | 1629 | | |
| 1630 | + | |
| 1631 | + | |
| 1632 | + | |
1630 | 1633 | | |
1631 | 1634 | | |
1632 | 1635 | | |
| |||
1759 | 1762 | | |
1760 | 1763 | | |
1761 | 1764 | | |
| 1765 | + | |
| 1766 | + | |
1762 | 1767 | | |
1763 | 1768 | | |
1764 | 1769 | | |
| |||
0 commit comments