-
Notifications
You must be signed in to change notification settings - Fork 822
映射文档 No.70 #5860
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
映射文档 No.70 #5860
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
80af80d
fix docs bugs
Hzwords a97e61f
Merge branch 'develop' of https://github.com/PaddlePaddle/docs into m…
Hzwords f2a649a
fix docs bugs
Hzwords 14f87f5
torch.nn.functional.mish
Hzwords 6b81149
fix
Hzwords ad00b30
fix2
Hzwords 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
50 changes: 50 additions & 0 deletions
50
...odel_convert/convert_from_pytorch/api_difference/Tensor/torch.Tensor.nanmean.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,50 @@ | ||
## [ torch 参数更多 ]torch.Tensor.nanmean | ||
|
||
### [torch.Tensor.nanmean](https://pytorch.org/docs/1.13/generated/torch.Tensor.nanmean.html?highlight=nanmean#torch.Tensor.nanmean) | ||
|
||
```python | ||
torch.Tensor.nanmean(dim=None, | ||
keepdim=False, | ||
dtype=None, | ||
out=None) | ||
``` | ||
|
||
### [paddle.Tensor.nanmean](暂无对应文档) | ||
|
||
```python | ||
paddle.Tensor.nanmean(axis=None, | ||
keepdim=False, | ||
name=None) | ||
``` | ||
|
||
Pytorch 相比 Paddle 支持更多其他参数,具体如下: | ||
### 参数映射 | ||
| PyTorch | PaddlePaddle | 备注 | | ||
| ------------- | ------------ | ------------------------------------------------------ | | ||
| dim | axis | 表示进行运算的轴,可选项,仅参数名不一致。 | | ||
| keepdim | keepdim | 表示是否保留计算后的维度,可选项。 | | ||
| dtype | - | 指定输出数据类型,可选项,Pytorch 默认值为 None,Paddle 无此参数,需要转写。 | | ||
| out | - | 表示输出的 Tensor,可选项,Paddle 无此参数,需要进行转写。 | | ||
|
||
### 转写示例 | ||
|
||
#### dytpe:指定数据类型 | ||
|
||
```python | ||
# Pytorch 写法 | ||
x.nanmean(dim=-1, dtype=torch.float32,out=y) | ||
|
||
# Paddle 写法 | ||
x.astype('float32') | ||
paddle.assign(x.nanmean(dim=-1),y) | ||
``` | ||
|
||
#### out:指定输出 | ||
|
||
```python | ||
# Pytorch 写法 | ||
x.nanmean(dim=1,out=y) | ||
|
||
# Paddle 写法 | ||
paddle.assign(x.nanmean(dim=1), y) | ||
``` |
22 changes: 22 additions & 0 deletions
22
...vert/convert_from_pytorch/api_difference/functional/torch.nn.functional.mish.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,22 @@ | ||
## [ torch 参数更多 ]torch.nn.functional.mish | ||
|
||
### [torch.nn.functional.mish](https://pytorch.org/docs/1.13/generated/torch.nn.functional.mish.html?highlight=torch+nn+functional+mish#torch.nn.functional.mish) | ||
|
||
```python | ||
torch.nn.functional.mish(input, | ||
inplace=False) | ||
``` | ||
|
||
### [paddle.nn.functional.mish](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/nn/functional/mish_cn.html) | ||
|
||
```python | ||
paddle.nn.functional.mish(x, | ||
name=None) | ||
``` | ||
|
||
Pytorch 相比 Paddle 支持更多其他参数,具体如下: | ||
### 参数映射 | ||
| PyTorch | PaddlePaddle | 备注 | | ||
| ------------- | ------------ | ------------------------------------------------------ | | ||
| input | x | 表示输入的 Tensor ,仅参数名不一致。 | | ||
| inplace | - | 表示在不更改变量的内存地址的情况下,直接修改变量的值,主要功能为节省显存,一般对网络训练影响不大,Paddle 无此参数,可直接删除。 | |
34 changes: 34 additions & 0 deletions
34
...es/model_convert/convert_from_pytorch/api_difference/linalg/torch.linalg.eig.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,34 @@ | ||
## [ torch 参数更多 ]torch.linalg.eig | ||
|
||
### [torch.linalg.eig](https://pytorch.org/docs/1.13/generated/torch.linalg.eig.html?highlight=torch+linalg+eig#torch.linalg.eig) | ||
|
||
```python | ||
torch.linalg.eig(A, | ||
out=None) | ||
``` | ||
|
||
### [paddle.linalg.eig](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/linalg/eig_cn.html) | ||
|
||
```python | ||
paddle.linalg.eig(x, | ||
name=None) | ||
``` | ||
|
||
Pytorch 相比 Paddle 支持更多其他参数,具体如下: | ||
### 参数映射 | ||
| PyTorch | PaddlePaddle | 备注 | | ||
| ------------- | ------------ | ------------------------------------------------------ | | ||
| A | x | 表示输入的 Tensor ,仅参数名不一致。 | | ||
| out | - | 表示输出的 tuple, Paddle 无此参数,需要进行转写。 | | ||
|
||
### 转写示例 | ||
|
||
#### out:指定输出 | ||
|
||
```python | ||
# Pytorch 写法 | ||
torch.linalg.eig(t,out=(L,V)) | ||
|
||
# Paddle 写法 | ||
L,V=paddle.linalg.eig(t) | ||
``` |
34 changes: 34 additions & 0 deletions
34
...odel_convert/convert_from_pytorch/api_difference/linalg/torch.linalg.eigvals.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,34 @@ | ||
## [ torch 参数更多 ]torch.linalg.eigvals | ||
|
||
### [torch.linalg.eigvals](https://pytorch.org/docs/1.13/generated/torch.linalg.eigvals.html?highlight=torch+linalg+eigvals#torch.linalg.eigvals) | ||
|
||
```python | ||
torch.linalg.eigvals(A, | ||
out=None) | ||
``` | ||
|
||
### [paddle.linalg.eigvals](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/linalg/eigvals_cn.html) | ||
|
||
```python | ||
paddle.linalg.eigvals(x, | ||
name=None) | ||
``` | ||
|
||
Pytorch 相比 Paddle 支持更多其他参数,具体如下: | ||
### 参数映射 | ||
| PyTorch | PaddlePaddle | 备注 | | ||
| ------- | ------------ | ---------------------------------------------------- | | ||
| A | x | 表示输入的 Tensor ,仅参数名不一致。 | | ||
| out | - | 表示输出的 Tensor , Paddle 无此参数,需要进行转写。 | | ||
|
||
### 转写示例 | ||
|
||
#### out:指定输出 | ||
|
||
```python | ||
# Pytorch 写法 | ||
torch.linalg.eigvals(t, out=y) | ||
|
||
# Paddle 写法 | ||
paddle.assign(paddle.linalg.eigvals(t), y) | ||
``` |
34 changes: 34 additions & 0 deletions
34
...el_convert/convert_from_pytorch/api_difference/linalg/torch.linalg.multi_dot.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,34 @@ | ||
## [ torch 参数更多 ]torch.linalg.multi_dot | ||
|
||
### [torch.linalg.multi_dot](https://pytorch.org/docs/1.13/generated/torch.linalg.multi_dot.html?highlight=torch+linalg+multi_dot#torch.linalg.multi_dot) | ||
|
||
```python | ||
torch.linalg.multi_dot(tensors, | ||
out=None) | ||
``` | ||
|
||
### [paddle.linalg.multi_dot](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/linalg/multi_dot_cn.html) | ||
|
||
```python | ||
paddle.linalg.multi_dot(x, | ||
name=None) | ||
``` | ||
|
||
Pytorch 相比 Paddle 支持更多其他参数,具体如下: | ||
### 参数映射 | ||
| PyTorch | PaddlePaddle | 备注 | | ||
| ------------- | ------------ | ------------------------------------------------------ | | ||
| tensors | x | 表示输入的一个 tensor 列表 ,仅参数名不一致。 | | ||
| out | - | 表示输出的 Tensor , Paddle 无此参数,需要进行转写。 | | ||
|
||
### 转写示例 | ||
|
||
#### out:指定输出 | ||
|
||
```python | ||
# Pytorch 写法 | ||
torch.linalg.multi_dot(x, out=y) | ||
|
||
# Paddle 写法 | ||
paddle.assign(paddle.linalg.multi_dot(x), y) | ||
``` |
19 changes: 19 additions & 0 deletions
19
docs/guides/model_convert/convert_from_pytorch/api_difference/nn/troch.nn.Mish.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,19 @@ | ||
## [ torch 参数更多 ]troch.nn.Mish | ||
|
||
### [troch.nn.Mish](https://pytorch.org/docs/1.13/generated/torch.nn.Mish.html?highlight=troch+nn+mish) | ||
|
||
```python | ||
troch.nn.Mish(inplace=False) | ||
``` | ||
|
||
### [paddle.nn.Mish](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/nn/Mish_cn.html) | ||
|
||
```python | ||
paddle.nn.Mish(name=None) | ||
``` | ||
|
||
Pytorch 相比 Paddle 支持更多其他参数,具体如下: | ||
### 参数映射 | ||
| PyTorch | PaddlePaddle | 备注 | | ||
| ------------- | ------------ | ------------------------------------------------------ | | ||
| inplace | - | 表示在不更改变量的内存地址的情况下,直接修改变量的值,主要功能为节省显存,一般对网络训练影响不大,Paddle 无此参数,可直接删除。 | |
34 changes: 34 additions & 0 deletions
34
docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.frexp.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,34 @@ | ||
## [ torch 参数更多 ]torch.frexp | ||
|
||
### [torch.frexp](https://pytorch.org/docs/1.13/generated/torch.frexp.html?highlight=frexp#torch.frexp) | ||
|
||
```python | ||
torch.frexp(input, | ||
out=None) | ||
``` | ||
|
||
### [paddle.frexp](暂无对应文档) | ||
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. 可以提issue报文档bug 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. 已提交issue |
||
|
||
```python | ||
paddle.frexp(x, | ||
name=None) | ||
``` | ||
|
||
Pytorch 相比 Paddle 支持更多其他参数,具体如下: | ||
### 参数映射 | ||
| PyTorch | PaddlePaddle | 备注 | | ||
| ------------- | ------------ | ------------------------------------------------------ | | ||
| input | x | 表示输入的 Tensor,仅参数名不一致。 | | ||
| out | - | 表示输出的 Tensor,可选项,Paddle 无此参数,需要进行转写。 | | ||
|
||
### 转写示例 | ||
|
||
#### out:指定输出 | ||
|
||
```python | ||
# Pytorch 写法 | ||
torch.frexp(x,out=y) | ||
|
||
# Paddle 写法 | ||
paddle.assign(paddle.frexp(x), y) | ||
``` |
52 changes: 52 additions & 0 deletions
52
docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.nanmean.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,52 @@ | ||
## [ torch 参数更多 ]torch.nanmean | ||
|
||
### [torch.nanmean](https://pytorch.org/docs/1.13/generated/torch.nanmean.html?highlight=nanmean#torch.nanmean) | ||
|
||
```python | ||
torch.nanmean(input, | ||
dim=None, | ||
keepdim=False, | ||
dtype=None, | ||
out=None) | ||
``` | ||
|
||
### [paddle.nanmean](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/nanmean_cn.html) | ||
|
||
```python | ||
paddle.nanmean(x, | ||
axis=None, | ||
keepdim=False, | ||
name=None) | ||
``` | ||
|
||
Pytorch 相比 Paddle 支持更多其他参数,具体如下: | ||
### 参数映射 | ||
| PyTorch | PaddlePaddle | 备注 | | ||
| ------------- | ------------ | ------------------------------------------------------ | | ||
| input | x | 表示输入的 Tensor,仅参数名不一致。 | | ||
| dim | axis | 表示进行运算的轴,可选项,仅参数名不一致。 | | ||
| keepdim | keepdim | 表示是否保留计算后的维度,可选项。 | | ||
| dtype | - | 指定输出数据类型,可选项,Pytorch 默认值为 None,Paddle 无此参数,需要转写。 | | ||
| out | - | 表示输出的 Tensor,可选项,Paddle 无此参数,需要进行转写。 | | ||
|
||
### 转写示例 | ||
|
||
#### dytpe:指定数据类型 | ||
|
||
```python | ||
# Pytorch 写法 | ||
torch.nanmean(x, dim=-1, dtype=torch.float32,out=y) | ||
|
||
# Paddle 写法 | ||
paddle.assign(paddle.nanmean(x.astype('float32'),dim=-1),y) | ||
``` | ||
|
||
#### out:指定输出 | ||
|
||
```python | ||
# Pytorch 写法 | ||
torch.nanmean(t, dim=1,out=y) | ||
|
||
# Paddle 写法 | ||
paddle.assign(paddle.nanmean(t, dim=1), y) | ||
``` |
39 changes: 39 additions & 0 deletions
39
...s/model_convert/convert_from_pytorch/api_difference/ops/torch.take_along_dim.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.take_along_dim | ||
|
||
### [torch.take_along_dim](https://pytorch.org/docs/1.13/generated/torch.take_along_dim.html?highlight=torch+take_along_dim#torch.take_along_dim) | ||
|
||
```python | ||
torch.take_along_dim(input, | ||
indices, | ||
dim, | ||
out=None) | ||
``` | ||
|
||
### [paddle.take_along_axis](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/take_along_axis_cn.html) | ||
|
||
```python | ||
paddle.take_along_axis(arr, | ||
indices, | ||
axis) | ||
``` | ||
|
||
Pytorch 相比 Paddle 支持更多其他参数,具体如下: | ||
### 参数映射 | ||
| PyTorch | PaddlePaddle | 备注 | | ||
| ------------- | ------------ | ------------------------------------------------------ | | ||
| input | arr | 表示输入的 Tensor ,仅参数名不一致。 | | ||
| indices | indices | 表示索引矩阵 ,仅参数名不一致。 | | ||
| dim | axis | 表示沿着哪个维度获取对应的值,仅参数名不一致。 | | ||
| out | - | 表示输出的 Tensor , Paddle 无此参数,需要进行转写。 | | ||
|
||
### 转写示例 | ||
|
||
#### out:指定输出 | ||
|
||
```python | ||
# Pytorch 写法 | ||
torch.take_along_dim(t, idx, 1,out=y) | ||
|
||
# Paddle 写法 | ||
paddle.assign(paddle.take_along_axis(t, idx, 1), y) | ||
``` |
34 changes: 34 additions & 0 deletions
34
...s/model_convert/convert_from_pytorch/api_difference/others/torch.special.erf.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,34 @@ | ||
## [ torch 参数更多 ]torch.special.erf | ||
|
||
### [torch.special.erf](https://pytorch.org/docs/1.13/special.html?highlight=torch+special+erf#torch.special.erf) | ||
|
||
```python | ||
torch.special.erf(input, | ||
out=None) | ||
``` | ||
|
||
### [paddle.erf](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/erf_cn.html) | ||
|
||
```python | ||
paddle.erf(x, | ||
name=None) | ||
``` | ||
|
||
Pytorch 相比 Paddle 支持更多其他参数,具体如下: | ||
### 参数映射 | ||
| PyTorch | PaddlePaddle | 备注 | | ||
| ------------- | ------------ | ------------------------------------------------------ | | ||
| input | x | 表示输入的 Tensor ,仅参数名不一致。 | | ||
| out | - | 表示输出的 Tensor , Paddle 无此参数,需要进行转写。 | | ||
|
||
### 转写示例 | ||
|
||
#### out:指定输出 | ||
|
||
```python | ||
# Pytorch 写法 | ||
torch.special.erf(t, out=y) | ||
|
||
# Paddle 写法 | ||
paddle.assign(paddle.erf(t), y) | ||
``` |
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.
这个文档bug,可以提issue