class_docstr: Computes query statistics metrics.
class_docstr_tok: ["Computes","query","statistics","metrics","."]
code: def add_input(
      self,
      accumulator: _QueryStatisticsAccumulator,
      element: metric_types.StandardMetricInputs,
  ) -> _QueryStatisticsAccumulator:
      for (
          _,
          _,
          example_weight,
      ) in metric_util.to_label_prediction_example_weight(
          element,
          eval_config=self._eval_config,
          model_name=self._model_name,
          output_name=self._output_name,
          example_weighted=self._example_weighted,
          flatten=False,
          require_single_example_weight=True,
      ):
          example_weight = float(example_weight)
          accumulator.total_queries += example_weight
          num_documents = len(element.prediction) * example_weight
          accumulator.total_documents += num_documents
          accumulator.min_documents = min(
              accumulator.min_documents, num_documents
          )
          accumulator.max_documents = max(
              accumulator.max_documents, num_documents
          )
      return accumulator
  
file_path: model-analysis/tensorflow_model_analysis/metrics/query_statistics.py
imports: from typing import Dict, Iterable, Optional
  import apache_beam
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.metrics import metric_util
  from tensorflow_model_analysis.proto import config_pb2
label_desc: Use image node_id 3 for calling the _QueryStatisticsCombiner obj's underlying member method code with example usage: obj.add_input(accumulator, element) and returns: accumulator