What if you still pass frozen parameters to optimizer?

I want to make sure I understand the relationship between

setting requires_grad = False

AND

not passing the layer’s parameters into the optimizer, as discussed here.

My question is if requires_grad = False, what will the optimizer do with those parameters? Does it ever make sense to set requires_grad = False and still pass the frozen parameters to the optimizer?

Nevermind, this question doesn’t even make any sense. If you try to do this, you will get the error:

ValueError: optimizing a parameter that doesn't require gradients