Pytorch Weighted Mean Formula For Thesis