Commit 563e409c authored by moto's avatar moto Committed by Facebook GitHub Bot
Browse files

Specify backend directly in test (#3262)

Summary:
Preparation to land https://github.com/pytorch/audio/pull/3241

This commit applies patch to make the sox_io TorchScript test pass when dispatcher is enabled.

Pull Request resolved: https://github.com/pytorch/audio/pull/3262

Reviewed By: hwangjeff

Differential Revision: D44897513

Pulled By: mthrok

fbshipit-source-id: 9b65f705cd02324328a2bc1c414aa4b7ca0fed32
parent 4b0254ba
......@@ -20,11 +20,11 @@ from .common import get_enc_params, name_func
def py_info_func(filepath: str) -> torchaudio.backend.sox_io_backend.AudioMetaData:
return torchaudio.info(filepath)
return torchaudio.backend.sox_io_backend.info(filepath)
def py_load_func(filepath: str, normalize: bool, channels_first: bool):
return torchaudio.load(filepath, normalize=normalize, channels_first=channels_first)
return torchaudio.backend.sox_io_backend.load(filepath, normalize=normalize, channels_first=channels_first)
def py_save_func(
......@@ -36,7 +36,9 @@ def py_save_func(
encoding: Optional[str] = None,
bits_per_sample: Optional[int] = None,
):
torchaudio.save(filepath, tensor, sample_rate, channels_first, compression, None, encoding, bits_per_sample)
torchaudio.backend.sox_io_backend.save(
filepath, tensor, sample_rate, channels_first, compression, None, encoding, bits_per_sample
)
@skipIfNoExec("sox")
......@@ -44,8 +46,6 @@ def py_save_func(
class SoxIO(TempDirMixin, TorchaudioTestCase):
"""TorchScript-ability Test suite for `sox_io_backend`"""
backend = "sox_io"
@parameterized.expand(
list(
itertools.product(
......
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