code: def prediction_loop(self, dataset_type: str) -> None:
      reporter = self.dataset_loader.get_test_reporter(dataset_type)
      skipped_batches = 0
      loaded_batches = 0
      with torch.no_grad():
          self.model.eval()
          logger.info(f"Starting {dataset_type} inference predictions")
  
          while reporter.next_dataset():
              dataloader = reporter.get_dataloader()
              if self._can_use_tqdm(dataloader):
                  dataloader = tqdm.tqdm(dataloader)
              for batch in dataloader:
                  prepared_batch = reporter.prepare_batch(batch)
                  prepared_batch = to_device(
                      prepared_batch, self.device
                  )
                  loaded_batches += 1
                  if not validate_batch_sizes(
                      prepared_batch.get_batch_size()
                  ):
                      logger.info(
                          "Skip batch due to unequal batch sizes."
                      )
                      skipped_batches += 1
                      continue
                  with torch.cuda.amp.autocast(
                      enabled=self.training_config.fp16
                  ):
                      model_output = self.model(prepared_batch)
                  report = Report(prepared_batch, model_output)
                  reporter.add_to_report(report, self.model)
                  report.detach()
  
              reporter.postprocess_dataset_report()
  
          logger.info(f"Finished predicting. Loaded {loaded_batches}")
          logger.info(f" -- skipped {skipped_batches} batches.")
          self.model.train()
  
file_path: mmf/mmf/trainers/core/evaluation_loop.py
imports: import logging
  from abc import ABC
  from typing import Any, Dict, Tuple, Type
  import torch
  import tqdm
  from mmf.common.meter import Meter
  from mmf.common.report import Report
  from mmf.common.sample import to_device
  from mmf.utils.distributed import gather_tensor, is_main, is_xla
label_desc: Use image node_id 2 for calling the TrainerEvaluationLoopMixin obj's underlying member method code with example usage: obj.prediction_loop(dataset_type) without return types