code: def testBesselIvRatioVAndZSmall(self):
      seed_stream = test_util.test_seed_stream()
      z = tf.random.uniform([int(1e3)], seed=seed_stream())
      v = tf.random.uniform([int(1e3)], seed=seed_stream())
      # When both values are small, both the scipy ratio and
      # the computation become numerically unstable.
      # Anecdotally (when comparing to mpmath) the computation is more often
      # 'right' compared to the naive ratio.
  
      bessel_iv_ratio, v, z = self.evaluate(
          [bessel.bessel_iv_ratio(v, z), v, z]
      )
      scipy_ratio = scipy_special.ive(v, z) / scipy_special.ive(
          v - 1.0, z
      )
  
      safe_scipy_values = np.where(
          ~np.isnan(scipy_ratio) & (scipy_ratio != 0.0)
      )
  
      self.assertAllClose(
          bessel_iv_ratio[safe_scipy_values],
          scipy_ratio[safe_scipy_values],
          rtol=3e-4,
          atol=1e-6,
      )
  
imports: import functools
  from absl.testing import parameterized
  import numpy
  from scipy import constants
  from scipy import special
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import test_util
  from tensorflow_probability.python.math import bessel
  from tensorflow_probability.python.math import gradient
  from tensorflow_probability.python.math.bessel import _compute_general_continued_fraction
label_desc: Use image node_id 3 for calling the BesselIvRatioTest obj's underlying member method code with example usage: obj.testBesselIvRatioVAndZSmall() without return types