Hi, I just checked your code, and it seems that nothing is wrong with your pack and unpack. I met the same issue that model just didn’t learn anything and loss didn’t go down.
In my case, I finally found that my lr was set too large (lr=1e-3). When set lr=1e-5, and applied update with step, my model start learn something after step>60.
so, I don’t know the value of lr in your model. Do you attemp let lr down to smaller?