def binary_channel_to_unary(logits, eps=1e-9):
    """
    Converts binary channel logits to unary channel logits for lovasz hinge loss.
    """
    probas = F.softmax(logits, axis=1)
    probas = probas[:, 1, :, :]
    logits = paddle.log(probas + eps / (1 - probas + eps))
    logits = logits.unsqueeze(1)
    return logits

    Converts binary channel logits to unary channel logits for lovasz hinge loss.
    
paddleseg/models/losses/lovasz_loss.py