Add forward AD for rsub, polar, and FFT
This PR adds forward AD support for:
- torch.rsub
- tensor.\_\_rsub\_\_
- torch.polar
- torch.fft.fft
- torch.fft.fft2
- torch.fft.fftn
- torch.fft.hfft
- torch.fft.hfft2
- torch.fft.hfftn
- torch.fft.rfft
- torch.fft.rfft2
- torch.fft.rfftn
- torch.fft.ifft
- torch.fft.ifft2
- torch.fft.ifftn
- torch.fft.ihfft
- torch.fft.ihfft2
- torch.fft.ihfftn
- torch.fft.irfft
- torch.fft.irfft2
- torch.fft.irfftn
- torch.stft
- torch.istft
Ref. https://github.com/pytorch/pytorch/issues/71117
Pull Request resolved: https://github.com/pytorch/pytorch/pull/75326
Approved by: https://github.com/soulitzer