Skip to content

Commit

Permalink
add api mapping (PaddlePaddle#5687)
Browse files Browse the repository at this point in the history
* Add api convert

* pytorch-paddle-api-convert-0307

* add api mapping

* adjust directory structure
  • Loading branch information
huajiao-hjyp authored Mar 10, 2023
1 parent d982221 commit 88f5888
Show file tree
Hide file tree
Showing 269 changed files with 2,008 additions and 379 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
## torch.nn.functional.adaptive_avg_pool1d

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

```python
torch.nn.functional.adaptive_avg_pool1d(input, output_size)
```

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

```python
paddle.nn.functional.adaptive_avg_pool1d(x, output_size, name=None)
```

两者功能一致,仅参数名不一致,具体如下:
### 参数差异
| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| input | x | 表示输入的 Tensor 。 |
| output_size | output_size | 表示输出 Tensor 的大小。 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## torch.nn.functional.adaptive_avg_pool2d

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

```python
torch.nn.functional.adaptive_avg_pool2d(input, output_size)
```

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

```python
paddle.nn.functional.adaptive_avg_pool2d(x,
output_size,
data_format='NCHW',
name=None)
```

其中 Paddle 相比 PyTorch 支持更多其他参数,具体如下:
### 参数差异
| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| input | x | 表示输入的 Tensor 。 |
| output_size | output_size | 表示输出 Tensor 的大小。 |
| - | data_format | 表示输入 Tensor 的数据格式, PyTorch 无此参数, Paddle 保持默认即可。 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## torch.nn.functional.adaptive_avg_pool3d

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

```python
torch.nn.functional.adaptive_avg_pool3d(input, output_size)
```

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

```python
paddle.nn.functional.adaptive_avg_pool3d(x,
output_size,
data_format='NCDHW',
name=None)
```

两者功能一致,仅参数名不一致,具体如下:
### 参数差异
| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| input | x | 表示输入的 Tensor 。 |
| output_size | output_size | 表示输出 Tensor 的大小。 |
| - | data_format | 表示输入 Tensor 的数据格式, PyTorch 无此参数, Paddle 保持默认即可。 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## torch.nn.functional.adaptive_max_pool1d

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

```python
torch.nn.functional.adaptive_max_pool1d(input,
output_size,
return_indices=False)
```

### [paddle.nn.functional.adaptive_max_pool1d](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/nn/functional/adaptive_max_pool1d_cn.html#adaptive-max-pool1d)

```python
paddle.nn.functional.adaptive_max_pool1d(x,
output_size,
return_mask=False,
name=None)
```

两者功能一致,仅参数名不一致,具体如下:
### 参数差异
| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| input | x | 表示输入的 Tensor 。 |
| output_size | output_size | 表示输出 Tensor 的大小。 |
| return_indices | return_mask | 表示是否返回最大值的索引。 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## torch.nn.functional.adaptive_max_pool2d

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

```python
torch.nn.functional.adaptive_max_pool2d(input,
output_size,
return_indices=False)
```

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

```python
paddle.nn.functional.adaptive_max_pool2d(x,
output_size,
return_mask=False,
name=None)
```

两者功能一致,仅参数名不一致,具体如下:
### 参数差异
| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| input | x | 表示输入的 Tensor 。 |
| output_size | output_size | 表示输出 Tensor 的大小。 |
| return_indices | return_mask | 表示是否返回最大值的索引。 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
## torch.nn.functional.adaptive_max_pool3d

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

```python
torch.nn.functional.adaptive_max_pool3d(input,
output_size,
return_indices=False)
```

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

```python
paddle.nn.functional.adaptive_max_pool3d(x,
output_size,
return_mask=False,
name=None)
```

两者功能一致,仅参数名不一致,具体如下:
### 参数差异
| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| input | x | 表示输入的 Tensor 。 |
| output_size | output_size | 表示输出 Tensor 的大小。 |
| return_indices | return_mask | 表示是否返回最大值的索引。 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
## torch.nn.functional.bilinear

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

```python
torch.nn.functional.bilinear(input1,
input2,
weight,
bias=None)
```

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

```python
paddle.nn.functional.bilinear(x1,
x2,
weight,
bias=None,
name=None)
```

两者功能一致,仅参数名不一致,具体如下:
### 参数差异
| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| input1 | x1 | 表示第一个输入的 Tensor 。 |
| input2 | x2 | 表示第二个输入的 Tensor 。 |
| weight | weight | 表示权重 Tensor 。 |
| bias | bias | 表示偏重 Tensor 。 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## torch.nn.functional.conv1d

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

```python
torch.nn.functional.conv1d(input,
weight,
bias=None,
stride=1,
padding=0,
dilation=1,
groups=1)
```

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

```python
paddle.nn.functional.conv1d(x,
weight,
bias=None,
stride=1,
padding=0,
dilation=1,
groups=1,
data_format='NCL',
name=None)
```

其中 Paddle 相比 PyTorch 支持更多其他参数,具体如下:
### 参数差异
| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| input | x | 表示输入的 Tensor 。 |
| - | data_format | 表示输入 Tensor 的数据格式, PyTorch 无此参数, Paddle 保持默认即可。 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## torch.nn.functional.conv2d

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

```python
torch.nn.functional.conv1d(input,
weight,
bias=None,
stride=1,
padding=0,
dilation=1,
groups=1)
```

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

```python
paddle.nn.functional.conv2d(x,
weight,
bias=None,
stride=1,
padding=0,
dilation=1,
groups=1,
data_format='NCHW',
name=None)
```

其中 Paddle 相比 PyTorch 支持更多其他参数,具体如下:
### 参数差异
| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| input | x | 表示输入的 Tensor 。 |
| - | data_format | 表示输入 Tensor 的数据格式, PyTorch 无此参数, Paddle 保持默认即可。 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## torch.nn.functional.conv3d

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

```python
torch.nn.functional.conv3d(input,
weight,
bias=None,
stride=1,
padding=0,
dilation=1,
groups=1)
```

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

```python
paddle.nn.functional.conv3d(x,
weight,
bias=None,
stride=1,
padding=0,
dilation=1,
groups=1,
data_format='NCDHW',
name=None)
```

其中 Paddle 相比 PyTorch 支持更多其他参数,具体如下:
### 参数差异
| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| input | x | 表示输入的 Tensor 。 |
| - | data_format | 表示输入 Tensor 的数据格式, PyTorch 无此参数, Paddle 保持默认即可。 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## torch.nn.functional.conv_transpose1d

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

```python
torch.nn.functional.conv_transpose1d(input,
weight,
bias=None,
stride=1,
padding=0,
output_padding=0,
groups=1,
dilation=1)
```

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

```python
paddle.nn.functional.conv1d_transpose(x,
weight,
bias=None,
stride=1,
padding=0,
output_padding=0,
groups=1,
dilation=1,
output_size=None,
data_format='NCL',
name=None)
```

其中 Paddle 相比 PyTorch 支持更多其他参数,具体如下:
### 参数差异
| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| input | x | 表示输入的 Tensor 。 |
| - | output_size | 表示输出 Tensor 的尺寸, PyTorch 无此参数, Paddle 保持默认即可。 |
| - | data_format | 表示输入 Tensor 的数据格式, PyTorch 无此参数, Paddle 保持默认即可。 |
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
## torch.nn.functional.conv_transpose2d

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

```python
torch.nn.functional.conv_transpose2d(input,
weight,
bias=None,
stride=1,
padding=0,
output_padding=0,
groups=1,
dilation=1)
```

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

```python
paddle.nn.functional.conv2d_transpose(x,
weight,
bias=None,
stride=1,
padding=0,
output_padding=0,
groups=1,
dilation=1,
data_format='NCHW',
output_size=None,
name=None)
```

其中 Paddle 相比 PyTorch 支持更多其他参数,具体如下:
### 参数差异
| PyTorch | PaddlePaddle | 备注 |
| ------------- | ------------ | ------------------------------------------------------ |
| input | x | 表示输入的 Tensor 。 |
| - | data_format | 表示输入 Tensor 的数据格式, PyTorch 无此参数, Paddle 保持默认即可。 |
| - | output_size | 表示输出 Tensor 的尺寸, PyTorch 无此参数, Paddle 保持默认即可。 |
Loading

0 comments on commit 88f5888

Please sign in to comment.