williamFalcon / pytorch-complex-tensor

Unofficial complex tensor and scalar support for Pytorch
MIT License
78 stars 8 forks source link

Get imaginary and real part as different tensors #6

Closed eakirtas closed 3 years ago

eakirtas commented 4 years ago

Hello,

I am working on task which requires Fast Fourier Transformation(FFT). Pytorch supports FFT with method torch.fft(input, signal_ndim, normalized). According to the doc, input must be a tensor with last dimension of size 2, representing the real and imaginary components of complex numbers,....

I am wondering if a can get imaginary and real part as different tensors.

For example numpy supports the following expressions:

x_imag = np.imag(x)
x_real = np.real(x)

Thank you in advance.