-
Notifications
You must be signed in to change notification settings - Fork 823
【PaddlePaddle Hackathon 3 No.17】为 Paddle 新增 sgn 文档 #5107
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,24 @@ | ||||||
.. _cn_api_tensor_sgn: | ||||||
|
||||||
sgn | ||||||
------------------------------- | ||||||
|
||||||
.. py:function:: paddle.sgn(x, name=None) | ||||||
|
||||||
对输入参数 ``x`` 中每个元素进行正负判断,并且输出正负判断值:1 代表正,-1 代表负,0 代表零。 | ||||||
对于复数张量,此函数返回一个新的张量,其元素与 input 元素的角度相同且绝对值为 1。 | ||||||
|
||||||
参数 | ||||||
:::::::::::: | ||||||
- **x** (Tensor) – 输入 Tensor,数据类型为 float16, float32, float64, complex64 或 complex128。 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
- **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 | ||||||
|
||||||
返回 | ||||||
:::::::::::: | ||||||
Tensor,输出正负号或复数的单位向量,数据的 shape 大小及数据类型和输入 ``x`` 一致。 | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这里的话中文应该没问题,英文有点简单了可以修改下,两者也需要一致~ There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. done |
||||||
|
||||||
|
||||||
代码示例 | ||||||
:::::::::::: | ||||||
|
||||||
COPY-FROM: paddle.sgn |
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.
这两句与英文的顺序正好是反的,中英文两者顺序也应当是一致的~
以及在 rst 中空一行才能分隔两个段落~可以看下预览里现在的效果~