我一直在使用 TensorFlow 中矩阵乘法的介绍性示例。
matrix1 = tf.constant([[3., 3.]])
matrix2 = tf.constant([[2.],[2.]])
product = tf.matmul(matrix1, matrix2)
当我打印产品时,它会将其显示为一个Tensor
对象:
<tensorflow.python.framework.ops.Tensor object at 0x10470fcd0>
但我怎么知道 的价值product
?
以下没有帮助:
print product
Tensor("MatMul:0", shape=TensorShape([Dimension(1), Dimension(1)]), dtype=float32)
我知道图形在 上运行Sessions
,但有没有什么办法可以检查Tensor
对象的输出而不在 a 中运行图形session
?