first try with backward CPU for contrastive loss ayer