Hi everyone,
Recently, I asked this 60 question. Though I got an answer for my original question, last comment 8 confused me a little bit.
I don’t understand the difference between these two cases:

According to answers, this is a safe operation:

bs,seq_len,input_size= 5,20,128
x = torch.rand(bs,seq_len,input_size)
torch.reshape(x,(x.shape[0],x.shape[1],1,x.shape[2])


However, if I want to change the shape (bs, seq_len, input_size) matrix x into (seq_len, bs, input_size), it is said that I should use x.permute(1, 0, 2) rather than reshape.

Why these two cases differs from each other ?