First, you posted this in Convolutional Neural Networks (DLS course 4) but your query belongs to DLS course 5. Kindly change the category as instructed here.
So, what is sq?
Hint: In a notebook, it is said that “\tanh(W_{ax}x^{\langle t \rangle}+W_{aa} a^{\langle t-1 \rangle} + b_{a}) was computed and saved as a_next in the forward pass.”
Also, note that sharing your code is not allowed. Just sharing your full error will suffice.