Skip to content

Instantly share code, notes, and snippets.

View caisq's full-sized avatar

Shanqing Cai caisq

View GitHub Profile
@pradeepbn
pradeepbn / tensorflow_debugging_example.py
Last active April 28, 2018 09:12
Example to show how to use tf.Print and tfdbg
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)