print('torch.tensor=',x)
x=torch.tensor([[1,2,3,4],[5,6,7,8]]) #列表转张量
print('torch.tensor=',x)
x=torch.as_tensor...(l) #列表转张量
print('torch.as_tensor=',x)
x=torch.as_tensor(nparray) #numpy数组转张量
print('torch.as_tensor...=',x)
x=torch.from_numpy(nparray) #numpy数组转张量
print('torch.as_tensor=',x)
x=torch.empty(5,3) #创建空张量,...=None) -> (Tensor, LongTensor) 众数
# torch.norm(input, p, dim, out=None) # Tensor 指定维度p范数
# torch.prod...(input, dim, max=None, max_indices=None) -> (Tensor, LongTensor) 返回指定维度最大值和索引
# torch.log2(),torch.log10