## sess Session 会话控制的简单运用
## sess 每run一次,便执行一次结构
## sess.close()
import tensorflow as tf
matrix1 = tf.constant([[3,3]]) # 1*3 矩阵
matrix2 = tf.constant([[2],
[2]]) # 2*1 矩阵
product = tf.matmul(matrix1,matrix2) # matrix multiply np.dot(m1,m2)
### method 1
sess = tf.Session()
result = sess.run(product)
print(result)
sess.close()
### method 2
with tf.Session() as sess:
result2 = sess.run(product)
print(result2)
# 已经自动close