Skip to content

Commit ff37bcc

Browse files
Assert dimension consistency even without label weights
PiperOrigin-RevId: 762307281
1 parent 803835f commit ff37bcc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

tf_keras/metrics/confusion_metrics.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1471,9 +1471,10 @@ def update_state(self, y_true, y_pred, sample_weight=None):
14711471
# label_weights should be of length equal to the number of
14721472
# labels.
14731473
shapes.append((self.label_weights, ("L",)))
1474-
tf.debugging.assert_shapes(
1475-
shapes, message="Number of labels is not consistent."
1476-
)
1474+
1475+
tf.debugging.assert_shapes(
1476+
shapes, message="Number of labels is not consistent."
1477+
)
14771478

14781479
# Only forward label_weights to update_confusion_matrix_variables when
14791480
# multi_label is False. Otherwise the averaging of individual label AUCs

0 commit comments

Comments
 (0)