In the default settings nn.BatchNorm will have affine trainable parameters (gamma and beta in the original paper or weight and bias in PyTorch) as well as running estimates.
If you don’t want to use the batch statistics and update the running estimates, but instead use the running stats, you should call m.eval() as shown in your example.
However, this won’t disable the gradients for weight and bias!
If you don’t want to train them at all, you can just specify affine=False. Otherwise you should treat them as trainable parameters.