human
I wrote the below code

    if (dim < 0):
        dim += tensor.dim()
    dim_size = tensor.size(dim)
    num_splits = (((dim_size + split_size) - 1) // split_size)
    last_split_size = (split_size - ((split_size * num_splits) - dim_size))
    def get_split_size(i):
        return (split_size if (i < (num_splits - 1)) else last_split_size)
    return tuple((tensor.narrow(int(dim), int((i * split_size)), int(get_split_size(i))) for i in _range(0, num_splits)))

What's a good function header?
 Here's a good function header?
assistant
#Here's a good function header.

def split(tensor, split_size, dim=0):