You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to do : IF True: return a ; else : return b (in python) . But there is a error : Using a tf.Tensor as a Python bool is not allowed. How can I do this
The text was updated successfully, but these errors were encountered:
c=tf.placeholder(tf.bool) if c : loss=-tf.reduce_sum(lable * tf.log(lable2))
raise TypeError("Using a tf.Tensor as a Python bool is not allowed. "
TypeError: Using a tf.Tensor as a Python bool is not allowed. Use if t is not None: instead of if t: to test if a tensor is defined, and use TensorFlow ops such as tf.cond to execute subgraphs conditioned on the value of a tensor.
I want to do : IF True: return a ; else : return b (in python) . But there is a error : Using a
tf.Tensor
as a Pythonbool
is not allowed. How can I do thisThe text was updated successfully, but these errors were encountered: