Thank you for your quick answer ! I’m also checking the following thread ‘model.eval()’ vs ‘with torch.no_grad()’ 3 where they say that the recommended way should be torch.no_grad() (and should be faster). At the end, It’s not very clear. What should we do ?
I didn’t read the tutorial but in the code, you can see at line 451 self.dropout = nn.Dropout(self.dropout_p) and at line 699 with torch.no_grad(): and not an encoder.eval() or decoder.eval(). I could also find similarities with other tutorials.