I want to use a repository that was built with PyTorch 1.6, with newer versions of PyTorch (preferably the latest). This repository uses
torch.rfft()
which was deprecated to torch.fft.rfft
in later PyTorch versions.
The snippet of code that I want to replace is
v = torch.cat([x[:, ::2], x[:, 1::2].flip([1])], dim=1)
Vc = torch.fft.rfft(v, 1, onesided=False)
where x
is a two dimensional tensor. In the comments around that piece of code, it is written that
Discrete Cosine Transform, Type II (a.k.a. the DCT)
I switched torch.rfft()
with torch.fft.rfft
but then I get the error
TypeError: fft_rfft() got an unexpected keyword argument 'onesided'
Does anyone know the exact equivalent of this code to the current PyTorch version?
Additionally, I have also found this line of code
v = torch.irfft(V, 1, onesided=False)
which also needs an update.
Thank you in advance.