import tensorflow as tf

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

product = tf.matmul(matrix1,matrix2)  #矩阵相乘

# sess = tf.Session()
# result = sess.run(product)
# print(result)
# sess.close()

with tf.Session() as sess:
    result2 = sess.run(product)
    print(result2)

[[12]]

  

相关文章:

  • 2021-10-29
  • 2021-11-14
  • 2021-09-01
  • 2022-12-23
  • 2022-12-23
  • 2022-01-03
  • 2022-01-27
猜你喜欢
  • 2021-12-06
  • 2021-04-25
  • 2021-11-30
相关资源
相似解决方案