code: def _testConfMatrix(
      self, labels, predictions, truth, weights=None, num_classes=None
  ):
      with self.cached_session():
          dtype = predictions.dtype
          ans = confusion_matrix.confusion_matrix(
              labels,
              predictions,
              dtype=dtype,
              weights=weights,
              num_classes=num_classes,
          ).eval()
          self.assertAllClose(truth, ans, atol=1e-10)
          self.assertEqual(ans.dtype, dtype)
  
imports: import numpy
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors_impl
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import confusion_matrix
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import random_ops
  from tensorflow.python.platform import test
label_desc: Use image node_id 2 for calling the ConfusionMatrixTest obj's underlying member method code with example usage: obj._testConfMatrix(labels, predictions, truth, weights, num_classes) without return types