Skip to content

Instantly share code, notes, and snippets.

@nithyadurai87
Last active December 12, 2019 14:54
Show Gist options
  • Save nithyadurai87/a2b16555bbe599d089969bf43318265e to your computer and use it in GitHub Desktop.
Save nithyadurai87/a2b16555bbe599d089969bf43318265e to your computer and use it in GitHub Desktop.
import tensorflow as tf
a = tf.get_variable("v3", [3,3])
b = tf.get_variable("v4", initializer=tf.constant([[3, 3],[4, 4]]))
x = tf.Variable(1)
y = tf.constant(2)
r = tf.assign(x,tf.multiply(x,y))
with tf.Session() as s:
#print(s.run(a))
s.run(tf.global_variables_initializer())
print(s.run(a))
print(s.run(b))
for i in range(10):
print (s.run(r))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment