parameters: (self, metrics)
docstring: Adds in the state from a list of metrics.
  
      Default implementation sums all the metric variables.
  
      Args:
        metrics: A list of metrics with the same type as `self`.
  
      Raises:
        ValueError: If metrics contains invalid data.
docstring_summary: Adds in the state from a list of metrics.
docstring_tokens: Adds in the state from a list of metrics .
function: def aggregate(self, metrics):
      """Adds in the state from a list of metrics.
  
      Default implementation sums all the metric variables.
  
      Args:
        metrics: A list of metrics with the same type as `self`.
  
      Raises:
        ValueError: If metrics contains invalid data.
      """
      for m in metrics:
        if type(self) != type(m):  # pylint: disable=unidiomatic-typecheck
          raise TypeError("All metrics must be the same type, '%s' != '%s'." %
                          (type(self), type(m)))
      # pylint: disable=protected-access
      for i in range(len(self._vars)):
        if any(m._vars[i].name != self._vars[i].name for m in metrics):
          raise ValueError("All metrics must have variables in the same order.")
        self._vars[i].assign_add(math_ops.add_n([m._vars[i] for m in metrics]))
function_tokens: def aggregate ( self , metrics ) : for m in metrics : if type ( self ) != type ( m ) : # pylint: disable=unidiomatic-typecheck raise TypeError ( "All metrics must be the same type, '%s' != '%s'." % ( type ( self ) , type ( m ) ) ) # pylint: disable=protected-access for i in range ( len ( self . _vars ) ) : if any ( m . _vars [ i ] . name != self . _vars [ i ] . name for m in metrics ) : raise ValueError ( "All metrics must have variables in the same order." ) self . _vars [ i ] . assign_add ( math_ops . add_n ( [ m . _vars [ i ] for m in metrics ] ) )