class_docstr: Accumulator for compilable TF metrics.
  
  Attributes:
    inputs: Accumulated batch of inputs. The inputs are stored in a
      multi-dimensional list. The first dimension is used to index the
      associated output (for single-output models this will only have one item).
      The second dimension is used to store the args passed to update_state
      (i.e. (y_true, y_pred, example_weight)). Batching is done on the last
      dimension.calling update_state directly. Batching is done on the last
      dimension.
    weights: Accumulated weights. The weights are stored in a multi-dimensional
      list where the first dimension is used to index the associated output (for
      single-output models this will only have one item). The second dimension
      is used to store the accumulated weights for each metric associated with
      the output dimension.
    pad: True if padding needed.
    last_dim: Max size of the last dimension of labels or predictions (used with
      padding).
    size_estimator: Batch size estimator.
    desired_batch_size: Desired batch size.
class_docstr_tok: ["Accumulator","for","compilable","TF","metrics",".","Attributes",":","inputs",":","Accumulated","batch","of","inputs",".","The","inputs","are","stored","in","a","multi-dimensional","list",".","The","first","dimension","is","used","to","index","the","associated","output","(","for","single-output","models","this","will","only","have","one","item",")",".","The","second","dimension","is","used","to","store","the","args","passed","to","update_state","(","i.e",".","(","y_true",",","y_pred",",","example_weight",")",")",".","Batching","is","done","on","the","last","dimension.calling","update_state","directly",".","Batching","is","done","on","the","last","dimension",".","weights",":","Accumulated","weights",".","The","weights","are","stored","in","a","multi-dimensional","list","where","the","first","dimension","is","used","to","index","the","associated","output","(","for","single-output","models","this","will","only","have","one","item",")",".","The","second","dimension","is","used","to","store","the","accumulated","weights","for","each","metric","associated","with","the","output","dimension",".","pad",":","True","if","padding","needed",".","last_dim",":","Max","size","of","the","last","dimension","of","labels","or","predictions","(","used","with","padding",")",".","size_estimator",":","Batch","size","estimator",".","desired_batch_size",":","Desired","batch","size","."]
docstr: Initializes accumulator using a list of metric counts per output.
docstr_tok: ["Initializes","accumulator","using","a","list","of","metric","counts","per","output","."]
code: def __init__(
      self,
      padding_options: Optional[config_pb2.PaddingOptions],
      metric_counts: List[int],
      desired_batch_size: Optional[int] = None,
  ):
      """Initializes accumulator using a list of metric counts per output."""
      super().__init__(
          # Input args of labels, predictions, example_weights for each output.
          input_counts=[3] * len(metric_counts),
          metric_counts=metric_counts,
          size_estimator_fn=_numpy_array_size_fn,
          desired_batch_size=desired_batch_size,
      )
  
      self._pad = False
      if padding_options is not None:
  
          def get_padding_value(oneof_name):
              oneof = padding_options.WhichOneof(oneof_name)
              return (
                  None
                  if oneof is None
                  else getattr(padding_options, oneof)
              )
  
          self._pad = True
          self._label_padding = get_padding_value("label_padding")
          self._prediction_padding = get_padding_value(
              "prediction_padding"
          )
          self._pad_to_dim = 0
  
imports: from typing import Any, Callable, List, Optional, Tuple, Union
  import numpy
  from tensorflow_model_analysis.metrics import metric_util
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.utils import size_estimator
label_desc: Use image node_id 1 to create a new TFCompilableMetricsAccumulator object from inherited base classes: TFMetricsAccumulator with example: obj = TFCompilableMetricsAccumulator(padding_options, metric_counts, desired_batch_size)