title: How to understand sess.as_default() and sess.graph.as_default()?
body: <p>I read the <a href="https://www.tensorflow.org/api_docs/python/tf/Session#as_default" rel="noreferrer">docs of sess.as_default()</a></p>
  
  <blockquote>
    <p>N.B. The default session is a property of the current thread. If you create a new thread, and wish to use the default session in that thread, you must explicitly add a with sess.as_default(): in that thread's function.</p>
  </blockquote>
  
  <p>My understanding is that if there are two more sessions when a new thread is created, we must set a session to run TensorFlow code in it. So, to do this, a session is chosen and <code>as_default()</code> is called.</p>
  
  <blockquote>
    <p>N.B. Entering a with sess.as_default(): block does not affect the current default graph. If you are using multiple graphs, and sess.graph is different from the value of tf.get_default_graph, you must explicitly enter a with sess.graph.as_default(): block to make sess.graph the default graph.</p>
  </blockquote>
  
  <p>In <code>sess.as_default()</code> block, to call a specific graph, one must call <code>sess.graph.as_default()</code> to run the graph?</p>