Skip to content
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

映射文档 No. 253/261/279 #6047

Merged
merged 2 commits into from
Jul 24, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## [仅参数名不一致]torch.nn.functional.gaussian_nll_loss

### [torch.nn.functional.gaussian_nll_loss](https://pytorch.org/docs/stable/generated/torch.nn.functional.gaussian_nll_loss.html#torch.nn.functional.gaussian_nll_loss)

```python
torch.nn.functional.gaussian_nll_loss(input, target, var, full=False, eps=1e-06, reduction='mean')
```

### [paddle.nn.functional.gaussian_nll_loss](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/gaussian_nll_loss_cn.html#gaussian-nll-loss)

```python
paddle.nn.functional.gaussian_nll_loss(input, label, variance, full=False, epsilon=1e-6, reduction='mean', name=None)
```

两者功能一致,仅参数名不一致,具体如下:

### 参数映射

| PyTorch | PaddlePaddle | 备注 |
| --------- | ------------ | ----------------------------------------------------------------- |
| input | input | 输入 Tensor。 |
| target | label | 输入 Tensor,仅参数名不一致。 |
| var | variance | 输入 Tensor,仅参数名不一致。 |
| full | full | 是否在损失计算中包括常数项。 |
| eps | epsilon | 用于限制 variance 的值,使其不会导致除 0 的出现,仅参数名不一致。 |
| reduction | reduction | 指定应用于输出结果的计算方式。 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## [仅 paddle 参数更多]torch.autograd.profiler.profile.export_chrome_trace

### [torch.autograd.profiler.profile.export_chrome_trace](https://pytorch.org/docs/stable/generated/torch.autograd.profiler.profile.export_chrome_trace.html#torch.autograd.profiler.profile.export_chrome_trace)

```python
torch.autograd.profiler.profile.export_chrome_trace(path)
```

### [paddle.profiler.export_chrome_tracing](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/profiler/export_chrome_tracing_cn.html)

```python
paddle.profiler.export_chrome_tracing(dir_name: str, worker_name: Optional[str] = None)
```

Paddle 相比 PyTorch 支持更多其他参数,具体如下:

### 参数映射

| PyTorch | PaddlePaddle | 备注 |
| ------- | ------------ | ------------------------------------------------------------------------- |
| path | dir_name | 性能数据导出所保存到的文件夹路径,仅参数名不一致。 |
| - | worker_name | 性能数据导出所保存到的文件名前缀,PyTorch 无此参数,Paddle 保持默认即可。 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
## [torch 参数更多]torch.special.i0e

### [torch.special.i0e](https://pytorch.org/docs/stable/special.html#torch.special.i0e)

```python
torch.special.i0e(input, *, out=None)
```

### [paddle.i0e](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/i0e_cn.html)

```python
paddle.i0e(x, name=None)
```

其中 Pytorch 相比 Paddle 支持更多其他参数,具体如下:

### 参数映射

| PyTorch | PaddlePaddle | 备注 |
| ------- | ------------ | -------------------------------------------------- |
| input | x | 表示输入的 Tensor,仅参数名不一致。 |
| out | - | 表示输出的 Tensor,Paddle 无此参数,需要进行转写。 |

### 转写示例

#### out:指定输出

```python
# Pytorch 写法
x = torch.tensor([1, 2, 3, 4, 5], dtype=torch.float32)
torch.special.i0e(x, out=y)

# Paddle 写法
x = paddle.to_tensor([1, 2, 3, 4, 5], dtype="float32")
paddle.assign(paddle.i0e(x), y)
```