code: def generator_loss(disc_outputs):
      loss = 0
      gen_losses = []
      for dg in disc_outputs:
          l = torch.mean((1 - dg) ** 2)
          gen_losses.append(l)
          loss += l
  
      return loss, gen_losses
  
imports: import torch
  import torch.nn
  import torch.nn.functional
  from torch.nn import AvgPool1d, Conv1d, Conv2d, ConvTranspose1d
  from torch.nn.utils import remove_weight_norm, spectral_norm, weight_norm
label_desc: Use image node_id 5 for calling a global function with example usage: generator_loss(disc_outputs) and returns: loss,  gen_losses