title: How do I get the current value of a Variable?
body: <p>Suppose we have a variable:</p>
  
  <pre><code>x = tf.Variable(...)
  </code></pre>
  
  <p>This variable can be updated during the training process using the <code>assign()</code> method.</p>
  
  <p><em>What is the best way to get the current value of a variable?</em></p>
  
  <p>I know we could use this:</p>
  
  <pre><code>session.run(x)
  </code></pre>
  
  <p>But I'm afraid this would trigger a whole chain of operations.</p>
  
  <p>In Theano, you could just do</p>
  
  <pre><code>y = theano.shared(...)
  y_vals = y.get_value()
  </code></pre>
  
  <p>I'm looking for the equivalent thing in TensorFlow.</p>