input (Variable): The input variable which is an N-D Tensor or LoDTensor, data type being float32, float64, int32 or int64.
input (Tensor): A N-D Tensor. The data type is bool, float16, float32, float64, int32 or int64.
num_or_sections (int|list|tuple): If :attr:`num_or_sections` is an integer,
num_or_sections (int|list|tuple): If ``num_or_sections`` is int, then the ``num_or_sections``
then the integer indicates the number of equal sized sub-Tensors
indicates the number of equal sized sub-Tensors that the ``input``
that the Tensor will be divided into. If :attr:`num_or_sections`
will be divided into. If ``num_or_sections`` is a list or tuple, the length of it
is a list or tuple, the length of it indicates the number of
indicates the number of sub-Tensors and the elements in it indicate the sizes of sub-Tensors'
sub-Tensors and the elements in it indicate the sizes of sub-Tensors'
dimension orderly. The length of the list mustn't be larger than the ``input`` 's size of specified dim.
:attr:`dim` dimension orderly. The length of the list mustn't be larger than the Tensor's size of :attr:`dim` .
dim (int|Tensor, optional): The dimension along which to split, it can be a scalar with type ``int`` or
dim (int32|Varible, optional): A scalar with type ``int32`` or a ``Tensor`` with shape [1] and type ``int32``. The dimension along which to split. If :math:`dim < 0`, the
a ``Tensor`` with shape [1] and data type ``int32`` or ``int64``. If :math:`dim < 0`,
dimension to split along is :math:`rank(input) + dim`. Default is -1.
the dimension to split along is :math:`rank(input) + dim`. Default is -1.
name(str, optional): The default value is None. Normally there is no need for user to set this property. For more information, please refer to :ref:`api_guide_Name` .
name (str, optional): The default value is None. Normally there is no need for user to set this property.
For more information, please refer to :ref:`api_guide_Name` .
Returns:
Returns:
list(Variable): The list of segmented Tensor variables.
list(Tensor): The list of segmented Tensors.
Raises:
Raises:
TypeError: num_or_sections is not int, list or tuple.
TypeError: The data type of ``input`` must be one of bool, float16, float32, float64, int32, int64.
TypeError: dim is not int or Variable.
TypeError: ``num_or_sections`` is not int, list or tuple.
TypeError: ``dim`` is not int or Tensor. The data type of ``dim`` must be int32 or int64 when it's a Tensor.
input (Variable): The input variable which is an N-D Tensor or LoDTensor, data type being float32, float64, int32 or int64.
x (Tensor): A N-D Tensor. The data type is bool, float16, float32, float64, int32 or int64.
num_or_sections (int|list|tuple): If :attr:`num_or_sections` is an integer,
num_or_sections (int|list|tuple): If ``num_or_sections`` is an int, then ``num_or_sections``
then the integer indicates the number of equal sized sub-Tensors
indicates the number of equal sized sub-Tensors that the ``x`` will be divided into.
that the Tensor will be divided into. If :attr:`num_or_sections`
If ``num_or_sections`` is a list or tuple, the length of it indicates the number of
is a list or tuple, the length of it indicates the number of
sub-Tensors and the elements in it indicate the sizes of sub-Tensors' dimension orderly.
sub-Tensors and the elements in it indicate the sizes of sub-Tensors'
The length of the list must not be larger than the ``x`` 's size of specified ``axis``.
:attr:`dim` dimension orderly. The length of the list mustn't be larger than the Tensor's size of :attr:`dim` .
axis (int|Tensor, optional): The axis along which to split, it can be a scalar with type
dim (int32|Varible, optional): A scalar with type ``int32`` or a ``Tensor`` with shape [1] and type ``int32``. The dimension along which to split. If :math:`dim < 0`, the
``int`` or a ``Tensor`` with shape [1] and data type ``int32`` or ``int64``.
dimension to split along is :math:`rank(input) + dim`. Default is -1.
If :math::`axis < 0`, the axis to split along is :math:`rank(x) + axis`. Default is 0.
name(str, optional): The default value is None. Normally there is no need for user to set this property. For more information, please refer to :ref:`api_guide_Name` .
name (str, optional): The default value is None. Normally there is no need for user to set this property.
For more information, please refer to :ref:`api_guide_Name` .
Returns:
Returns:
list(Variable): The list of segmented Tensor variables.
list(Tensor): The list of segmented Tensors.
Raises:
Raises:
TypeError: num_or_sections is not int, list or tuple.
TypeError: The data type of ``x`` must be one of bool, float16, float32, float64, int32, int64.
TypeError: dim is not int or Variable.
TypeError: ``num_or_sections`` is not int, list or tuple.
TypeError: ``axis`` is not int or Tensor. the data type of ``axis`` must be int32 or int64 when it's a Tensor.