Created
May 17, 2020 12:02
-
-
Save ryaninhust/66963239346def231d8fd349f7b1b1b0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import tensorflow as tf | |
import numpy as np | |
vocabulary_size = 10 | |
embeddings = tf.placeholder(tf.float32, shape=[vocabulary_size]) | |
a = embeddings | |
c = a*2 | |
with tf.Session() as sess: | |
sess.run(tf.initialize_all_variables()) | |
#1 | |
a_,c_ = sess.run([a, c], feed_dict={embeddings: np.random.rand(10)}) | |
print(c_/a_) | |
#2 | |
a_ = sess.run(a, feed_dict={embeddings: np.random.rand(10)}) | |
c_ = sess.run(c, feed_dict={a: a_}) | |
print(c_/a_) | |
#3 | |
a_ = sess.run(a, feed_dict={embeddings: np.random.rand(10)}) | |
c_ = sess.run(c, feed_dict={embeddings: np.random.rand(10)}) | |
print(c_/a_) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment