class_docstr: SV2P with discrete latent.
class_docstr_tok: ["SV2P","with","discrete","latent","."]
code: def next_frame(
      self,
      frames,
      actions,
      rewards,
      target_frame,
      internal_states,
      video_features,
  ):
      del video_features
  
      if self.has_pred_actions or self.has_values:
          raise NotImplementedError(
              "Parameter sharing with policy not supported."
          )
  
      frames, actions, rewards = frames[0], actions[0], rewards[0]
  
      if internal_states is None:
          internal_states = [None] * (
              5 if self.hparams.small_mode else 7
          )
  
      extra_loss = 0.0
      latent = self.simple_discrete_latent_tower(frames, target_frame)
  
      pred_image, internal_states, _ = self.construct_predictive_tower(
          frames, None, actions, internal_states, latent, True
      )
  
      if not self.has_rewards:
          return pred_image, None, extra_loss, internal_states
  
      pred_reward = self.reward_prediction(
          pred_image, actions, rewards, latent
      )
      return (
          pred_image,
          pred_reward,
          None,
          None,
          extra_loss,
          internal_states,
      )
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from tensor2tensor.layers import common_layers
  from tensor2tensor.layers import common_video
  from tensor2tensor.layers import discretization
  from tensor2tensor.models.video import base
  from tensor2tensor.models.video import base_vae
  from tensor2tensor.utils import contrib
  from tensor2tensor.utils import registry
  import tensorflow.compat.v1
label_desc: Use image node_id 4 for calling the NextFrameSv2pDiscrete obj's underlying member method code with example usage: obj.next_frame(frames, actions, rewards, target_frame, internal_states, video_features) and returns: pred_image,  pred_reward,  None,  None,  extra_loss,  internal_states, pred_image,  None,  extra_loss,  internal_states