def expand_2d_to_3d(file_data_2d, lens):
    """
    Restore the 2D file data back to 3D.

    Args:
        file_data_2d: A 2D nested list
        lens: A list of integers recording the number of files in each CL.

    Returns:
        A 3D nested list.
    """
    restore_3d_file_data = []
    prefix_train = 0
    for l in lens:
        restore_3d_file_data.append(
            file_data_2d[prefix_train:prefix_train + l].tolist())
        prefix_train += l
    return restore_3d_file_data