Fix missed parameter from AUC config
diff --git a/keras/metrics/confusion_matrix_test.py b/keras/metrics/confusion_matrix_test.py
index 773323fe094..631e36596c1 100644
--- a/keras/metrics/confusion_matrix_test.py
+++ b/keras/metrics/confusion_matrix_test.py
@@ -1299,9 +1299,11 @@ class AUCTest(tf.test.TestCase, parameterized.TestCase):
     def setup(self):
         self.num_thresholds = 3
         self.y_pred = tf.constant([0, 0.5, 0.3, 0.9], dtype=tf.float32)
+        self.y_pred_multi_label = tf.constant([[0., 0.4], [0.5, 0.7], [0.3, 0.2], [0.9, 0.3]], dtype=tf.float32)
         epsilon = 1e-12
         self.y_pred_logits = -tf.math.log(1.0 / (self.y_pred + epsilon) - 1.0)
         self.y_true = tf.constant([0, 0, 1, 1])
+        self.y_true_multi_label = tf.constant([[0, 0], [1, 1], [1, 1], [1, 0]])
         self.sample_weight = [1, 2, 3, 4]
 
         # threshold values are [0 - 1e-7, 0.5, 1 + 1e-7]
@@ -1332,22 +1334,30 @@ def test_config(self):
             curve="PR",
             summation_method="majoring",
             name="auc_1",
+            dtype=tf.float64,
+            multi_label=True,
+            num_labels=2,
+            from_logits=True
         )
-        auc_obj.update_state(self.y_true, self.y_pred)
+        auc_obj.update_state(self.y_true_multi_label, self.y_pred_multi_label)
         self.assertEqual(auc_obj.name, "auc_1")
+        self.assertEqual(auc_obj._dtype, tf.float64)
         self.assertLen(auc_obj.variables, 4)
         self.assertEqual(auc_obj.num_thresholds, 100)
         self.assertEqual(auc_obj.curve, metrics_utils.AUCCurve.PR)
         self.assertEqual(
             auc_obj.summation_method, metrics_utils.AUCSummationMethod.MAJORING
         )
+        self.assertTrue(auc_obj.multi_label)
+        self.assertEqual(auc_obj.num_labels, 2)
+        self.assertTrue(auc_obj._from_logits)
         old_config = auc_obj.get_config()
         self.assertNotIn("thresholds", old_config)
         self.assertDictEqual(old_config, json.loads(json.dumps(old_config)))
 
         # Check save and restore config.
         auc_obj2 = metrics.AUC.from_config(auc_obj.get_config())
-        auc_obj2.update_state(self.y_true, self.y_pred)
+        auc_obj2.update_state(self.y_true_multi_label, self.y_pred_multi_label)
         self.assertEqual(auc_obj2.name, "auc_1")
         self.assertLen(auc_obj2.variables, 4)
         self.assertEqual(auc_obj2.num_thresholds, 100)
@@ -1355,6 +1365,9 @@ def test_config(self):
         self.assertEqual(
             auc_obj2.summation_method, metrics_utils.AUCSummationMethod.MAJORING
         )
+        self.assertTrue(auc_obj2.multi_label)
+        self.assertEqual(auc_obj2.num_labels, 2)
+        self.assertTrue(auc_obj2._from_logits)
         new_config = auc_obj2.get_config()
         self.assertNotIn("thresholds", new_config)
         self.assertDictEqual(old_config, new_config)
@@ -2067,5 +2080,5 @@ def test_even_thresholds_correctness_2(self, metric_cls):
                 self.assertAllClose(v1, v2)
 
 
-if __name__ == "__main__":
-    tf.test.main()
+if __name__ == '__main__':
+  tf.test.main()
diff --git a/keras/metrics/metrics.py b/keras/metrics/metrics.py
index f68dfd2f9ef..61eb231d5f4 100644
--- a/keras/metrics/metrics.py
+++ b/keras/metrics/metrics.py
@@ -1782,6 +1782,7 @@ def __init__(
 
         # Handle multilabel arguments.
         self.multi_label = multi_label
+        self.num_labels = num_labels
         if label_weights is not None:
             label_weights = tf.constant(label_weights, dtype=self.dtype)
             tf.debugging.assert_non_negative(
@@ -2107,7 +2108,9 @@ def get_config(self):
             "curve": self.curve.value,
             "summation_method": self.summation_method.value,
             "multi_label": self.multi_label,
+            'num_labels': self.num_labels,
             "label_weights": label_weights,
+            'from_logits': self._from_logits,
         }
         # optimization to avoid serializing a large number of generated thresholds
         if self._init_from_thresholds:
diff --git a/keras/utils/metrics_utils.py b/keras/utils/metrics_utils.py
index ee1de7668f5..50abd9e6e64 100644
--- a/keras/utils/metrics_utils.py
+++ b/keras/utils/metrics_utils.py
@@ -394,7 +394,7 @@ def _update_confusion_matrix_variables_optimized(
         )
         if not multi_label:
             label_weights = tf.reshape(label_weights, [-1])
-    weights = tf.multiply(sample_weights, label_weights)
+    weights = tf.cast(tf.multiply(sample_weights, label_weights), y_true.dtype)
 
     # We shouldn't need this, but in case there are predict value that is out of
     # the range of [0.0, 1.0]

AUC metrics missed `from_logits` parameter in `get_config` method, which will cause a error when load from a saved model and `from_logits` is True.