class_docstr: Combine state for AggregateCombineFn.
  
  There are two parts to the state: the metric variables (the actual state),
  and a list of FeaturesPredictionsLabels or other inputs. See
  _AggregateCombineFn for why we need this.
class_docstr_tok: ["Combine","state","for","AggregateCombineFn",".","There","are","two","parts","to","the","state",":","the","metric","variables","(","the","actual","state",")",",","and","a","list","of","FeaturesPredictionsLabels","or","other","inputs",".","See","_AggregateCombineFn","for","why","we","need","this","."]
code: def __init__(self, desired_batch_size: Optional[int] = None):
      self.metric_variables = (
          None
      )  # type: Optional[types.MetricVariablesType]
      self.inputs = []  # type: List[bytes]
      self.size_estimator = size_estimator.SizeEstimator(
          size_threshold=self._TOTAL_INPUT_BYTE_SIZE_THRESHOLD,
          size_fn=len,
      )
      if desired_batch_size and desired_batch_size > 0:
          self._desired_batch_size = desired_batch_size
      else:
          self._desired_batch_size = self._DEFAULT_DESIRED_BATCH_SIZE
  
imports: from typing import Any, Dict, Iterable, List, Optional
  import apache_beam
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.api import types
  from tensorflow_model_analysis.eval_metrics_graph import eval_metrics_graph
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.utils import model_util
  from tensorflow_model_analysis.utils import size_estimator
label_desc: Use image node_id 1 to create a new _AggState object  with example: obj = _AggState(desired_batch_size)