小记
tensorflow的sess有一个分步执行的函数partial_run,此函数的文档说明和具体运行有点差异,留文以记录。
形式1
import tensorflow as tf
a = tf.placeholder(dtype=tf.float32, shape=[])
b = tf.placeholder(dtype=tf.float32, shape=[])
c = tf.placeholder(dtype=tf.float32, shape=[])
e = tf.placeholder(dtype=tf.float32, shape=[])
d = tf.Variable(dtype=tf.float32, initial_value=0)
r1 = tf.add(a, b)
a_0 = tf.assign(d, tf.add(d,c),name='0')
a_1 = tf.assign(d, tf.add(d,e),name='1')
with tf.Session()