code: def test_scaler_checkpointing_and_restoring(
      self, trial_class, tmp_path: pathlib.Path
  ) -> None:
      if (
          trial_class is pytorch_onevar_model.OneVarApexAMPTrial
          and not HAVE_APEX
      ):
          pytest.skip("Apex not available")
  
      updated_hparams = {
          "global_batch_size": 1,
          **self.hparams,
      }
  
      tm_a, tm_b = self.checkpoint_and_check_metrics(
          trial_class=pytorch_onevar_model.OneVarApexAMPTrial,
          hparams=updated_hparams,
          tmp_path=tmp_path,
          steps=(1, 1),
      )
  
      amp_metrics_test(trial_class, tm_a)
      amp_metrics_test(trial_class, tm_b)
  
imports: import contextlib
  import importlib
  import io
  import os
  import pathlib
  import sys
  import typing
  from unittest import mock
  import numpy
  import pytest
  import torch
  from _pytest import monkeypatch
  from torch.distributed import launcher
  import determined
  from determined import pytorch
  from tests.experiment import pytorch_utils, utils
  from tests.experiment.fixtures import pytorch_onevar_model
label_desc: Use image node_id 6 for calling the TestPyTorchTrial obj's underlying member method code with example usage: obj.test_scaler_checkpointing_and_restoring(trial_class, tmp_path) without return types