class_docstr: TensorNormalizer with exponential moving avg. mean and var estimates.
docstr: Returns a list of update obs for EMATensorNormalizer mean and var.
  
  This normalizer tracks the mean & variance of the dimensions of the input
  tensor using an exponential moving average. The batch mean comes from just
  the batch statistics, and the batch variance comes from the squared
  difference of tensor values from the current mean estimate. The mean &
  variance are both updated as (old_value + update_rate *
  (batch_value - old_value)).
  
  Args:
    tensor: The tensor of values to be normalized.
    outer_dims: The batch dimensions over which to compute normalization
      statistics.
  
  Returns:
    A list of ops, which when run will update all necessary normaliztion
    variables.
docstr_tok: ["Returns","a","list","of","update","obs","for","EMATensorNormalizer","mean","and","var",".","This","normalizer","tracks","the","mean","&","variance","of","the","dimensions","of","the","input","tensor","using","an","exponential","moving","average",".","The","batch","mean","comes","from","just","the","batch","statistics",",","and","the","batch","variance","comes","from","the","squared","difference","of","tensor","values","from","the","current","mean","estimate",".","The","mean","&","variance","are","both","updated","as","(","old_value","+","update_rate","*","(","batch_value","-","old_value",")",")",".","Args",":","tensor",":","The","tensor","of","values","to","be","normalized",".","outer_dims",":","The","batch","dimensions","over","which","to","compute","normalization","statistics",".","Returns",":","A","list","of","ops",",","which","when","run","will","update","all","necessary","normaliztion","variables","."]
code: def _update_ops(self, tensor, outer_dims):
      """Returns a list of update obs for EMATensorNormalizer mean and var.
  
      This normalizer tracks the mean & variance of the dimensions of the input
      tensor using an exponential moving average. The batch mean comes from just
      the batch statistics, and the batch variance comes from the squared
      difference of tensor values from the current mean estimate. The mean &
      variance are both updated as (old_value + update_rate *
      (batch_value - old_value)).
  
      Args:
        tensor: The tensor of values to be normalized.
        outer_dims: The batch dimensions over which to compute normalization
          statistics.
  
      Returns:
        A list of ops, which when run will update all necessary normaliztion
        variables.
      """
  
      def _tensor_update_ops(single_tensor, mean_var, var_var):
          """Make update ops for a single non-nested tensor."""
          # Take the moments across batch dimension. Calculate variance with
          #   moving avg mean, so that this works even with batch size 1.
          mean = tf.reduce_mean(single_tensor, axis=outer_dims)
          var = tf.reduce_mean(
              tf.math.squared_difference(single_tensor, mean_var),
              axis=outer_dims,
          )
  
          # Ops to update moving average. Make sure that all stats are computed
          #   before updates are performed.
          with tf.control_dependencies([mean, var]):
              update_ops = [
                  mean_var.assign_add(
                      self._norm_update_rate * (mean - mean_var)
                  ),
                  var_var.assign_add(
                      self._norm_update_rate * (var - var_var)
                  ),
              ]
          return update_ops
  
      # Aggregate update ops for all parts of potentially nested tensor.
      tensor = tf.nest.flatten(tensor)
      updates = tf.nest.map_structure(
          _tensor_update_ops,
          tensor,
          self._mean_moving_avg,
          self._var_moving_avg,
      )
      all_update_ops = tf.nest.flatten(updates)
  
      return all_update_ops
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import abc
  from typing import Tuple
  import six
  import tensorflow
  from tf_agents.specs import tensor_spec
  from tf_agents.typing import types
  from tf_agents.utils import common
  from tf_agents.utils import nest_utils
label_desc: Use image node_id 4 for calling the EMATensorNormalizer obj's underlying member method code with example usage: obj._update_ops(tensor, outer_dims) and returns: all_update_ops, update_ops