code: def _undo_batch_normalization(
      x, mean, variance, offset, scale, variance_epsilon, name=None
  ):
      r"""Inverse of tf.nn.batch_normalization.
  
      Args:
        x: Input `Tensor` of arbitrary dimensionality.
        mean: A mean `Tensor`.
        variance: A variance `Tensor`.
        offset: An offset `Tensor`, often denoted `beta` in equations, or
          None. If present, will be added to the normalized tensor.
        scale: A scale `Tensor`, often denoted `gamma` in equations, or
          `None`. If present, the scale is applied to the normalized tensor.
        variance_epsilon: A small `float` added to the minibatch `variance` to
          prevent dividing by zero.
        name: A name for this operation (optional).
  
      Returns:
        batch_unnormalized: The de-normalized, de-scaled, de-offset `Tensor`.
      """
      with tf.name_scope(name or "undo_batch_normalization"):
          # inv = tf.rsqrt(variance + variance_epsilon)
          # if scale is not None:
          #   inv *= scale
          # return x * inv + (
          #     offset - mean * inv if offset is not None else -mean * inv)
          rescale = tf.sqrt(variance + variance_epsilon)
          if scale is not None:
              rescale = rescale / scale
          batch_unnormalized = x * rescale + (
              mean - offset * rescale if offset is not None else mean
          )
          return batch_unnormalized
  
file_path: probability/tensorflow_probability/python/bijectors/batch_normalization.py
imports: import tensorflow.compat.v2
  from tensorflow_probability.python.bijectors import bijector
  from tensorflow_probability.python.internal import tf_keras
label_desc: Use image node_id 1 for calling a global function with example usage: _undo_batch_normalization(x, mean, variance, offset, scale, variance_epsilon, name) and returns: batch_unnormalized