import tensorflow as tf

      imgs = random_apply(color_drop, imgs, self._aug_color_drop_prob)
      return tf.stop_gradient(imgs)

    aug_images, aug_generated = augment(images), augment(generated)

    # concat all images
    all_images = tf.concat([images, generated, aug_images, aug_generated], 0)

    if self.conditional:
      all_y = tf.concat([y, sampled_y, y, sampled_y], axis=0)

    # Compute discriminator output for real and fake images in one batch.

    d_all, d_all_logits, d_latents = self.discriminator(
        x=all_images, y=all_y, is_training=is_training)

    z_projs = self._latent_projections(d_latents)

