class_docstr: Nonlinear transform coding model.
code: def analysis(self, x):
      y = tf.cast(x, self.dtype)
      if y.shape[-1] != self.ndim_source:
          raise ValueError(
              f"Expected {self.ndim_source} trailing dimensions, "
              f"received {y.shape[-1]}."
          )
      batch_shape = tf.shape(y)[:-1]
      y = tf.reshape(y, (-1, self.ndim_source))
      y = self._analysis(y)
      assert y.shape[-1] == self.ndim_latent
      return tf.reshape(
          y, tf.concat([batch_shape, [self.ndim_latent]], 0)
      )
  
imports: import matplotlib.pyplot
  import numpy
  import tensorflow
  import tensorflow_compression
  import tensorflow_probability
  from toy_sources import compression_model
label_desc: Use image node_id 4 for calling the NTCModel obj's underlying member method code with example usage: obj.analysis(x) and returns: tf