code: def test_report_empty_batch(self):
      class MockMetadata:
          class MockTarget:
              pad_token_idx = 1
  
          def __init__(self):
              self.target = self.MockTarget()
  
      metrics_reporter = LanguageModelMetricReporter(
          channels=[],
          metadata=MockMetadata(),
          tensorizers=None,
          aggregate_metrics=True,
          perplexity_type=PerplexityType.MEDIAN,
          pep_format=False,
      )
      target_words = torch.tensor([])
      target_lens = torch.tensor([0])
      targets = (target_words, target_lens)
      preds = torch.tensor([])
      metrics_reporter.add_batch_stats(
          n_batches=128,
          preds=preds,
          targets=targets,
          scores=None,
          loss=torch.tensor([1]),
          m_input=None,
      )
      self.assertEqual(len(metrics_reporter.all_scores), 0)
  
file_path: pytext/pytext/metric_reporters/tests/language_model_metric_reporter_test.py
imports: from unittest import TestCase
  from unittest.mock import patch
  import torch
  from pytext.common.constants import Stage
  from pytext.config.module_config import PerplexityType
  from pytext.metric_reporters.language_model_metric_reporter import LanguageModelMetricReporter, MaskedLMMetricReporter
label_desc: Use image node_id 2 for calling the TestLMMetricsReporter obj's underlying member method code with example usage: obj.test_report_empty_batch() without return types