code: def eval_best_model(results: tune.ResultGrid):
      """Test the best model given output of tuner.fit()."""
      with results.get_best_result().checkpoint.as_directory() as best_checkpoint_path:
          best_model = ConvNet()
          best_checkpoint = torch.load(
              os.path.join(best_checkpoint_path, "checkpoint.pt")
          )
          best_model.load_state_dict(best_checkpoint["model"])
          # Note that test only runs on a small random set of the test data, thus the
          # accuracy may be different from metrics shown in tuning process.
          test_acc = test_func(best_model, get_data_loaders()[1])
          print("best model accuracy: ", test_acc)
  
file_path: ray/python/ray/tune/examples/pbt_convnet_function_example.py
imports: import argparse
  import os
  import numpy
  import torch
  import torch.optim
  from ray.tune.examples.mnist_pytorch import test_func, ConvNet, get_data_loaders
  import ray
  from ray import train, tune
  from ray.train import Checkpoint
  from ray.tune.schedulers import PopulationBasedTraining
label_desc: Use image node_id 2 for calling a global function with example usage: eval_best_model(results) without return types