Learn practical skills, build real-world projects, and advance your career
Updated 4 years ago
import torch
print(torch.__version__)
torch.cuda.is_available()
torch.version.cuda
1.5.0
'10.2'
torch.cuda.is_available()
print(torch.cuda.is_available())
True
t1 = torch.tensor(4.)
print(t1)
tensor(4.)
t2 = torch.tensor([[5.,6],[7,8.],[9,10]])
t2
tensor([[ 5., 6.],
[ 7., 8.],
[ 9., 10.]])