print('torch.tensor=',x)
x=torch.as_tensor(l) #列表转张量
print('torch.as_tensor=',x)
x=torch.as_tensor...是点的个数,包括端点, (等距离)
# torch.logspace(start, end, steps) #
x=torch.arange(1,10,2) #step为间距
print('torch.arange...print('torch.randn=',x)
x=torch.randint(3, 8, [5,3]) #low和high之间的随机数
print('torch.randint=',x)
# 随机排列生成...# torch.randperm(n) # 生成一个0到n-1的n-1个整数的随机排列
x=torch.randperm(10)
print('torch.randperm=',x)
# 计算函数...# torch.abs(input,out) # tensor 输出张量元素绝对值
# torch.acos(input,out) # 求反余弦
# torch.add(input,value,out