Learn practical skills, build real-world projects, and advance your career
4 years ago
import torch
tensor_1 = torch.tensor(4.) # create a 0-d tensor
tensor_1
tensor_1.dtype
t2 = torch.tensor([4.0, 3, 2, 10]) # pytorch convert int to float in case float exists