Let's say I have a tensor input of shape 100x1 and another tensor inplace of shape 20x1 and an index_tensor of shape 100x1. The index_tensor represents places of input where I want to insert the values from inplace. The index_tensor has only 20 True values and rest of its values are False. I try to explain the desired operation below.
How can this operation be achieved using tensorflow.
assign operation works only for tf.Variable while I want to apply it on the output of tf.nn.rnn.
I read one can use tf.scatter_nd but it requires inplace and index_tensor to be of the same shape.
The reason I want to use this is that I get an output from rnn, then I extract some values from and feed them to some dense layer and this output from dense layer, I want to insert back in the original tensor which I obtained from rnn operation. I do not want to apply dense layer operation on the whole output from rnn due to certain reasons and if I do not insert the result of dense layer back in output of rnn, then the dense layer is kind of useless.
Any suggestion will be really appreciated.