Pytorch Weighted Average