Skip to content

Commit c820a79

Browse files
[SCU][Docathon][Add API Legend No.44] repeat_interleave -part (#6988)
* repeat_interleave * revised * modify
1 parent 5a00e06 commit c820a79

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

docs/api/paddle/repeat_interleave_cn.rst

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,18 @@ repeat_interleave
44
-------------------------------
55

66
.. py:function:: paddle.repeat_interleave(x, repeats, axis=None, name=None)
7+
沿着指定轴 ``axis`` 对输入 ``x`` 进行复制,创建并返回到一个新的 Tensor。当 ``repeats`` 为 ``1-D`` Tensor 时,``repeats`` 长度必须和指定轴 ``axis`` 维度一致,``repeats`` 对应位置的值表示 ``x`` 对应位置元素需要复制的次数。当 ``repeats`` 为 int 时,``x`` 沿指定轴 ``axis`` 上所有元素复制 ``repeats`` 次。
78

89

9-
沿着指定轴 ``axis`` 对输入 ``x`` 进行复制,创建并返回到一个新的 Tensor。当 ``repeats`` 为 ``1-D`` Tensor 时,``repeats`` 长度必须和指定轴 ``axis`` 维度一致,``repeats`` 对应位置的值表示 ``x`` 对应位置元素需要复制的次数。当 ``repeats`` 为 int 时,``x`` 沿指定轴 ``axis`` 上所有元素复制 ``repeats`` 次。
10+
**示例一图解说明**:
11+
以下图为例,输入张量 ``[[1, 2, 3], [4, 5, 6]]``,重复次数 ``repeats`` 为 [3, 2, 1],参数 ``axis =1``,表示第 1 列元素重复 3 次,第 2 列重复 2 次,第 3 列重复 1 次。
12+
13+
最终输出为二维张量 ``[[1, 1, 1, 2, 2, 3], [4, 4, 4, 5, 5, 6]]``。
14+
15+
.. figure:: ../../images/api_legend/repeat_interleave.png
16+
:width: 500
17+
:alt: 示例一图示
18+
:align: center
1019

1120
参数
1221
:::::::::
110 KB
Loading

0 commit comments

Comments
 (0)