code: def int_to_bit_embed(x_int, num_bits, embedding_size, base=2):
      """Turn x_int into a bitwise (lower-endian) tensor and embed densly."""
      shape = common_layers.shape_list(x_int)
      inputs = int_to_bit(x_int, num_bits, base=base)
      inputs = tf.reshape(inputs, shape[:-1] + [shape[-1] * 8])
      inputs = 2.0 * tf.to_float(inputs) - 1.0  # Move from 0/1 to -1/1.
      return tf.layers.dense(
          inputs, embedding_size, name="int_to_bit_embed"
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from functools import partial
  from tensor2tensor.layers import common_hparams
  from tensor2tensor.layers import common_image_attention
  from tensor2tensor.layers import common_layers
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
  import tensorflow_probability
  from tensorflow.python.training import moving_averages
label_desc: Use image node_id 7 for calling a global function with example usage: int_to_bit_embed(x_int, num_bits, embedding_size, base) and returns: tf