class_docstr: Base combiner for aggregating metrics for keras based models.
class_docstr_tok: ["Base","combiner","for","aggregating","metrics","for","keras","based","models","."]
code: def setup(self):
      if self._model is None:
          # TODO(b/179500321): We are skipping the shared handle here to ensure that
          # we don't have issues with sharing the model between threads. This is
          # very inefficient, we should just clone the model but
          # tf.keras.models.clone_model removes compiled_metrics.
          self._model = (
              self._model_loaders[  # pylint: disable=protected-access
                  self._model_name
              ]._construct_fn_with_load_time(
                  self._set_model_load_seconds
              )()
          )
  
imports: import collections
  from itertools import chain
  from typing import Dict, Iterable, List, Optional
  import apache_beam
  import numpy
  import tensorflow
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.metrics import metric_util
  from tensorflow_model_analysis.metrics import tf_metric_accumulators
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.utils import model_util
  from tensorflow_model_analysis.utils import util
label_desc: Use image node_id 2 for calling the _KerasCombiner obj's underlying member method code with example usage: obj.setup() without return types