code: def geometric(p):
      cond = tf.cast(Bernoulli(probs=p), tf.bool)
  
      def fn1():
          return tf.constant(0)
  
      def fn2():
          return geometric(p) + 1
  
      # TensorFlow builds the op non-lazily, unrolling both functions
      # before it checks the condition. This makes this function fail.
      return tf.cond(cond, fn1, fn2)
  
file_path: edward/examples/pp_stochastic_recursion.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: tf, tf, unknown