Skip to content

Commit

Permalink
parameterize power
Browse files Browse the repository at this point in the history
  • Loading branch information
mthrok committed Nov 6, 2020
1 parent 627e8a5 commit a305fb8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/torchaudio_unittest/functional/functional_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ def test_clamp(self):


class Spectrogram(common_utils.TestBaseMixin):
def test_grad_at_zero(self):
@parameterized.expand([
(0, ),
(1, ),
(2, ),
(3, ),
])
def test_grad_at_zero(self, power):
"""The gradient of power spectrogram should not be non but zero near x=0
https://github.com/pytorch/audio/issues/993
Expand All @@ -46,7 +52,7 @@ def test_grad_at_zero(self):
n_fft=2048,
hop_length=None,
win_length=None,
power=1,
power=power,
normalized=False,
)
spec.sum().backward()
Expand Down

0 comments on commit a305fb8

Please sign in to comment.