code: def _check_lr(name, optimizer, lr):
      
      n = len(optimizer.param_groups)
      if not isinstance(lr, (list, tuple)):
          return lr * np.ones(n)
  
      if len(lr) != n:
          raise ValueError("{} lr values were passed for {} but there are "
                           "{} param groups.".format(n, name, len(lr)))
      return np.array(lr)
docs: Return one learning rate for each param group.