You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you use STFT through Spectrogram, with power=1, you can easily get a NaN. If your spectrogram square magnitude underflows to zero, you end up taking backprop of sqrt(0), which leads to a NaN.
To Reproduce
Steps to reproduce the behavior:
Use torchaudio.transforms.Spectrogram, set power=1, do a backward pass.
Expected behavior
There should be a configurable epsilon to clamp the input to sqrt, otherwise users have to use torch.stft directly or use other workarounds (such as power=2).