Solved by DoubtWang in post #5 
              
              
                if u set batch_first=True, the shape of input must be (B, L, D). 

batch_first  – If  True , then the input and output tensors are provided as (batch, seq, feature). Default:  False