Backpropagation and thus the gradient calculation will also work after calling model.eval() but as previously described the forward pass will be different. E.g. while the batchnorm layers will use the running_mean and running_var to normalize the data, the affine parameters (weight and bias) will still be trained and will get gradients.