parameters: (self, features)
return_statement: return estimator_lib.EstimatorSpec(
          loss=model_outputs.loss,
          mode=mode,
          eval_metric_ops=metrics,
          # needed for custom metrics.
          predictions=model_outputs.predictions)
docstring: Add ops for evaluation (aka filtering) to the graph.
docstring_summary: Add ops for evaluation (aka filtering) to the graph.
docstring_tokens: Add ops for evaluation ( aka filtering ) to the graph .
function: def _evaluate_ops(self, features):
      """Add ops for evaluation (aka filtering) to the graph."""
      mode = estimator_lib.ModeKeys.EVAL
      with variable_scope.variable_scope("model", use_resource=True):
        model_outputs = self.create_loss(features, mode)
      metrics = {}
      # Just output in-sample predictions for the last chunk seen
      for prediction_key, prediction_value in model_outputs.predictions.items():
        metrics[prediction_key] = _identity_metric_single(prediction_key,
                                                          prediction_value)
      metrics[feature_keys.FilteringResults.TIMES] = _identity_metric_single(
          feature_keys.FilteringResults.TIMES, model_outputs.prediction_times)
      metrics[feature_keys.FilteringResults.STATE_TUPLE] = (
          _identity_metric_nested(feature_keys.FilteringResults.STATE_TUPLE,
                                  model_outputs.end_state))
      metrics[metric_keys.MetricKeys.LOSS_MEAN] = metrics_impl.mean(
          model_outputs.loss, name="average_loss")
      return estimator_lib.EstimatorSpec(
          loss=model_outputs.loss,
          mode=mode,
          eval_metric_ops=metrics,
          # needed for custom metrics.
          predictions=model_outputs.predictions)
function_tokens: def _evaluate_ops ( self , features ) : mode = estimator_lib . ModeKeys . EVAL with variable_scope . variable_scope ( "model" , use_resource = True ) : model_outputs = self . create_loss ( features , mode ) metrics = { } # Just output in-sample predictions for the last chunk seen for prediction_key , prediction_value in model_outputs . predictions . items ( ) : metrics [ prediction_key ] = _identity_metric_single ( prediction_key , prediction_value ) metrics [ feature_keys . FilteringResults . TIMES ] = _identity_metric_single ( feature_keys . FilteringResults . TIMES , model_outputs . prediction_times ) metrics [ feature_keys . FilteringResults . STATE_TUPLE ] = ( _identity_metric_nested ( feature_keys . FilteringResults . STATE_TUPLE , model_outputs . end_state ) ) metrics [ metric_keys . MetricKeys . LOSS_MEAN ] = metrics_impl . mean ( model_outputs . loss , name = "average_loss" ) return estimator_lib . EstimatorSpec ( loss = model_outputs . loss , mode = mode , eval_metric_ops = metrics , # needed for custom metrics. predictions = model_outputs . predictions )