Unverified Commit fc2537e7 authored by moto's avatar moto Committed by GitHub
Browse files

Make batch test backend-agnostic (#561)

parent 84c494dd
......@@ -6,7 +6,6 @@ import torchaudio
import torchaudio.functional as F
import common_utils
from common_utils import AudioBackendScope, BACKENDS
def _test_batch_consistency(functional, tensor, *args, batch_size=1, atol=1e-8, rtol=1e-5, **kwargs):
......@@ -182,10 +181,8 @@ class TestTransforms(unittest.TestCase):
computed = torchaudio.transforms.MelSpectrogram()(waveform.repeat(3, 1, 1))
torch.testing.assert_allclose(computed, expected)
@unittest.skipIf("sox" not in BACKENDS, "sox not available")
@AudioBackendScope("sox")
def test_batch_mfcc(self):
test_filepath = common_utils.get_asset_path('steam-train-whistle-daniel_simon.mp3')
test_filepath = common_utils.get_asset_path('steam-train-whistle-daniel_simon.wav')
waveform, _ = torchaudio.load(test_filepath)
# Single then transform then batch
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment