code: def test_log2(self):
      test_cases = [
          (tf.float16, 1e-3),
          (tf.float32, 1e-6),
          (tf.float64, 1e-12),
      ]
  
      for dtype, tolerance in test_cases:
          expected = tf.constant([1, 2, 3, 4, 5, 6], dtype=dtype)
          actual = utils.log2(
              tf.constant([2, 4, 8, 16, 32, 64], dtype=dtype)
          )
  
          with self.subTest("Values"):
              self.assertAllClose(
                  self.evaluate(actual),
                  self.evaluate(expected),
                  rtol=tolerance,
              )
          with self.subTest("DType"):
              self.assertEqual(actual.dtype, expected.dtype)
  
file_path: tf-quant-finance/tf_quant_finance/math/qmc/utils_test.py
imports: import tensorflow.compat.v2
  import tf_quant_finance
  from tensorflow.python.framework import test_util
label_desc: Use image node_id 3 for calling the UtilsTest obj's underlying member method code with example usage: obj.test_log2() without return types