Commit 18280e0
authored
Fix upsample half pixel mode for size one (#2918)
Fixes the ATen upsampling lowering for `align_corners=False` to use ONNX
`half_pixel` mode instead of `pytorch_half_pixel`.
`pytorch_half_pixel` special-cases output size 1 differently from
PyTorch eager behavior, causing mismatches for cases like
`upsample_bilinear2d(..., output_size=(1, 1), align_corners=False)`.
This change makes the exported `Resize` node match PyTorch results for
that edge case.
Adds regression samples for 2D upsampling with output size 1, covering
both `upsample_bilinear2d` and `upsample_bilinear2d.vec`.1 parent 33d1445 commit 18280e0
2 files changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2320 | 2320 | | |
2321 | 2321 | | |
2322 | 2322 | | |
2323 | | - | |
| 2323 | + | |
2324 | 2324 | | |
2325 | 2325 | | |
2326 | 2326 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1887 | 1887 | | |
1888 | 1888 | | |
1889 | 1889 | | |
| 1890 | + | |
| 1891 | + | |
| 1892 | + | |
1890 | 1893 | | |
1891 | 1894 | | |
1892 | 1895 | | |
| |||
1934 | 1937 | | |
1935 | 1938 | | |
1936 | 1939 | | |
| 1940 | + | |
| 1941 | + | |
| 1942 | + | |
1937 | 1943 | | |
1938 | 1944 | | |
1939 | 1945 | | |
| |||
0 commit comments