code: def test_schedules_num_steps_per_epoch(self):
      # ensure the learning rate schedule still maintains hat shape
      # if number of actual batches differs from parameter provided
      # in constructor
      for gradual_unfreezing in [True, False]:
          for discriminative_fine_tuning in [True, False]:
              for num_actual_steps_per_epoch in [7, 11]:
                  params = {
                      "num_epochs": 5,
                      "num_steps_per_epoch": 10,
                      "gradual_unfreezing": gradual_unfreezing,
                      "discriminative_fine_tuning": discriminative_fine_tuning,
                  }
                  lrs = self._run_scheduler_get_lrs(
                      params, num_actual_steps_per_epoch
                  )
                  first_layer_lrs = [rates[0] for rates in lrs]
                  second_layer_lrs = [rates[1] for rates in lrs]
  
                  if gradual_unfreezing:
                      assert (
                          max(
                              first_layer_lrs[
                                  :num_actual_steps_per_epoch
                              ]
                          )
                          < 1e-8
                      )
                      assert (
                          min(
                              first_layer_lrs[
                                  :num_actual_steps_per_epoch
                              ]
                          )
                          > -1e-8
                      )
                      assert is_hat_shaped(
                          first_layer_lrs[num_actual_steps_per_epoch:]
                      )
                      assert is_hat_shaped(
                          second_layer_lrs[:num_actual_steps_per_epoch]
                      )
                      assert is_hat_shaped(
                          second_layer_lrs[num_actual_steps_per_epoch:]
                      )
                  else:
                      assert is_hat_shaped(first_layer_lrs)
                      assert is_hat_shaped(second_layer_lrs)
  
imports: from collections import OrderedDict
  from copy import deepcopy
  from typing import Any, Dict, List, Tuple
  import torch
  import pytest
  from allennlp.common import Lazy, Params
  from allennlp.common.checks import ConfigurationError
  from allennlp.common.testing import AllenNlpTestCase
  from allennlp.data.data_loaders import SimpleDataLoader
  from allennlp.training import Trainer
  from allennlp.training.learning_rate_schedulers import LearningRateScheduler, SlantedTriangular
  from allennlp.training.optimizers import Optimizer
label_desc: Use image node_id 8 for calling the SlantedTriangularTest obj's underlying member method code with example usage: obj.test_schedules_num_steps_per_epoch() without return types