Loading...
「ツール」は右上に移動しました。
利用したサーバー: wtserver1
8いいね 478 views回再生

Tensorflow: 12 Variables and Placeholders

tf.compat.v1.disable_eager_execution()
x = tf.compat.v1.placeholder(tf.float32)

y = tf.matmul(x, x)
sess = tf.compat.v1.Session()
print(sess.run(y)) # ERROR: will fail because x was not fed.
rand_array = np.random.rand(1024, 1024)
print(sess.run(y, feed_dict={x: rand_array})) # Will succeed.

コメント