Skip to content

Commit

Permalink
Add autograd test for T.Fade (#1424)
Browse files Browse the repository at this point in the history
  • Loading branch information
krishnakalyan3 committed Apr 5, 2021
1 parent 90311ed commit 7d034ea
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions test/torchaudio_unittest/transforms/autograd_test_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,3 +77,9 @@ def test_resample(self, orig_freq, new_freq):
transform = T.Resample(orig_freq=orig_freq, new_freq=new_freq)
waveform = get_whitenoise(sample_rate=8000, duration=0.05, n_channels=2)
self.assert_grad(transform, [waveform])

@parameterized.expand([("linear", ), ("exponential", ), ("logarithmic", ), ("quarter_sine", ), ("half_sine", )])
def test_fade(self, fade_shape):
transform = T.Fade(fade_shape=fade_shape)
waveform = get_whitenoise(sample_rate=8000, duration=0.05, n_channels=2)
self.assert_grad(transform, [waveform], nondet_tol=1e-10)

0 comments on commit 7d034ea

Please sign in to comment.