code: def test_single_output_case(self):
      compile_metrics = CompileMetrics(
          metrics=[metrics_module.MeanSquaredError()],
          weighted_metrics=[metrics_module.MeanSquaredError()],
      )
      # Test symbolic build
      y_true, y_pred = backend.KerasTensor((3, 4)), backend.KerasTensor(
          (3, 4)
      )
      compile_metrics.build(y_true, y_pred)
      # Test eager build
      y_true = np.array([[0.1, 0.2], [0.3, 0.4], [0.5, 0.6]])
      y_pred = np.array([[0.4, 0.1], [0.2, 0.6], [0.6, 0.1]])
      sample_weight = np.array([1, 0.0, 1])
      compile_metrics.build(y_true, y_pred)
  
      # Test update / result / reset flow
      compile_metrics.update_state(
          y_true, y_pred, sample_weight=sample_weight
      )
      y_pred = np.array([[0.3, 0.2], [0.1, 0.4], [0.2, 0.3]])
      compile_metrics.update_state(
          y_true, y_pred, sample_weight=sample_weight
      )
      result = compile_metrics.result()
      self.assertIsInstance(result, dict)
      self.assertEqual(len(result), 2)
      self.assertAllClose(result["mean_squared_error"], 0.055833336)
      self.assertAllClose(result["weighted_mean_squared_error"], 0.0725)
  
      compile_metrics.reset_state()
      result = compile_metrics.result()
      self.assertIsInstance(result, dict)
      self.assertEqual(len(result), 2)
      self.assertAllClose(result["mean_squared_error"], 0.0)
      self.assertAllClose(result["weighted_mean_squared_error"], 0.0)
  
imports: import numpy
  from absl.testing import parameterized
  from keras import backend
  from keras import metrics
  from keras import metrics
  from keras import ops
  from keras import testing
  from keras.trainers.compile_utils import CompileLoss
  from keras.trainers.compile_utils import CompileMetrics
label_desc: Use image node_id 1 for calling the TestCompileMetrics obj's underlying member method code with example usage: obj.test_single_output_case() without return types