code: def evaluate_classifier_fraction(input_,
                                   labels,
                                   per_example_weights=None,
                                   topk=1,
                                   name=PROVIDED,
                                   phase=Phase.train):
    
    _ = name  # Suppress lint
    if not (tf.float32.is_compatible_with(labels.dtype) or
            tf.float64.is_compatible_with(labels.dtype)):
      raise ValueError('labels must be floating point: %s.' % labels.dtype)
    correct_predictions, examples = _compute_average_correct(input_,
                                                             labels,
                                                             per_example_weights,
                                                             topk=topk)
    correct_predictions, examples, my_parameters = _eval_metric(
        input_, topk, correct_predictions, examples, phase)
    return input_.with_sequence([correct_predictions, examples], my_parameters)
docs: Calculates the total of correct predictions and example count.
  
    In test and infer mode, this creates variables in the graph collection
    pt.GraphKeys.TEST_VARIABLES and does not add them to
    tf.GraphKeys.ALL_VARIABLES.  This means that you must initialize them
    separately from tf.global_variables_initializer().
  
    In the case of `topk == 1`, this breaks ties left-to-right, in all other cases
    it follows `tf.nn.in_top_k`. *Note*: the tie behavior will change in the
    future.
  
    Args:
      input_: A rank 2 Tensor or a Pretty Tensor holding the result of the model.
      labels: A float or double `Tensor` containing the target for this layer *or*
        an integer `Tensor` with the sparse one-hot indices.
      per_example_weights: Weights that are applied to every example.
      topk: Integer k for 'accuracy at top k' metric.
      name: The name of this layer.
      phase: In training mode the batch accuracy is returned and in eval/infer
        modes a total average is calculated.
    Returns:
      A Pretty Tensor that contains correct_predictions, num_examples.
    Raises:
      ValueError: If labels is not the correct shape.