chainer.functions.split_axis¶
-
chainer.functions.
split_axis
(x, indices_or_sections, axis, force_tuple=True)[source]¶ Splits given variables along an axis.
Parameters: - x (tuple of Variables) – Variables to be split.
- indices_or_sections (int or 1-D array) – If this argument is an integer, N, the array will be divided into N equal arrays along axis. If it is a 1-D array of sorted integers, it indicates the positions where the array is split.
- axis (int) – Axis that the input array is split along.
- force_tuple (bool) – If
True
(the default) this method returns a tuple even when the number of outputs is one. Otherwise, ifFalse
a Variable will be returned when the number of outputs is one.
Returns: Return type: Note
This function raises
ValueError
if at least one of the outputs is split to zero-size (i.e.axis
-th value of its shape is zero).