-
Notifications
You must be signed in to change notification settings - Fork 824
Fix docs #6870
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
Fix docs #6870
Changes from all commits
Commits
Show all changes
21 commits
Select commit
Hold shift + click to select a range
fd00b66
fix hsplit
Xuxuanang 5d18669
fix docs
Xuxuanang ee0c717
fix
Xuxuanang 5078cc1
fix-docs1
Xuxuanang c3fc9b9
fix docs
Xuxuanang 09c801d
Merge branch 'PaddlePaddle:develop' into fix-docs1
Xuxuanang 7e04190
fix docs
Xuxuanang 647bf95
docs1
Xuxuanang a972ff4
fix docs
Xuxuanang aa86075
fix docs
Xuxuanang d5ea3d8
fix docs1
Xuxuanang c26830f
fix docs
Xuxuanang 690c5aa
fix-docs
Xuxuanang df16122
fix docs
Xuxuanang 3a5030d
fix-docs
Xuxuanang 3ccee2f
fix-docs
Xuxuanang 282036e
fix-docs1
Xuxuanang a81c4a0
fix-docs1
Xuxuanang 265c1eb
fix-docs1
Xuxuanang e346dde
fix -docs1
Xuxuanang 33d147a
fix paddle default
Xuxuanang 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
15 changes: 15 additions & 0 deletions
15
...onvert/convert_from_pytorch/api_difference/cuda/torch.cuda.is_bf16_supported.md
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,15 @@ | ||
## [无参数]torch.cuda.is_bf16_supported | ||
|
||
### [torch.cuda.is_bf16_supported](https://pytorch.org/docs/stable/cuda.html) | ||
|
||
```python | ||
torch.cuda.is_bf16_supported() | ||
``` | ||
|
||
### [paddle.amp.is_bfloat16_supported](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/amp/is_bfloat16_supported_cn.html#is-bfloat16-supported) | ||
|
||
```python | ||
paddle.amp.is_bfloat16_supported() | ||
``` | ||
|
||
功能一致,无参数。 |
28 changes: 28 additions & 0 deletions
28
...nvert_from_pytorch/api_difference/distributions/torch.distributions.Binomial.md
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 @@ | ||
## [ torch 参数更多 ] torch.distributions.Binomial | ||
|
||
### [torch.distributions.Binomial](https://pytorch.org/docs/stable/distributions.html#torch.distributions.binomial.Binomial) | ||
|
||
```python | ||
torch.distributions.Binomial(total_count=1, | ||
probs=None, | ||
logits=None, | ||
validate_args=None) | ||
``` | ||
|
||
### [paddle.distribution.Binomial](https://www.paddlepaddle.org.cn/documentation/docs/zh/2.6/api/paddle/distribution/Binomial_cn.html#binomial) | ||
|
||
```python | ||
paddle.distribution.Binomial(total_count, | ||
probs) | ||
``` | ||
|
||
PyTorch 相比 Paddle 支持更多其他参数,具体如下: | ||
|
||
### 参数映射 | ||
|
||
| PyTorch | PaddlePaddle | 备注 | | ||
| ------------- | ------ | ------------------------------------------------------------ | | ||
| total_count | total_count | 样本大小。 | | ||
| probs | probs | 每次伯努利实验中事件发生的概率。 | | ||
| logits | - | 采样 1 的 log-odds,Paddle 无此参数,暂无转写方式。 | | ||
| validate_args | - | 是否添加验证环节。Paddle 无此参数,一般对训练结果影响不大,可直接删除。 | |
28 changes: 28 additions & 0 deletions
28
...pytorch/api_difference/distributions/torch.distributions.ContinuousBernoulli.md
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 @@ | ||
## [ torch 参数更多 ] torch.distributions.ContinuousBernoulli | ||
|
||
### [torch.distributions.ContinuousBernoulli](https://pytorch.org/docs/stable/distributions.html) | ||
|
||
```python | ||
torch.distributions.ContinuousBernoulli(probs=None, | ||
logits=None, | ||
lims=(0.499, 0.501) | ||
validate_args=None) | ||
``` | ||
|
||
### [paddle.distribution.ContinuousBernoulli](https://www.paddlepaddle.org.cn/documentation/docs/zh/2.6/api/paddle/distribution/ContinuousBernoulli_cn.html#continuousbernoulli) | ||
|
||
```python | ||
paddle.distribution.ContinuousBernoulli(probs, | ||
lims=(0.499, 0.501)) | ||
``` | ||
|
||
PyTorch 相比 Paddle 支持更多其他参数,具体如下: | ||
|
||
### 参数映射 | ||
|
||
| PyTorch | PaddlePaddle | 备注 | | ||
| ------------- | ------ | ------------------------------------------------------------ | | ||
| probs | probs | 参数化分布的 (0,1) 值。 | | ||
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. 默认值不一致:torch是可选的,paddle是必选的,应该要写清楚paddle该如何设置 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. 这个如果torch不选的话,就要指定logits值,paddle目前不支持 |
||
| logits | - | 实值参数,与 probs 通过 sigmoid 函数匹配。Paddle 无此参数,暂无转写方式。 | | ||
| lims | lims | 一个包含两个元素的元组,指定了分布的下限和上限,默认为 (0.499, 0.501)。 | | ||
| validate_args | - | 是否添加验证环节。Paddle 无此参数,一般对训练结果影响不大,可直接删除。 | |
23 changes: 23 additions & 0 deletions
23
...rt_from_pytorch/api_difference/distributions/torch.distributions.Exponential.md
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,23 @@ | ||
## [ torch 参数更多 ] torch.distributions.Exponential | ||
|
||
### [torch.distributions.Exponential](https://pytorch.org/docs/stable/distributions.html#torch.distributions.exponential.Exponential.arg_constraints) | ||
|
||
```python | ||
torch.distributions.Exponential(rate, | ||
validate_args=None) | ||
``` | ||
|
||
### [paddle.distribution.Exponential](https://www.paddlepaddle.org.cn/documentation/docs/zh/2.6/api/paddle/distribution/ExponentialFamily_cn.html#exponential) | ||
|
||
```python | ||
paddle.distribution.Exponential(rate) | ||
``` | ||
|
||
PyTorch 相比 Paddle 支持更多其他参数,具体如下: | ||
|
||
### 参数映射 | ||
|
||
| PyTorch | PaddlePaddle | 备注 | | ||
| ------------- | ------ | ------------------------------------------------------------ | | ||
| rate | rate | 分布的速率参数。 | | ||
| validate_args | - | 是否添加验证环节。Paddle 无此参数,一般对训练结果影响不大,可直接删除。 | |
32 changes: 32 additions & 0 deletions
32
..._pytorch/api_difference/distributions/torch.distributions.MultivariateNormal.md
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,32 @@ | ||
## [ torch 参数更多 ] torch.distributions.MultivariateNormal | ||
|
||
### [torch.distributions.MultivariateNormal](https://pytorch.org/docs/stable/distributions.html#multivariatenormal) | ||
|
||
```python | ||
torch.distributions.MultivariateNormal(loc, | ||
covariance_matrix=None, | ||
precision_matrix=None, | ||
scale_tril=None, | ||
validate_args=None) | ||
``` | ||
|
||
### [paddle.distribution.MultivariateNormal](https://www.paddlepaddle.org.cn/documentation/docs/zh/2.6/api/paddle/distribution/MultivariateNormal_cn.html#multivariatenormal) | ||
|
||
```python | ||
paddle.distribution.MultivariateNormal(loc, | ||
covariance_matrix=None, | ||
precision_matrix=None, | ||
scale_tril=None) | ||
``` | ||
|
||
PyTorch 相比 Paddle 支持更多其他参数,具体如下: | ||
|
||
### 参数映射 | ||
|
||
| PyTorch | PaddlePaddle | 备注 | | ||
| ------------- | ------ | ------------------------------------------------------------ | | ||
| loc | loc | MultivariateNormal 的均值向量。 | | ||
| covariance_matrix | covariance_matrix | MultivariateNormal 的协方差矩阵。 | | ||
| precision_matrix | precision_matrix | MultivariateNormal 协方差矩阵的逆矩阵。 | | ||
| scale_tril | scale_tril | MultivariateNormal 协方差矩阵的柯列斯基分解的下三角矩阵。 | | ||
| validate_args | - | 是否添加验证环节。Paddle 无此参数,一般对训练结果影响不大,可直接删除。 | |
26 changes: 26 additions & 0 deletions
26
...t_from_pytorch/api_difference/functional/torch.nn.functional.channel_shuffle.md
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,26 @@ | ||
## [ paddle 参数更多 ]torch.nn.functional.channel_shuffle | ||
|
||
### [torch.nn.functional.channel_shuffle](https://pytorch.org/docs/stable/generated/torch.nn.ChannelShuffle.html) | ||
|
||
```python | ||
torch.nn.functional.channel_shuffle(input, | ||
groups) | ||
``` | ||
|
||
### [paddle.nn.functional.channel_shuffle](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/channel_shuffle_cn.html#channel-shuffle) | ||
|
||
```python | ||
paddle.nn.functional.channel_shuffle(x, | ||
groups, | ||
data_format='NCHW', | ||
name=None) | ||
``` | ||
|
||
其中 Paddle 相比 PyTorch 支持更多其他参数,具体如下: | ||
### 参数映射 | ||
|
||
| PyTorch | PaddlePaddle | 备注 | | ||
| ------------- | ------------ | ------------------------------------------------------ | | ||
| input | x | 表示输入的 Tensor ,仅参数名不一致。 | | ||
| groups | groups | 表示要把通道分成的组数。 | | ||
| - | data_format | 数据格式,可选:NCHW 或 NHWC。PyTorch 无此参数,Paddle 保持默认即可。 | |
39 changes: 39 additions & 0 deletions
39
...el_convert/convert_from_pytorch/api_difference/others/torch.special.gammainc.md
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,39 @@ | ||
## [torch 参数更多] torch.special.gammainc | ||
|
||
### [torch.special.gammainc](https://pytorch.org/docs/stable/special.html#torch.special.gammainc) | ||
|
||
```python | ||
torch.special.gammainc(input, | ||
other, | ||
*, | ||
out=None) | ||
``` | ||
|
||
### [paddle.gammainc](https://www.paddlepaddle.org.cn/documentation/docs/zh/2.6/api/index_cn.html) | ||
|
||
```python | ||
paddle.gammainc(x, | ||
y) | ||
``` | ||
|
||
PyTorch 相比 Paddle 支持更多其他参数,具体如下: | ||
|
||
### 参数映射 | ||
|
||
| PyTorch | PaddlePaddle | 备注 | | ||
| ------------- | ------ | ------------------------------------------------------------ | | ||
| input | x | 第一个非负输入张量,仅参数名不一致。 | | ||
| other | y | 第二个非负输入张量,仅参数名不一致。 | | ||
| out | - | Paddle 无此参数,需要转写。 | | ||
|
||
### 转写示例 | ||
|
||
#### out:指定输出 | ||
|
||
```python | ||
# PyTorch 写法 | ||
torch.special.gammainc(torch.tensor([1.0,2.0]),torch.tensor([3.0,4.0]),out=y) | ||
|
||
# Paddle 写法 | ||
paddle.assign(paddle.gammainc(paddle.to_tensor([1.0,2.0]),paddle.to_tensor([3.0,4.0])), y) | ||
``` |
37 changes: 37 additions & 0 deletions
37
...l_convert/convert_from_pytorch/api_difference/others/torch.special.gammaincc.md
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,37 @@ | ||
## [ torch 参数更多 ]torch.special.gammaincc | ||
|
||
### [torch.special.gammaincc](https://pytorch.org/docs/stable/special.html#torch.special.gammaincc) | ||
|
||
```python | ||
torch.special.gammaincc(input, | ||
other, | ||
*, | ||
out=None) | ||
``` | ||
|
||
### [paddle.gammaincc](https://www.paddlepaddle.org.cn/documentation/docs/zh/2.6/api/index_cn.html) | ||
|
||
```python | ||
paddle.gammaincc(x, | ||
y) | ||
``` | ||
|
||
PyTorch 相比 Paddle 支持更多其他参数,具体如下: | ||
|
||
### 参数映射 | ||
|
||
| PyTorch | PaddlePaddle | 备注 | | ||
| ------------- | ------ | ------------------------------------------------------------ | | ||
| input | x | 第一个非负输入张量,仅参数名不一致。 | | ||
| other | y | 第二个非负输入张量,仅参数名不一致。 | | ||
| out | - | Paddle 无此参数,需要转写。 | | ||
|
||
### 转写示例 | ||
#### out:指定输出 | ||
```python | ||
# PyTorch 写法 | ||
torch.special.gammaincc(torch.tensor([1.0,2.0]),torch.tensor([3.0,4.0]),out=y) | ||
|
||
# Paddle 写法 | ||
paddle.assign(paddle.gammaincc(paddle.to_tensor([1.0,2.0]),paddle.to_tensor([3.0,4.0])), y) | ||
``` |
21 changes: 21 additions & 0 deletions
21
...el_convert/convert_from_pytorch/api_difference/torch/torch.__version__.split.md
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,21 @@ | ||
## [ 参数完全一致 ] torch._\_version__.split | ||
|
||
### [torch._\_version__.split]() | ||
|
||
```python | ||
torch.__version__.split(sep=None, maxsplit=-1) | ||
``` | ||
|
||
### [paddle._\_version__.split]() | ||
|
||
```python | ||
paddle.__version__.split(sep=None, maxsplit=-1) | ||
``` | ||
|
||
两者功能一致,参数完全一致,具体如下: | ||
### 参数映射 | ||
|
||
| PyTorch | PaddlePaddle | 备注 | | ||
|---------|--------------| -------------------------------------------------- | | ||
| sep | sep | 分割字符串的分隔符。 | | ||
| max | max | 分割操作的最大次数 | |
36 changes: 36 additions & 0 deletions
36
...s/model_convert/convert_from_pytorch/api_difference/torch/torch.amp.autocast.md
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,36 @@ | ||
## [ torch 参数更多 ] torch.amp.autocast | ||
|
||
### [torch.amp.autocast](https://pytorch.org/docs/stable/amp.html#torch.cuda.amp.autocast) | ||
|
||
```python | ||
torch.amp.autocast(device_type, | ||
dtype=None, | ||
enabled=True, | ||
cache_enabled=None) | ||
``` | ||
|
||
### [paddle.amp.auto_cast](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/amp/auto_cast_cn.html#auto-cast) | ||
|
||
```python | ||
paddle.amp.auto_cast(enable=True, | ||
custom_white_list=None, | ||
custom_black_list=None, | ||
level='O1', | ||
dtype='float16', | ||
use_promote=True) | ||
``` | ||
|
||
PyTorch 相比 Paddle 支持更多其他参数,具体如下: | ||
|
||
### 参数映射 | ||
|
||
| PyTorch | PaddlePaddle | 备注 | | ||
| ------------- | ------ | ------------------------------------------------------------ | | ||
| device_type | - | 指定设备类型,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | | ||
| dtype | dtype | 指定自动混合精度的计算类型 | | ||
| enabled | enable | 是否启用自动混合精度。 | | ||
| cache_enabled | - | 启用或禁用 CUDA 图形缓存 Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | | ||
| - | custom_white_list | 白名单,通常不需要设置。PyTorch 无此参数,Paddle 保持默认即可。 | | ||
| - | custom_black_list | 黑名单,通常不需要设置。PyTorch 无此参数,Paddle 保持默认即可。 | | ||
| - | level | 混合精度训练的优化级别,可为 O1 、O2 或者 OD 模式。PyTorch 无此参数,Paddle 保持默认即可。 | | ||
| - | use_promote | 当一个算子存在 float32 类型的输入时,按照 Promote to the Widest 原则,选择 float32 数据类型进行计算。PyTorch 无此参数,Paddle 保持默认即可。 | |
21 changes: 21 additions & 0 deletions
21
...m_pytorch/api_difference_third_party/flash_attn/flash_attn.__version__.split.md
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,21 @@ | ||
## [ 参数完全一致 ] flash_attn._\_version__.split | ||
|
||
### [flash_attn._\_version__.split](https://github.com/Dao-AILab/flash-attention/blob/72e27c6320555a37a83338178caa25a388e46121/flash_attn/__init__.py) | ||
|
||
```python | ||
flash_attn.__version__.split(sep=None, maxsplit=-1) | ||
``` | ||
|
||
### [paddle._\_version__.split](https://github.com/PaddlePaddle/Paddle/tree/develop) | ||
|
||
```python | ||
paddle.__version__.split(sep=None, maxsplit=-1) | ||
``` | ||
|
||
两者功能一致,参数完全一致,具体如下: | ||
### 参数映射 | ||
|
||
| flash_attn | PaddlePaddle | 备注 | | ||
|---------|--------------| -------------------------------------------------- | | ||
| sep | sep | 分割字符串的分隔符。 | | ||
| max | max | 分割操作的最大次数 | |
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.
这个也是 默认参数不一致:torch是可选的,paddle是必选的,需要写下当torch未输入时paddle应该如何处理