-
Notifications
You must be signed in to change notification settings - Fork 874
【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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -227,6 +227,7 @@ Methods | |
| set_value | ||
| shard_index | ||
| sign | ||
| sgn | ||
| sin | ||
| sinh | ||
| slice | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| .. _cn_api_tensor_sgn: | ||
|
|
||
| sgn | ||
| ------------------------------- | ||
|
|
||
| .. py:function:: paddle.sgn(x, name=None) | ||
|
|
||
| 对于复数张量,此函数返回一个新的张量,其元素与 input 元素的角度相同且绝对值为 1。 | ||
|
|
||
| 对于实数张量,对输入参数 ``x`` 中每个元素进行正负判断,并且输出正负判断值:1 代表正,-1 代表负,0 代表零。 | ||
|
|
||
| 参数 | ||
| :::::::::::: | ||
| - **x** (Tensor) – 输入 Tensor,数据类型为 float16、float32、float64、complex64 或 complex128。 | ||
| - **name** (str,可选) - 具体用法请参见 :ref:`api_guide_Name`,一般无需设置,默认值为 None。 | ||
|
|
||
| 返回 | ||
| :::::::::::: | ||
| Tensor,输出正负号或复数的单位向量,数据的 shape 大小及数据类型和输入 ``x`` 一致。 | ||
|
Member
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. 这里的话中文应该没问题,英文有点简单了可以修改下,两者也需要一致~
Contributor
Author
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 | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.
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 中空一行才能分隔两个段落~可以看下预览里现在的效果~