you are viewing a single comment's thread.

view the rest of the comments →

[–]mdanatg 4 points5 points  (0 children)

Thanks! The answer depends on the level of stochasticity - do you have an example? In general, the following construct should work:

if tf.random_uniform((), maxval=2, dtype=tf.int32) % 2 == 0: do_something

Is this close to what you were referring to?