title: TensorFlow: Initializing variables multiple times
body: <p>I am a bit confused by how the following code segment runs.</p>
  
  <pre><code>import tensorflow as tf
  
  x = tf.Variable(0)
  init_op = tf.initialize_all_variables()
  modify_op = x.assign(5)
  
  with tf.Session() as sess:
      sess.run(init_op)
      print(sess.run(x))
      x += 3
      print(sess.run(x))
      sess.run(init_op) # Trying to initialize x once again to 0
      print(sess.run(x)) # Gives out 3, which leaves me confused.
      print(sess.run(modify_op))
      print(sess.run(x)) # Gives out 8, even more confusing
  </code></pre>
  
  <p>This is the output:<br>
      <code>0</code><br>
      <code>3</code><br>
      <code>3</code><br>
      <code>5</code><br>
      <code>8</code></p>
  
  <p>Is it that the line <code>x += 3</code> is not part of the default graph? Or something else is going on? Some help will be appreciated, thanks!</p>