Tensorflow: Why is tf.case giving me the wrong result?
问题 I'm trying to use tf.case (https://www.tensorflow.org/api_docs/python/tf/case) to conditionally update a Tensor. As shown, I'm trying to update learning_rate to 0.01 when global_step == 2 , and to 0.001 when global_step == 4 . However, when global_step == 2 , I already get learning_rate = 0.001 . Upon further inspection, it looks like tf.case is giving me the wrong result when global_step == 2 (I get 0.001 instead of 0.01 ). This is happening even though the predicate for 0.01 is evaluating