Consider the case where I have constructed the optimizer as follows
model = load_some_pretrained_model()
optimizer = torch.optim.some_optim(model.parameters(), arg1, arg2)

# Later I Set required_grad of some params as False.
for param in model.parameters():
    if param in arbit_list:
        param.requires_grad = False

# ... Some more code for doing training
optimizer.step()

I wanted to confirm if the changes to requires_grad is reflected in the optimizer.step() as well. I do understand the graph is reconstructed every time the code is run, thus it makes sense for the optimizer to check before calling a step on the parameter. But just in case there was some optimization to not check it every time …