Einsturing:

Is the L - sequence length a concept in NLP?


Yes, a sequence length is often used in NLP (e.g. you can see words as a sequence forming a sentence) but is not limited to NLP (e.g. EEG readings can be processed in a similar way).



 Einsturing:

Therefore, the possible reason is that the dimension by torch.cat() is used as L, which causes these three Tensors to play different roles in the calculation of LSTM, which leads to the different predictions, right?


Yes, that could be the case. This post explains it in more detail. While the processing would be different, I wouldn’t claim that only a specific sequence input would work, but you would need to run some experiments.