def forward(self, logits, labels):
        r"""
        Forward computation.

        Args:
            logits (Tensor): Shape is [N, 1, H, W] or [N, 2, H, W], logits at each pixel (between -\infty and +\infty).
            labels (Tensor): Shape is [N, 1, H, W] or [N, H, W], binary ground truth masks (0 or 1).
        """
        if logits.shape[1] == 2:
            logits = binary_channel_to_unary(logits)
        loss = lovasz_hinge_flat(
            *flatten_binary_scores(logits, labels, self.ignore_index))
        return loss

        Forward computation.

        Args:
            logits (Tensor): Shape is [N, 1, H, W] or [N, 2, H, W], logits at each pixel (between -\infty and +\infty).
            labels (Tensor): Shape is [N, 1, H, W] or [N, H, W], binary ground truth masks (0 or 1).
        
paddleseg/models/losses/lovasz_loss.py