Skip to content

Commit

Permalink
fix: Bugfix for align_corners=False- FX interpolate (#1561)
Browse files Browse the repository at this point in the history
  • Loading branch information
gs-olive authored Dec 20, 2022
1 parent f43be5b commit 0a075f0
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
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

0 comments on commit 0a075f0

Please sign in to comment.