class_docstr: Main function for Stochastic Adversarial Video Prediction.
docstr: Get the discriminator + generator loss at every step.
  
  This performs an 1:1 update of the discriminator and generator at every
  step.
  
  Args:
    true_frames: 5-D Tensor of shape (num_steps, batch_size, H, W, C)
                 Assumed to be ground truth.
    gen_frames: 5-D Tensor of shape (num_steps, batch_size, H, W, C)
                Assumed to be fake.
    name: discriminator scope.
  Returns:
    loss: 0-D Tensor, with d_loss + g_loss
docstr_tok: ["Get","the","discriminator","+","generator","loss","at","every","step",".","This","performs","an","1:1","update","of","the","discriminator","and","generator","at","every","step",".","Args",":","true_frames",":","5-D","Tensor","of","shape","(","num_steps",",","batch_size",",","H",",","W",",","C",")","Assumed","to","be","ground","truth",".","gen_frames",":","5-D","Tensor","of","shape","(","num_steps",",","batch_size",",","H",",","W",",","C",")","Assumed","to","be","fake",".","name",":","discriminator","scope",".","Returns",":","loss",":","0-D","Tensor",",","with","d_loss","+","g_loss"]
code: def get_gan_loss(self, true_frames, gen_frames, name):
      """Get the discriminator + generator loss at every step.
  
      This performs an 1:1 update of the discriminator and generator at every
      step.
  
      Args:
        true_frames: 5-D Tensor of shape (num_steps, batch_size, H, W, C)
                     Assumed to be ground truth.
        gen_frames: 5-D Tensor of shape (num_steps, batch_size, H, W, C)
                    Assumed to be fake.
        name: discriminator scope.
      Returns:
        loss: 0-D Tensor, with d_loss + g_loss
      """
      # D - STEP
      with tf.variable_scope(
          "%s_discriminator" % name, reuse=tf.AUTO_REUSE
      ):
          gan_d_loss, _, fake_logits_stop = self.d_step(
              true_frames, gen_frames
          )
  
      # G - STEP
      with tf.variable_scope("%s_discriminator" % name, reuse=True):
          gan_g_loss_pos_d, gan_g_loss_neg_d = self.g_step(
              gen_frames, fake_logits_stop
          )
      gan_g_loss = gan_g_loss_pos_d + gan_g_loss_neg_d
      tf.summary.scalar(
          "gan_loss_%s" % name, gan_g_loss_pos_d + gan_d_loss
      )
  
      if self.hparams.gan_optimization == "joint":
          gan_loss = gan_g_loss + gan_d_loss
      else:
          curr_step = self.get_iteration_num()
          gan_loss = tf.cond(
              tf.logical_not(curr_step % 2 == 0),
              lambda: gan_g_loss,
              lambda: gan_d_loss,
          )
      return gan_loss
  
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 7 for calling the NextFrameSavpBase obj's underlying member method code with example usage: obj.get_gan_loss(true_frames, gen_frames, name) and returns: gan_loss