code: def test_accuracy(
      self,
      x,
      fn,
      true_fwd_fn,
      true_bwd_fn,
      value_rtol=1e-4,
      grad_rtol=1e-4,
      skip_fn=lambda: False,
  ):
      if skip_fn():
          self.skipTest(
              "This test is expected to fail in this configuration."
          )
      dtype = dtype_util.as_numpy_dtype(self.dtype)
  
      x_gt = np.array(x)
      x = x_gt.astype(dtype)
  
      y = self.run_fn(fn, (x,))
      y_gt = true_fwd_fn(x_gt).astype(dtype)
  
      self.assertAllClose(y_gt, y, rtol=value_rtol)
  
      if NUMPY_MODE:
          return
  
      num_outputs = np.prod(y.shape).astype(np.int32)
  
      dy_gt = (
          np.arange(1, 1 + num_outputs)
          .astype(np.float64)
          .reshape(y.shape)
      )
      dy = dy_gt.astype(dtype)
  
      y, grads = self.run_fn(
          lambda x, dy: gradient.value_and_gradient(
              fn, x, output_gradients=dy
          ),
          (x, dy),
      )
      grads_gt = true_bwd_fn(x_gt, dy_gt).astype(dtype)
  
      self.assertAllClose(y_gt, y, rtol=value_rtol)
      self.assertAllClose(grads_gt, grads, rtol=grad_rtol)
  
file_path: probability/tensorflow_probability/python/experimental/math/manual_special_functions_test.py
imports: import functools
  from absl import flags
  from absl.testing import parameterized
  import mock
  import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.experimental.math import manual_special_functions
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import gradient
label_desc: Use image node_id 4 for calling the ManualSpecialFunctionsTest obj's underlying member method code with example usage: obj.test_accuracy(x, fn, true_fwd_fn, true_bwd_fn, value_rtol, grad_rtol, skip_fn) without return types