1

Following the code,

normal_rv=tf.Variable(tf.truncated_normal([2,3], stddev=0.1))
init_op=tf.initialize_all_variables()

with tf.Session() as sess:
    sess.run(init_op)
    print(sess.run(normal_rv))

(https://stackoverflow.com/a/37543184/1279459)

we can print the values of the tensor. However, how can we check those values after or before the printing command at the debug mode?

Community
  • 1
  • 1
cerebrou
  • 5,353
  • 15
  • 48
  • 80

1 Answers1

0

A small modification to the code where we assign the output of the sess.run(normal_rv) to a new variable leads to the answer:

normal_rv=tf.Variable(tf.truncated_normal([2,3], stddev=0.1))
init_op=tf.initialize_all_variables()

with tf.Session() as sess:
    res=sess.run(init_op)
    print(res)

enter image description here

cerebrou
  • 5,353
  • 15
  • 48
  • 80