question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`torch.*fft` is deprecated

See original GitHub issue

Getting the warnings

tests/scattering1d/test_torch_backend_1d.py::test_fft[cuda-TorchSkcudaBackend1D]
  /home/jenkins/workspace/kymatio_dev/kymatio/scattering1d/backend/torch_backend.py:12: UserWarning: The function torch.fft is deprecated and will be removed in PyTorch 1.8. Use the new torch.fft module functions, instead, by importing torch.fft and calling torch.fft.fft or torch.fft.fftn. (Triggered internally at  /pytorch/aten/src/ATen/native/SpectralOps.cpp:567.)
    _fft = lambda x: torch.fft(x, 1, normalized=False)


tests/scattering1d/test_torch_backend_1d.py::test_fft[cuda-TorchSkcudaBackend1D]
  /home/jenkins/workspace/kymatio_dev/kymatio/scattering1d/backend/torch_backend.py:13: UserWarning: The function torch.ifft is deprecated and will be removed in a future PyTorch release. Use the new torch.fft module functions, instead, by importing torch.fft and calling torch.fft.ifft or torch.fft.ifftn. (Triggered internally at  /pytorch/aten/src/ATen/native/SpectralOps.cpp:578.)
    _ifft = lambda x: torch.ifft(x, 1, normalized=False)


tests/scattering1d/test_torch_backend_1d.py::test_fft[cuda-TorchSkcudaBackend1D]
  /home/jenkins/workspace/kymatio_dev/kymatio/scattering1d/backend/torch_backend.py:14: UserWarning: The function torch.irfft is deprecated and will be removed in a future PyTorch release. Use the new torch.fft module functions, instead, by importing torch.fft and calling torch.fft.ifft or torch.fft.irfft. (Triggered internally at  /pytorch/aten/src/ATen/native/SpectralOps.cpp:602.)
    _irfft = lambda x: torch.irfft(x, 1, normalized=False, onesided=False)[..., None]

Should probably fix this soonish.

Issue Analytics

  • State:closed
  • Created a year ago
  • Reactions:1
  • Comments:7

github_iconTop GitHub Comments

1reaction
jandencommented, Jun 20, 2022

Hmm ok. So they deprecated in 1.7 but didn’t provide an upgrade path until 1.8. Not cool…

At any rate, these warnings will go away from our CI once #892 merges so I’ll close this.

0reactions
lostanlencommented, Jun 18, 2022

so … it’s not so trivial. In Torch 1.7, there is a torch.fft module but

>>> torch.fft.fft2
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: module 'torch.fft' has no attribute 'fft2'

(they did not only move functions from torch to torch.fft, they also changed the semantics)

If we really insist on removing this DeprecationWarning, i think that our simplest response is just catch it by means of a warning.simplefilter. Otherwise, i’d have to add at least three more conditional branches to Kymatio (for 1D/2D/3D) …

Read more comments on GitHub >

github_iconTop Results From Across the Web

The torch.fft module in PyTorch 1.7 - GitHub
This will work in PyTorch 1.6, throw a deprecation warning in PyTorch 1.7, and will not work in PyTorch 1.8 when the torch.Tensor.fft()...
Read more >
Using torch.fft module to update torch.fft() deprecated functions
I'm trying to update a repo since I was getting this error: AttributeError: module 'torch' has no attribute 'rfft'.
Read more >
torch.fft — PyTorch 1.13 documentation
torch.fft. Discrete Fourier transforms and related functions. ... Computes the one dimensional discrete Fourier transform of input .
Read more >
Fourier transform in latest pytorch - vision
The deprecation notice in PyTorch 1.7 (which I had to look up myself, so don't feel bad about not seeing it), your use...
Read more >
torch.fft.fft — PyTorch 1.13 documentation
Supports torch.half and torch.chalf on CUDA with GPU Architecture SM53 or greater. However it only supports powers of 2 signal length in every...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found