Skip to content

fix: Bugfix for align_corners=False- FX interpolate #1561

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 20, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion py/torch_tensorrt/fx/converters/acc_ops_converters.py
Original file line number Diff line number Diff line change
Expand Up @@ -3630,7 +3630,7 @@ def acc_ops_interpolate(
else:
layer.resize_mode = trt.ResizeMode.NEAREST

if align_corners != None:
if (align_corners is not None) and align_corners:
layer.coordinate_transformation = (
trt.ResizeCoordinateTransformation.ALIGN_CORNERS
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ class TestInterpolateConverter(AccTestCase):
("bilinear"),
(None),
), # linear for 4D only
(
"4d_dim_scale_bilinear_align_corners_bool",
(2, 3, 4, 5),
(None),
(2),
("bilinear"),
(False),
), # linear for 4D only
(
"4d_dim_scale_align",
(2, 3, 4, 5),
Expand Down