Sample code is here @ku294714 ,
optimizer = optim.SGD(net.parameters(), lr=0.1)
scheduler = optim.lr_scheduler.StepLR(optimizer, step_size=5, gamma=0.5)

for i in range(15):
    lr = scheduler.get_last_lr()[0] # latest pytorch 1.5+ uses get_last_lr,  previously it was get_lr iirc;
    lr1 = optimizer.param_groups[0]["lr"] # either the above line or this, both should do the same thing
    print(i, lr, lr1)
    scheduler.step()