Created
March 12, 2019 08:13
-
-
Save MSWon/b5db609311b7b44554b2886cf4f49472 to your computer and use it in GitHub Desktop.
padding zero vector not trainable via scatter_update
This file contains 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 | |
g = tf.Graph() | |
with g.as_default(): | |
a = tf.Variable(initial_value=[[1, 2, 4, 0],[2, 4, 5, 8]]) | |
b = tf.scatter_update(a, [0], [[0, 0, 0, 0]]) | |
with tf.Session(graph=g) as sess: | |
sess.run(tf.initialize_all_variables()) | |
print(sess.run(a)) | |
print(sess.run(b)) | |
print(sess.run(a)) | |
''' | |
[[1 2 4 0] | |
[2 4 5 8]] | |
[[0 0 0 0] | |
[2 4 5 8]] | |
[[0 0 0 0] | |
[2 4 5 8]] | |
''' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment