import tensorflow as tf

      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)
    self.assertArrayNear(alpha_fixed_progress, [0, 0.8, 1, 1], 1.0e-6)

  def test_blend_images_in_stable_stage(self):
    x_np = np.random.normal(size=[2, 8, 8, 3])
    x = tf.constant(x_np, tf.float32)
    x_blend = networks.blend_images(
        x,
        progress=tf.constant(0.0),
        resolution_schedule=networks.ResolutionSchedule(
            scale_base=2, num_resolutions=2),
        num_blocks=2)
    with self.test_session(use_gpu=True) as sess:
      x_blend_np = sess.run(x_blend)
      x_blend_expected_np = sess.run(layers.upscale(layers.downscale(x, 2), 2))
    self.assertNDArrayNear(x_blend_np, x_blend_expected_np, 1.0e-6)

  def test_blend_images_in_transition_stage(self):
    x_np = np.random.normal(size=[2, 8, 8, 3])
    x = tf.constant(x_np, tf.float32)
    x_blend = networks.blend_images(
        x,
        tf.constant(0.2),
