class_docstr: Main function for Stochastic Adversarial Video Prediction.
docstr: Performs the generator step in computing the GAN loss.
  
  Args:
    gen_frames: Generated frames
    fake_logits_stop: Logits corresponding to the generated frames as per
                      the discriminator. Assumed to have a stop-gradient term.
  Returns:
    gan_g_loss_pos_d: Loss.
    gan_g_loss_neg_d: -gan_g_loss_pos_d but with a stop gradient on generator.
docstr_tok: ["Performs","the","generator","step","in","computing","the","GAN","loss",".","Args",":","gen_frames",":","Generated","frames","fake_logits_stop",":","Logits","corresponding","to","the","generated","frames","as","per","the","discriminator",".","Assumed","to","have","a","stop-gradient","term",".","Returns",":","gan_g_loss_pos_d",":","Loss",".","gan_g_loss_neg_d",":","-gan_g_loss_pos_d","but","with","a","stop","gradient","on","generator","."]
code: def g_step(self, gen_frames, fake_logits_stop):
      """Performs the generator step in computing the GAN loss.
  
      Args:
        gen_frames: Generated frames
        fake_logits_stop: Logits corresponding to the generated frames as per
                          the discriminator. Assumed to have a stop-gradient term.
      Returns:
        gan_g_loss_pos_d: Loss.
        gan_g_loss_neg_d: -gan_g_loss_pos_d but with a stop gradient on generator.
      """
      hparam_to_gen_loss = {
          "least_squares": gan_losses.least_squares_generator_loss,
          "cross_entropy": gan_losses.modified_generator_loss,
          "wasserstein": gan_losses.wasserstein_generator_loss,
      }
  
      fake_logits = self.discriminator(gen_frames)
      mean_fake_logits = tf.reduce_mean(fake_logits)
      tf.summary.scalar("mean_fake_logits", mean_fake_logits)
  
      # Generator loss.
      # Using gan_g_loss_pos_d updates the discriminator as well.
      # To avoid this add gan_g_loss_neg_d = -gan_g_loss_pos_d
      # but with stop gradient on the generator.
      # This makes sure that the net gradient on the discriminator is zero and
      # net-gradient on the generator is just due to the gan_g_loss_pos_d.
      generator_loss_func = hparam_to_gen_loss[self.hparams.gan_loss]
      gan_g_loss_pos_d = generator_loss_func(
          discriminator_gen_outputs=fake_logits, add_summaries=True
      )
      gan_g_loss_neg_d = -generator_loss_func(
          discriminator_gen_outputs=fake_logits_stop, add_summaries=True
      )
      return gan_g_loss_pos_d, gan_g_loss_neg_d
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numbers
  import numpy
  from tensor2tensor.layers import common_layers
  from tensor2tensor.layers import common_video
  from tensor2tensor.models.video import savp_params
  from tensor2tensor.models.video import sv2p
  from tensor2tensor.utils import contrib
  from tensor2tensor.utils import registry
  from tensor2tensor.utils import update_ops_hook
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
  import tensorflow_gan
label_desc: Use image node_id 6 for calling the NextFrameSavpBase obj's underlying member method code with example usage: obj.g_step(gen_frames, fake_logits_stop) and returns: gan_g_loss_pos_d,  gan_g_loss_neg_d