code: def geometric(p):
      i = tf.constant(0)
      sample = tf.while_loop(
          cond=lambda i: tf.cast(1 - Bernoulli(probs=p), tf.bool),
          body=lambda i: i + 1,
          loop_vars=[i],
      )
      return sample
  
file_path: edward/examples/pp_stochastic_control_flow.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import matplotlib.pyplot
  import tensorflow
  from edward.models import Bernoulli
label_desc: Use image node_id 1 for calling a global function with example usage: geometric(p) and returns: sample