Pytorch Compute Class Weight