def _split(value, num_or_size_splits, axis=0, num=None, name='split'):
    'Map tf.split -> np.split.'
    indices_or_sections = np.array(num_or_size_splits)
    if (indices_or_sections.ndim == 1):
        if any(((idx == (- 1)) for idx in indices_or_sections)):
            total_splits = sum((idx for idx in indices_or_sections if (idx != (- 1))))
            remainder = int(max(0, (np.array(value).shape[axis] - total_splits)))
            indices_or_sections = [(idx if (idx != (- 1)) else remainder) for idx in indices_or_sections]
        indices_or_sections = np.cumsum(np.array(indices_or_sections))[:(- 1)]
    return np.split(value, indices_or_sections, axis)
Map tf.split -> np.split.
def _split(value, num_or_size_splits, axis=0, num=None, name='split'):
    
    indices_or_sections = np.array(num_or_size_splits)
    if (indices_or_sections.ndim == 1):
        if any(((idx == (- 1)) for idx in indices_or_sections)):
            total_splits = sum((idx for idx in indices_or_sections if (idx != (- 1))))
            remainder = int(max(0, (np.array(value).shape[axis] - total_splits)))
            indices_or_sections = [(idx if (idx != (- 1)) else remainder) for idx in indices_or_sections]
        indices_or_sections = np.cumsum(np.array(indices_or_sections))[:(- 1)]
    return np.split(value, indices_or_sections, axis)