Open saugatkandel opened 3 years ago
Yes, all usage of torch.fft
should be through the wrapper.
Also @saugatkandel in case you are interested in expanding Adorym, I've invited you as a collaborator. With that, when you find it necessary, you'll have control on accepting pull requests etc. for this repository.
Pytorch even supports complex numbers natively now, so it looks like a lot of operations could be simplified now. I will try this out as well.
I think I've done the switch to complex numbers... at least for ptychography. I'm in the testing phase now. The master branch on my fork has the simple FFT conversion, while my dev is (I think) almost fully converted to complex numbers, and works. This generally gives me a pretty decent speed boost as well.
Thanks @tcpekin. If you would like to, please feel free to submit a pull request.
Starting in Pytorch 1.8,
torch.fft
is a module and not a function. So the FFT calls are now similar to that for numpy.See: https://pytorch.org/blog/the-torch.fft-module-accelerated-fast-fourier-transforms-with-autograd-in-pyTorch/
I think the "adorym/adorym/wrappers.py" is the only file affected. Anywhere else?