From 88cc4108f8c015b7db0b0827c9dd5af0742c803d Mon Sep 17 00:00:00 2001 From: co63oc Date: Sat, 15 Jul 2023 07:25:03 +0800 Subject: [PATCH 1/3] Add api_difference docs --- .../others/torch.special.erfinv.md | 34 ++++++++++++++++++ .../others/torch.special.logit.md | 35 +++++++++++++++++++ 2 files changed, 69 insertions(+) create mode 100644 docs/guides/model_convert/convert_from_pytorch/api_difference/others/torch.special.erfinv.md create mode 100644 docs/guides/model_convert/convert_from_pytorch/api_difference/others/torch.special.logit.md diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/others/torch.special.erfinv.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/others/torch.special.erfinv.md new file mode 100644 index 00000000000..57f7a2e7f1f --- /dev/null +++ b/docs/guides/model_convert/convert_from_pytorch/api_difference/others/torch.special.erfinv.md @@ -0,0 +1,34 @@ +## [torch 参数更多]torch.special.erfinv + +### [torch.special.erfinv](https://pytorch.org/docs/1.13/special.html#torch.special.erfinv) + +```python +torch.special.erfinv(input, *, out=None) +``` + +### [paddle.erfinv](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/erfinv_cn.html) + +```python +paddle.erfinv(x, name=None) +``` + +其中 Pytorch 相比 Paddle 支持更多其他参数,具体如下: + +### 参数映射 + +| PyTorch | PaddlePaddle | 备注 | +| ------- | ------------ | -------------------------------------------------- | +| input | x | 表示输入的 Tensor,仅参数名不一致。 | +| out | - | 表示输出的 Tensor,Paddle 无此参数,需要进行转写。 | + +### 转写示例 + +#### out:指定输出 + +```python +# Pytorch 写法 +torch.special.erfinv(x, out=y) + +# Paddle 写法 +paddle.assign(paddle.erfinv(x), y) +``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/others/torch.special.logit.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/others/torch.special.logit.md new file mode 100644 index 00000000000..ae66b3347c7 --- /dev/null +++ b/docs/guides/model_convert/convert_from_pytorch/api_difference/others/torch.special.logit.md @@ -0,0 +1,35 @@ +## [torch 参数更多]torch.special.logit + +### [torch.special.logit](https://pytorch.org/docs/1.13/special.html#torch.special.logit) + +```python +torch.special.logit(input, eps=None, *, out=None) +``` + +### [paddle.logit](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/logit_cn.html) + +```python +paddle.logit(x, eps=None, name=None) +``` + +其中 Pytorch 相比 Paddle 支持更多其他参数,具体如下: + +### 参数映射 + +| PyTorch | PaddlePaddle | 备注 | +| ------- | ------------ | -------------------------------------------------- | +| input | x | 表示输入的 Tensor,仅参数名不一致。 | +| eps | eps | 传入该参数后可将 x 的范围控制在 [eps,1−eps]。 | +| out | - | 表示输出的 Tensor,Paddle 无此参数,需要进行转写。 | + +### 转写示例 + +#### out:指定输出 + +```python +# Pytorch 写法 +torch.special.logit(x, out=y) + +# Paddle 写法 +paddle.assign(paddle.logit(x), y) +``` From 0d61d0a16c9c95d8d30152564d1ea73cb34d9cc8 Mon Sep 17 00:00:00 2001 From: co63oc Date: Tue, 18 Jul 2023 20:09:28 +0800 Subject: [PATCH 2/3] Fix --- .../api_difference/others/torch.special.logit.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/others/torch.special.logit.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/others/torch.special.logit.md index ae66b3347c7..df536ce1c44 100644 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/others/torch.special.logit.md +++ b/docs/guides/model_convert/convert_from_pytorch/api_difference/others/torch.special.logit.md @@ -18,7 +18,7 @@ paddle.logit(x, eps=None, name=None) | PyTorch | PaddlePaddle | 备注 | | ------- | ------------ | -------------------------------------------------- | -| input | x | 表示输入的 Tensor,仅参数名不一致。 | +| input | x | 输入的 Tensor,仅参数名不一致。 | | eps | eps | 传入该参数后可将 x 的范围控制在 [eps,1−eps]。 | | out | - | 表示输出的 Tensor,Paddle 无此参数,需要进行转写。 | From 992d2a54415aa0356e6407c3ddd1aa09e7c74757 Mon Sep 17 00:00:00 2001 From: co63oc Date: Tue, 18 Jul 2023 20:11:05 +0800 Subject: [PATCH 3/3] Fix --- .../api_difference/others/torch.special.erfinv.md | 2 +- .../api_difference/others/torch.special.logit.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/others/torch.special.erfinv.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/others/torch.special.erfinv.md index 57f7a2e7f1f..fb7ca593b08 100644 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/others/torch.special.erfinv.md +++ b/docs/guides/model_convert/convert_from_pytorch/api_difference/others/torch.special.erfinv.md @@ -1,6 +1,6 @@ ## [torch 参数更多]torch.special.erfinv -### [torch.special.erfinv](https://pytorch.org/docs/1.13/special.html#torch.special.erfinv) +### [torch.special.erfinv](https://pytorch.org/docs/stable/special.html#torch.special.erfinv) ```python torch.special.erfinv(input, *, out=None) diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/others/torch.special.logit.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/others/torch.special.logit.md index df536ce1c44..0ea7b1d0846 100644 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/others/torch.special.logit.md +++ b/docs/guides/model_convert/convert_from_pytorch/api_difference/others/torch.special.logit.md @@ -1,6 +1,6 @@ ## [torch 参数更多]torch.special.logit -### [torch.special.logit](https://pytorch.org/docs/1.13/special.html#torch.special.logit) +### [torch.special.logit](https://pytorch.org/docs/stable/special.html#torch.special.logit) ```python torch.special.logit(input, eps=None, *, out=None)