I think that got asked before. I also don’t see why the encoding is done via a loop and and not giving the GRU layer the full sentence.
I assume one could in principle use a GRUCell. The only difference when it comes to feeding it step by step is that GRU supports multiple layers, but I don’t even know if this is meaningful without the full sequence.
I’m also pretty sure that the first version of the tutorial didn’t use a loop for the encoding since I also used the tutorial as a template back then.