code: def false_postives_upper_bound(labels, logits, weights):
      """
      false_positives_upper_bound defined in paper:
      "Scalable Learning of Non-Decomposable Objectives"
  
      Args:
          labels: A `Tensor` of shape broadcastable to logits.
          logits: A `Tensor` of shape [N, C] or [N, C, K].
              If the third dimension is present,
              the lower bound is computed on each slice [:, :, k] independently.
          weights: Per-example loss coefficients, with shape broadcast-compatible with
              that of `labels`. i.e. [N, 1] or [N, C]
  
      Returns:
          A `Tensor` of shape [C] or [C, K].
      """
      loss_on_negatives = weighted_hinge_loss(
          labels, logits, positive_weights=0
      )
  
      weighted_loss_on_negatives = (
          weights.unsqueeze(-1) * loss_on_negatives
          if loss_on_negatives.dim() > weights.dim()
          else weights * loss_on_negatives
      )
      return weighted_loss_on_negatives.sum(0)
  
file_path: pytext/pytext/utils/loss.py
imports: import numpy
  import torch
  from .cuda import FloatTensor
label_desc: Use image node_id 5 for calling a global function with example usage: false_postives_upper_bound(labels, logits, weights) and returns: weighted_loss_on_negatives