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

【PaddlePaddle Hackathon 3 No.17】为 Paddle 新增 sgn 文档 #5107

Merged
merged 2 commits into from Aug 11, 2022

Conversation

peachlcy
Copy link
Contributor

@peachlcy peachlcy commented Aug 4, 2022

@paddle-bot
Copy link

paddle-bot bot commented Aug 4, 2022

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

@SigureMo
Copy link
Member

SigureMo commented Aug 4, 2022

这个 API 应该也能通过 Tensor.sgn 访问吧,这样的话也需要在 docs/api/paddle/Tensor/Overview_en.rstdocs/api/paddle/Tensor_cn.rst 添加下相关内容~可参考 #5089

以及可添加 PADDLEPADDLE_PR=44568 以确保文档预览可以正确构建,paddle bot 的回复里也有相关链接,可以参考下~

预览工具的更多说明,请参考:[Beta]飞桨文档预览工具

.. py:function:: paddle.sgn(x, name=None)

对输入参数 ``x`` 中每个元素进行正负判断,并且输出正负判断值:1 代表正,-1 代表负,0 代表零。
对于复数张量,此函数返回一个新的张量,其元素与 input 元素的角度相同且绝对值为 1。
Copy link
Member

@SigureMo SigureMo Aug 4, 2022

Choose a reason for hiding this comment

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

这两句与英文的顺序正好是反的,中英文两者顺序也应当是一致的~

以及在 rst 中空一行才能分隔两个段落~可以看下预览里现在的效果~


参数
::::::::::::
- **x** (Tensor) – 输入 Tensor,数据类型为 float16, float32, float64, complex64 或 complex128。
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
- **x** (Tensor) – 输入 Tensor,数据类型为 float16float32float64complex64 或 complex128。
- **x** (Tensor) – 输入 Tensor,数据类型为 float16float32float64complex64 或 complex128。


返回
::::::::::::
Tensor,输出正负号或复数的单位向量,数据的 shape 大小及数据类型和输入 ``x`` 一致。
Copy link
Member

Choose a reason for hiding this comment

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

这里的话中文应该没问题,英文有点简单了可以修改下,两者也需要一致~

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Copy link
Member

@SigureMo SigureMo left a comment

Choose a reason for hiding this comment

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

LGTM~(虽然没啥用)

Copy link
Collaborator

@Ligoml Ligoml left a comment

Choose a reason for hiding this comment

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

good job!LGTM

@luotao1 luotao1 merged commit 75e2ab9 into PaddlePaddle:develop Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants