Skip to content

Commit

Permalink
Add autograd test for T.ComputeDeltas (#1422)
Browse files Browse the repository at this point in the history
  • Loading branch information
yoyololicon committed Apr 5, 2021
1 parent f0ab42c commit e964f93
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions test/torchaudio_unittest/transforms/autograd_test_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,11 @@ def test_mfcc(self, log_mels):
waveform = get_whitenoise(sample_rate=sample_rate, duration=0.05, n_channels=2)
self.assert_grad(transform, [waveform])

def test_compute_deltas(self):
transform = T.ComputeDeltas()
spec = torch.rand(10, 20)
self.assert_grad(transform, [spec])

@parameterized.expand([(8000, 8000), (8000, 4000), (4000, 8000)])
def test_resample(self, orig_freq, new_freq):
transform = T.Resample(orig_freq=orig_freq, new_freq=new_freq)
Expand Down

0 comments on commit e964f93

Please sign in to comment.