Kalle:

Does train() and eval() change the model.state_dict()?


No, it doesn’t. Calling model.train() or model.eval() will change the internal self.training flag to True or False, respectively. This flag is then used in some modules (e.g. nn.Dropout and batchnorm layers) so switch the behavior in their forward method.