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

前端 未结 21 1879
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-22 07:44

I have been using the introductory example of matrix multiplication in TensorFlow.

matrix1 = tf.constant([[3., 3.]])
matrix2 = tf.constant([[2.],[2.]])
produ         


        
21条回答
  •  温柔的废话
    2020-11-22 08:16

    You can use Keras, one-line answer will be to use eval method like so:

    import keras.backend as K
    print(K.eval(your_tensor))
    

提交回复
热议问题