Tensorflow入门
import tensorflow as tf
#创建一个常亮m1
m1 = tf.constant([[3,3]])
#创建一个常量m2
m2 = tf.constant([[2],[3]])
#矩阵相乘
product = tf.matmul(m1,m2)
print(product)
#定义一个会话,启动默认图
sess = tf.Session()
#调用sess的run方法
result = sess.run(product)
print(result)
sess.close()
with tf.Session() as sess:
result = sess.run(product)
print(result)
QQ 3087438119