title: Faster for-loop with tensorflow
body: <p>I'm currently testing some things with tensorflow and I built a little neural network. To train it, I'm repeatedly running the session on the optimizer object:</p>
  
  <pre><code>error = 0.5 * tf.square(tf.subtract(output_layer, supervised_layer))
  optimizer = tf.train.GradientDescentOptimizer(0.05).minimize(error)
  
  session.run(tf.global_variables_initializer())
  
  for i in range(1000):
      session.run([optimizer, error], feed_dict={
          input_layer: [[0, 1], [1, 0], [0, 0], [1, 1]],
          supervised_layer: [[1], [1], [0], [0]]
      })
  </code></pre>
  
  <p>I feel like calling <code>session.run()</code> very often from python doesn't make good use of the way tensorflow works and probably can't use GPU processing advantages.</p>
  
  <p>So my question now is quite simple: Is there any overhead on <code>session.run()</code> and is there a better way for running a session very often.</p>