Answers for "pytorch version 1.4"

1

get pytorch version

import torch
print(torch.__version__)
Posted by: Guest on April-26-2020
0

pytorch 1.7

>>> 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])

>>> t = tensor([0.+1.j, 2.+3.j, 4.+5.j, 6.+7.j])
>>> torch.fft.fft(t)
tensor([12.+16.j, -8.+0.j, -4.-4.j,  0.-8.j])
Posted by: Guest on May-06-2021

Python Answers by Framework

Browse Popular Code Answers by Language