leckofunny:

So what would be good way to reshape the tensor to sequence length first in this case?


The conversion between sequence first and batch first is a usually a .permute(1, 0, 2) (could also be written as transpose, but to me permute better captures the intent).