class_docstr: Extend Glow for video.
docstr: Objective based on the prior over latent z.
  
  Args:
    condition: Whether or not to condition on cond_latents.
    cond_latents: tensor or list of tensors depending on
                  hparams.latent_dist_encoder
  Returns:
    objective: float, log-likelihood of z under the prior.
    dist: instance of tfp.distributions.Normal, prior distribution.
  Raises:
    ValueError: If input is smaller than the prior, uneven height
                or rectangular.
code: def top_prior(self, condition=False, cond_latents=None):
      """Objective based on the prior over latent z.
  
      Args:
        condition: Whether or not to condition on cond_latents.
        cond_latents: tensor or list of tensors depending on
                      hparams.latent_dist_encoder
      Returns:
        objective: float, log-likelihood of z under the prior.
        dist: instance of tfp.distributions.Normal, prior distribution.
      Raises:
        ValueError: If input is smaller than the prior, uneven height
                    or rectangular.
      """
      if isinstance(condition, bool):
          condition = tf.constant(condition, dtype=tf.bool)
      self._all_conds.append(condition)
  
      if self.hparams.gen_mode == "conditional":
          # cond_top_latents is None when
          # latent_dist_encoder is a lstm and frame_ind == 0.
          # latent_dist_encoder is conv_net and frame_ind < num_cond_frames.
          marginal_mean, marginal_scale = self.uncond_top_dist()
          if cond_latents is None:
              mean, scale = marginal_mean, marginal_scale
          else:
              cond_mean, cond_scale = self.cond_top_dist(cond_latents)
              mean, scale = tf.cond(
                  condition,
                  lambda: (cond_mean, cond_scale),
                  lambda: (marginal_mean, marginal_scale),
              )
          return glow_ops.TemperedNormal(mean, scale, self.temperature)
      if self.hparams.top_prior == "prev_frame":
          return self.get_squeeze_prior()
      else:
          return super(NextFrameGlow, self).top_prior()
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  from six.moves import range
  from tensor2tensor.layers import common_layers
  from tensor2tensor.layers import common_video
  from tensor2tensor.layers import modalities
  from tensor2tensor.models.research import glow
  from tensor2tensor.models.research import glow_ops
  from tensor2tensor.utils import contrib
  from tensor2tensor.utils import registry
  import tensorflow.compat.v1
  import tensorflow_probability
label_desc: Use image node_id 9 for calling the NextFrameGlow obj's underlying member method code with example usage: obj.top_prior(condition, cond_latents) and returns: glow_ops, self, super