code: def train_from_checkpoint(
      hparams: typing.Dict,
      trial_class: pytorch.PyTorchTrial,
      tmp_path: pathlib.Path,
      exp_config: typing.Dict,
      slots_per_trial: int = 1,
      steps: typing.Tuple[int, int] = (1, 1),
      batches_trained: int = 0,
      trial_args: typing.Optional[typing.Dict] = None,
  ) -> None:
      checkpoint_dir = str(tmp_path.joinpath("checkpoint"))
      tensorboard_path = tmp_path.joinpath("tensorboard")
  
      num_existing_checkpoints = len(os.listdir(checkpoint_dir))
  
      trial, trial_controller = create_trial_and_trial_controller(
          trial_class=trial_class,
          hparams=hparams,
          slots_per_trial=slots_per_trial,
          exp_config=exp_config,
          max_batches=steps[0] + steps[1],
          min_validation_batches=steps[0],
          min_checkpoint_batches=sys.maxsize,
          checkpoint_dir=checkpoint_dir,
          tensorboard_path=tensorboard_path,
          latest_checkpoint=os.listdir(checkpoint_dir)[0],
          steps_completed=batches_trained,
          expose_gpus=True,
          trial_args=trial_args,
      )
      trial_controller.run()
  
      assert (
          len(os.listdir(checkpoint_dir))
          == num_existing_checkpoints + 1
      ), "trial did not create a checkpoint"
  
file_path: determined/harness/tests/experiment/pytorch_utils.py
imports: import os
  import pathlib
  import random
  import sys
  import typing
  import uuid
  from torch.distributed import launcher
  import determined
  from determined import gpu, pytorch
  from tests.experiment import utils
label_desc: Use image node_id 3 for calling a global function with example usage: train_from_checkpoint(hparams, trial_class, tmp_path, exp_config, slots_per_trial, steps, batches_trained, trial_args) without return types