message: Code cleanup: remove some usages of v1 metrics.
diff: @@ -26,10 +26,10 @@ from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import random_seed
  +from tensorflow.python.keras import metrics as metrics_module
  from tensorflow.python.layers import layers
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import math_ops
  -from tensorflow.python.ops import metrics
  from tensorflow.python.ops import state_ops
  from tensorflow.python.ops import variable_scope
  from tensorflow.python.ops.losses import losses
  @@ -117,16 +117,18 @@ class EvaluateOnceTest(test.TestCase):
  logits = logistic_classifier(inputs)
  predictions = math_ops.round(logits)
  - accuracy, update_op = metrics.accuracy(
  - predictions=predictions, labels=labels)
  + accuracy = metrics_module.Accuracy()
  + update_op = accuracy.update_state(labels, predictions)
  checkpoint_path = saver.latest_checkpoint(checkpoint_dir)
  final_ops_values = evaluation._evaluate_once(
  checkpoint_path=checkpoint_path,
  eval_ops=update_op,
  - final_ops={'accuracy': accuracy},
  - hooks=[evaluation._StopAfterNEvalsHook(1),])
  + final_ops={'accuracy': (accuracy.result(), update_op)},
  + hooks=[
  + evaluation._StopAfterNEvalsHook(1),
  + ])
  self.assertTrue(final_ops_values['accuracy'] > .99)
  def testEvaluateWithFiniteInputs(self):
  @@ -148,17 +150,21 @@ class EvaluateOnceTest(test.TestCase):
  logits = logistic_classifier(inputs)
  predictions = math_ops.round(logits)
  - accuracy, update_op = metrics.accuracy(
  - predictions=predictions, labels=labels)
  + accuracy = metrics_module.Accuracy()
  + update_op = accuracy.update_state(labels, predictions)
  checkpoint_path = saver.latest_checkpoint(checkpoint_dir)
  final_ops_values = evaluation._evaluate_once(
  checkpoint_path=checkpoint_path,
  eval_ops=update_op,
  - final_ops={'accuracy': accuracy,
  - 'eval_steps': evaluation._get_or_create_eval_step()},
  - hooks=[evaluation._StopAfterNEvalsHook(None),])
  + final_ops={
  + 'accuracy': (accuracy.result(), update_op),
  + 'eval_steps': evaluation._get_or_create_eval_step()
  + },
  + hooks=[
  + evaluation._StopAfterNEvalsHook(None),
  + ])
  self.assertTrue(final_ops_values['accuracy'] > .99)
  # Runs evaluation for 4 iterations. First 2 evaluate full batch of 6 inputs
  # each; the 3rd iter evaluates the remaining 4 inputs, and the last one
  