def normalize(grid):
    """Normalize input grid from [-1, 1] to [0, 1]

    Args:
        grid (Tensor): The grid to be normalize, range [-1, 1].

    Returns:
        Tensor: Normalized grid, range [0, 1].
    """

    return (grid + 1.0) / 2.0