Skip to content

Commit 4200be0

Browse files
committed
fix cuda + ffmpeg6 tolerances
1 parent 3be131f commit 4200be0

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

test/test_ops.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1214,12 +1214,9 @@ def test_video_encoder_round_trip(self, tmp_path, format, method, device):
12141214

12151215
# If FFmpeg selects a codec or pixel format that does lossy encoding, assert 99% of pixels
12161216
# are within a higher tolerance.
1217-
if ffmpeg_version == 6:
1217+
if ffmpeg_version == 6 or device == "cuda":
12181218
atol = 15
1219-
assert_close = partial(assert_tensor_close_on_at_least, percentage=99)
1220-
elif device == "cuda":
1221-
atol = 15
1222-
percentage = 98
1219+
percentage = 98 if device == "cuda" else 99
12231220
assert_close = partial(
12241221
assert_tensor_close_on_at_least, percentage=percentage
12251222
)

0 commit comments

Comments
 (0)