I'd like to use if operation in tensorflow, as I've learned tf.cond()should be used here. While I'm confused about what if i'd like to use only if operation instead else operation. For example:
a = tf.Constant(10)
b = tf.Constant(5)
for i in range(5):
tmp = tf.greater_equal(a,b)
result = tf.cond(tmp, lambda:tf.constant(i), None)
if result is not None:
return i
as above, I want to do nothing in else operation, while tf.cond() ask there has to be a value to return.Hope someone can provide some help.
Aucun commentaire:
Enregistrer un commentaire