RuntimeError: stack expects each tensor to be equal size, but got [12] at entry 0 and [35] at entry 1

I think the tokenized texts are not of the same length as indicated by this warning message.

If you adjust the input length to be the same at each batch, I think the error will go away.

3 Likes