Pytorch Weighted Mean Formula