假期学习四
tensorflow基本计算单元-变量
视频代码
import tensorflow as tf
a=3
w = tf.Variable([[0.5,1.0]])
x = tf.Variable([[2.0],[1.0]])
y = tf.matmul(w,x)
init = tf.global_variables_initializer()
with tf.Session() as sess:
sess.run(init)
print(y.eval())
tensorflow运行需要自己的转化为自己的变量类型才行