class_docstr: Multiprocessing evaluator
class_docstr_tok: ["Multiprocessing","evaluator"]
code: def evaluate(self) -> Mapping[str, EstimatorResults]:
      results = {}
      if self._tasks is None:
          for estimators, input in self._experiments:
              for estimator in estimators:
                  estimator_name = repr(estimator)
                  if estimator_name in results:
                      result = results[estimator_name]
                  else:
                      result = EstimatorResults()
                      results[estimator_name] = result
                  result.append(estimator.evaluate(input))
      else:
          tmp_files = []
          tmp_file_names = []
          for task in self._tasks:
              fp = tempfile.NamedTemporaryFile()
              # pyre-fixme[6]: For 2nd argument expected `SupportsWrite[bytes]`
              #  but got `_TemporaryFileWrapper[bytes]`.
              pickle.dump(task, fp, protocol=pickle.HIGHEST_PROTOCOL)
              fp.flush()
              tmp_files.append(fp)
              tmp_file_names.append(fp.name)
          with Pool(len(tmp_file_names)) as pool:
              evaluation_results = pool.map(
                  run_evaluation, tmp_file_names
              )
          for tmp_file in tmp_files:
              tmp_file.close()
          for evaluation_result in evaluation_results:
              if evaluation_result is None:
                  continue
              for (
                  estimator_name,
                  estimator_results,
              ) in evaluation_result.items():
                  if estimator_name in results:
                      result = results[estimator_name]
                  else:
                      result = EstimatorResults()
                      results[estimator_name] = result
                  for estimator_result in estimator_results:
                      result.append(estimator_result)
      return results
  
imports: import logging
  import math
  import pickle
  import tempfile
  from abc import ABC, abstractmethod
  from dataclasses import dataclass, field
  from multiprocessing import Pool
  from typing import Iterable, List, Mapping, Optional, Tuple, Union
  import torch
  from reagent.evaluation.cpe import bootstrapped_std_error_of_mean
  from torch import Tensor
label_desc: Use image node_id 2 for calling the Evaluator obj's underlying member method code with example usage: obj.evaluate() and returns: results