class_docstr: Computes total attributions.
docstr: Adds values in b to a at matching offsets.
code: def _sum(self, a: List[float], b: Union[np.ndarray, List[float]]):
      """Adds values in b to a at matching offsets."""
      if isinstance(b, (float, np.floating)) or (
          isinstance(b, np.ndarray) and b.size == 1
      ):
          if len(a) != 1:
              raise ValueError(
                  "Attributions have different array sizes {} != {}".format(
                      a, b
                  )
              )
          a[0] += abs(float(b)) if self._absolute else float(b)
      else:
          if len(a) != len(b):
              raise ValueError(
                  "Attributions have different array sizes {} != {}".format(
                      a, b
                  )
              )
          for i, v in enumerate(b):
              a[i] += abs(v) if self._absolute else v
  
imports: import functools
  from typing import Any, Dict, Iterable, List, Optional, Union
  import apache_beam
  import numpy
  from tensorflow_model_analysis import constants
  from tensorflow_model_analysis.metrics import example_count
  from tensorflow_model_analysis.metrics import metric_specs
  from tensorflow_model_analysis.metrics import metric_types
  from tensorflow_model_analysis.metrics import metric_util
  from tensorflow_model_analysis.proto import config_pb2
  from tensorflow_model_analysis.utils import util
label_desc: Use image node_id 2 for calling the _TotalAttributionsCombiner obj's underlying member method code with example usage: obj._sum(a, b) without return types