class_docstr: Compute Discriminator Loss values depending on training
  configuration 
class_docstr_tok: ["Compute","Discriminator","Loss","values","depending","on","training","configuration"]
code: def forward(self, scores_fake, scores_real):
      loss = 0
      return_dict = {}
  
      if self.use_mse_gan_loss:
          mse_D_loss, mse_D_real_loss, mse_D_fake_loss = _apply_D_loss(
              scores_fake=scores_fake,
              scores_real=scores_real,
              loss_func=self.mse_loss,
          )
          return_dict["D_mse_gan_loss"] = mse_D_loss
          return_dict["D_mse_gan_real_loss"] = mse_D_real_loss
          return_dict["D_mse_gan_fake_loss"] = mse_D_fake_loss
          loss += mse_D_loss
  
      if self.use_hinge_gan_loss:
          (
              hinge_D_loss,
              hinge_D_real_loss,
              hinge_D_fake_loss,
          ) = _apply_D_loss(
              scores_fake=scores_fake,
              scores_real=scores_real,
              loss_func=self.hinge_loss,
          )
          return_dict["D_hinge_gan_loss"] = hinge_D_loss
          return_dict["D_hinge_gan_real_loss"] = hinge_D_real_loss
          return_dict["D_hinge_gan_fake_loss"] = hinge_D_fake_loss
          loss += hinge_D_loss
  
      return_dict["D_loss"] = loss
      return return_dict
  
imports: import torch
  from torch import nn
  from torch.nn import functional
label_desc: Use image node_id 2 for calling the DiscriminatorLoss obj's underlying member method code with example usage: obj.forward(scores_fake, scores_real) and returns: return_dict