title: What does tf.global_variables_initializer() do under the hood?
body: <p>There have been many cases (<a href="https://stackoverflow.com/questions/45047589/tensorflow-fully-connected-not-working-in-unit-test-cases/45047635#45047635">here</a> and <a href="https://stackoverflow.com/questions/44584809/why-this-tensorflow-tutorial-code-not-working/44585267#44585267">here</a>) of TensorFlow users adding</p>
  
  <pre class="lang-py prettyprint-override"><code>init_op = tf.global_variables_initializer()
  </code></pre>
  
  <p>before defining any variables or operations and then getting an error along the lines of</p>
  
  <pre><code>Attempting to use uninitialized value
  </code></pre>
  
  <p>There is an explanation <a href="https://stackoverflow.com/questions/44433438/understanding-tf-global-variables-initializer">here</a> but it makes no mention of the underlying <code>tf.global_variables_initializer</code> calls. It's almost copying TF API wholesale. This question focuses on the fact that there are still uninitialized values when some users call <code>sess.run(init_op)</code>. Example code and an analysis into what <code>tf.global_variables_initializer</code> would be great.</p>