Hello,
I’m working with pytorch 1.7 within docker (based on the image: nvcr.io/nvidia/pytorch 20.10-py3 in case it matter), I’m using Ubuntu LTS 18.04 with CUDA 11.1.
>>> torch.__version__
'1.7.0a0+7036e91'
I can use the fft functions of pytorch but I want to use the fft module as advised in the documentation.
The problem is I can’t reproduce the examples given in the doc:
Using torch.fft.fft
according to the doc:
>>> import torch.fft
>>> t = torch.arange(4)
>>> t
tensor([0, 1, 2, 3])
>>> torch.fft.fft(t)
tensor([ 6.+0.j, -2.+2.j, -2.+0.j, -2.-2.j])
What I get when I try to reproduce it:
>>> import torch.fft
>>> t = torch.arange(4)
>>> t
tensor([0, 1, 2, 3])
>>> torch.fft.fft(t)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
RuntimeError: Expected a complex tensor.
Using torch.fft.rfft
according to the doc:
>>> import torch.fft
>>> t = torch.arange(4)
>>> t
tensor([0, 1, 2, 3])
>>> torch.fft.rfft(t)
tensor([ 6.+0.j, -2.+2.j, -2.+0.j])
What I get when I try to reproduce it:
>>> import torch.fft
>>> t = torch.arange(4)
>>> t
tensor([0, 1, 2, 3])
>>> torch.fft.rfft(t)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'torch.fft' has no attribute 'rfft'
So I’ve got 2 questions ::
1)Am I doing something wrong, or is there a problem with my pytorch installation (I had no problem so far)? How can I reproduce successfully the doc examples?
2)Is it possible to use half datatype with torch.fft module? (it’s discouraged in the torch.fft functions)
Thanks in advance for any help
Thomas