code: def _sample_discrete_laplace(t, shape):
      """Sample from discrete Laplace with scale t.
  
      This method is based on the observation that sampling from Z ~ Lap(t) is
      equivalent to sampling X, Y independently from Geo(1 - exp(-1/t)) and take
      Z = X - Y.
  
      Note also that tensorflow_probability's geometric sampler is based on floating
      operations and may possibly be inexact.
  
      Args:
        t: The scale of the discrete Laplace distribution.
        shape: The tensor shape of the tensors drawn.
  
      Returns:
        A tensor of the specified shape filled with random values.
      """
      geometric_probs = 1.0 - tf.exp(-1.0 / tf.cast(t, tf.float64))
      sampler = tf_prob.distributions.Geometric(probs=geometric_probs)
      return tf.cast(
          sampler.sample(shape) - sampler.sample(shape), tf.int64
      )
  
imports: import tensorflow
  import tensorflow_probability
label_desc: Use image node_id 1 for calling a global function with example usage: _sample_discrete_laplace(t, shape) and returns: tf