code: def log_expm1(x):
      """Computes log(exp(x)-1) stably.
  
      For large values of x, exp(x) will return Inf whereas log(exp(x)-1) ~= x.
      Here we use this approximation for x>15, such that the output is non-Inf for
      all positive values x.
  
      Args:
       x: A tensor.
  
      Returns:
        log(exp(x)-1)
  
      """
      # If x<15.0, we can compute it directly. For larger values,
      # we have log(exp(x)-1) ~= log(exp(x)) = x.
      cond = x < 15.0
      x_small = tf.minimum(x, 15.0)
      return tf.where(cond, tf.math.log(tf.math.expm1(x_small)), x)
  
imports: import tensorflow
  import tensorflow_probability
  from tensorflow_compression.python.distributions import helpers
  from tensorflow_compression.python.distributions import uniform_noise
label_desc: Use image node_id 1 for calling a global function with example usage: log_expm1(x) and returns: tf