OK I’m thinking that instead of using all the already computed hs, I probably need to define both x(t) and h(t) as gradient-requiring inputs, then evolve to h(t+1) and take the gradient w.r.t. h(t) for each time step… can anyone confirm and/or help out a bit?