def blend_resolution(lores, hires, alpha):
    """Blend two images.

    Args:
        lores: 4D tensor in NCHW, low resolution image.
        hires: 4D tensor in NCHW, high resolution image.
        alpha: scalar tensor in [0, 1], 0 produces the low resolution, 1 the high one.

    Returns:
        4D tensor in NCHW of blended images.
    """
    return lores + alpha * (hires - lores)