Here is something which you can look forward to, as you have asked this provides example also. However when I went over the examples I found few typos but that you can easily see. I am suggesting this because it will give you atleast a direction to move forward if not solve your problem completely.

  
      
      GitHub
  
  
    

locuslab/pytorch_fft 133

pytorch_fft - PyTorch wrapper for FFTs