Skip to content

Commit

Permalink
Autograd tests for Transforms MFCC (#1415)
Browse files Browse the repository at this point in the history
Co-authored-by: krishnakalyan3 <[email protected]>
  • Loading branch information
krishnakalyan3 and krishnakalyan3 authored Apr 2, 2021
1 parent 52decd2 commit 404fa12
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions test/torchaudio_unittest/transforms/autograd_test_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,10 @@ def test_melspectrogram(self):
transform = T.MelSpectrogram(sample_rate=sample_rate)
waveform = get_whitenoise(sample_rate=sample_rate, duration=0.05, n_channels=2)
self.assert_grad(transform, [waveform], nondet_tol=1e-10)

@parameterized.expand([(False, ), (True, )])
def test_mfcc(self, log_mels):
sample_rate = 8000
transform = T.MFCC(sample_rate=sample_rate, log_mels=log_mels)
waveform = get_whitenoise(sample_rate=sample_rate, duration=0.05, n_channels=2)
self.assert_grad(transform, [waveform])

0 comments on commit 404fa12

Please sign in to comment.