class_docstr: Nonlinear transform coding model.
code: def plot_prior_latent(self, intervals, figsize=None, **kwargs):
      if len(intervals) != self.ndim_latent or self.ndim_latent not in (
          1,
          2,
      ):
          raise ValueError(
              "This method is only defined for 1D or 2D models."
          )
  
      y = [
          tf.linspace(float(i[0]), float(i[1]), int(i[2]))
          for i in intervals
      ]
      y = tf.meshgrid(*y, indexing="ij")
      y = tf.stack(y, axis=-1)
      prob = tfpd.Independent(self.prior(**kwargs), 1).prob(y)
  
      if self.ndim_latent == 1:
          plt.figure(figsize=figsize or (16, 6))
          plt.plot(y, prob)
          plt.xlabel("latent space")
          plt.ylabel("prior")
          plt.grid(True)
          plt.xticks(np.arange(*np.ceil(intervals[0][:2])))
      else:
          plt.figure(figsize=figsize or (16, 14))
          plt.imshow(
              prob,
              vmin=0,
              vmax=np.max(prob),
              origin="lower",
              extent=(y[0, 0, 1], y[0, -1, 1], y[0, 0, 0], y[-1, 0, 0]),
          )
          plt.axis("image")
          plt.grid(False)
          plt.xlim(y[0, 0, 1], y[0, -1, 1])
          plt.ylim(y[0, 0, 0], y[-1, 0, 0])
          plt.xlabel("latent dimension 1")
          plt.ylabel("latent dimension 2")
  
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 16 for calling the NTCModel obj's underlying member method code with example usage: obj.plot_prior_latent(intervals, figsize) without return types