未验证 提交 87c73a3e 编写于 作者: M MRXLT 提交者: GitHub

fix unstack op doc (#26268)

上级 4026dd08
...@@ -11139,12 +11139,12 @@ def unstack(x, axis=0, num=None): ...@@ -11139,12 +11139,12 @@ def unstack(x, axis=0, num=None):
raised. raised.
Args: Args:
x (Variable): Input Tensor. It is a N-D Tensors of data types float32, float64, int32, int64. x (Tensor): Input Tensor. It is a N-D Tensors of data types float32, float64, int32, int64.
axis (int): The axis along which the input is unstacked. axis (int): The axis along which the input is unstacked.
num (int|None): The number of output variables. num (int|None): The number of output variables.
Returns: Returns:
list(Variable): The unstacked Tensors list. The list elements are N-D Tensors of data types float32, float64, int32, int64. list(Tensor): The unstacked Tensors list. The list elements are N-D Tensors of data types float32, float64, int32, int64.
Raises: Raises:
ValueError: If x.shape[axis] <= 0 or axis is not in range [-D, D). ValueError: If x.shape[axis] <= 0 or axis is not in range [-D, D).
...@@ -11153,7 +11153,7 @@ def unstack(x, axis=0, num=None): ...@@ -11153,7 +11153,7 @@ def unstack(x, axis=0, num=None):
.. code-block:: python .. code-block:: python
import paddle.fluid as fluid import paddle.fluid as fluid
x = fluid.layers.data(name='x', shape=[2, 3, 5], dtype='float32') # create a tensor with shape=[2, 3, 5] x = fluid.data(name='x', shape=[2, 3, 5], dtype='float32') # create a tensor with shape=[2, 3, 5]
y = fluid.layers.unstack(x, axis=1) # unstack with second axis, which results 3 tensors with shape=[2, 5] y = fluid.layers.unstack(x, axis=1) # unstack with second axis, which results 3 tensors with shape=[2, 5]
""" """
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册