均值

t = torch.rand(3,48)
t.mean(dim=0,keepdim=True).shape # torch.Size([1, 48])

t = torch.rand(3,100,100,100)
t.mean(dim=(0,2,3),keepdim=True).shape # torch.Size([1, 100, 1, 1])

你可能感兴趣的:(均值)