Skip to content

Conversation

@LLSGYN
Copy link
Contributor

@LLSGYN LLSGYN commented Sep 5, 2025

Add chinese documents for paddle.Tensor.requires_grad, paddle.var, paddle.multinomial, paddle.rand_like, paddle.(Tensor.)mean.

Reference:

@paddle-bot
Copy link

paddle-bot bot commented Sep 5, 2025

感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-7422.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html
预览工具的更多说明,请参考:飞桨文档预览工具

Copy link
Collaborator

@sunzhongkai588 sunzhongkai588 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

问题是共通的,修改一下~

::::::::::
- **x** (Tensor) - 输入的 Tensor,数据类型为:float32、float64。
- **x** (Tensor) - 输入的 Tensor,数据类型为:bool、bfloat16、float16、float32、float64、int32、int64、complex64、complex128。
- **input** - ``x`` 的别名,行为完全一致。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

别名不要单独列出来,否则和开头的函数声明会有冲突,造成误解。直接在参数名 x 描述的最后加上 别名:xxx

- **x** (Tensor) - 输入的 Tensor,数据类型为:bool、bfloat16、float16、float32、float64、int32、int64、complex64、complex128。
- **input** - ``x`` 的别名,行为完全一致。
- **axis** (int|list|tuple,可选) - 指定对 ``x`` 进行计算的轴。``axis`` 可以是 int、list(int)、tuple(int)。如果 ``axis`` 包含多个维度,则沿着 ``axis`` 中的所有轴进行计算。``axis`` 或者其中的元素值应该在范围[-D, D)内,D 是 ``x`` 的维度。如果 ``axis`` 或者其中的元素值小于 0,则等价于 :math:`axis + D`。如果 ``axis`` 是 None,则对 ``x`` 的全部元素计算平均值。默认值为 None。
- **dim** - ``axis`` 的别名,行为完全一致。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同样的问题,别名不要单独列出来

- **keepdim** (bool,可选) - 是否在输出 Tensor 中保留减小的维度。如果 ``keepdim`` 为 True,则输出 Tensor 和 ``x`` 具有相同的维度(减少的维度除外,减少的维度的大小为 1)。否则,输出 Tensor 的形状会在 ``axis`` 上进行 squeeze 操作。默认值为 False。
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。
- **dtype** (str,可选) - 输出 Tensor 的数据类型。如果指定了 ``dtype``,在计算之前输入 Tensor 会被转换为指定的类型。默认值为 None,此时输出的数据类型与输入 ``x`` 的数据类型一致。
- **out** (Tensor,可选) - 输出的结果 `Tensor`,是与输出数据类型相同的 N-D `Tensor`。默认值为 None,此时将创建新的 Tensor 来保存输出结果。
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

关键字参数最好在参数描述里说明一下,是关键字参数

@sunzhongkai588 sunzhongkai588 merged commit 622f8fa into PaddlePaddle:develop Sep 11, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants