import tensorflow as tf
import os
# Just disables the warning, doesn't enable AVX/FMA
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
<tf.Tensor 'Add_2:0' shape=() dtype=int32>
# assign the new value to a
update = tf.assign(a, c)
<tf.Variable 'Variable_4:0' shape=() dtype=int32_ref>
# You can't change the constant by using assign.
# Initialize global variables
init_op = tf.global_variables_initializer()
session = tf.Session()
session.run(init_op)
0
1
1
for _ in range(4):
session.run(update)
print(session.run(a))
2
3
4
5