I' m following this Manipulating matrix elements in tensorflow. using tf.scatter_update. But my problem is: What happens if my tf.Variable is 2D? Let's say:
a = tf.Variable(initial_value=[[0, 0, 0, 0],[0, 0, 0, 0]])
How can i update for example the first element of every row and assign to that the value 1?
I tried something like
for line in range(2):
sess.run(tf.scatter_update(a[line],[0],[1]))
but it fails (i was expecting that) and gives me the error:
TypeError: Input 'ref' of 'ScatterUpdate' Op requires l-value input
How can i fix that kind of problems?
`