code: def test_custom_eval(self, tmp_path: pathlib.Path) -> None:
      tensorboard_path = tmp_path.joinpath("tensorboard")
  
      training_metrics = {"A": [], "B": []}  # type: typing.Dict
      validation_metrics = {"A": [], "B": []}  # type: typing.Dict
  
      (
          trial_A,
          trial_controller_A,
      ) = pytorch_utils.create_trial_and_trial_controller(
          trial_class=pytorch_onevar_model.OneVarTrial,
          hparams=self.hparams,
          trial_seed=self.trial_seed,
          max_batches=900,
          min_validation_batches=100,
          min_checkpoint_batches=sys.maxsize,
          tensorboard_path=tensorboard_path,
      )
      trial_controller_A.run()
  
      metrics_callback = trial_A.metrics_callback
  
      training_metrics["A"] = metrics_callback.training_metrics
      validation_metrics["A"] = metrics_callback.validation_metrics
  
      (
          trial_B,
          trial_controller_B,
      ) = pytorch_utils.create_trial_and_trial_controller(
          trial_class=pytorch_onevar_model.OneVarTrialCustomEval,
          hparams=self.hparams,
          trial_seed=self.trial_seed,
          expose_gpus=True,
          max_batches=900,
          min_validation_batches=100,
          min_checkpoint_batches=sys.maxsize,
          tensorboard_path=tensorboard_path,
      )
      trial_controller_B.run()
  
      metrics_callback = trial_B.metrics_callback
      training_metrics["B"] = metrics_callback.training_metrics
      validation_metrics["B"] = metrics_callback.validation_metrics
  
      for original, custom_eval in zip(
          training_metrics["A"], training_metrics["B"]
      ):
          assert np.allclose(
              original["loss"], custom_eval["loss"], atol=1e-6
          )
  
      for original, custom_eval in zip(
          validation_metrics["A"], validation_metrics["B"]
      ):
          assert np.allclose(
              original["val_loss"], custom_eval["val_loss"], atol=1e-6
          )
  
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 9 for calling the TestPyTorchTrial obj's underlying member method code with example usage: obj.test_custom_eval(tmp_path) without return types