code: def run_class_loss_test(
      self,
      ddp: bool,
      loss_sum_or_avg: torch.Tensor,
      num_measurements: torch.Tensor,
      dist_sync_on_step: bool,
      take_avg_loss: bool,
      check_dist_sync_on_step: bool = True,
      check_batch: bool = True,
  ):
      if ddp:
          if sys.platform == "win32":
              pytest.skip("DDP not supported on windows")
          self.pool.starmap(
              partial(
                  _loss_class_test,
                  loss_sum_or_avg=loss_sum_or_avg,
                  num_measurements=num_measurements,
                  dist_sync_on_step=dist_sync_on_step,
                  take_avg_loss=take_avg_loss,
                  check_dist_sync_on_step=check_dist_sync_on_step,
                  check_batch=check_batch,
                  atol=self.atol,
              ),
              [(rank, self.poolSize) for rank in range(self.poolSize)],
          )
      else:
          _loss_class_test(
              0,
              1,
              loss_sum_or_avg=loss_sum_or_avg,
              num_measurements=num_measurements,
              dist_sync_on_step=dist_sync_on_step,
              take_avg_loss=take_avg_loss,
              check_dist_sync_on_step=check_dist_sync_on_step,
              check_batch=check_batch,
              atol=self.atol,
          )
  
imports: import os
  import pickle
  import sys
  from functools import partial
  from typing import Callable, Optional
  import numpy
  import pytest
  import torch
  from scipy.stats import entropy
  from torch.distributions.utils import logits_to_probs
  from torch.multiprocessing import Pool, set_start_method
  from torchmetrics import Metric
  from nemo.collections.common.metrics import GlobalAverageLossMetric, Perplexity
label_desc: Use image node_id 1 for calling the LossTester obj's underlying member method code with example usage: obj.run_class_loss_test(ddp, loss_sum_or_avg, num_measurements, dist_sync_on_step, take_avg_loss, check_dist_sync_on_step, check_batch) without return types