Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rollback torch.norm() in spectrogram() #747

Merged
merged 4 commits into from
Jun 26, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 3 additions & 0 deletions torchaudio/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,9 @@ def spectrogram(
spec_f /= window.pow(2.).sum().sqrt()
if power is not None:
spec_f = complex_norm(spec_f, power=power)
lbjcom marked this conversation as resolved.
Show resolved Hide resolved
# Replace by torch.norm once issue is fixed
# https://github.com/pytorch/pytorch/issues/34279
spec_f = spec_f.pow(2.).sum(-1).pow(0.5 * power)

return spec_f

Expand Down