class_docstr: Exponential moving average.
  
  This class is a checkpointable implementation of a subset of the functionality
  provided by tf.train.ExponentialMovingAverage. The tf version is not
  checkpointable due to use of tf.Variable.ref() to associate tf.Variables
  objects to their corresponding averages
  (cf. https://github.com/tensorflow/tensorflow/issues/38452). This version uses
  the order of the tf.Variable objects in a sequence to associate the variables
  with their averages.
  
  Note: This class offers less functionality than the tensorflow version and it
  is only implemented for replica context.
  
  Attributes:
    averaged_variables: A sequence of tf.Variables that stores the averages for
      the variables. They are associated to the new values that are provided to
      ExponentialMovingAverage.apply() by the order in the sequence. If None a
      call to ExponentialMovingAverage.apply() initializes the variable before
      applying the update.
docstr: Applies the new values to the exponential moving averages.
docstr_tok: ["Applies","the","new","values","to","the","exponential","moving","averages","."]
code: def _apply_values(self, variables: Sequence[tf.Variable]):
      """Applies the new values to the exponential moving averages."""
  
      def merge_fn(
          strategy: tf.distribute.Strategy,
          variable: tf.Variable,
          value: tf.Tensor,
      ):
          value = strategy.extended.reduce_to(
              tf.distribute.ReduceOp.MEAN, value, variable
          )
          strategy.extended.update(
              variable, self._ema_assign_fn, args=(value,)
          )
  
      replica_context = tf.distribute.get_replica_context()
  
      if replica_context:
          for variable_ema, variable in zip(
              self.averaged_variables, variables
          ):
              replica_context.merge_call(
                  merge_fn, args=(variable_ema, variable)
              )
      else:
          raise NotImplementedError(
              "Cross-replica context version not implemented."
          )
  
imports: from typing import Sequence
  import tensorflow
label_desc: Use image node_id 3 for calling the ExponentialMovingAverage obj's underlying member method code with example usage: obj._apply_values(variables) without return types