From fd00b66434020e65af2395ed5abc7b159e71ad48 Mon Sep 17 00:00:00 2001 From: xxa <1829994704@qq.com> Date: Fri, 23 Aug 2024 20:59:55 +0800 Subject: [PATCH 1/5] fix hsplit --- .../api_difference/torch/torch.hsplit.md | 42 ++++++++++++++++--- 1 file changed, 36 insertions(+), 6 deletions(-) diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch/torch.hsplit.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch/torch.hsplit.md index 0225fab4cd5..ade5c0fbdce 100644 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch/torch.hsplit.md +++ b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch/torch.hsplit.md @@ -1,24 +1,54 @@ ## [ 仅参数名不一致 ]torch.hsplit +api存在重载情况,分别如下: + +------------------------------------------------------------------------------------------------- + +### [torch.hsplit](https://pytorch.org/docs/stable/generated/torch.hsplit.html#torch.hsplit) + +```python +torch.hsplit(input, +        sections) +``` + +### [paddle.hsplit](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/hsplit_cn.html) + +```python +paddle.hsplit(x, +        num_or_indices, +        name=None) +``` + +其中 Paddle 相比 PyTorch 仅参数名不一致,具体如下: + +### 参数映射 + +| PyTorch       | PaddlePaddle | 备注                                                   | +| ------------- | ------------ | ------------------------------------------------------ | +| input          |  x           | 输入多维 Tensor ,仅参数名不一致。  | +| sections           | num_or_indices         | 表示分割的数量,仅参数名不一致。                          | + +------------------------------------------------------------------------------------------------- + ### [torch.hsplit](https://pytorch.org/docs/stable/generated/torch.hsplit.html#torch.hsplit) ```python torch.hsplit(input, - indices_or_sections) +        indices) ``` ### [paddle.hsplit](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/hsplit_cn.html) ```python paddle.hsplit(x, - num_or_indices, - name=None) +        num_or_indices, +        name=None) ``` 其中 Paddle 相比 PyTorch 仅参数名不一致,具体如下: ### 参数映射 -| PyTorch | PaddlePaddle | 备注 | +| PyTorch       | PaddlePaddle | 备注                                                   | | ------------- | ------------ | ------------------------------------------------------ | -| input | x | 输入多维 Tensor ,仅参数名不一致。 | -| indices_or_sections | num_or_indices | 表示分割的数量或索引,仅参数名不一致。 | +| input          |  x           | 输入多维 Tensor ,仅参数名不一致。  | +| indices           | num_or_indices         | 表示分割的数量,仅参数名不一致。                          | From 5d18669635c9d9be34c24977e34cc84a18adc123 Mon Sep 17 00:00:00 2001 From: xxa <1829994704@qq.com> Date: Fri, 23 Aug 2024 22:10:35 +0800 Subject: [PATCH 2/5] fix docs --- .../Tensor/torch.Tensor.dsplit.md | 29 +++++++++- .../Tensor/torch.Tensor.hsplit.md | 29 +++++++++- .../Tensor/torch.Tensor.tensor_split.md | 54 +++++++++++++++++- .../api_difference/torch/torch.dsplit.md | 34 ++++++++++- .../torch/torch.tensor_split.md | 56 ++++++++++++++++++- 5 files changed, 192 insertions(+), 10 deletions(-) diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/Tensor/torch.Tensor.dsplit.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/Tensor/torch.Tensor.dsplit.md index 9db6885457c..7c5c36ff77d 100644 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/Tensor/torch.Tensor.dsplit.md +++ b/docs/guides/model_convert/convert_from_pytorch/api_difference/Tensor/torch.Tensor.dsplit.md @@ -1,9 +1,34 @@ ## [ 仅参数名不一致 ]torch.Tensor.dsplit +api 存在重载情况,分别如下: + +------------------------------------------------------------------------------------------------- + +### [torch.Tensor.dsplit](https://pytorch.org/docs/stable/generated/torch.Tensor.dsplit.html) + +```python +torch.Tensor.dsplit(sections) +``` + +### [paddle.Tensor.dsplit](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor_cn.html#dsplit-num_or_indices-name-none) + +```python +paddle.Tensor.dsplit(num_or_indices, name=None) +``` + +其中 Paddle 相比 PyTorch 仅参数名不一致,具体如下: + +### 参数映射 + +| PyTorch | PaddlePaddle | 备注 | +| ------------- | ------------ | ------------------------------------------------------ | +| sections | num_or_indices | 表示分割的数量,仅参数名不一致。 | + +------------------------------------------------------------------------------------------------- ### [torch.Tensor.dsplit](https://pytorch.org/docs/stable/generated/torch.Tensor.dsplit.html) ```python -torch.Tensor.dsplit(split_size_or_sections) +torch.Tensor.dsplit(indices) ``` ### [paddle.Tensor.dsplit](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor_cn.html#dsplit-num_or_indices-name-none) @@ -18,4 +43,4 @@ paddle.Tensor.dsplit(num_or_indices, name=None) | PyTorch | PaddlePaddle | 备注 | | ------------- | ------------ | ------------------------------------------------------ | -| split_size_or_sections | num_or_indices | 表示分割的数量或索引,仅参数名不一致。 | +| indices | num_or_indices | 表示分割的索引,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/Tensor/torch.Tensor.hsplit.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/Tensor/torch.Tensor.hsplit.md index 114ea061661..fccfa0ea794 100644 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/Tensor/torch.Tensor.hsplit.md +++ b/docs/guides/model_convert/convert_from_pytorch/api_difference/Tensor/torch.Tensor.hsplit.md @@ -1,9 +1,34 @@ ## [ 仅参数名不一致 ]torch.Tensor.hsplit +api 存在重载情况,分别如下: + +------------------------------------------------------------------------------------------------- + +### [torch.Tensor.hsplit](https://pytorch.org/docs/stable/generated/torch.Tensor.hsplit.html) + +```python +torch.Tensor.hsplit(sections) +``` + +### [paddle.Tensor.hsplit](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor_cn.html#hsplit-num_or_indices-name-none) + +```python +paddle.Tensor.hsplit(num_or_indices, name=None) +``` + +其中 Paddle 相比 PyTorch 仅参数名不一致,具体如下: + +### 参数映射 + +| PyTorch | PaddlePaddle | 备注 | +| ------------- | ------------ | ------------------------------------------------------ | +| sections | num_or_indices | 表示分割的数量,仅参数名不一致。 | + +------------------------------------------------------------------------------------------------- ### [torch.Tensor.hsplit](https://pytorch.org/docs/stable/generated/torch.Tensor.hsplit.html) ```python -torch.Tensor.hsplit(split_size_or_sections) +torch.Tensor.hsplit(indices) ``` ### [paddle.Tensor.hsplit](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor_cn.html#hsplit-num_or_indices-name-none) @@ -18,4 +43,4 @@ paddle.Tensor.hsplit(num_or_indices, name=None) | PyTorch | PaddlePaddle | 备注 | | ------------- | ------------ | ------------------------------------------------------ | -| split_size_or_sections | num_or_indices | 表示分割的数量或索引,仅参数名不一致。 | +| indices | num_or_indices | 表示分割的索引,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/Tensor/torch.Tensor.tensor_split.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/Tensor/torch.Tensor.tensor_split.md index 5926b3633e1..e0b45ef06fa 100644 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/Tensor/torch.Tensor.tensor_split.md +++ b/docs/guides/model_convert/convert_from_pytorch/api_difference/Tensor/torch.Tensor.tensor_split.md @@ -1,8 +1,58 @@ ## [ 仅参数名不一致 ]torch.Tensor.tensor_split +api 存在重载情况,分别如下: + +------------------------------------------------------------------------------------------------- + +### [torch.Tensor.tensor_split](https://pytorch.org/docs/stable/generated/torch.Tensor.tensor_split.html) + +```python +torch.Tensor.tensor_split(indices, dim=0) +``` + +### [paddle.Tensor.tensor_split](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor_cn.html#tensor_split-num_or_indices-axis-0-name-none) + +```python +paddle.Tensor.tensor_split(num_or_indices, axis=0, name=None) +``` + +其中 Paddle 相比 PyTorch 仅参数名不一致,具体如下: + +### 参数映射 + +| PyTorch | PaddlePaddle | 备注 | +| ------------- | ------------ | ------------------------------------------------------ | +| indices | num_or_indices | 表示分割的索引,仅参数名不一致。 | +| dim | axis | 表示需要分割的维度,仅参数名不一致。 | + +------------------------------------------------------------------------------------------------- + +### [torch.Tensor.tensor_split](https://pytorch.org/docs/stable/generated/torch.Tensor.tensor_split.html) + +```python +torch.Tensor.tensor_split(tensor_indices_or_sections, dim=0) +``` + +### [paddle.Tensor.tensor_split](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor_cn.html#tensor_split-num_or_indices-axis-0-name-none) + +```python +paddle.Tensor.tensor_split(num_or_indices, axis=0, name=None) +``` + +其中 Paddle 相比 PyTorch 仅参数名不一致,具体如下: + +### 参数映射 + +| PyTorch | PaddlePaddle | 备注 | +| ------------- | ------------ | ------------------------------------------------------ | +| tensor_indices_or_sections | num_or_indices | 表示分割的数量或索引,仅参数名不一致。 | +| dim | axis | 表示需要分割的维度,仅参数名不一致。 | + +------------------------------------------------------------------------------------------------- + ### [torch.Tensor.tensor_split](https://pytorch.org/docs/stable/generated/torch.Tensor.tensor_split.html) ```python -torch.Tensor.tensor_split(indices_or_sections, dim=0) +torch.Tensor.tensor_split(sections, dim=0) ``` ### [paddle.Tensor.tensor_split](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor_cn.html#tensor_split-num_or_indices-axis-0-name-none) @@ -17,5 +67,5 @@ paddle.Tensor.tensor_split(num_or_indices, axis=0, name=None) | PyTorch | PaddlePaddle | 备注 | | ------------- | ------------ | ------------------------------------------------------ | -| indices_or_sections | num_or_indices | 表示分割的数量或索引,仅参数名不一致。 | +| sections | num_or_indices | 表示分割的数量,仅参数名不一致。 | | dim | axis | 表示需要分割的维度,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch/torch.dsplit.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch/torch.dsplit.md index 63be788aca7..f74cce2b8f8 100644 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch/torch.dsplit.md +++ b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch/torch.dsplit.md @@ -1,9 +1,39 @@ ## [ 仅参数名不一致 ]torch.dsplit +api 存在重载情况,分别如下: + +------------------------------------------------------------------------------------------------- + +### [torch.dsplit](https://pytorch.org/docs/stable/generated/torch.dsplit.html#torch.dsplit) + +```python +torch.dsplit(input, + sections) +``` + +### [paddle.dsplit](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/dsplit_cn.html) + +```python +paddle.dsplit(x, + num_or_indices, + name=None) +``` + +其中 Paddle 相比 PyTorch 仅参数名不一致,具体如下: + +### 参数映射 + +| PyTorch | PaddlePaddle | 备注 | +| ------------- | ------------ | ------------------------------------------------------ | +| input | x | 输入多维 Tensor ,仅参数名不一致。 | +| sections | num_or_indices | 表示分割的数量,仅参数名不一致。 | + +------------------------------------------------------------------------------------------------- + ### [torch.dsplit](https://pytorch.org/docs/stable/generated/torch.dsplit.html#torch.dsplit) ```python torch.dsplit(input, - indices_or_sections) + indices) ``` ### [paddle.dsplit](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/dsplit_cn.html) @@ -21,4 +51,4 @@ paddle.dsplit(x, | PyTorch | PaddlePaddle | 备注 | | ------------- | ------------ | ------------------------------------------------------ | | input | x | 输入多维 Tensor ,仅参数名不一致。 | -| indices_or_sections | num_or_indices | 表示分割的数量或索引,仅参数名不一致。 | +| indices | num_or_indices | 表示分割的索引,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch/torch.tensor_split.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch/torch.tensor_split.md index a6f9f6bb1bd..32cb7a30571 100644 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch/torch.tensor_split.md +++ b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch/torch.tensor_split.md @@ -1,8 +1,60 @@ ## [ 仅参数名不一致 ]torch.tensor_split +api 存在重载情况,分别如下: + +------------------------------------------------------------------------------------------------- + +### [torch.tensor_split](https://pytorch.org/docs/stable/generated/torch.tensor_split.html) + +```python +torch.tensor_split(input, indices, dim=0) +``` + +### [paddle.tensor_split](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/tensor_split_cn.html) + +```python +paddle.tensor_split(x, num_or_indices, axis=0, name=None) +``` + +其中 Paddle 相比 PyTorch 仅参数名不一致,具体如下: + +### 参数映射 + +| PyTorch | PaddlePaddle | 备注 | +| ------------- | ------------ | ------------------------------------------------------ | +| input | x | 表示输入的 Tensor ,仅参数名不一致。 | +| indices | num_or_indices | 表示分割的索引,仅参数名不一致。 | +| dim | axis | 表示需要分割的维度,仅参数名不一致。 | + +------------------------------------------------------------------------------------------------- + +### [torch.tensor_split](https://pytorch.org/docs/stable/generated/torch.tensor_split.html) + +```python +torch.tensor_split(input, tensor_indices_or_sections, dim=0) +``` + +### [paddle.tensor_split](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/tensor_split_cn.html) + +```python +paddle.tensor_split(x, num_or_indices, axis=0, name=None) +``` + +其中 Paddle 相比 PyTorch 仅参数名不一致,具体如下: + +### 参数映射 + +| PyTorch | PaddlePaddle | 备注 | +| ------------- | ------------ | ------------------------------------------------------ | +| input | x | 表示输入的 Tensor ,仅参数名不一致。 | +| tensor_indices_or_sections | num_or_indices | 表示分割的数量或索引,仅参数名不一致。 | +| dim | axis | 表示需要分割的维度,仅参数名不一致。 | + +------------------------------------------------------------------------------------------------- + ### [torch.tensor_split](https://pytorch.org/docs/stable/generated/torch.tensor_split.html) ```python -torch.tensor_split(input, indices_or_sections, dim=0) +torch.tensor_split(input, sections, dim=0) ``` ### [paddle.tensor_split](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/tensor_split_cn.html) @@ -18,5 +70,5 @@ paddle.tensor_split(x, num_or_indices, axis=0, name=None) | PyTorch | PaddlePaddle | 备注 | | ------------- | ------------ | ------------------------------------------------------ | | input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| indices_or_sections | num_or_indices | 表示分割的数量或索引,仅参数名不一致。 | +| sections | num_or_indices | 表示分割的数量,仅参数名不一致。 | | dim | axis | 表示需要分割的维度,仅参数名不一致。 | From ee0c71750965af4718b2576bcb71f4ab0c6ce9b9 Mon Sep 17 00:00:00 2001 From: xxa <1829994704@qq.com> Date: Mon, 26 Aug 2024 20:19:21 +0800 Subject: [PATCH 3/5] fix --- .../convert_from_pytorch/api_difference/torch/torch.hsplit.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch/torch.hsplit.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch/torch.hsplit.md index ade5c0fbdce..770dce34f37 100644 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch/torch.hsplit.md +++ b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch/torch.hsplit.md @@ -1,5 +1,5 @@ ## [ 仅参数名不一致 ]torch.hsplit -api存在重载情况,分别如下: +api 存在重载情况,分别如下: ------------------------------------------------------------------------------------------------- From 5078cc1e16fc6d3787917d1e30be295912fabc7a Mon Sep 17 00:00:00 2001 From: xxa <1829994704@qq.com> Date: Thu, 29 Aug 2024 00:12:30 +0800 Subject: [PATCH 4/5] fix-docs1 --- .../api_difference/Tensor/torch.Tensor.tensor_split.md | 9 +-------- .../api_difference/torch/torch.tensor_split.md | 10 +--------- 2 files changed, 2 insertions(+), 17 deletions(-) diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/Tensor/torch.Tensor.tensor_split.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/Tensor/torch.Tensor.tensor_split.md index e0b45ef06fa..bb43d7d8a15 100644 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/Tensor/torch.Tensor.tensor_split.md +++ b/docs/guides/model_convert/convert_from_pytorch/api_difference/Tensor/torch.Tensor.tensor_split.md @@ -38,14 +38,7 @@ torch.Tensor.tensor_split(tensor_indices_or_sections, dim=0) paddle.Tensor.tensor_split(num_or_indices, axis=0, name=None) ``` -其中 Paddle 相比 PyTorch 仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| tensor_indices_or_sections | num_or_indices | 表示分割的数量或索引,仅参数名不一致。 | -| dim | axis | 表示需要分割的维度,仅参数名不一致。 | +Paddle 当前无对应功能,功能缺失 ------------------------------------------------------------------------------------------------- diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch/torch.tensor_split.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch/torch.tensor_split.md index 32cb7a30571..7c1afe63dc1 100644 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch/torch.tensor_split.md +++ b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch/torch.tensor_split.md @@ -39,15 +39,7 @@ torch.tensor_split(input, tensor_indices_or_sections, dim=0) paddle.tensor_split(x, num_or_indices, axis=0, name=None) ``` -其中 Paddle 相比 PyTorch 仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| tensor_indices_or_sections | num_or_indices | 表示分割的数量或索引,仅参数名不一致。 | -| dim | axis | 表示需要分割的维度,仅参数名不一致。 | +paddle 当前无对应功能,功能缺失。 ------------------------------------------------------------------------------------------------- From c3fc9b97f66d217128fff0d9d43550548bb98ca4 Mon Sep 17 00:00:00 2001 From: xxa <1829994704@qq.com> Date: Thu, 29 Aug 2024 14:34:58 +0800 Subject: [PATCH 5/5] fix docs --- .../api_difference/Tensor/torch.Tensor.tensor_split.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/Tensor/torch.Tensor.tensor_split.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/Tensor/torch.Tensor.tensor_split.md index bb43d7d8a15..536226586f7 100644 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/Tensor/torch.Tensor.tensor_split.md +++ b/docs/guides/model_convert/convert_from_pytorch/api_difference/Tensor/torch.Tensor.tensor_split.md @@ -38,7 +38,7 @@ torch.Tensor.tensor_split(tensor_indices_or_sections, dim=0) paddle.Tensor.tensor_split(num_or_indices, axis=0, name=None) ``` -Paddle 当前无对应功能,功能缺失 +Paddle 当前无对应功能,功能缺失。 -------------------------------------------------------------------------------------------------