Skip to content

Commit ed91372

Browse files
committed
Hmm
1 parent 884d86a commit ed91372

2 files changed

Lines changed: 11 additions & 7 deletions

File tree

test/test_encoders.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import io
22
import json
33
import os
4+
import platform
45
import re
56
import subprocess
67
import sys
@@ -332,12 +333,15 @@ def test_against_cli(
332333
assert_close = partial(assert_tensor_close_on_at_least, percentage=99)
333334
elif format == "wav":
334335
rtol, atol = 0, 1e-4
335-
elif format == "mp3" and asset is SINE_MONO_S32 and num_channels == 2:
336-
# Not sure why, this one needs slightly higher tol. With default
337-
# tolerances, the check fails on ~1% of the samples, so that's
338-
# probably fine. It might be that the FFmpeg CLI doesn't rely on
339-
# libswresample for converting channels?
340-
rtol, atol = 0, 1e-3
336+
elif format == "mp3" and asset is SINE_MONO_S32:
337+
if platform.machine.lower() == "aarch64":
338+
rtol, atol = 0, 1e-2
339+
elif num_channels == 2:
340+
# Not sure why, this one needs slightly higher tol. With default
341+
# tolerances, the check fails on ~1% of the samples, so that's
342+
# probably fine. It might be that the FFmpeg CLI doesn't rely on
343+
# libswresample for converting channels?
344+
rtol, atol = 0, 1e-3
341345
else:
342346
rtol, atol = None, None
343347

test/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ def psnr(a, b, max_val=255) -> float:
139139
# not guarantee bit-for-bit equality across systems and architectures, so we
140140
# also cannot. We currently use Linux on x86_64 as our reference system.
141141
def assert_frames_equal(*args, **kwargs):
142-
if sys.platform == "linux" and "x86" in platform.machine():
142+
if sys.platform == "linux" and "x86" in platform.machine().lower():
143143
if args[0].device.type == "cuda":
144144
atol = 3 if cuda_version_used_for_building_torch() >= (13, 0) else 2
145145
if get_ffmpeg_major_version() == 4:

0 commit comments

Comments
 (0)