练习tensorflow矩阵乘法
import tensorflow as tf
matrix1 = tf.constant([[1, 2, 3]
, [4, 5, 6]])
matrix2 = tf.constant([[1, 1]
, [1, 1]
, [1, 1]])
#矩阵乘法
product = tf.matmul(matrix1, matrix2)
with tf.Session() as sess:
result = sess.run(product)
print (result)
[[ 6 6] [15 15]]