Contrastive Loss Function Pytorch Example