[tf]sess.run机制

2018-12-06  本文已影响24人  VanJordan
a = tf.constant(1)
b = tf.Variable(1)
addop= tf.assign(b,b+3)
c = addop + a
with tf.Session() as sess:
    tf.global_variables_initializer().run()
    cc,bb = sess.run([addop,c])
    print(cc,bb)
    bb = sess.run(addop)
    print(bb)
>>4 5
7
上一篇下一篇

猜你喜欢

热点阅读