class_docstr: Indexed entropy model for location-scale family of random variables.
  
  This class is a common special case of `ContinuousIndexedEntropyModel`. The
  specified distribution is parameterized with `num_scales` values of scale
  parameters. An element-wise location parameter is handled by shifting the
  distributions to zero.
  
  This method is illustrated in Figure 10 of:
  > "Nonlinear Transform Coding"<br />
  > J. Ballé, P.A. Chou, D. Minnen, S. Singh, N. Johnston, E. Agustsson,
  > S.J. Hwang, G. Toderici<br />
  > https://doi.org/10.1109/JSTSP.2020.3034501
  
  Note: this only works for shift-invariant `tfpd.Distribution` objects, where
  the `loc` parameter really denotes a translation (i.e., not for the log-normal
  distribution).
docstr: Quantizes a floating-point tensor.
  
  To use this entropy model as an information bottleneck during training, pass
  a tensor through this function. The tensor is rounded to integer values
  modulo the location parameters of the prior distribution given in `loc`.
  
  The gradient of this rounding operation is overridden with the identity
  (straight-through gradient estimator).
  
  Args:
    bottleneck: `tf.Tensor` containing the data to be quantized.
    loc: `None` or `tf.Tensor`. If `None`, the location parameter for all
      elements is assumed to be zero. Otherwise, specifies the location
      parameter for each element in `bottleneck`. Must have the same shape as
      `bottleneck`.
  
  Returns:
    A `tf.Tensor` containing the quantized values.
docstr_tok: ["Quantizes","a","floating-point","tensor",".","To","use","this","entropy","model","as","an","information","bottleneck","during","training",",","pass","a","tensor","through","this","function",".","The","tensor","is","rounded","to","integer","values","modulo","the","location","parameters","of","the","prior","distribution","given","in","`","loc","`",".","The","gradient","of","this","rounding","operation","is","overridden","with","the","identity","(","straight-through","gradient","estimator",")",".","Args",":","bottleneck",":","`","tf.Tensor","`","containing","the","data","to","be","quantized",".","loc",":","`","None","`","or","`","tf.Tensor","`",".","If","`","None","`",",","the","location","parameter","for","all","elements","is","assumed","to","be","zero",".","Otherwise",",","specifies","the","location","parameter","for","each","element","in","`","bottleneck","`",".","Must","have","the","same","shape","as","`","bottleneck","`",".","Returns",":","A","`","tf.Tensor","`","containing","the","quantized","values","."]
code: def quantize(self, bottleneck, loc=None):
      """Quantizes a floating-point tensor.
  
      To use this entropy model as an information bottleneck during training, pass
      a tensor through this function. The tensor is rounded to integer values
      modulo the location parameters of the prior distribution given in `loc`.
  
      The gradient of this rounding operation is overridden with the identity
      (straight-through gradient estimator).
  
      Args:
        bottleneck: `tf.Tensor` containing the data to be quantized.
        loc: `None` or `tf.Tensor`. If `None`, the location parameter for all
          elements is assumed to be zero. Otherwise, specifies the location
          parameter for each element in `bottleneck`. Must have the same shape as
          `bottleneck`.
  
      Returns:
        A `tf.Tensor` containing the quantized values.
      """
      bottleneck = tf.convert_to_tensor(
          bottleneck, dtype=self.bottleneck_dtype
      )
      return round_ops.round_st(bottleneck, loc)
  
imports: 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
  from tensorflow_compression.python.ops import round_ops
label_desc: Use image node_id 3 for calling the LocationScaleIndexedEntropyModel obj's underlying member method code with example usage: obj.quantize(bottleneck, loc) and returns: round_ops