Print value of variable in tensor flow from a member function of a class
<p>I have a viable defined as follows which is also the weight matrix for a regular neural net.</p>

<pre><code> W1 = tf.Variable(tf.truncated_normal([feature_space_size, hidden1], stddev=1.0 / math.sqrt(feature_space_size),dtype=tf.float64), name='W1')
</code></pre>

<p>How can I print its value while I am debugging ? The issue is that its defined in a constructor and I need to access it in a member function of the same class. I tried fetching using </p>

<pre><code>tf.get_variable('W1',[4,300])
</code></pre>

<p>But I am not able to print its value using self.sess.run(). Please advise. There should really be a simpler way to print the value of variables. And moreover, it seems likee after I do get_variable, its no longer in the op graph for TF.</p>