title: Why using placeholders for the input data of the TensorFlow functions
body: <p>When I read TensorFlow codes, I see people specify placeholders for the input arguments of the functions and then feed the input data in a <code>session.run</code>. A trivial example can be like:</p>
  
  <pre><code>def sigmoid(z):
  
      x = tf.placeholder(tf.float32, name='x')
  
      sigmoid = tf.sigmoid(x)
  
      with tf.Session() as session:
          result = session.run(sigmoid, feed_dict={x:z})
  
      return result
  </code></pre>
  
  <p>I wonder why don't they directly feed the <code>z</code> into the <code>tf.sigmoid(z)</code> and get rid of the placeholder <code>x</code>? </p>
  
  <p>If this is a best practice, what is the reason behind it?</p>