class_docstr: Variational entropy-constrained vector quantization model.
code: def test_losses(self, x):
      rates, distortions = self.all_rd(x)
      all_rd = rates + self.lmbda * distortions
      indexes = tf.argmin(all_rd, axis=-1, output_type=tf.int32)
      rates = tf.gather(rates, indexes)
      distortions = tf.gather(
          distortions, indexes, batch_dims=indexes.shape.rank
      )
      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 5 for calling the VECVQModel obj's underlying member method code with example usage: obj.test_losses(x) and returns: rates,  distortions