class_docstr: Evaluation Base class
  
  # Parameters
  
  batch_postprocessor: `Postprocessor`, optional (default=`SimplePostprocessor`)
      The postprocessor to use for turning both the batches and the outputs
      of the model into human readable data.
  
  cuda_device : `Union[int, torch.device]`, optional (default=`-1`)
      The cuda device to use for this evaluation.  The model is assumed to
       already be using this device; this parameter is only used for moving
       the input data to the correct device.
  
  postprocessor_fn_name: `str`, optional (default=`"make_output_human_readable"`)
      Function name of the model's postprocessing function.
docstr: Evaluate a single data source.
  
  # Parameters
  
  model : `Model`
      The model to evaluate
  data_loader : `DataLoader`
      The `DataLoader` that will iterate over the evaluation data (data loaders already contain
      their data).
  batch_weight_key : `str`, optional (default=`None`)
      If given, this is a key in the output dictionary for each batch that specifies how to weight
      the loss for that batch.  If this is not given, we use a weight of 1 for every batch.
  metrics_output_file : `Union[str, PathLike]`, optional (default=`None`)
      Optional path to write the final metrics to.
  
  predictions_output_file : `Union[str, PathLike]`, optional (default=`None`)
      Optional path to write the predictions to. If passed the
      postprocessor will be called and its output will be written as lines.
  
  
  # Returns
  
  metrics: `Dict[str, Any]`
      The metrics from evaluating the file.
docstr_tok: ["Evaluate","a","single","data","source",".","#","Parameters","model",":","`","Model","`","The","model","to","evaluate","data_loader",":","`","DataLoader","`","The","`","DataLoader","`","that","will","iterate","over","the","evaluation","data","(","data","loaders","already","contain","their","data",")",".","batch_weight_key",":","`","str","`",",","optional","(","default=","`","None","`",")","If","given",",","this","is","a","key","in","the","output","dictionary","for","each","batch","that","specifies","how","to","weight","the","loss","for","that","batch",".","If","this","is","not","given",",","we","use","a","weight","of","1","for","every","batch",".","metrics_output_file",":","`","Union","[","str",",","PathLike","]","`",",","optional","(","default=","`","None","`",")","Optional","path","to","write","the","final","metrics","to",".","predictions_output_file",":","`","Union","[","str",",","PathLike","]","`",",","optional","(","default=","`","None","`",")","Optional","path","to","write","the","predictions","to",".","If","passed","the","postprocessor","will","be","called","and","its","output","will","be","written","as","lines",".","#","Returns","metrics",":","`","Dict","[","str",",","Any","]","`","The","metrics","from","evaluating","the","file","."]
code: def __call__(
      self,
      model: Model,
      data_loader: DataLoader,
      batch_weight_key: str = None,
      metrics_output_file: Union[str, PathLike] = None,
      predictions_output_file: Union[str, PathLike] = None,
  ) -> Dict[str, Any]:
      """
      Evaluate a single data source.
  
      # Parameters
  
      model : `Model`
          The model to evaluate
      data_loader : `DataLoader`
          The `DataLoader` that will iterate over the evaluation data (data loaders already contain
          their data).
      batch_weight_key : `str`, optional (default=`None`)
          If given, this is a key in the output dictionary for each batch that specifies how to weight
          the loss for that batch.  If this is not given, we use a weight of 1 for every batch.
      metrics_output_file : `Union[str, PathLike]`, optional (default=`None`)
          Optional path to write the final metrics to.
  
      predictions_output_file : `Union[str, PathLike]`, optional (default=`None`)
          Optional path to write the predictions to. If passed the
          postprocessor will be called and its output will be written as lines.
  
  
      # Returns
  
      metrics: `Dict[str, Any]`
          The metrics from evaluating the file.
      """
      raise NotImplementedError("__call__")
  
imports: from typing import Union, Dict, Any, Optional
  from os import PathLike
  from pathlib import Path
  import torch
  import logging
  from allennlp.common.checks import check_for_gpu
  from allennlp.common.tqdm import Tqdm
  from allennlp.common.util import dump_metrics, int_to_device
  from allennlp.nn import util
  from allennlp.common import Registrable
  from allennlp.models import Model
  from allennlp.data import DataLoader
  from allennlp.evaluation.serializers.serializers import Serializer, SimpleSerializer
label_desc: Use image node_id 2 for calling the Evaluator obj's underlying member method code with example usage: obj.__call__(model, data_loader, batch_weight_key, metrics_output_file, predictions_output_file) without return types