Skip to content

Commit

Permalink
Add api_difference
Browse files Browse the repository at this point in the history
  • Loading branch information
co63oc committed Jul 15, 2023
1 parent c02695e commit c1adc6f
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## [参数完全一致]torch.Tensor.nan_to_num

### [torch.Tensor.nan_to_num](https://pytorch.org/docs/1.13/generated/torch.Tensor.nan_to_num.html#torch.Tensor.nan_to_num)

```python
torch.Tensor.nan_to_num(nan=0.0, posinf=None, neginf=None)
```

### [paddle.Tensor.nan_to_num](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor_cn.html#nan-to-num)

```python
paddle.Tensor.nan_to_num(nan=0.0, posinf=None, neginf=None)
```

两者功能一致,且参数用法一致,具体如下:

### 参数映射

| PyTorch | PaddlePaddle | 备注 |
| ------- | ------------ | --------------- |
| nan | nan | NaN 的替换值。 |
| posinf | posinf | +inf 的替换值。 |
| neginf | neginf | -inf 的替换值。 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## [仅参数名不一致]torch.Tensor.nextafter

### [torch.Tensor.nextafter](https://pytorch.org/docs/1.13/generated/torch.Tensor.nextafter.html#torch.Tensor.nextafter)

```python
torch.Tensor.nextafter(other)
```

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

```python
paddle.Tensor.nextafter(y)
```

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

### 参数映射

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

| PyTorch | PaddlePaddle | 备注 |
| ------- | ------------ | ---------------------------------- |
| other | y | 输⼊第二个 Tensor,仅参数名不同。 |

0 comments on commit c1adc6f

Please sign in to comment.