class_docstr: Tests adversarial losses.
      
class_docstr_tok: ["Tests","adversarial","losses","."]
docstr: Tests :meth:`~texar.tf.losses.adv_losses.binary_adversarial_losse`.
          
docstr_tok: ["Tests",":","meth",":","`","~texar.tf.losses.adv_losses.binary_adversarial_losse","`","."]
code: def test_binary_adversarial_losses(self):
      """Tests :meth:`~texar.tf.losses.adv_losses.binary_adversarial_losse`."""
      batch_size = 16
      data_dim = 64
      real_data = tf.zeros([batch_size, data_dim], dtype=tf.float32)
      fake_data = tf.ones([batch_size, data_dim], dtype=tf.float32)
      const_logits = tf.zeros([batch_size], dtype=tf.float32)
      # Use a dumb discriminator that always outputs logits=0.
      gen_loss, disc_loss = binary_adversarial_losses(
          real_data, fake_data, lambda x: const_logits
      )
      gen_loss_2, disc_loss_2 = binary_adversarial_losses(
          real_data, fake_data, lambda x: const_logits, mode="min_fake"
      )
  
      with self.test_session() as sess:
          gen_loss_, disc_loss_ = sess.run([gen_loss, disc_loss])
          gen_loss_2_, disc_loss_2_ = sess.run(
              [gen_loss_2, disc_loss_2]
          )
          self.assertAlmostEqual(gen_loss_, -gen_loss_2_)
          self.assertAlmostEqual(disc_loss_, disc_loss_2_)
  
imports: import tensorflow
  from texar.tf.losses.adv_losses import binary_adversarial_losses
label_desc: Use image node_id 1 for calling the AdvLossesTest obj's underlying member method code with example usage: obj.test_binary_adversarial_losses() without return types