def split(indices_or_sections, axis:0)
      axis = check_axis(axis)
      size_axis = shape[axis]
      case indices_or_sections
      when Integer
        div_axis, mod_axis = size_axis.divmod(indices_or_sections)
        refs = [true]*ndim
        beg_idx = 0
        mod_axis.times.map do |i|
          end_idx = beg_idx + div_axis + 1
          refs[axis] = beg_idx ... end_idx
          beg_idx = end_idx
          self[*refs]
        end +
        (indices_or_sections-mod_axis).times.map do |i|
          end_idx = beg_idx + div_axis
          refs[axis] = beg_idx ... end_idx
          beg_idx = end_idx
          self[*refs]
        end
      when NArray
        split(indices_or_sections.to_a,axis:axis)
      when Array
        refs = [true]*ndim
        fst = 0
        (indices_or_sections + [size_axis]).map do |lst|
          lst = size_axis if lst > size_axis
          refs[axis] = (fst < size_axis) ? fst...lst : -1...-1
          fst = lst
          self[*refs]
        end
      else
        raise TypeError,"argument must be Integer or Array"
      end
    end
def split(indices_or_sections, axis:0)
      axis = check_axis(axis)
      size_axis = shape[axis]
      case indices_or_sections
      when Integer
        div_axis, mod_axis = size_axis.divmod(indices_or_sections)
        refs = [true]*ndim
        beg_idx = 0
        mod_axis.times.map do |i|
          end_idx = beg_idx + div_axis + 1
          refs[axis] = beg_idx ... end_idx
          beg_idx = end_idx
          self[*refs]
        end +
        (indices_or_sections-mod_axis).times.map do |i|
          end_idx = beg_idx + div_axis
          refs[axis] = beg_idx ... end_idx
          beg_idx = end_idx
          self[*refs]
        end
      when NArray
        split(indices_or_sections.to_a,axis:axis)
      when Array
        refs = [true]*ndim
        fst = 0
        (indices_or_sections + [size_axis]).map do |lst|
          lst = size_axis if lst > size_axis
          refs[axis] = (fst < size_axis) ? fst...lst : -1...-1
          fst = lst
          self[*refs]
        end
      else
        raise TypeError,"argument must be Integer or Array"
      end
    end
@example
   p x = Numo::DFloat.new(9).seq
   # Numo::DFloat#shape=[9]
   # [0, 1, 2, 3, 4, 5, 6, 7, 8]

   pp x.split(3)
   # [Numo::DFloat(view)#shape=[3]
   # [0, 1, 2],
   #  Numo::DFloat(view)#shape=[3]
   # [3, 4, 5],
   #  Numo::DFloat(view)#shape=[3]
   # [6, 7, 8]]

   p x = Numo::DFloat.new(8).seq
   # Numo::DFloat#shape=[8]
   # [0, 1, 2, 3, 4, 5, 6, 7]

   pp x.split([3, 5, 6, 10])
   # [Numo::DFloat(view)#shape=[3]
   # [0, 1, 2],
   #  Numo::DFloat(view)#shape=[2]
   # [3, 4],
   #  Numo::DFloat(view)#shape=[1]
   # [5],
   #  Numo::DFloat(view)#shape=[2]
   # [6, 7],
   #  Numo::DFloat(view)#shape=[0][]]