class_docstr: Indexed entropy model model which implements Universal Quantization.
  
  In contrast to the base class, which uses rounding for quantization, here
  "quantization" is performed additive uniform noise, which is implemented with
  Universal Quantization.
  
  This is described in Sec. 3.2. in the paper
  > "Universally Quantized Neural Compression"<br />
  > Eirikur Agustsson & Lucas Theis<br />
  > https://arxiv.org/abs/2006.09952
class_docstr_tok: ["Indexed","entropy","model","model","which","implements","Universal","Quantization",".","In","contrast","to","the","base","class",",","which","uses","rounding","for","quantization",",","here","''","quantization","''","is","performed","additive","uniform","noise",",","which","is","implemented","with","Universal","Quantization",".","This","is","described","in","Sec",".","3.2.","in","the","paper",">","``","Universally","Quantized","Neural","Compression","''","<","br","\/",">",">","Eirikur","Agustsson","&","Lucas","Theis","<","br","\/",">",">","https",":","\/\/arxiv.org\/abs\/2006.09952"]
docstr: Compresses a floating-point tensor.
  
  Compresses the tensor to bit strings. `bottleneck` is first quantized
  as in `quantize()`, and then compressed using the probability tables derived
  from `indexes`. The quantized tensor can later be recovered by calling
  `decompress()`.
  
  The innermost `self.coding_rank` dimensions are treated as one coding unit,
  i.e. are compressed into one string each. Any additional dimensions to the
  left are treated as batch dimensions.
  
  Args:
    bottleneck: `tf.Tensor` containing the data to be compressed.
    indexes: `tf.Tensor` specifying the scalar distribution for each element
      in `bottleneck`. See class docstring for examples.
  
  Returns:
    A `tf.Tensor` having the same shape as `bottleneck` without the
    `self.coding_rank` innermost dimensions, containing a string for each
    coding unit.
docstr_tok: ["Compresses","a","floating-point","tensor",".","Compresses","the","tensor","to","bit","strings",".","`","bottleneck","`","is","first","quantized","as","in","`","quantize","(",")","`",",","and","then","compressed","using","the","probability","tables","derived","from","`","indexes","`",".","The","quantized","tensor","can","later","be","recovered","by","calling","`","decompress","(",")","`",".","The","innermost","`","self.coding_rank","`","dimensions","are","treated","as","one","coding","unit",",","i.e",".","are","compressed","into","one","string","each",".","Any","additional","dimensions","to","the","left","are","treated","as","batch","dimensions",".","Args",":","bottleneck",":","`","tf.Tensor","`","containing","the","data","to","be","compressed",".","indexes",":","`","tf.Tensor","`","specifying","the","scalar","distribution","for","each","element","in","`","bottleneck","`",".","See","class","docstring","for","examples",".","Returns",":","A","`","tf.Tensor","`","having","the","same","shape","as","`","bottleneck","`","without","the","`","self.coding_rank","`","innermost","dimensions",",","containing","a","string","for","each","coding","unit","."]
code: def compress(self, bottleneck, indexes):
      """Compresses a floating-point tensor.
  
      Compresses the tensor to bit strings. `bottleneck` is first quantized
      as in `quantize()`, and then compressed using the probability tables derived
      from `indexes`. The quantized tensor can later be recovered by calling
      `decompress()`.
  
      The innermost `self.coding_rank` dimensions are treated as one coding unit,
      i.e. are compressed into one string each. Any additional dimensions to the
      left are treated as batch dimensions.
  
      Args:
        bottleneck: `tf.Tensor` containing the data to be compressed.
        indexes: `tf.Tensor` specifying the scalar distribution for each element
          in `bottleneck`. See class docstring for examples.
  
      Returns:
        A `tf.Tensor` having the same shape as `bottleneck` without the
        `self.coding_rank` innermost dimensions, containing a string for each
        coding unit.
      """
      bottleneck = tf.convert_to_tensor(
          bottleneck, dtype=self.bottleneck_dtype
      )
      indexes = _add_offset_indexes(indexes, self._num_noise_levels)
      indexes = self._normalize_indexes(indexes)
      flat_indexes = self._flatten_indexes(indexes)
      symbols_shape = tf.shape(flat_indexes)
      batch_shape = symbols_shape[: -self.coding_rank]
      offset = self._offset_from_indexes(indexes)
      symbols = tf.cast(tf.round(bottleneck - offset), tf.int32)
      symbols -= tf.gather(self.cdf_offset, flat_indexes)
      handle = gen_ops.create_range_encoder(batch_shape, self.cdf)
      handle = gen_ops.entropy_encode_index(
          handle, flat_indexes, symbols
      )
      return gen_ops.entropy_encode_finalize(handle)
  
imports: import functools
  import tensorflow
  from tensorflow_compression.python.entropy_models import continuous_base
  from tensorflow_compression.python.ops import gen_ops
  from tensorflow_compression.python.ops import math_ops
label_desc: Use image node_id 12 for calling the UniversalIndexedEntropyModel obj's underlying member method code with example usage: obj.compress(bottleneck, indexes) and returns: gen_ops