code: def test_horovod_torch_mnist_gpu_checkpoint(ray_start_4_cpus_2_gpus):
      def checkpointing_func(config):
          net = torch.nn.Linear(in_features=8, out_features=16)
          net.to("cuda")
  
          with TemporaryDirectory() as tmpdir:
              torch.save(
                  net.state_dict(),
                  os.path.join(tmpdir, "checkpoint.pt"),
              )
              train.report(
                  {"metric": 1},
                  checkpoint=Checkpoint.from_directory(tmpdir),
              )
  
      num_workers = 2
      trainer = HorovodTrainer(
          checkpointing_func,
          scaling_config=ScalingConfig(
              num_workers=num_workers, use_gpu=True
          ),
      )
      trainer.fit()
  
imports: import os
  from tempfile import TemporaryDirectory
  import pytest
  import torch
  from ray import train
  from ray.air.constants import TRAINING_ITERATION
  from ray.train import Checkpoint, ScalingConfig
  from ray.train.examples.horovod.horovod_example import train_func
  from ray.train.examples.pytorch.torch_fashion_mnist_example import train_func_per_worker
  from ray.train.examples.tf.tensorflow_mnist_example import train_func
  from ray.train.horovod.horovod_trainer import HorovodTrainer
  from ray.train.tensorflow.tensorflow_trainer import TensorflowTrainer
  from ray.train.tests.test_tune import torch_fashion_mnist, tune_tensorflow_mnist
  from ray.train.torch.torch_trainer import TorchTrainer
label_desc: Use image node_id 4 for calling a global function with example usage: test_horovod_torch_mnist_gpu_checkpoint(ray_start_4_cpus_2_gpus) without return types