From 0a63caa62a716f4ef8ae2e8837d783ac93a76798 Mon Sep 17 00:00:00 2001 From: yongqiangma Date: Tue, 12 May 2020 12:17:35 +0800 Subject: [PATCH] add cn doc of unbind API (#2064) * add cn doc of unbind API --- doc/fluid/api_cn/tensor_cn/unbind_cn.rst | 32 +++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/doc/fluid/api_cn/tensor_cn/unbind_cn.rst b/doc/fluid/api_cn/tensor_cn/unbind_cn.rst index c5b287c1f..7186dcc0f 100644 --- a/doc/fluid/api_cn/tensor_cn/unbind_cn.rst +++ b/doc/fluid/api_cn/tensor_cn/unbind_cn.rst @@ -1,3 +1,33 @@ +.. _cn_api_paddle_tensor_unbind unbind ------------------------------- -**版本升级,文档正在开发中** + +.. py:function:: paddle.tensor.unbind(input, axis=0) + +该OP将输入Tensor按照指定的维度分割成多个子Tensor。 + +**参数**: + - **input** (Variable) - 输入变量,数据类型为float32,float64,int32,int64的多维Tensor。 + - **axis** (int32|int64,可选) - 数据类型为int32或int64,表示需要分割的维度。如果axis < 0,则划分的维度为rank(input) + axis。默认值为0。 + +**返回**:分割后的Tensor列表。 + +**返回类型**:列表(Variable),数据类型为int32,int64,float32,float64。 + +**代码示例**: + +.. code-block:: python + + import paddle + # input is a variable which shape is [3, 4, 5] + input = paddle.fluid.data( + name="input", shape=[3, 4, 5], dtype="float32") + [x0, x1, x2] = paddle.tensor.unbind(input, axis=0) + # x0.shape [4, 5] + # x1.shape [4, 5] + # x2.shape [4, 5] + [x0, x1, x2, x3] = paddle.tensor.unbind(input, axis=1) + # x0.shape [3, 5] + # x1.shape [3, 5] + # x2.shape [3, 5] + # x3.shape [3, 5] -- GitLab