Hello 성현!



 sh0416:

…
Can we get the gradient of fft function with respect to input?
I think it is possible, but I want to make sure things.


It looks like the gradient is supported.  Try:
>>> import torch
>>> t = torch.randn (1, 8, 2)
>>> t.requires_grad = True
>>> torch.fft (t, 1)
tensor([[[-2.7232,  3.8741],
         [-2.9743, -2.1404],
         [ 1.1234,  4.4275],
         [ 1.7661,  1.6113],
         [-3.6401,  3.6872],
         [ 0.0582, -3.4854],
         [-1.6034,  0.3976],
         [ 0.3413,  0.8839]]], grad_fn=<FftWithSizeBackward>)

(I haven’t actually tried this, but I would imagine that
FftWithSizeBackward works correctly.)
Best.
K. Frank