class_docstr: ``EvaluateBatchLoop`` 针对一个 dataloader 的数据完成一个 epoch 的评测迭代过程；
  
  :param batch_step_fn: 您可以传入该参数来替换默认的 ``bath_step_fn``；
docstr: 需要返回在传入的 ``dataloader`` 中的 evaluation 结果
  
  :param evaluator: :class:`~fastNLP.core.controllers.Evaluator` 对象
  :param dataloader: 当前需要进行评测的 ``dataloader``
  :return:
code: def run(self, evaluator, dataloader) -> Dict:
      r"""
      需要返回在传入的 ``dataloader`` 中的 evaluation 结果
  
      :param evaluator: :class:`~fastNLP.core.controllers.Evaluator` 对象
      :param dataloader: 当前需要进行评测的 ``dataloader``
      :return:
      """
      iterator = iter(dataloader)
      batch_idx = 0
      while True:
          try:
              batch = next(iterator)
          except StopIteration:
              break
          try:
              batch = match_and_substitute_params(
                  evaluator.input_mapping, batch
              )
              batch = evaluator.move_data_to_device(batch)
  
              self.batch_step_fn(evaluator, batch)
              batch_idx += 1
              evaluator.update_progress_bar(
                  batch_idx, evaluator.cur_dataloader_name
              )
  
          except BaseException as e:
              if callable(
                  getattr(dataloader, "get_batch_indices", None)
              ):
                  indices = dataloader.get_batch_indices()
                  if evaluator.cur_dataloader_name is not None:
                      logger.error(
                          f"Exception happens when evaluating on samples in dataloader:"
                          f"{evaluator.cur_dataloader_name}: {indices}"
                      )
                  else:
                      logger.error(
                          f"Exception happens when evaluating on samples: {indices}"
                      )
              raise e
      # 获取metric结果。返回的dict内容示例为{'metric_name1': metric_results, 'metric_name2': metric_results, ...}
      results = evaluator.get_metric()
      return results
  
file_path: fastNLP/fastNLP/core/controllers/loops/evaluate_batch_loop.py
imports: from typing import Optional, Callable, Dict
  from .loop import Loop
  from fastNLP.core.log import logger
  from fastNLP.core.utils import match_and_substitute_params
label_desc: Use image node_id 2 for calling the EvaluateBatchLoop obj's underlying member method code with example usage: obj.run(evaluator, dataloader) and returns: results