class_docstr: Extend Glow for video.
docstr: Glow network that encodes frame to a hierarchy of latents.
  
  Args:
    frame: 5-D Tensor of shape (batch_size, 1, height, width, channels).
    condition: Whether or not to condition on cond_latents.
    cond_latents: optional, list of tensors with length equal to
                  hparams.n_levels - 1. If provided, the latent at level l is
                  conditioned on the cond_latent at level l.
    init: Whether the given batch is an "init" batch or a "train" batch.
  Returns:
    objective: log-likelihood of the frame per the model.
    z_top: top-level latent.
    z_levels: a list of tensors with latents at all levels.
code: def glow_encoder(
      self, frame, condition=False, cond_latents=None, init=False
  ):
      """Glow network that encodes frame to a hierarchy of latents.
  
      Args:
        frame: 5-D Tensor of shape (batch_size, 1, height, width, channels).
        condition: Whether or not to condition on cond_latents.
        cond_latents: optional, list of tensors with length equal to
                      hparams.n_levels - 1. If provided, the latent at level l is
                      conditioned on the cond_latent at level l.
        init: Whether the given batch is an "init" batch or a "train" batch.
      Returns:
        objective: log-likelihood of the frame per the model.
        z_top: top-level latent.
        z_levels: a list of tensors with latents at all levels.
      """
      frame = self.squeeze_video(frame, init=init)
      frame = self.preprocess(frame)
      frame, objective = glow_ops.uniform_binning_correction(frame)
  
      glow_vals = glow_ops.encoder_decoder(
          "codec",
          frame,
          self.hparams,
          eps=None,
          reverse=False,
          cond_latents=cond_latents,
          states=self.level_states,
          condition=condition,
      )
      (
          z_top,
          encoder_objective,
          self.eps,
          z_levels,
          self.level_states,
      ) = glow_vals
      objective += encoder_objective
      return objective, z_top, z_levels
  
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 12 for calling the NextFrameGlow obj's underlying member method code with example usage: obj.glow_encoder(frame, condition, cond_latents, init) and returns: objective,  z_top,  z_levels