Splits a tensor into multiple sub-tensors, all of which are views of input,
along dimension dim according to the indices or number of sections specified
by . This function is based on NumPy’s
.
Splits input into sections sections along dimension dim.
If input is divisible by sections along dimension dim, each
section will be of equal size, input.size(dim)/sections. If input
is not divisible by sections, the sizes of the first
int(input.size(dim)%sections) sections will have size
int(input.size(dim)/sections)+1, and the rest will have size
int(input.size(dim)/sections).
sections can also be a zero-dimensional long tensor.
Splits input along dimension dim at each of the indices in
indices. For instance, indices=[2,3] and dim=0
would result in the tensors input[:2], input[2:3], and
input[3:].
indices can be a list or tuple of ints, or a one-dimensional long
tensor on the CPU.