Hi,
When you have a single data, still it means you have a batch of data, but size of batch is 1. Note that in almost all math libraries, rows correspond to observations(samples) and columns correspond to features, so when you pass a single output with length of L, model considers it as L different samples with 1 feature. To solve this issue, just add another dimension to your input.



 Mengran_Wang:

scores = model(preprocess_seq)


Can be replaced by:
scores = model(preprocess_seq.unsqeeuze(0))

Bests