将输出张量连接到tensorflow中的占位符

将输出张量连接到tensorflow中的占位符,tensorflow,graph,connection,Tensorflow,Graph,Connection,如果我有如下图表: x0 = tf.placeholder(tf.float32, shape=(None, None, None, None)) y0 = x0 + 10.0 x1 = tf.placeholder(tf.float32, shape=(None, None, None, None)) y1 = x1 * 5.0 第二种情况如下: x0 = tf.placeholder(tf.float32, shape=(None, None, None, None)) y0 = x0

如果我有如下图表:

x0 = tf.placeholder(tf.float32, shape=(None, None, None, None))
y0 = x0 + 10.0
x1 = tf.placeholder(tf.float32, shape=(None, None, None, None))
y1 = x1 * 5.0
第二种情况如下:

x0 = tf.placeholder(tf.float32, shape=(None, None, None, None))
y0 = x0 + 10.0
x1 = tf.placeholder(tf.float32, shape=(None, None, None, None))
y1 = x1 * 5.0
如何将第一个图形(y0)的输出连接到第二个图形(x1)的输入占位符? 实际上,我不知道这两个图形的内部工作原理。 一个目标是能够像这样重复应用图2:

x = x_in = tf.placeholder(tf.float32, shape=(None, None, None, None))
x = graph1(x)
for i in range(n):
  x = graph2(x)
x_out = x

假设您想要计算
y1=(x0+10.0)*5.0
,您可以进行以下操作:

x0 = tf.placeholder(tf.float32, shape=(None, None, None, None))
y0 = x0 + 10.0
y1 = y0 * 5.0

谢谢你的回答。我给出的例子是我实际所做工作的简化版本。实际上,我不知道第一个和第二个图形做什么,我只有输入和输出。我会更新这个问题。如果你不发布准确的代码,帮助你有点困难。如果
graph2
的输入是一个占位符,并且您不能更改它,那么您需要作为占位符馈送到
graph1
的输出。实现这一点的方法是两个有两个sess.run(),第一个是计算
graph1
的输出,第二个是将其输入到
graph2
并进行处理。