@@ -5204,11 +5204,8 @@ def test_image_functional_correctness(self, coefficients, interpolation, fill, m
52045204 image , startpoints = None , endpoints = None , coefficients = coefficients , interpolation = interpolation , fill = fill
52055205 )
52065206 if make_input is make_image_cvcuda :
5207- actual = F .cvcuda_to_tensor (actual ).to (device = "cpu" )
5208- actual = actual .squeeze (0 )
5209- # drop the batch dimension
5210- image = F .cvcuda_to_tensor (image ).to (device = "cpu" )
5211- image = image .squeeze (0 )
5207+ actual = cvcuda_to_pil_compatible_tensor (actual )
5208+ image = cvcuda_to_pil_compatible_tensor (image )
52125209
52135210 expected = F .to_image (
52145211 F .perspective (
@@ -5234,7 +5231,7 @@ def test_image_functional_correctness(self, coefficients, interpolation, fill, m
52345231 # visually the results are the same on real images,
52355232 # realistically, the diff is not visible to the human eye
52365233 tolerance = 255 if interpolation is transforms .InterpolationMode .NEAREST else 125
5237- torch . testing . assert_close (actual , expected , rtol = 0 , atol = tolerance )
5234+ assert_close (actual , expected , rtol = 0 , atol = tolerance )
52385235
52395236 def _reference_perspective_bounding_boxes (self , bounding_boxes , * , startpoints , endpoints ):
52405237 format = bounding_boxes .format
0 commit comments