Last active
April 28, 2018 09:12
-
-
Save pradeepbn/ee640c7d2a1fedc6999ae88c28f41e48 to your computer and use it in GitHub Desktop.
Example to show how to use tf.Print and tfdbg
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
from tensorflow.python import debug as tf_debug | |
a = tf.constant([1.0, 4.0], shape=[2,1]) | |
b = tf.constant([2.0, 3.0], shape=[1,2]) | |
c = tf.add(tf.matmul(a,b), tf.constant([5.0, 6.0])) | |
d = tf.Print(c, [c, 2.0], message="Value of C is:") | |
sess = tf_debug.LocalCLIDebugWrapperSession(sess) | |
with tf.Session() as sess: | |
sess.run(d) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
to print the value of d...use below command after running session.
print(d.eval())
it will show you a resultant value of multiplication and addition operation.