Hello,
I have a code in old version Pytorch (1.4) which works fine. I want to use new version of Pytorch(1/9), however, I can not get the same result using torch.fft.rfft()
The code in Pytorch 1.4:
import torch
X = torch.Tensor([[1,2,3,0], [4,5,6,1],[7,8,9,2] , [10,11,12,3]])
fftfull = torch.rfft(X,2)
print("fftful {}".format(fftfull))
The result:
fftful tensor([[[ 84., 0.],
[ -8., -20.],
[ 20., 0.]],
[[-20., 20.],
[ 4., 4.],
[ -4., 4.]],
[[-20., 0.],
[ 0., 4.],
[ -4., 0.]],
[[-20., -20.],
[ -4., 4.],
[ -4., -4.]]]
The code in Pytorch 1.9:
import torch
import torch.fft
X = torch.Tensor([[1,2,3,0], [4,5,6,1],[7,8,9,2] , [10,11,12,3]])
fftfull = torch.fft.rfft(X, dim=-1)
print("fftful {}".format(fftfull))
The result:
fftful tensor([[ 6.+0.j, -2.-2.j, 2.+0.j],
[16.+0.j, -2.-4.j, 4.+0.j],
[26.+0.j, -2.-6.j, 6.+0.j],
[36.+0.j, -2.-8.j, 8.+0.j]])
Why the results are not the same. How can I get the same values in Pytorch 1.9?
Thank you for your help in advance.