练习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]]
TensorFlow矩阵乘法实战
本文演示了如何使用TensorFlow进行矩阵乘法操作,并通过具体示例代码展示了两个矩阵相乘的过程及其结果。
5924

被折叠的 条评论
为什么被折叠?



