code: def accuracy_without_true_negatives(
      true_positives, false_positives, false_negatives
  ):
      """Creates an op for calculating accuracy without true negatives.
  
      Args:
        true_positives: A tensor representing true_positives.
        false_positives: A tensor representing false_positives.
        false_negatives: A tensor representing false_negatives.
  
      Returns:
        A tensor with the result of the calculation.
      """
      return tf.where(
          tf.greater(
              true_positives + false_positives + false_negatives, 0
          ),
          true_positives
          / (true_positives + false_positives + false_negatives),
          0,
      )
  
file_path: magenta/magenta/models/onsets_frames_transcription/metrics.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import collections
  import functools
  from magenta.models.onsets_frames_transcription import constants
  from magenta.models.onsets_frames_transcription import data
  from magenta.models.onsets_frames_transcription import infer_util
  import mir_eval
  from note_seq import sequences_lib
  from note_seq.protobuf import music_pb2
  import numpy
  import tensorflow.compat.v1
label_desc: Use image node_id 2 for calling a global function with example usage: accuracy_without_true_negatives(true_positives, false_positives, false_negatives) and returns: tf