x = tf.constant(1.) bool = tf.constant(True) res = tf.cond(bool, lambda: tf.add(x, 1.), lambda: tf.add(x, 10.)) # sess.run(res) will give you 2.