So I’ve read the official documentation and searched a few of related questions about BN layer at evaluation time. I wonder what does function eval() exactly do for BN cause when run it, it seems no attributes of BN class changes.
here is my jupyter code:
for m in model.modules():
    if isinstance(m,nn.BatchNorm2d):
        m.eval()
        print(m)

and here is the result:
BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
BatchNorm2d(64, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
BatchNorm2d(256, eps=1e-05, momentum=0.1, affine=True, track_running_stats=True)
……

So you can see the track_running_stats attribute is still True, and the requires_grad flags for weights are True as well. Then what does eval() do?
Further more, say I can only run a very small batch_size, like 1 because of limited GPU memory during training. What should I do? set the requires_grad to False or track_running_stats to False? Or both?