code: def testContinuedFraction(self):
      # Check that the simplest continued fraction returns the golden ratio.
      self.assertAllClose(
          self.evaluate(
              _compute_general_continued_fraction(
                  100, [], partial_numerator_fn=lambda _: 1.0
              )
          ),
          scipy_constants.golden - 1.0,
      )
  
      # Check the continued fraction constant is returned.
      cf_constant_denominators = scipy_special.i1(
          2.0
      ) / scipy_special.i0(2.0)
  
      self.assertAllClose(
          self.evaluate(
              _compute_general_continued_fraction(
                  100,
                  [],
                  partial_denominator_fn=lambda i: i,
                  tolerance=1e-5,
              )
          ),
          cf_constant_denominators,
          rtol=1e-5,
      )
  
      cf_constant_numerators = (
          np.sqrt(2 / (np.e * np.pi))
          / (scipy_special.erfc(np.sqrt(0.5)))
          - 1.0
      )
  
      # Check that we can specify dtype and tolerance.
      self.assertAllClose(
          self.evaluate(
              _compute_general_continued_fraction(
                  100,
                  [],
                  partial_numerator_fn=lambda i: i,
                  tolerance=1e-5,
                  dtype=tf.float64,
              )
          ),
          cf_constant_numerators,
          rtol=1e-5,
      )
  
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 1 for calling the BesselIvRatioTest obj's underlying member method code with example usage: obj.testContinuedFraction() without return types