import os
os.environ[‘TF_CPP_MIN_LOG_LEVEL‘]=‘2‘
import tensorflow as tf
matrix1 = tf.constant([[3,3]])
matrix2 = tf.constant([[2],[2]])
protuct = tf.matmul(matrix1,matrix2)
# sess = tf.Session()
# result = sess.run(protuct)
# print(result)
# sess.close()
with tf.Session() as sess:
result = sess.run(protuct)
print(result)
时间: 2024-10-09 03:50:28