tensor

How to print the value of a Tensor object in TensorFlow?

蹲街弑〆低调 提交于 2019-11-25 23:24:18
问题 I have been using the introductory example of matrix multiplication in TensorFlow. matrix1 = tf.constant([[3., 3.]]) matrix2 = tf.constant([[2.],[2.]]) product = tf.matmul(matrix1, matrix2) When I print the product, it is displaying it as a Tensor object: <tensorflow.python.framework.ops.Tensor object at 0x10470fcd0> But how do I know the value of product ? The following doesn\'t help: print product Tensor(\"MatMul:0\", shape=TensorShape([Dimension(1), Dimension(1)]), dtype=float32) I know