code: def _runOneTest(self, shape, dtype, batch, scalar_test):
      if dtype == dtypes_lib.float64:
          tol = 1e-5
      elif dtype == dtypes_lib.complex128:
          tol = 5e-5
      else:
          tol = 5e-3
      epsilon = np.finfo(dtype.as_numpy_dtype).eps
      delta = epsilon ** (1.0 / 3.0)
  
      def RandomInput():
          a = np.random.randn(shape[0], shape[1]).astype(
              dtype.as_numpy_dtype
          )
          if dtype.is_complex:
              a += 1j * np.random.randn(shape[0], shape[1]).astype(
                  dtype.as_numpy_dtype
              )
          return a
  
      def Compute(x):
          # Turn the random matrix x into a Hermitian matrix by
          # computing the quadratic form x * x^H.
          a = (
              test_util.matmul_without_tf32(
                  x, math_ops.conj(array_ops.matrix_transpose(x))
              )
              / shape[0]
          )
          if batch:
              a = array_ops.tile(array_ops.expand_dims(a, 0), [2, 1, 1])
          # Finally take the cholesky decomposition of the Hermitian matrix.
          c = linalg_ops.cholesky(a)
          if scalar_test:
              # Reduce to a single scalar output to speed up test.
              c = math_ops.reduce_mean(c)
          return c
  
      theoretical, numerical = gradient_checker_v2.compute_gradient(
          Compute, [RandomInput()], delta=delta
      )
      self.assertAllClose(theoretical, numerical, atol=tol, rtol=tol)
  
imports: import numpy
  from tensorflow.python.client import session
  from tensorflow.python.framework import constant_op
  from tensorflow.python.framework import dtypes
  from tensorflow.python.framework import errors_impl
  from tensorflow.python.framework import ops
  from tensorflow.python.framework import test_util
  from tensorflow.python.ops import array_ops
  from tensorflow.python.ops import control_flow_ops
  from tensorflow.python.ops import gradient_checker_v2
  from tensorflow.python.ops import linalg_ops
  from tensorflow.python.ops import math_ops
  from tensorflow.python.ops import stateless_random_ops
  from tensorflow.python.ops import variables
  from tensorflow.python.ops.linalg import linalg
  from tensorflow.python.platform import benchmark
  from tensorflow.python.platform import test
label_desc: Use image node_id 9 for calling the CholeskyGradTest obj's underlying member method code with example usage: obj._runOneTest(shape, dtype, batch, scalar_test) and returns: a, c