1. 程式人生 > >tensorflow教程:變數

tensorflow教程:變數

import tensorflow as tf
a = tf.Variable(tf.random_uniform(shape=[10, 10]))

with tf.Session() as sess:
 #必須呼叫,否則a沒辦法初始化值
sess.run(tf.global_variables_initializer())

print sess.run(a)