import tensorflow as tf

      with tf.control_dependencies([update]):
        self.d_loss_class = tf.identity(self.d_loss_class)
    self.d_loss_fake = tf.nn.sigmoid_cross_entropy_with_logits(
        logits=self.end_points_D['D_on_G_logits'],
        labels=tf.zeros_like(self.end_points_D['D_on_G_logits']))
    self.d_loss_class = tf.reduce_mean(self.d_loss_class)
    self.d_loss_real = tf.reduce_mean(self.d_loss_real)
    self.d_loss_fake = tf.reduce_mean(self.d_loss_fake)

    if is_fm_loss:
      global_pool_head = self.end_points_D['global_pool']
      real_data_features = tf.slice(global_pool_head, [0, 0], [batch_size_train, num_classes])
