code: def test_custom_reducers(self, tmp_path: pathlib.Path) -> None:
      tensorboard_path = tmp_path.joinpath("tensorboard")
  
      (
          trial,
          controller,
      ) = pytorch_utils.create_trial_and_trial_controller(
          trial_class=pytorch_onevar_model.OneVarTrial,
          hparams=self.hparams,
          trial_seed=self.trial_seed,
          max_batches=30,
          min_validation_batches=30,
          min_checkpoint_batches=sys.maxsize,
          scheduling_unit=10,
          tensorboard_path=tensorboard_path,
      )
      controller.run()
      metrics_callback = trial.metrics_callback
      training_metrics = metrics_callback.training_metrics
      validation_metrics = metrics_callback.validation_metrics
      batch_size = self.hparams["global_batch_size"]
  
      for i, metrics in enumerate(training_metrics):
          expect = pytorch_onevar_model.TriangleLabelSum.expect(
              batch_size, 10 * i, 10 * (i + 1)
          )
          assert "cls_reducer" in metrics
          assert metrics["cls_reducer"] == expect
          assert "fn_reducer" in metrics
          assert metrics["fn_reducer"] == expect
  
      for metrics in validation_metrics:
          num_batches = (
              len(pytorch_onevar_model.OnesDataset()) // batch_size
          )
          expect = pytorch_onevar_model.TriangleLabelSum.expect(
              batch_size, 0, num_batches
          )
          assert "cls_reducer" in metrics
          assert metrics["cls_reducer"] == expect
          assert "fn_reducer" in metrics
          assert metrics["fn_reducer"] == expect
  
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 15 for calling the TestPyTorchTrial obj's underlying member method code with example usage: obj.test_custom_reducers(tmp_path) without return types