Related to this jupyter notebook: https://github.com/ematvey/tensorflow-seq2seq-tutorials/blob/master/2-seq2seq-advanced.ipynb
At In[17] you are setting the weights W (and bias b) once and then you use them in two different places
First, you use them inside loop function at In[20] and then you use them again at In[23].
You are doing the same thing, aren't you? You want to calculate, at In[23] what you have already calculated inside In[20] but you have trouble extracting it?...
Cannot understand what is going on exactly. Could you help clarify it?