title: How to inject values into the middle of TensorFlow graph?
body: <p>Consider the following code:</p>
  
  <pre><code>x = tf.placeholder(tf.float32, (), name='x')
  z = x + tf.constant(5.0)
  y = tf.mul(z, tf.constant(0.5))
  
  with tf.Session() as sess:
      print(sess.run(y, feed_dict={x: 30}))
  </code></pre>
  
  <p>The resulting graph is x -> z -> y. Sometimes I'm interested in computing y all the way from from x but sometimes I have z to start and would like inject this value into the graph. So the z needs to behave like a partial placeholder. How can I do that?</p>
  
  <p>(For anyone interested why I need this. I am working with an autoencoder network which observes an image x, generates an intermediate compressed representation z, then computes reconstruction of image y. I'd like to see what the network reconstructs when I inject different values for z.)</p>