-
Notifications
You must be signed in to change notification settings - Fork 875
[API compatibility] Update 6 API Docs #7438
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
Open
zhanghonggeng
wants to merge
9
commits into
PaddlePaddle:develop
Choose a base branch
from
zhanghonggeng:new_op1
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+109
−5
Open
Changes from 3 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
dd3505e
[API compatibility] Update 6 API Docs
zhanghonggeng c4bb30f
Fix ci
zhanghonggeng f61c5cf
update
zhanghonggeng e98d85b
update
zhanghonggeng c1af1b7
Merge branch 'develop' of https://github.com/PaddlePaddle/docs into n…
zhanghonggeng 02253f9
update
zhanghonggeng 2408e14
Merge branch 'develop' into new_op1
zhanghonggeng 6f8339b
Merge branch 'develop' into new_op1
zhanghonggeng 0a550e4
Update docs/api/paddle/sub_cn.rst
sunzhongkai588 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| .. _cn_api_paddle_Size: | ||
|
|
||
| Size | ||
| ------------------------------- | ||
|
|
||
| .. py:class:: paddle.Size() | ||
| ``paddle.Tensor.size()`` 的返回类型,用于描述张量的维度大小。作为 ``tuple`` 的子类,支持所有常见的序列操作(如索引、切片、拼接等)。 | ||
|
|
||
| **参数** | ||
| ::::::::: | ||
| - ``*args``:表示维度的整数序列或多个整数参数。 | ||
|
|
||
| **返回** | ||
| ::::::::: | ||
| - ``Size``:表示张量维度的特殊元组子类。 | ||
|
|
||
| **代码示例** | ||
| ::::::::: | ||
|
|
||
| COPY-FROM: paddle.Size | ||
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 |
|---|---|---|
|
|
@@ -22,4 +22,4 @@ rand_like | |
| 代码示例 | ||
| ::::::::::: | ||
|
|
||
| COPY-FROM: paddle.rand_like | ||
| COPY-FROM: paddle.rand_like | ||
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,28 @@ | ||
| .. _cn_api_paddle_random_: | ||
|
|
||
| random\_ | ||
| ------------------------------- | ||
|
|
||
| .. py:function:: paddle.random_(x, from=0, to=None, *, generator=None) | ||
|
|
||
| 将张量自身填充为从离散均匀分布[``from``, ``to`` - 1]范围内采样的随机数。若未指定参数,数值范围通常仅受张量数据类型的限制。 | ||
| 但对于浮点类型,若未指定范围,则默认范围为[0, 2^尾数位数],以确保每个值均可被精确表示。例如,paddle.to_tensor(1, dtype='float64').uniform_() 将在 [0, 2^53] 范围内均匀分布。 | ||
| random_ 为 Inplace 版本实现,对输入 `x` 采用 Inplace 策略。 | ||
|
|
||
| 参数 | ||
| :::::::::::: | ||
|
|
||
| - **x** (Tensor) - 输入多维 Tensor,可选的数据类型为 'int32'、'int64'、'float32'、'float64'、'float16'、'bfloat16'。 | ||
| - **from** (int,可选) - 生成随机值的范围下限,默认为 0。。 | ||
| - **to** (int|None,可选) - 生成随机值的范围上限(开区间),默认为 None。 | ||
| - **generator** (None) - 随机数生成器的占位参数,当前未实现,保留未来使用。 | ||
|
|
||
| 返回 | ||
| :::::::::::: | ||
|
|
||
| Tensor:数值服从范围[``from``, ``to`` - 1]内均匀分布的随机 Tensor。 | ||
|
|
||
| 代码示例 | ||
| :::::::::::: | ||
|
|
||
| COPY-FROM: paddle.random_ |
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,7 @@ | ||
| .. _cn_api_paddle_sub_: | ||
|
|
||
| sub\_ | ||
| ------------------------------- | ||
|
|
||
| .. py:function:: paddle.sub_(x, y, name=None, *, alpha=1) | ||
| 别名函数,功能与 :ref:`cn_api_paddle_subtract_` 完全相同,详情请参考 :ref:`cn_api_paddle_subtract_` 。 |
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,7 @@ | ||
| .. _cn_api_paddle_sub: | ||
|
|
||
| sub | ||
| ------------------------------- | ||
|
|
||
| .. py:function:: paddle.sub(x, y, name=None, *, alpha=1, out=None) | ||
| 别名函数,功能与 :ref:`_cn_api_paddle_subtract` 完全相同,详情请参考 :ref:`_cn_api_paddle_subtract`。 | ||
sunzhongkai588 marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
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
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.
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.
问题描述见 PaddlePaddle/Paddle#44671 ,rename 成带有
__upper后缀以避免冲突Size__upper_cn.rstThere 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.
已修改