import torch import numpy as np print(torch.tensor([1,2,3])) print(torch.tensor(np.arange(15).reshape(3,5))) print(torch.empty([3,4])) print(torch.ones([3,4])) print(torch.zeros([3,4])) #0-1之间的随机数 print(torch.rand([2,3])) #3-10之间的随机整数 print(torch.ran…