|
1 |
| -## [ 仅参数名不一致 ]torch.nn.functional.softmax |
| 1 | +## [ torch 参数更多 ]torch.nn.functional.softmax |
2 | 2 |
|
3 |
| -### [torch.nn.functional.softmax](https://pytorch.org/docs/stable/generated/torch.nn.functional.softmax.html?highlight=softmax#torch.nn.functional.softmax) |
| 3 | +### [torch.nn.functional.softmax](https://pytorch.org/docs/stable/generated/torch.nn.functional.softmax.html#torch.nn.functional.softmax) |
4 | 4 |
|
5 | 5 | ```python
|
6 |
| -torch.nn.functional.softmax(input, |
7 |
| - dim=None, |
8 |
| - dtype=None) |
| 6 | +torch.nn.functional.softmax(input, dim=None, _stacklevel=3, dtype=None) |
9 | 7 | ```
|
10 | 8 |
|
11 |
| -### [paddle.nn.functional.softmax](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/softmax_cn.html) |
| 9 | +### [paddle.nn.functional.softmax](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/softmax_cn.html#softmax) |
12 | 10 |
|
13 | 11 | ```python
|
14 |
| -paddle.nn.functional.softmax(x, |
15 |
| - axis=- 1, |
16 |
| - dtype=None, |
17 |
| - name=None) |
| 12 | +paddle.nn.functional.softmax(x, axis=-1, dtype=None, name=None) |
18 | 13 | ```
|
19 | 14 |
|
20 |
| -两者功能一致,仅参数名不一致,具体如下: |
| 15 | +PyTorch 相比 Paddle 支持更多其他参数,具体如下: |
| 16 | + |
21 | 17 | ### 参数映射
|
22 | 18 |
|
23 |
| -| PyTorch | PaddlePaddle | 备注 | |
24 |
| -| ------------- | ------------ | ------------------------------------------------------ | |
25 |
| -| input | x | 表示输入 Tensor ,仅参数名不一致。 | |
26 |
| -| dim | axis | 表示对输入 Tensor 运算的轴 ,仅参数名不一致。 | |
27 |
| -| dtype | dtype | 表示输入 Tensor 的数据类型 。 | |
| 19 | +| PyTorch | PaddlePaddle | 备注 | |
| 20 | +| --------- | -------------- | ----------------------------------------------------- | |
| 21 | +| input | x | 表示输入张量,仅参数名不一致。 | |
| 22 | +| dim | axis | 表示对输入 Tensor 进行运算的轴,仅参数名不一致。 | |
| 23 | +| dtype | dtype | 表示返回张量所需的数据类型。 | |
| 24 | +| _stacklevel | - | Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | |
0 commit comments