diff --git a/src/torchaudio/functional/functional.py b/src/torchaudio/functional/functional.py index af34e707e5..a6bf6cafb3 100644 --- a/src/torchaudio/functional/functional.py +++ b/src/torchaudio/functional/functional.py @@ -230,14 +230,14 @@ def inverse_spectrogram( def _get_spec_norms(normalized: Union[str, bool]): frame_length_norm, window_norm = False, False - if torch.jit.isinstance(normalized, str): + if isinstance(normalized, str): if normalized not in ["frame_length", "window"]: raise ValueError("Invalid normalized parameter: {}".format(normalized)) if normalized == "frame_length": frame_length_norm = True elif normalized == "window": window_norm = True - elif torch.jit.isinstance(normalized, bool): + elif isinstance(normalized, bool): if normalized: window_norm = True else: diff --git a/test/torchaudio_unittest/transforms/transforms_test.py b/test/torchaudio_unittest/transforms/transforms_test.py index 0a6e81b440..b6fba9dd5b 100644 --- a/test/torchaudio_unittest/transforms/transforms_test.py +++ b/test/torchaudio_unittest/transforms/transforms_test.py @@ -281,6 +281,10 @@ def test_compute_deltas_twochannel(self): assert computed.shape == expected.shape, (computed.shape, expected.shape) self.assertEqual(computed, expected, atol=1e-6, rtol=1e-8) + def test_mfcc_compile_fullgraph(self): + # test that MFCC does not use language features not supported by torch.compile + torch.compile(MFCC(), fullgraph=True) + class SmokeTest(common_utils.TorchaudioTestCase): def test_spectrogram(self):