docstr: Test that learning rate was set correctly.
docstr_tok: ["Test","that","learning","rate","was","set","correctly","."]
code: def assert_lr_correct(
      self,
      optimizer,
      targets,
      epochs,
      min_lr,
      max_lr,
      base_period,
      period_mult,
  ):
      """Test that learning rate was set correctly."""
      targets = (
          [targets] if len(optimizer.param_groups) == 1 else targets
      )
      scheduler = WarmRestartLR(
          optimizer, min_lr, max_lr, base_period, period_mult
      )
      for epoch in range(epochs):
          optimizer.step()  # suppress warning about .step call order
          scheduler.step(epoch)
          for param_group, target in zip(
              optimizer.param_groups, targets
          ):
              assert param_group["lr"] == pytest.approx(target[epoch])
  
imports: from unittest.mock import Mock
  import numpy
  import pytest
  from sklearn.base import clone
  from torch.optim import SGD
  from torch.optim.lr_scheduler import CosineAnnealingLR
  from torch.optim.lr_scheduler import ExponentialLR
  from torch.optim.lr_scheduler import LambdaLR
  from torch.optim.lr_scheduler import MultiStepLR
  from torch.optim.lr_scheduler import ReduceLROnPlateau
  from torch.optim.lr_scheduler import StepLR
  from torch.optim.lr_scheduler import CyclicLR
  from skorch import NeuralNetClassifier
  from skorch.callbacks.lr_scheduler import WarmRestartLR, LRScheduler
label_desc: Use image node_id 1 for calling the TestWarmRestartLR obj's underlying member method code with example usage: obj.assert_lr_correct(optimizer, targets, epochs, min_lr, max_lr, base_period, period_mult) without return types