I don’t know what exactly changed in the code execution, but based on the RuntimeError it seems your tensors have now an additional dimension. tensor.t() would transpose a 2D tensor and you should be able to use permute instead on 3D tensors.
However, it might also be a good idea to try to check why the number of dimension changed at all.