import tensorflow as tf

    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),
        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 = 0.8 * sess.run(
          layers.upscale(layers.downscale(x, 2), 2)) + 0.2 * x_np
    self.assertNDArrayNear(x_blend_np, x_blend_expected_np, 1.0e-6)

  def test_num_filters(self):
