Skip to content
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

[Docathon][Add Inplace CN Doc No.9] Create cauchy__cn.rst,Update Overview_cn.rst #7234

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

VVX94
Copy link
Contributor

@VVX94 VVX94 commented Apr 5, 2025

【Docathon】补充缺失的中文 API 文档(Inplace 类)
No.9 paddle.cauchy_ 的中文文档补充

增加:
新增cauchy__cn.rst中文文档

修改:
Overview_cn.rst中新增cauchy_相关信息(在“tensor 数学操作原位(inplace)版本”标题下)

issue:#7090
英文文档链接:https://www.paddlepaddle.org.cn/documentation/docs/en/3.0-beta/api/paddle/cauchy__en.html
@sunzhongkai588

Copy link

paddle-bot bot commented Apr 5, 2025

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

@CLAassistant
Copy link

CLAassistant commented Apr 5, 2025

CLA assistant check
All committers have signed the CLA.

@VVX94 VVX94 changed the title Create cauchy__cn.rst,Update Overview_cn.rst [Docathon][Add Inplace CN Doc No.9] Create cauchy__cn.rst,Update Overview_cn.rst Apr 5, 2025
@cangtianhuang
Copy link
Contributor

Copy link
Contributor

@cangtianhuang cangtianhuang left a comment

Choose a reason for hiding this comment

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

劳烦同学修改一下啦~😘


.. py:function:: paddle.cauchy_(x: paddle.Tensor, loc: Numeric = 0, scale: Numeric = 1, name: str | None = None)

使用 Cauchy 分布中的数字填充张量。
Copy link
Contributor

@cangtianhuang cangtianhuang Apr 5, 2025

Choose a reason for hiding this comment

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

使用 Cauchy 分布中的数字填充张量。

描述改为:使用柯西分布(Cauchy distribution)随机数就地(Inplace)填充输入张量 x

可以适当增加 Wiki 中对柯西分布的描述,并附加参考链接,形式如 [柯西分布](https://zh.wikipedia.org/wiki/%E6%9F%AF%E8%A5%BF%E5%88%86%E5%B8%83)

paddle 中也有柯西分布相关 api,可以增加说明字段以示区分:cauchy

cauchy\_
------------------------------

.. py:function:: paddle.cauchy_(x: paddle.Tensor, loc: Numeric = 0, scale: Numeric = 1, name: str | None = None)
Copy link
Contributor

Choose a reason for hiding this comment

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

函数签名不需要说明类型,但需要填写默认值,如 loc=0

参数
:::::::::
- **x** (Tensor) - 将被填充的张量,数据类型为 float32 或 float64。
- **loc** (scalar, optional) - 分布峰值的位置。数据类型为 float32 或 float64。
Copy link
Contributor

Choose a reason for hiding this comment

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

optional 改为中文的 可选

增加默认值的说明,如 默认值为 0

:::::::::
- **x** (Tensor) - 将被填充的张量,数据类型为 float32 或 float64。
- **loc** (scalar, optional) - 分布峰值的位置。数据类型为 float32 或 float64。
- **scale** (scalar, optional) - 半高宽(HWHM)。数据类型为 float32 或 float64。必须为正值。
Copy link
Contributor

Choose a reason for hiding this comment

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

同上

- **x** (Tensor) - 将被填充的张量,数据类型为 float32 或 float64。
- **loc** (scalar, optional) - 分布峰值的位置。数据类型为 float32 或 float64。
- **scale** (scalar, optional) - 半高宽(HWHM)。数据类型为 float32 或 float64。必须为正值。
- **name** (str|None, optional) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。
Copy link
Contributor

Choose a reason for hiding this comment

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

str|None 改为 stroptional 同上

:::::::::
使用 Cauchy 分布中的数字填充的输入张量。

返回类型
Copy link
Contributor

Choose a reason for hiding this comment

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

合并到“返回”中,不用单独说明


返回
:::::::::
使用 Cauchy 分布中的数字填充的输入张量。
Copy link
Contributor

Choose a reason for hiding this comment

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

@VVX94
Copy link
Contributor Author

VVX94 commented Apr 6, 2025

劳烦同学修改一下啦~😘

okkk😘

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor HappyOpenSource 快乐开源活动issue与PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants