I have been using the introductory example of matrix multiplication in TensorFlow.
matrix1 = tf.constant([[3., 3.]])
matrix2 = tf.constant([[2.],[2.]])
produ
Question: How to print the value of a Tensor object in TensorFlow?
Answer:
import tensorflow as tf
# Variable
x = tf.Variable([[1,2,3]])
# initialize
init = (tf.global_variables_initializer(), tf.local_variables_initializer())
# Create a session
sess = tf.Session()
# run the session
sess.run(init)
# print the value
sess.run(x)