class_docstr: Task object for tf-ranking BERT.
class_docstr_tok: ["Task","object","for","tf-ranking","BERT","."]
docstr: Aggregates over logs. This runs on CPU in eager mode.
code: def aggregate_logs(self, state=None, step_outputs=None):
      """Aggregates over logs. This runs on CPU in eager mode."""
      logging_keys = list(self._get_logging_feature_names())
      logging_keys.extend([_PREDICTION, _LABEL])
      if state is None:
          state = {key: [] for key in logging_keys}
      for key in logging_keys:
          state[key].append(
              np.concatenate(
                  [v.numpy() for v in step_outputs[key]], axis=0
              )
          )
      return state
  
imports: import dataclasses
  import os
  import time
  from typing import Dict, Mapping, Optional, Tuple
  from absl import logging
  import numpy
  import tensorflow
  from official.core import task_factory
  from official.modeling.hyperparams import base_config
  from official.nlp.configs import encoders
  from tensorflow_ranking.extension import task
  from tensorflow_ranking.python.keras import metrics
  from tensorflow_ranking.python.keras import model
label_desc: Use image node_id 5 for calling the TFRBertTask obj's underlying member method code with example usage: obj.aggregate_logs(state, step_outputs) and returns: state