Skip to content

Commit

Permalink
【映射文档】在映射主目录中补全已有文档的条目 (PaddlePaddle#6656)
Browse files Browse the repository at this point in the history
* fix 5 inconsistent api items

* update validator

* update pytorch_api_mapping_cn.md

* pre-commit
  • Loading branch information
RedContritio authored May 27, 2024
1 parent 0a895a7 commit 4be8fb4
Show file tree
Hide file tree
Showing 6 changed files with 983 additions and 629 deletions.
1 change: 1 addition & 0 deletions docs/guides/model_convert/convert_from_pytorch/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
docs_mappings.json
pytorch_api_mapping_cn.tmp.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,24 @@
## [ 仅参数名不一致 ]torch.nn.functional.softmax
## [ torch 参数更多 ]torch.nn.functional.softmax

### [torch.nn.functional.softmax](https://pytorch.org/docs/stable/generated/torch.nn.functional.softmax.html?highlight=softmax#torch.nn.functional.softmax)
### [torch.nn.functional.softmax](https://pytorch.org/docs/stable/generated/torch.nn.functional.softmax.html#torch.nn.functional.softmax)

```python
torch.nn.functional.softmax(input,
dim=None,
dtype=None)
torch.nn.functional.softmax(input, dim=None, _stacklevel=3, dtype=None)
```

### [paddle.nn.functional.softmax](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/softmax_cn.html)
### [paddle.nn.functional.softmax](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/softmax_cn.html#softmax)

```python
paddle.nn.functional.softmax(x,
axis=- 1,
dtype=None,
name=None)
paddle.nn.functional.softmax(x, axis=-1, dtype=None, name=None)
```

两者功能一致,仅参数名不一致,具体如下:
PyTorch 相比 Paddle 支持更多其他参数,具体如下:

### 参数映射

| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| input | x | 表示输入 Tensor ,仅参数名不一致。 |
| dim | axis | 表示对输入 Tensor 运算的轴 ,仅参数名不一致。 |
| dtype | dtype | 表示输入 Tensor 的数据类型 。 |
| PyTorch | PaddlePaddle | 备注 |
| --------- | -------------- | ----------------------------------------------------- |
| input | x | 表示输入张量,仅参数名不一致。 |
| dim | axis | 表示对输入 Tensor 进行运算的轴,仅参数名不一致。 |
| dtype | dtype | 表示返回张量所需的数据类型。 |
| _stacklevel | - | Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 |

This file was deleted.

Loading

0 comments on commit 4be8fb4

Please sign in to comment.