def normalize_moments(counts, mean_ss, variance_ss, shift, name=None):
    'Calculate the mean and variance of based on the sufficient statistics.\n\n  Args:\n    counts: A `Tensor` containing a the total count of the data (one value).\n    mean_ss: A `Tensor` containing the mean sufficient statistics: the (possibly\n      shifted) sum of the elements to average over.\n    variance_ss: A `Tensor` containing the variance sufficient statistics: the\n      (possibly shifted) squared sum of the data to compute the variance over.\n    shift: A `Tensor` containing the value by which the data is shifted for\n      numerical stability, or `None` if no shift was performed.\n    name: Name used to scope the operations that compute the moments.\n\n  Returns:\n    Two `Tensor` objects: `mean` and `variance`.\n  '
    with ops.op_scope([counts, mean_ss, variance_ss, shift], name, 'normalize'):
        divisor = math_ops.inv(counts, name='divisor')
        if (shift is not None):
            shifted_mean = math_ops.mul(mean_ss, divisor, name='shifted_mean')
            mean = math_ops.add(shifted_mean, shift, name='mean')
        else:
            shifted_mean = math_ops.mul(mean_ss, divisor, name='mean')
            mean = shifted_mean
        variance = math_ops.sub(math_ops.mul(variance_ss, divisor), math_ops.square(shifted_mean), name='variance')
    return (mean, variance)
Calculate the mean and variance of based on the sufficient statistics.

Args:
  counts: A `Tensor` containing a the total count of the data (one value).
  mean_ss: A `Tensor` containing the mean sufficient statistics: the (possibly
    shifted) sum of the elements to average over.
  variance_ss: A `Tensor` containing the variance sufficient statistics: the
    (possibly shifted) squared sum of the data to compute the variance over.
  shift: A `Tensor` containing the value by which the data is shifted for
    numerical stability, or `None` if no shift was performed.
  name: Name used to scope the operations that compute the moments.

Returns:
  Two `Tensor` objects: `mean` and `variance`.
def normalize_moments(counts, mean_ss, variance_ss, shift, name=None):
    'Calculate the mean and variance of based on the sufficient statistics.\n\n  Args:\n    counts: A `Tensor` containing a the total count of the data (one value).\n    mean_ss: A `Tensor` containing the mean sufficient statistics: the (possibly\n      shifted) sum of the elements to average over.\n    variance_ss: A `Tensor` containing the variance sufficient statistics: the\n      (possibly shifted) squared sum of the data to compute the variance over.\n    shift: A `Tensor` containing the value by which the data is shifted for\n      numerical stability, or `None` if no shift was performed.\n    name: Name used to scope the operations that compute the moments.\n\n  Returns:\n    Two `Tensor` objects: `mean` and `variance`.\n  '
    with ops.op_scope([counts, mean_ss, variance_ss, shift], name, 'normalize'):
        divisor = math_ops.inv(counts, name='divisor')
        if (shift is not None):
            shifted_mean = math_ops.mul(mean_ss, divisor, name='shifted_mean')
            mean = math_ops.add(shifted_mean, shift, name='mean')
        else:
            shifted_mean = math_ops.mul(mean_ss, divisor, name='mean')
            mean = shifted_mean
        variance = math_ops.sub(math_ops.mul(variance_ss, divisor), math_ops.square(shifted_mean), name='variance')
    return (mean, variance)