code: def _test(
      self,
      inputs,
      class_tmpdir,
      checkpoint_tag,
      mp_size,
      pp_size,
      mp_resize,
      pp_resize,
  ):
      args_defaults = {
          "num_layers": 8,
          "hidden_size": 128,
          "num_attention_heads": 8,
          "max_position_embeddings": 128,
      }
  
      topo = get_topology(mp_resize, pp_resize, mp_resize * pp_resize)
      gpt2_pipe_model = GPT2ModelPipe(
          num_layers=8,
          num_stages=pp_resize,
          mp_size=mp_resize,
          args_others=args_defaults,
          topo=topo,
      )
      model = get_deepspeed_model(gpt2_pipe_model)
  
      with torch.no_grad():
          model.load_checkpoint(
              class_tmpdir,
              tag=checkpoint_tag,
              load_optimizer_states=False,
              load_lr_scheduler_states=False,
          )
          inputs = [
              x.to(get_accelerator().device_name()) for x in inputs
          ]
          if model.is_first_stage() or model.is_last_stage():
              loader = RepeatingLoader([(inputs[0], 0)])
              data_iter = iter(loader)
          else:
              data_iter = None
  
          test = model.eval_batch(
              data_iter=data_iter,
              compute_loss=False,
              reduce_output=None,
          )
  
          if test is not None:
              # test should be [[hidden, True]]]
              assert len(test) == 1
              assert len(test[0]) == 1
              assert torch.is_tensor(test[0][0])
              test = test[0][0].cpu()
              load_path = os.path.join(
                  class_tmpdir, f"output-{checkpoint_tag}.pt"
              )
              baseline = torch.load(load_path)
              assert torch.allclose(
                  baseline, test, atol=1e-03
              ), f"Baseline output {baseline} is not equal to save-then-load output {test}"
  
imports: import os
  import torch
  import deepspeed
  import pytest
  import random
  import numpy
  import deepspeed.comm
  from unit.common import DistributedTest, DistributedFixture
  from unit.megatron_model import get_megatron_version
  from unit.megatron_model import MockGPT2ModelPipe
  from deepspeed.utils import RepeatingLoader
  from deepspeed.accelerator import get_accelerator
  from deepspeed.runtime.utils import required_torch_version
label_desc: Use image node_id 1 for calling the TestConfigurableResizePP obj's underlying member method code with example usage: obj._test(inputs, class_tmpdir, checkpoint_tag, mp_size, pp_size, mp_resize, pp_resize) without return types