class_docstr: Sliced GAN for demonstration.
class_docstr_tok: ["Sliced","GAN","for","demonstration","."]
docstr: Losses in the sliced case.
docstr_tok: ["Losses","in","the","sliced","case","."]
code: def losses(self, inputs, generated):
      """Losses in the sliced case."""
      is_training = self.hparams.mode == tf_estimator.ModeKeys.TRAIN
  
      def discriminate(x):
          return self.discriminator(
              x, is_training=is_training, reuse=False
          )
  
      generator_loss = common_layers.sliced_gan_loss(
          inputs,
          reverse_gradient(generated),
          discriminate,
          self.hparams.num_sliced_vecs,
      )
      return {"training": -generator_loss}
  
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 1 for calling the SlicedGan obj's underlying member method code with example usage: obj.losses(inputs, generated) and returns: dict, self