We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8d1b7fa commit 81a980fCopy full SHA for 81a980f
torchaudio/functional/functional.py
@@ -113,10 +113,8 @@ def spectrogram(
113
if power is not None:
114
if power == 1.0:
115
return spec_f.abs()
116
- if power == 2.0:
117
- if spec_f.is_cuda:
118
- return torch.view_as_real(spec_f).pow(power).sum(-1)
119
- return spec_f.pow(power)
+ if power == 2.0 and spec_f.is_cuda:
+ return torch.view_as_real(spec_f).pow(power).sum(-1)
120
return spec_f.abs().pow(power)
121
if not return_complex:
122
return torch.view_as_real(spec_f)
0 commit comments