def tile_nd(s, tensor, tile):
    """Scheduling utility to perform N-dimensional tiling.

    Parameters
    ----------
    s : tvm.te.Schedule
        The schedule to apply the tiling to.
    tensor : tvm.te.Tensor
        The tensor to apply the tiling to.
    tile : tuple
        The N-dimensional tile size.

    Returns
    -------
    outer_indices : list of tvm.tir.IterVar
        The outer iteration variables.
    inner_indices : list of tvm.tir.IterVar
        The inner iteration variables.

    """
    outer_indices = []
    inner_indices = []
    for i, size in enumerate(tile):
        outer, inner = s[tensor].split(tensor.op.axis[i], size)
        outer_indices.append(outer)
        inner_indices.append(inner)

    s[tensor].reorder(*outer_indices, *inner_indices)
    return outer_indices, inner_indices