class_docstr: Binary Lovasz hinge loss.
  
  Args:
      ignore_index (int64): Specifies a target value that is ignored and does not contribute to the input gradient. Default ``255``.
class_docstr_tok: ["Binary","Lovasz","hinge","loss",".","Args",":","ignore_index","(","int64",")",":","Specifies","a","target","value","that","is","ignored","and","does","not","contribute","to","the","input","gradient",".","Default","``","255","``","."]
docstr: 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).
docstr_tok: ["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",")","."]
code: 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
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import paddle
  from paddle import nn
  import paddle.nn.functional
  from paddleseg.cvlibs import manager
label_desc: Use image node_id 2 for calling the LovaszHingeLoss obj's underlying member method code with example usage: obj.forward(logits, labels) and returns: loss