code: def flatten_binary_scores(scores, labels, ignore=None):
      """
      Flattens predictions in the batch (binary case).
      Remove labels according to 'ignore'.
      """
      scores = paddle.reshape(scores, [-1])
      labels = paddle.reshape(labels, [-1])
      labels.stop_gradient = True
      if ignore is None:
          return scores, labels
      valid = labels != ignore
      valid_mask = paddle.reshape(valid, (-1, 1))
      indexs = paddle.nonzero(valid_mask)
      indexs.stop_gradient = True
      vscores = paddle.gather(scores, indexs[:, 0])
      vlabels = paddle.gather(labels, indexs[:, 0])
      return vscores, vlabels
  
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 4 for calling a global function with example usage: flatten_binary_scores(scores, labels, ignore) and returns: vscores,  vlabels, scores,  labels