code: def generator_loss(discriminator_gen_outputs):
      """
      Original generator loss for GANs.
      L = -log(sigmoid(D(G(z))))
      See `Generative Adversarial Nets` (https://arxiv.org/abs/1406.2661)
      for more details.
      Args:
      discriminator_gen_outputs: Discriminator output on generated data. Expected
        to be in the range of (-inf, inf).
      Returns:
      A scalar loss Tensor.
      """
      loss = tf.compat.v1.losses.sigmoid_cross_entropy(
          tf.ones_like(discriminator_gen_outputs),
          discriminator_gen_outputs,
      )
      tf.contrib.summary.scalar("generator_loss", loss)
      return loss
  
imports: from __future__ import absolute_import, division, print_function
  import argparse
  import os
  import sys
  import time
  from tempfile import gettempdir
  import tensorflow
  from tensorflow.examples.tutorials.mnist import input_data
  from clearml import Task
label_desc: Use image node_id 2 for calling a global function with example usage: generator_loss(discriminator_gen_outputs) and returns: loss