code: def test_linear_scheduler(self):
      # Testing step_constant
      net = ToyNet(value=-1)
      engine = Engine(lambda e, b: None)
      ParamSchedulerHandler(
          parameter_setter=net.set_value,
          value_calculator="linear",
          vc_kwargs={
              "initial_value": 0,
              "step_constant": 2,
              "step_max_value": 5,
              "max_value": 10,
          },
          epoch_level=True,
          event=Events.EPOCH_COMPLETED,
      ).attach(engine)
      engine.run([0] * 8, max_epochs=2)
      assert_allclose(net.get_value(), 0)
  
      # Testing linear increase
      net = ToyNet(value=-1)
      engine = Engine(lambda e, b: None)
      ParamSchedulerHandler(
          parameter_setter=net.set_value,
          value_calculator="linear",
          vc_kwargs={
              "initial_value": 0,
              "step_constant": 2,
              "step_max_value": 5,
              "max_value": 10,
          },
          epoch_level=True,
          event=Events.EPOCH_COMPLETED,
      ).attach(engine)
      engine.run([0] * 8, max_epochs=3)
      assert_allclose(net.get_value(), 3.333333, atol=0.001, rtol=0.0)
  
      # Testing max_value
      net = ToyNet(value=-1)
      engine = Engine(lambda e, b: None)
      ParamSchedulerHandler(
          parameter_setter=net.set_value,
          value_calculator="linear",
          vc_kwargs={
              "initial_value": 0,
              "step_constant": 2,
              "step_max_value": 5,
              "max_value": 10,
          },
          epoch_level=True,
          event=Events.EPOCH_COMPLETED,
      ).attach(engine)
      engine.run([0] * 8, max_epochs=10)
      assert_allclose(net.get_value(), 10)
  
file_path: MONAI/tests/test_handler_parameter_scheduler.py
imports: from __future__ import annotations
  import unittest
  from ignite.engine import Engine, Events
  from torch.nn import Module
  from monai.handlers.parameter_scheduler import ParamSchedulerHandler
  from tests.utils import assert_allclose
label_desc: Use image node_id 1 for calling the TestHandlerParameterScheduler obj's underlying member method code with example usage: obj.test_linear_scheduler() without return types