class_docstr: Base class for all GANs.
class_docstr_tok: ["Base","class","for","all","GANs","."]
docstr: Body of the model.
  
  Args:
    features: a dictionary with the tensors.
  
  Returns:
    A pair (predictions, losses) where predictions is the generated image
    and losses is a dictionary of losses (that get added for the final loss).
docstr_tok: ["Body","of","the","model",".","Args",":","features",":","a","dictionary","with","the","tensors",".","Returns",":","A","pair","(","predictions",",","losses",")","where","predictions","is","the","generated","image","and","losses","is","a","dictionary","of","losses","(","that","get","added","for","the","final","loss",")","."]
code: def body(self, features):
      """Body of the model.
  
      Args:
        features: a dictionary with the tensors.
  
      Returns:
        A pair (predictions, losses) where predictions is the generated image
        and losses is a dictionary of losses (that get added for the final loss).
      """
      features["targets"] = features["inputs"]
      is_training = self.hparams.mode == tf_estimator.ModeKeys.TRAIN
  
      # Input images.
      inputs = tf.to_float(features["targets_raw"])
  
      # Noise vector.
      z = tf.random_uniform(
          [self.hparams.batch_size, self.hparams.bottleneck_bits],
          minval=-1,
          maxval=1,
          name="z",
      )
  
      # Generator output: fake images.
      out_shape = common_layers.shape_list(inputs)[1:4]
      g = self.generator(z, is_training, out_shape)
  
      losses = self.losses(inputs, g)  # pylint: disable=not-callable
  
      summary_g_image = tf.reshape(
          g[0, :], [1] + common_layers.shape_list(inputs)[1:]
      )
      tf.summary.image("generated", summary_g_image, max_outputs=1)
  
      if (
          is_training
      ):  # Returns an dummy output and the losses dictionary.
          return tf.zeros_like(inputs), losses
      return tf.reshape(g, tf.shape(inputs)), losses
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from tensor2tensor.layers import common_hparams
  from tensor2tensor.layers import common_layers
  from tensor2tensor.utils import registry
  from tensor2tensor.utils import t2t_model
  import tensorflow.compat.v1
  from tensorflow.compat.v1 import estimator
label_desc: Use image node_id 4 for calling the AbstractGAN obj's underlying member method code with example usage: obj.body(features) and returns: tf,  losses, tf,  losses