标签:ima com type oat assign oba ssi image lob
a = tf.Variable(0.0,dtype=tf.float32) with tf.Session() as sess: sess.run(tf.global_variables_initializer()) print(sess.run(a)) a = tf.assign(a,10) print(sess.run(a)) a = tf.assign(a,20) print(sess.run(a))
0.0 10.0 20.0
a = tf.Variable(1,dtype=tf.float32) with tf.Session() as sess: sess.run(tf.global_variables_initializer()) print(sess.run(a)) a = tf.assign_add(a,10) print(sess.run(a)) a = tf.assign_sub(a,20) print(sess.run(a))
1.0 11.0 1.0
tf.assign,tf.assign_add,tf.assign_sub
标签:ima com type oat assign oba ssi image lob
原文地址:https://www.cnblogs.com/wzdLY/p/10066749.html