code: def _bessel_ive_shared(v, z, output_log_space=False):
      """Compute bessel_ive(v, z)."""
      dtype = dtype_util.common_dtype([v, z], tf.float32)
      numpy_dtype = dtype_util.as_numpy_dtype(dtype)
  
      # I_{-v} == I_{v} for negative integers
      v_is_integer = tf.math.equal(tf.math.floor(v), v)
      v_abs = tf.where((v < 0.0) & v_is_integer, -v, v)
  
      z_abs = tf.math.abs(z)
      # Handle the zero case specially.
      z_abs = tf.where(
          tf.math.equal(z_abs, 0.0), numpy_dtype(1.0), z_abs
      )
  
      small_v = tf.where(
          tf.math.abs(v_abs) < 50.0, v_abs, numpy_dtype(0.1)
      )
      large_v = tf.where(
          tf.math.abs(v_abs) >= 50.0, v_abs, numpy_dtype(1000.0)
      )
  
      olver_ive, _ = _olver_asymptotic_uniform(
          large_v, z_abs, output_log_space=output_log_space
      )
      temme_ive = _temme_expansion(
          small_v, z_abs, output_log_space=output_log_space
      )[0]
      ive = tf.where(tf.math.abs(v) >= 50.0, olver_ive, temme_ive)
  
      # Handle when z is zero.
      if output_log_space:
          ive = tf.where(
              tf.math.equal(z, 0.0),
              tf.where(
                  tf.math.equal(v, 0.0),
                  numpy_dtype(0.0),
                  tf.where(
                      v_abs < 0.0,
                      numpy_dtype(np.inf),
                      numpy_dtype(-np.inf),
                  ),
              ),
              ive,
          )
      else:
          ive = tf.where(
              tf.math.equal(z, 0.0),
              tf.where(
                  tf.math.equal(v, 0.0),
                  numpy_dtype(1.0),
                  tf.where(
                      v_abs < 0.0, numpy_dtype(np.inf), numpy_dtype(0.0)
                  ),
              ),
              ive,
          )
  
      # Handle when z < 0.
      ive = tf.where(
          (z < 0.0) & ~v_is_integer, numpy_dtype(np.nan), ive
      )
      # If v is an odd integer, we flip sign of the computation.
      if not output_log_space:
          ive = tf.where(
              (z < 0.0)
              & v_is_integer
              & tf.math.not_equal(2.0 * tf.math.floor(v / 2.0), v),
              -ive,
              ive,
          )
      return ive
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import custom_gradient
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
  from tensorflow_probability.python.math import generic
label_desc: Use image node_id 15 for calling a global function with example usage: _bessel_ive_shared(v, z, output_log_space) and returns: ive