TF:Tensorflow定义变量+常量,实现输出计数功能—Jason niu
#TF:Tensorflow定义变量+常量,实现输出计数功能 import tensorflow as tf state = tf.Variable(0, name='Parameter_name_counter') #print(state.name) one = tf.constant(1) new_value = tf.add(state, one) update = tf.assign(state, new_value) init = tf.global_variables_initializer() with tf.Session() as sess: sess.run(init) for _ in range(8): sess.run(update) print(sess.run(state))
不念过去,不畏将来!
理想,信仰,使命感……
愿你出走半生,归来仍是少年……