code: def test_torch_save_load(dirname):
      lambda_state_parameter_scheduler = LambdaStateScheduler(
          param_name="custom_scheduled_param",
          lambda_obj=LambdaState(initial_value=10, gamma=0.99),
          create_new=True,
      )
  
      filepath = (
          Path(dirname) / "dummy_lambda_state_parameter_scheduler.pt"
      )
      torch.save(lambda_state_parameter_scheduler, filepath)
      loaded_lambda_state_parameter_scheduler = torch.load(filepath)
  
      engine1 = Engine(lambda e, b: None)
      lambda_state_parameter_scheduler.attach(
          engine1, Events.EPOCH_COMPLETED
      )
      engine1.run([0] * 8, max_epochs=2)
      torch_testing_assert_close(
          getattr(engine1.state, "custom_scheduled_param"),
          LambdaState(initial_value=10, gamma=0.99)(2),
      )
  
      engine2 = Engine(lambda e, b: None)
      loaded_lambda_state_parameter_scheduler.attach(
          engine2, Events.EPOCH_COMPLETED
      )
      engine2.run([0] * 8, max_epochs=2)
      torch_testing_assert_close(
          getattr(engine2.state, "custom_scheduled_param"),
          LambdaState(initial_value=10, gamma=0.99)(2),
      )
      torch_testing_assert_close(
          getattr(engine1.state, "custom_scheduled_param"),
          getattr(engine2.state, "custom_scheduled_param"),
      )
  
imports: import re
  from pathlib import Path
  from unittest.mock import patch
  import pytest
  import torch
  import torch.nn
  from packaging.version import Version
  from ignite.engine import Engine, Events
  from ignite.handlers.state_param_scheduler import ExpStateScheduler, LambdaStateScheduler, MultiStepStateScheduler, PiecewiseLinearStateScheduler, StepStateScheduler
  from bisect import bisect_right
label_desc: Use image node_id 13 for calling a global function with example usage: test_torch_save_load(dirname) without return types