While optimizer.step() wouldn’t update these parameters (since you’ve never passed them to the optimizer), these parameters would still accumulate the gradients.
This is of course wasteful, as these gradients are not needed (and Autograd could potentially stop the backward pass before reaching these parameters). Additionally to that, you would have to be careful, if you are planning to update these parameters in the future, e.g. by adding these parameters via optimizer.add_param_group, since they would already contain (large) gradients.