mmuckley / torchkbnufft

A high-level, easy-to-deploy non-uniform Fast Fourier Transform in PyTorch.
https://torchkbnufft.readthedocs.io/
MIT License
207 stars 44 forks source link

Data dtype error when calling inerpolation function using `torch.complex64` #99

Closed PepperXZC closed 1 month ago

PepperXZC commented 1 month ago

I'm very glad to see that torch.complex64 is default setting in this efficient toolbox, and issue #89 rarely happens when normally calling the functions. But when I built a dataset under torch.complex64, running by cuda, similar error like #89 raised.

I noticed that some of the functions in table_interp_adjoint under _nufft.interp automatically changes the data dtype. To overcome this little bug, I recommend adding .to(dtype) in line 685 to make sure the output of imag_exp() does not interfere original datatype.

image

If this bug has already been fixed in previous commits, i'm sorry for bothering.