Skip to content

Commit ec91729

Browse files
committed
loosen check tolerance with FFmpeg 4
1 parent 9aaa1e8 commit ec91729

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/utils.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@
1111

1212
import torch
1313

14+
from torchcodec.decoders._core import get_ffmpeg_library_versions
15+
1416

1517
# Decorator for skipping CUDA tests when CUDA isn't available. The tests are
1618
# effectively marked to be skipped in pytest_collection_modifyitems() of
@@ -31,8 +33,11 @@ def cpu_and_cuda():
3133
def assert_frames_equal(*args, **kwargs):
3234
if sys.platform == "linux":
3335
if args[0].device.type == "cuda":
36+
ffmpeg_major_version = int(
37+
get_ffmpeg_library_versions()["ffmpeg_version"].split(".")[0]
38+
)
3439
atol = 2
35-
if in_fbcode():
40+
if in_fbcode() or ffmpeg_major_version == 4:
3641
assert_tensor_close_on_at_least(
3742
args[0], args[1], percentage=95, atol=atol
3843
)

0 commit comments

Comments
 (0)