code: def _bessel_kve_shared(v, z, output_log_space=False):
      """Compute bessel_kve(v, z)."""
      dtype = dtype_util.common_dtype([v, z], tf.float32)
      numpy_dtype = dtype_util.as_numpy_dtype(dtype)
      v = tf.convert_to_tensor(v, dtype=dtype)
      z = tf.convert_to_tensor(z, dtype=dtype)
  
      # K_{-v} == K_{v} for negative values.
      v = tf.math.abs(v)
  
      z_abs = tf.math.abs(z)
  
      small_v = tf.where(v < 50.0, v, numpy_dtype(0.1))
      large_v = tf.where(v >= 50.0, v, numpy_dtype(1000.0))
  
      _, olver_kve = _olver_asymptotic_uniform(
          large_v, z_abs, output_log_space=output_log_space
      )
      temme_kve = _temme_expansion(
          small_v, z_abs, output_log_space=output_log_space
      )[1]
      kve = tf.where(v >= 50.0, olver_kve, temme_kve)
  
      # Handle when z is zero.
      kve = tf.where(tf.math.equal(z, 0.0), numpy_dtype(np.inf), kve)
      return tf.where(z < 0.0, numpy_dtype(np.nan), kve)
  
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 22 for calling a global function with example usage: _bessel_kve_shared(v, z, output_log_space) and returns: tf