def _split_input_slice(input_shape, num_split):
    """Get input slice from the input shape.

    Parameters
    ----------
    input_shape : tuple
        The input shape of the net.

    num_split : int
        The number of split we want to have.

    Returns
    -------
    slices : list of slice
        The split slices to get a specific slice.

    shapes : list of tuples
        The shape of each split slice.

    Raises
    ------
    ValueError
        If there are two many splits such that some slice can be empty.
    """
    batch_size = input_shape[0]
    step = (batch_size + num_split - 1) / num_split
    slices = []
    shapes = []
    for k in range(num_split):
        begin = int(min(k * step, batch_size))
        end = int(min((k+1) * step, batch_size))
        if begin == end:
            raise ValueError('Too many slices such that some splits are empty')
        slices.append(slice(begin, end))
        s = list(input_shape)
        s[0] = end - begin
        shapes.append(tuple(s))
    return (slices, shapes)