Pytorch Loss Function Weight Conversion