class_docstr: Old SV2P code. Only for legacy reasons.
class_docstr_tok: ["Old","SV2P","code",".","Only","for","legacy","reasons","."]
code: def visualize_predictions(
      self, real_frames, gen_frames, actions=None
  ):
      def concat_on_y_axis(x):
          x = tf.unstack(x, axis=1)
          x = tf.concat(x, axis=1)
          return x
  
      frames_gd = common_video.swap_time_and_batch_axes(real_frames)
      frames_pd = common_video.swap_time_and_batch_axes(gen_frames)
      if actions is not None:
          actions = common_video.swap_time_and_batch_axes(actions)
  
      if self.is_per_pixel_softmax:
          frames_pd_shape = common_layers.shape_list(frames_pd)
          frames_pd = tf.reshape(frames_pd, [-1, 256])
          frames_pd = tf.to_float(tf.argmax(frames_pd, axis=-1))
          frames_pd = tf.reshape(frames_pd, frames_pd_shape[:-1] + [3])
  
      frames_gd = concat_on_y_axis(frames_gd)
      frames_pd = concat_on_y_axis(frames_pd)
      if actions is not None:
          actions = tf.clip_by_value(actions, 0, 1)
          summary("action_vid", tf.cast(actions * 255, tf.uint8))
          actions = concat_on_y_axis(actions)
          side_by_side_video = tf.concat(
              [frames_gd, frames_pd, actions], axis=2
          )
      else:
          side_by_side_video = tf.concat([frames_gd, frames_pd], axis=2)
      tf.summary.image("full_video", side_by_side_video)
  
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 1 for calling the NextFrameSv2pLegacy obj's underlying member method code with example usage: obj.visualize_predictions(real_frames, gen_frames, actions) and returns: x