I guess you are passing your output directly to your criterion, which seems to be nn.CrossEntropyLoss.
Note that your model returns two outputs, i.e. out and self.hidden.
You could assign two output variables to your model’s output:
output, hidden = model(data)

or pass output[0] to your criterion.