fixing test failure due to fft functions in torch changing namespace
@@ -30,7 +30,11 @@ def compute_amplitude_gradients_for_X(model, X):
(torch.cos(phases_th), torch.sin(phases_th)), dim=-1)
fft_coefs = fft_coefs.squeeze(3)
- iffted = torch.irfft(
+ try:
+ iffted = torch.fft.irfft(
+ fft_coefs, signal_ndim=1, signal_sizes=(X.shape[2],))
+ except AttributeError:
+ iffted = torch.irfft( # Deprecated since 1.7
fft_coefs, signal_ndim=1, signal_sizes=(X.shape[2],))
outs = model(iffted)
