Skip to content

Commit

Permalink
assigning when executing
Browse files Browse the repository at this point in the history
  • Loading branch information
LordSomen committed Aug 31, 2018
1 parent 7c6f9f2 commit 3522051
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Tensorflow/tf_assign.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#%%
import tensorflow as tf
x = tf.Variable(tf.random_uniform(shape=(),minval=0.0,maxval=1.0))
x_new_val = tf.placeholder(shape=(),dtype=tf.float32)
x_assign = tf.assign(x, x_new_val)
with tf.Session():
x.initializer.run()
print(x.eval())
x_assign.eval(feed_dict={x_new_val: 5.0})
print(x.eval())

0 comments on commit 3522051

Please sign in to comment.