- torch.linspace(start, end, steps=100, out=None) → Tensor: 返回一个1维张量,包含在区间start和end上均匀间隔的step个点。
- C = torch.cat( (A,B),0 ) 按维数0拼接(竖着拼/上下拼)
C = torch.cat( (A,B),1 ) 按维数1拼接(横着拼/左右拼)(-1 与 1相同) - torch.unsqueeze() 和 torch.squeeze()
x=torch.Tensor([1, 2, 3, 4]) #(tensor([1., 2., 3., 4.]))
torch.unsqueeze(x,1) #