-
Notifications
You must be signed in to change notification settings - Fork 876
[API compatibility] add docs for requires_grad, var, mean, multinomial, rand_like #7422
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[API compatibility] add docs for requires_grad, var, mean, multinomial, rand_like #7422
Conversation
|
感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-7422.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html |
sunzhongkai588
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
问题是共通的,修改一下~
docs/api/paddle/mean_cn.rst
Outdated
| :::::::::: | ||
| - **x** (Tensor) - 输入的 Tensor,数据类型为:float32、float64。 | ||
| - **x** (Tensor) - 输入的 Tensor,数据类型为:bool、bfloat16、float16、float32、float64、int32、int64、complex64、complex128。 | ||
| - **input** - ``x`` 的别名,行为完全一致。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
别名不要单独列出来,否则和开头的函数声明会有冲突,造成误解。直接在参数名 x 描述的最后加上 别名:xxx
docs/api/paddle/mean_cn.rst
Outdated
| - **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`` 的别名,行为完全一致。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同样的问题,别名不要单独列出来
docs/api/paddle/mean_cn.rst
Outdated
| - **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 来保存输出结果。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
关键字参数最好在参数描述里说明一下,是关键字参数
63ff8fd to
ad44178
Compare
Add chinese documents for paddle.Tensor.requires_grad, paddle.var, paddle.multinomial, paddle.rand_like, paddle.(Tensor.)mean.
Reference:
paddle.Tensor.requires_gradPaddle#74491