import tensorflow as tf
#with 结构与不用with结构:
#1.不用with结构需要自己关闭程序
#2.with不用自己关闭
matrix1=tf.constant([[3,3]])
matrix2=tf.constant([[2],[2]])
product=tf.matmul(matrix1,matrix2)#矩阵乘法
#model1:
sess=tf.Session()
result=sess.run(product)
print(result)
sess.close
#model2:
with tf.Session()as sess:
result1=sess.run(product)
print(result1)