class_docstr: Variational entropy-constrained vector quantization model.
code: def all_rd(self, x):
      rates = tf.math.reduce_logsumexp(self.logits) - self.logits
      rates /= tf.cast(tf.math.log(2.0), dtype=self.dtype)
      distortions = self.distortion_fn(
          tf.expand_dims(x, -2), self.codebook
      )
      return rates, distortions
  
file_path: compression/models/toy_sources/vecvq.py
imports: import tensorflow
  from toy_sources import compression_model
label_desc: Use image node_id 3 for calling the VECVQModel obj's underlying member method code with example usage: obj.all_rd(x) and returns: rates,  distortions