Pytorch Weighted Sum