dim=0,降维(纵向压缩). b = torch.sum(a,dim=0) print(b) b.shape. output: tensor([ 5, 7, 9]) torch.Size([3]). 5 = 1 + 4
確定! 回上一頁