import tensorflow as tf

              networks._generator_alpha(block_id, tf.constant(1.2, tf.float32)))
          for block_id in range(1, 5)
      ]

    self.assertArrayNear(alpha_fixed_block_id, [0, 0.2, 1, 0.8, 0, 0, 0],
                         1.0e-6)
    self.assertArrayNear(alpha_fixed_progress, [0, 0.8, 0.2, 0], 1.0e-6)

  def test_discriminator_alpha(self):
    with self.test_session(use_gpu=True) as sess:
      alpha_fixed_block_id = [
          sess.run(
              networks._discriminator_alpha(2, tf.constant(
                  progress, tf.float32)))
          for progress in [0, 0.2, 1, 1.2, 2, 2.2, 3]
      ]
      alpha_fixed_progress = [
          sess.run(
              networks._discriminator_alpha(block_id,
                                            tf.constant(1.2, tf.float32)))
          for block_id in range(1, 5)
      ]

    self.assertArrayNear(alpha_fixed_block_id, [1, 1, 1, 0.8, 0, 0, 0], 1.0e-6)
