@ptrblck thank you once again for your detailed answer.
I am building something more complex, a version of an RNN model, specifically, a VRNN model (arxiv), where the computation of earlier sequence elements are used by the computations of the following elements, thus they cannot happen simultaneously.
Generally, I think that a for loop is the most basic way of doing things, which is the reason of the post.I guess that, in this case, this for loop is the best you can do.