Closed lhao0301 closed 7 years ago
tf.assign
does return a assigned Tensor whose value is what we want to assign, but it is not a variable, though it has same value as the changed variable. Evaling the returned tensor will change the variable's value directly, tf.assign
doesn't change variable's value by returning a new variable and substitute it. In this case, evaling tf.tuple(clipped_var_c)
will run all assign_op clipped_var_c
consists of, thus change the values of theta_c
.
I got it. Thank you very much!
I was confused about this line
clipped_var_c = [tf.assign(var, tf.clip_by_value(var, clamp_lower, clamp_upper)) for var in theta_c]
.clipped_var_c
is one copy of 'theta_c' and it is clipped. However I think that the value oftheta_c
actually was not clipped during training.