Repository: pytorch
Issue: UserWarning: Seems like `optimizer.step()` has been overridden after learning rate scheduler initialization. Please, make sure to call `optimizer.step()` before `lr_scheduler.step()`. See more details at https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate   warnings.warn("Seems like `optimizer.step()` has been overridden after learning rate scheduler
Labels: needs reproduction,module: optimizer,triaged,module: LrScheduler

### 🐛 Describe the bug

I am following the same way that is provided [here ](https://pytorch.org/docs/1.10.1/generated/torch.optim.lr_scheduler.StepLR.html#torch.optim.lr_scheduler.StepLR) for using `StepLR`:
```python 

scheduler = StepLR(optimizer, step_size=30, gamma=0.1)
for epoch in range(100):
    train(...)
    validate(...)
    scheduler.step()
```
but I keep getting the following warning which is very annoying

``` python
UserWarning: Seems like `optimizer.step()` has been overridden after learning rate scheduler initialization. Please, make sure to call `optimizer.step()` before `lr_scheduler.step()`. See more details at https://pytorch.org/docs/stable/optim.html#how-to-adjust-learning-rate
  warnings.warn("Seems like `optimizer.step()` has been overridden after learning rate scheduler
```


also the output of `collect_env` is:

```
Versions of relevant libraries:
[pip3] numpy==1.21.4
[pip3] torch==1.10.0
[pip3] torchaudio==0.10.0
[pip3] torcheck==1.0.1
[pip3] torchinfo==1.5.4
[pip3] torchvision==0.11.1
[conda] blas                      1.0                         mkl    defaults
[conda] cudatoolkit               11.3.1               h2bc3f7f_2    defaults
[conda] mkl                       2021.4.0           h06a4308_640    defaults
[conda] mkl-service               2.4.0            py39h7e14d7c_0    conda-forge
[conda] mkl_fft                   1.3.1            py39h0c7bc48_1    conda-forge
[conda] mkl_random                1.2.2            py39hde0f152_0    conda-forge
[conda] numpy                     1.21.2           py39h20f2e39_0    defaults
[conda] numpy-base                1.21.2           py39h79a1101_0    defaults
[conda] pytorch                   1.10.0          py3.9_cuda11.3_cudnn8.2.0_0    pytorch
[conda] pytorch-mutex             1.0                        cuda    pytorch
[conda] torchaudio                0.10.0               py39_cu113    pytorch
[conda] torchinfo                 1.5.4              pyhd8ed1ab_0    conda-forge
[conda] torchvision               0.11.1               py39_cu113    pytorch
```

### Versions

also the output of `collect_env` is:

```
Versions of relevant libraries:
[pip3] numpy==1.21.4
[pip3] torch==1.10.0
[pip3] torchaudio==0.10.0
[pip3] torcheck==1.0.1
[pip3] torchinfo==1.5.4
[pip3] torchvision==0.11.1
[conda] blas                      1.0                         mkl    defaults
[conda] cudatoolkit               11.3.1               h2bc3f7f_2    defaults
[conda] mkl                       2021.4.0           h06a4308_640    defaults
[conda] mkl-service               2.4.0            py39h7e14d7c_0    conda-forge
[conda] mkl_fft                   1.3.1            py39h0c7bc48_1    conda-forge
[conda] mkl_random                1.2.2            py39hde0f152_0    conda-forge
[conda] numpy                     1.21.2           py39h20f2e39_0    defaults
[conda] numpy-base                1.21.2           py39h79a1101_0    defaults
[conda] pytorch                   1.10.0          py3.9_cuda11.3_cudnn8.2.0_0    pytorch
[conda] pytorch-mutex             1.0                        cuda    pytorch
[conda] torchaudio                0.10.0               py39_cu113    pytorch
[conda] torchinfo                 1.5.4              pyhd8ed1ab_0    conda-forge
[conda] torchvision               0.11.1               py39_cu113    pytorch
```

cc @vincentqb @jbschlosser @albanD