Can use nn.LSTM with dropout=0.5 in training step but without dropout in evaluate step?

Can we use nn.LSTM with dropout=0.5 in training step but without dropout in evaluate step?
If I use dropout=0.5 to create the nn.LSTM then the dropout will always there(the number of my lstm is more than 2).

How to deal with this question? Or I should use the LSTMcell ?
Thanks.

Are you sure the dropout is always there? That would be so stupid.

Have you tried testing it?

model.eval()
out1 = model(input)
out2 = model(input)
# then check whether out1 and out2 are the same

Oh, thanks, I read the doc. There is the train mode option…:sweat_smile: