parameters: (self, all_estimator_spec)
return_statement: return model_fn.EstimatorSpec(
          mode=model_fn.ModeKeys.EVAL,
          predictions=predictions,
          loss=loss,
          eval_metric_ops=metrics)
docstring: Merges list of `EstimatorSpec` for eval.
  
      Args:
        all_estimator_spec: list of `EstimatorSpec` for the individual heads.
  
      Returns:
        `EstimatorSpec` that merges all heads for EVAL.
docstring_summary: Merges list of `EstimatorSpec` for eval.
docstring_tokens: Merges list of EstimatorSpec for eval .
function: def _merge_eval(self, all_estimator_spec):
      """Merges list of `EstimatorSpec` for eval.
  
      Args:
        all_estimator_spec: list of `EstimatorSpec` for the individual heads.
  
      Returns:
        `EstimatorSpec` that merges all heads for EVAL.
      """
      predictions = {}
      metrics = {}
      losses = []
      for head, spec in zip(self._heads, all_estimator_spec):
        losses.append(spec.loss)
        head_name = head.name
        # Metric keys already contain head.name.
        metrics.update(spec.eval_metric_ops or {})
        for k, v in six.iteritems(spec.predictions):
          predictions[(head_name, k)] = v
      loss = _merge_losses(losses, self._head_weights)
  
      return model_fn.EstimatorSpec(
          mode=model_fn.ModeKeys.EVAL,
          predictions=predictions,
          loss=loss,
          eval_metric_ops=metrics)
function_tokens: def _merge_eval ( self , all_estimator_spec ) : predictions = { } metrics = { } losses = [ ] for head , spec in zip ( self . _heads , all_estimator_spec ) : losses . append ( spec . loss ) head_name = head . name # Metric keys already contain head.name. metrics . update ( spec . eval_metric_ops or { } ) for k , v in six . iteritems ( spec . predictions ) : predictions [ ( head_name , k ) ] = v loss = _merge_losses ( losses , self . _head_weights ) return model_fn . EstimatorSpec ( mode = model_fn . ModeKeys . EVAL , predictions = predictions , loss = loss , eval_metric_ops = metrics )