class_docstr: tf metrics utils unittest
class_docstr_tok: ["tf","metrics","utils","unittest"]
docstr: test confusion matrix
docstr_tok: ["test","confusion","matrix"]
code: def test_confusion_matrix(self):
      """test confusion matrix"""
      logits = tf.constant(
          [
              [0.1, 0.2, 0.7],
              [0.5, 0.2, 0.3],
              [0.6, 0.1, 0.3],
              [0.2, 0.3, 0.5],
              [0.2, 0.5, 0.3],
              [0.2, 0.2, 0.6],
          ]
      )
      labels = tf.constant([2, 0, 0, 2, 1, 1])
      num_class = 3
      output = tf_metrics.confusion_matrix(logits, labels, num_class)
      output_true = tf.constant([[2, 0, 0], [0, 1, 1], [0, 0, 2]])
      self.assertAllEqual(output, output_true)
  
imports: import delta.compat
  from delta.utils.metrics import tf_metrics
label_desc: Use image node_id 2 for calling the TFMetricUtilsTest obj's underlying member method code with example usage: obj.test_confusion_matrix() without return types