pytorch-tensor处理速查表(cat stack squeeze unsqueeze permute等)
1torch.cattorch.cat((A,B),dim)将两个tensor在指定维度进行拼接A=torch.zeros(2,3)B=torch.zeros(2,3)C=torch.cat((A,B),0)##shape[4,3]D=torch.cat((A,B),1)##shape[2,6]2torch.stacktorch.stack((A,B),dim)增加新的维度进行堆叠A=torch.