Skip to content

Commit

Permalink
Revert "fix: cast to real numbers since pytorch 2.0+ supports complex"
Browse files Browse the repository at this point in the history
This reverts commit b506a0f. To be included in #104
  • Loading branch information
iyaja committed Feb 1, 2024
1 parent b506a0f commit 2638236
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions tests/core/test_grad.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,9 @@ def _test_audio_grad(attr: str, target=True, kwargs: dict = {}):
# If necessary, propagate spectrogram changes to waveform
if result.stft_data is not None:
result.istft()
if result.audio_data.dtype.is_complex:
result.real().sum().backward()
else:
result.audio_data.sum().backward()
result.audio_data.sum().backward()
else:
if result.dtype.is_complex:
result.real.sum().backward()
else:
result.sum().backward()
result.sum().backward()

assert signal.audio_data.grad is not None or not target
except RuntimeError:
Expand Down

0 comments on commit 2638236

Please sign in to comment.