Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
34a256c9
P
Paddle
项目概览
PaddlePaddle
/
Paddle
大约 1 年 前同步成功
通知
2299
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
34a256c9
编写于
3月 21, 2022
作者:
N
Nyakku Shigure
提交者:
GitHub
3月 21, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix paddle.tile en docs, test=document_fix (#40731)
上级
c54c60de
变更
1
显示空白变更内容
内联
并排
Showing
1 changed file
with
9 addition
and
7 deletion
+9
-7
python/paddle/tensor/manipulation.py
python/paddle/tensor/manipulation.py
+9
-7
未找到文件。
python/paddle/tensor/manipulation.py
浏览文件 @
34a256c9
...
...
@@ -1732,12 +1732,12 @@ def tile(x, repeat_times, name=None):
Args:
x (Tensor): The input tensor, its data type should be bool, float32, float64, int32 or int64.
repeat_times (
Tensor|tuple|list
): The number of repeating times. If repeat_times is a list or tuple, all its elements
repeat_times (
list|tuple|Tensor
): The number of repeating times. If repeat_times is a list or tuple, all its elements
should be integers or 1-D Tensors with the data type int32. If repeat_times is a Tensor, it should be an 1-D Tensor with the data type int32.
name (str, optional): Name for the operation (optional, default is None). For more information, please refer to :ref:`api_guide_Name`.
Returns:
N-D Tensor. The data type is the same as ``x``.
N-D Tensor. The data type is the same as ``x``.
The size of the i-th dimension is equal to ``x[i] * repeat_times[i]``.
Examples:
.. code-block:: python
...
...
@@ -1747,16 +1747,18 @@ def tile(x, repeat_times, name=None):
data = paddle.to_tensor([1, 2, 3], dtype='int32')
out = paddle.tile(data, repeat_times=[2, 1])
np_out = out.numpy()
# [[1, 2, 3], [1, 2, 3]]
# [[1, 2, 3]
# [1, 2, 3]]
out = paddle.tile(data, repeat_times=
[2, 2]
)
out = paddle.tile(data, repeat_times=
(2, 2)
)
np_out = out.numpy()
# [[1, 2, 3, 1, 2, 3], [1, 2, 3, 1, 2, 3]]
# [[1, 2, 3, 1, 2, 3]
# [1, 2, 3, 1, 2, 3]]
repeat_times = paddle.to_tensor([
2, 1
], dtype='int32')
repeat_times = paddle.to_tensor([
1, 2
], dtype='int32')
out = paddle.tile(data, repeat_times=repeat_times)
np_out = out.numpy()
# [[1, 2, 3
], [
1, 2, 3]]
# [[1, 2, 3
,
1, 2, 3]]
"""
if
paddle
.
in_dynamic_mode
():
return
_C_ops
.
tile
(
x
,
'repeat_times'
,
repeat_times
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录