class_docstr: Glow generative model.
  
  Reference: https://arxiv.org/abs/1807.03039
class_docstr_tok: ["Glow","generative","model",".","Reference",":","https",":","\/\/arxiv.org\/abs\/1807.03039"]
docstr: Normalize x.
  
  Args:
    x: 4-D Tensor.
  
  Returns:
    x: Scaled such that x lies in-between -0.5 and 0.5
docstr_tok: ["Normalize","x.","Args",":","x",":","4-D","Tensor",".","Returns",":","x",":","Scaled","such","that","x","lies","in-between","-0.5","and","0.5"]
code: def preprocess(self, x):
      """Normalize x.
  
      Args:
        x: 4-D Tensor.
  
      Returns:
        x: Scaled such that x lies in-between -0.5 and 0.5
      """
      n_bits_x = self.hparams.n_bits_x
      n_bins = 2**n_bits_x
      x = tf.cast(x, dtype=tf.float32)
      if n_bits_x < 8:
          x = tf.floor(x / 2 ** (8 - n_bits_x))
      x = x / n_bins - 0.5
      return x
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  from tensor2tensor.layers import common_hparams
  from tensor2tensor.layers import common_layers
  from tensor2tensor.models.research import glow_init_hook
  from tensor2tensor.models.research import glow_ops
  from tensor2tensor.utils import contrib
  from tensor2tensor.utils import registry
  from tensor2tensor.utils import t2t_model
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 2 for calling the Glow obj's underlying member method code with example usage: obj.preprocess(x) and returns: x