Unverified Commit 66f4cdf9 authored by lbjcom's avatar lbjcom Committed by GitHub
Browse files

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



* Update functional.py

rollback torch.norm() in spectrogram() to v0.4.0.

* Update functional.py

comment out `spec_f = complex_norm(spec_f, power=power)`.

* fixed complex_norm() instead of spectrogram() for torch.norm() issue.

* lint
Co-authored-by: default avatarbongjin.lee <bongjin.lee@navercorp.com>
Co-authored-by: default avatarVincent QB <vincentqb@users.noreply.github.com>
parent 793eeab8
......@@ -485,9 +485,10 @@ def complex_norm(
Returns:
Tensor: Power of the normed input tensor. Shape of `(..., )`
"""
if power == 1.0:
return torch.norm(complex_tensor, 2, -1)
return torch.norm(complex_tensor, 2, -1).pow(power)
# Replace by torch.norm once issue is fixed
# https://github.com/pytorch/pytorch/issues/34279
return complex_tensor.pow(2.).sum(-1).pow(0.5 * power)
def angle(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment