Do you have any random operations using the functional API, i.e. F.dropout()?
If so, could you check to set the training parameter accordingly, as it might not be set by model.eval().
How are you calculating pred inside your model?
As a small side note: you shouldn’t use model.forward() but rather call the model directly model(test_x).