code: def moving_mean_variance_zero_debiased(
      moving_mean,
      moving_variance=None,
      zero_debias_count=None,
      decay=0.99,
      name=None,
  ):
      """Compute zero debiased versions of `moving_mean` and `moving_variance`.
  
      Since `moving_*` variables initialized with `0`s will be biased (toward `0`),
      this function rescales the `moving_mean` and `moving_variance` by the factor
      `1 - decay**zero_debias_count`, i.e., such that the `moving_mean` is unbiased.
      For more details, see [Kingma (2014)][1].
  
      Args:
        moving_mean: `float`-like `tf.Variable` representing the exponentially
          weighted moving mean. Same shape as `moving_variance` and `value`. This
          function presumes the `tf.Variable` was created with all zero initial
          value(s).
        moving_variance: `float`-like `tf.Variable` representing the exponentially
          weighted moving variance. Same shape as `moving_mean` and `value`.  This
          function presumes the `tf.Variable` was created with all zero initial
          value(s).
          Default value: `None` (i.e., no moving variance is computed).
        zero_debias_count: `int`-like `tf.Variable` representing the number of times
          this function has been called on streaming input (*not* the number of
          reduced values used in this functions computation). When not `None` (the
          default) the returned values for `moving_mean` and `moving_variance` are
          "zero debiased", i.e., corrected for their presumed all zeros
          intialization. Note: the `tf.Variable`s `moving_mean` and
          `moving_variance` *always* store the unbiased calculation, regardless of
          setting this argument. To obtain unbiased calculations from these
          `tf.Variable`s, see `tfp.stats.moving_mean_variance_zero_debiased`.
          Default value: `None` (i.e., no zero debiasing calculation is made).
        decay: A `float`-like `Tensor` representing the moving mean decay. Typically
          close to `1.`, e.g., `0.99`.
          Default value: `0.99`.
        name: Python `str` prepended to op names created by this function.
          Default value: `None` (i.e., 'moving_mean_variance_zero_debiased').
  
      Returns:
        moving_mean: The zero debiased exponentially weighted moving mean.
        moving_variance: The zero debiased exponentially weighted moving variance.
  
      Raises:
        TypeError: if `moving_mean` does not have float type `dtype`.
        TypeError: if `moving_mean`, `moving_variance`, `decay` have different
          `base_dtype`.
  
      #### References
  
      [1]: Diederik P. Kingma, Jimmy Ba. Adam: A Method for Stochastic Optimization.
            _arXiv preprint arXiv:1412.6980_, 2014.
           https://arxiv.org/abs/1412.6980
      """
      with tf.name_scope(name or "zero_debias_count"):
          if zero_debias_count is None:
              raise ValueError()
          base_dtype = dtype_util.base_dtype(moving_mean.dtype)
          if not dtype_util.is_floating(base_dtype):
              raise TypeError(
                  "Argument `moving_mean` is not float type (saw {}).".format(
                      dtype_util.name(moving_mean.dtype)
                  )
              )
          t = tf.cast(zero_debias_count, dtype=base_dtype)
          # Could have used:
          #   bias_correction = -tf.math.expm1(t * tf.math.log(decay))
          # however since we expect decay to be nearly 1, we don't expect this to bear
          # a significant improvement, yet would incur higher computational cost.
          t = tf.where(t > 0.0, t, tf.constant(np.inf, base_dtype))
          bias_correction = 1.0 - decay**t
          unbiased_mean = moving_mean / bias_correction
          if moving_variance is None:
              return unbiased_mean
          if base_dtype != dtype_util.base_dtype(moving_variance.dtype):
              raise TypeError(
                  "Arguments `moving_mean` and `moving_variance` do not "
                  "have same base `dtype` (saw {}, {}).".format(
                      dtype_util.name(moving_mean.dtype),
                      dtype_util.name(moving_variance.dtype),
                  )
              )
          unbiased_variance = moving_variance / bias_correction
          return unbiased_mean, unbiased_variance
  
imports: import numpy
  import tensorflow.compat.v2
  from tensorflow_probability.python.internal import dtype_util
  from tensorflow_probability.python.internal import prefer_static
label_desc: Use image node_id 2 for calling a global function with example usage: moving_mean_variance_zero_debiased(moving_mean, moving_variance, zero_debias_count, decay, name) and returns: unbiased_mean,  unbiased_variance, unbiased_mean