class_docstr: Discrete bottleneck class.
class_docstr_tok: ["Discrete","bottleneck","class","."]
docstr: Turn x_bit representing numbers bitwise (lower-endian) to int tensor.
  
  Args:
      x_bit: Tensor containing numbers in a particular base to be
      converted to
      int.
      num_bits: Number of bits in the representation.
      base: Base of the representation.
  
  Returns:
      Integer representation of this number.
docstr_tok: ["Turn","x_bit","representing","numbers","bitwise","(","lower-endian",")","to","int","tensor",".","Args",":","x_bit",":","Tensor","containing","numbers","in","a","particular","base","to","be","converted","to","int",".","num_bits",":","Number","of","bits","in","the","representation",".","base",":","Base","of","the","representation",".","Returns",":","Integer","representation","of","this","number","."]
code: def bit_to_int(self, x_bit, num_bits, base=2):
      """Turn x_bit representing numbers bitwise (lower-endian) to int tensor.
  
      Args:
          x_bit: Tensor containing numbers in a particular base to be
          converted to
          int.
          num_bits: Number of bits in the representation.
          base: Base of the representation.
  
      Returns:
          Integer representation of this number.
      """
      x_l = tf.stop_gradient(
          tf.to_int32(tf.reshape(x_bit, [-1, num_bits]))
      )
      # pylint: disable=g-complex-comprehension
      x_labels = [
          x_l[:, i] * tf.to_int32(base) ** tf.to_int32(i)
          for i in range(num_bits)
      ]
      res = sum(x_labels)
      return tf.to_int32(
          tf.reshape(res, common_layers.shape_list(x_bit)[:-1])
      )
  
file_path: tensor2tensor/tensor2tensor/layers/vq_discrete.py
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from functools import partial
  from tensor2tensor.layers import common_layers
  import tensorflow.compat.v1
  from tensorflow.python.training import moving_averages
label_desc: Use image node_id 5 for calling the DiscreteBottleneck obj's underlying member method code with example usage: obj.bit_to_int(x_bit, num_bits, base) and returns: tf