Commit d7184cb
Fix quantized max_pool2d output observer for tuple-returning ops (pytorch#19259)
Summary:
prepare_pt2e skips the output observer for max_pool2d_with_indices because its output is a tuple, not a single tensor. This caused the quantized_max_pool2d fusion to silently fail.
Fix: annotate getitem[0] (single tensor) instead of the tuple-returning op. Also bail out if indices are consumed or the graph structure is unexpected.
Reviewed By: mcremon-meta
Differential Revision: D1034361721 parent a7e44bf commit d7184cb
1 file changed
Lines changed: 12 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
493 | 494 | | |
494 | 495 | | |
495 | 496 | | |
496 | | - | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
497 | 507 | | |
498 | 508 | | |
499 | 509 | | |
| |||
505 | 515 | | |
506 | 516 | | |
507 | 517 | | |
508 | | - | |
| 518 | + | |
509 | 519 | | |
510 | 520 | | |
511 | 521 | | |
| |||
0 commit comments