def METHOD_NAME(self, preds, label):
    assert "seg" in preds, "The input of PixelContrastCrossEntropyLoss should include 'seg' output, but not found."
    assert "embed" in preds, "The input of PixelContrastCrossEntropyLoss should include 'embed' output, but not found."
    seg = preds['seg']
    embedding = preds['embed']
    predict = paddle.argmax(seg, axis=1)
    loss = self.contrast_criterion(embedding, label, predict)
    return loss