I don’t think this is possible with the Trainer class as it is, but you can derive this class and then change the relevant methods.
In your case, I think you need to change the evaluation_loop method and delete the model.eval() line.
I think it would be better to keep the model.eval() line and set only the Dropout layer to train mode like it is shown in this post 3.
There might be some more changes that you need to make.
You can find the Trainer source code here.
Hope this helps  .