quoniammm:

The title_shape has been a 3D tensor.The error makes me very confused.Can you tell me why?


The title itself is a 3D tensor - The output of nn.Embedding will be a 3D tensor
Few concerns

I really dont know if MaxPool1d with kernel size 1 is useful - Won’t it be the same output as input?
Conv1d with an input of (1, 64, 3) and a 2D kernel of size (1, 64) seems odd. Maybe you meant a kernel of size 1. The you will get an output of size (1, 1, 3) at the end of the operation.

The error is due to the fact that the kernel size for your Conv1D is 2 dimension. It is not due to input being a 3D tensor.