diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.logical_xor.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.logical_xor.md index 9ad3d59946c..06bf1e2fbbe 100644 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.logical_xor.md +++ b/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.logical_xor.md @@ -1,26 +1,23 @@ ## [ 仅参数名不一致 ]torch.logical_xor -### [torch.logical_xor](https://pytorch.org/docs/1.13/generated/torch.logical_xor.html?highlight=logical_xor#torch.logical_xor) + +### [torch.logical_xor](https://pytorch.org/docs/1.13/generated/torch.logical_xor.html?highlight=torch+logical_xor#torch.logical_xor) ```python -torch.logical_xor(input, - other, - *, - out=None) +torch.logical_xor(input, other, *, out=None) ``` -### [paddle.logical_xor](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/logical_xor_cn.html#logical-xor) +### [paddle.logical_xor](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/logical_xor_cn.html) ```python -paddle.logical_xor(x, - y, - out=None, - name=None) +paddle.logical_xor(x, y, out=None, name=None) ``` -两者功能一致且参数用法一致,仅参数名不同,具体如下: +两者功能一致且参数用法一致,仅参数名不一致,具体如下: + ### 参数映射 -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| other | y | 表示输入的 Tensor ,仅参数名不一致。 | -| out | out | 表示输出的 Tensor 。| + +| PyTorch | PaddlePaddle | 备注 | +| ----------------------------------- | ------------ | ----------------------------------------------------------------------- | +| input | x | 表示输入的 Tensor ,仅参数名不一致。 | +| other | y | 表示输入的 Tensor ,仅参数名不一致。 | +| out | out | 表示输出的 Tensor 。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.logit.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.logit.md new file mode 100644 index 00000000000..3395655e81e --- /dev/null +++ b/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.logit.md @@ -0,0 +1,33 @@ +## [ torch 参数更多 ]torch.logit + +### [torch.logit](https://pytorch.org/docs/1.13/generated/torch.logit.html?highlight=torch+logit#torch.logit) + +```python +torch.logit(input, eps=None, *, out=None) +``` + +### [paddle.logit](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/logit_cn.html) + +```python +paddle.logit(x, eps=None, name=None) +``` + +Pytorch 相比 Paddle 支持更多其他参数,具体如下: + +### 参数映射 + +| PyTorch | PaddlePaddle | 备注 | +| ----------------------------------- | ------------ | ----------------------------------------------------------------------- | +| input | x | 表示输入的 Tensor ,仅参数名不一致。 | +| eps | eps | 将输入向量的范围控制在 [eps,1−eps] | +| out | - | 表示输出的 Tensor , Paddle 无此参数,需要进行转写。 | + +### 转写示例 +#### out:指定输出 +```python +# Pytorch 写法 +torch.logit(x, out=y) + +# Paddle 写法 +paddle.assign(paddle.logit(x),y) +``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.mul.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.mul.md index c61335f2464..decc59c1ba1 100644 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.mul.md +++ b/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.mul.md @@ -1,29 +1,26 @@ -## [torch 参数更多 ]torch.mul -### [torch.mul](https://pytorch.org/docs/stable/generated/torch.mul.html?highlight=mul#torch.mul) +## [ torch 参数更多 ]torch.mul + +### [torch.mul](https://pytorch.org/docs/1.13/generated/torch.mul.html?highlight=torch+mul#torch.mul) ```python -torch.mul(input, - other, - *, - out=None) +torch.mul(input, other, *, out=None) ``` -### [paddle.multiply](https://vpaddlepaddle.org.cn/documentation/docs/zh/api/paddle/multiply_cn.html#multiply) +### [paddle.multiply](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/multiply_cn.html) ```python -paddle.multiply(x, - y, - name=None) +paddle.multiply(x, y, name=None) ``` -其中 Pytorch 相比 Paddle 支持更多其他参数,具体如下: +Pytorch 相比 Paddle 支持更多其他参数,具体如下: + ### 参数映射 -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| other | y | 表示输入的 Tensor ,仅参数名不一致。 | -| out | - | 表示输出的 Tensor , Paddle 无此参数,需要进行转写。 | +| PyTorch | PaddlePaddle | 备注 | +| ----------------------------------- | ------------ | ----------------------------------------------------------------------- | +| input | x | 表示输入的 Tensor ,仅参数名不一致。 | +| other | y | 表示输入的 Tensor ,仅参数名不一致。 | +| out | - | 表示输出的 Tensor , Paddle 无此参数,需要进行转写。 | ### 转写示例 #### out:指定输出 @@ -32,5 +29,5 @@ paddle.multiply(x, torch.mul([3, 5], [1, 2], out=y) # Paddle 写法 -paddle.assign(paddle.multiply([3, 5], [1, 2]), y) +paddle.assign(paddle.multiply([3, 5], [1, 2]),y) ``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.multiply.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.multiply.md index 8149c0cecc8..cc5138ef6c1 100644 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.multiply.md +++ b/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.multiply.md @@ -1,36 +1,33 @@ -## [torch 参数更多 ]torch.multiply -### [torch.multiply](https://pytorch.org/docs/stable/generated/torch.multiply.html?highlight=multiply#torch.multiply) +## [ torch 参数更多 ]torch.multiply + +### [torch.multiply](https://pytorch.org/docs/1.13/generated/torch.multiply.html?highlight=torch+multiply#torch.multiply) ```python -torch.multiply(input, - other, - *, - out=None) +torch.multiply(input, other, *, out=None) ``` -### [paddle.multiply](https://vpaddlepaddle.org.cn/documentation/docs/zh/api/paddle/multiply_cn.html#multiply) +### [paddle.multiply](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/multiply_cn.html) ```python -paddle.multiply(x, - y, - name=None) +paddle.multiply(x, y, name=None) ``` -其中 Pytorch 相比 Paddle 支持更多其他参数,具体如下: +Pytorch 相比 Paddle 支持更多其他参数,具体如下: + ### 参数映射 -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| other | y | 表示输入的 Tensor ,仅参数名不一致。 | -| out | - | 表示输出的 Tensor , Paddle 无此参数,需要进行转写。 | +| PyTorch | PaddlePaddle | 备注 | +| ----------------------------------- | ------------ | ----------------------------------------------------------------------- | +| input | x | 表示输入的 Tensor ,仅参数名不一致。 | +| other | y | 表示输入的 Tensor ,仅参数名不一致。 | +| out | - | 表示输出的 Tensor , Paddle 无此参数,需要进行转写。 | ### 转写示例 #### out:指定输出 ```python # Pytorch 写法 -torch.multiply([3, 5], [1, 2], out=y) +torch.multiply([3, 5], [1, 2], out = y) # Paddle 写法 -paddle.assign(paddle.multiply([3, 5], [1, 2]), y) +paddle.assign(paddle.multiply([3, 5], [1, 2]) , y) ``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.nan_to_num.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.nan_to_num.md new file mode 100644 index 00000000000..ee2cea7ec3d --- /dev/null +++ b/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.nan_to_num.md @@ -0,0 +1,34 @@ +## [torch 参数更多 ]torch.nan_to_num + +### [torch.nan_to_num](https://pytorch.org/docs/1.13/generated/torch.nan_to_num.html?highlight=nan_to_num#torch.nan_to_num) + +```python +torch.nan_to_num(input, nan=0.0, posinf=None, neginf=None, *, out=None) +``` + +### [paddle.nan_to_num]() + +```python +paddle.nan_to_num(x, nan=0.0, posinf=None, neginf=None, name=None) +``` + +其中 Pytorch 相比 Paddle 支持更多其他参数,具体如下: +### 参数映射 +| PyTorch | PaddlePaddle | 备注 | +| ------------- | ------------ | ------------------------------------------------------ | +| input | x | 表示输入的 Tensor ,仅参数名不一致。 | +| nan | nan | 表示用于替换 nan 的值。 | +| posinf | posinf | 表示+inf 的替换值。 | +| neginf | neginf | 表示-inf 的替换值。 | +| out | - | 表示输出的 Tensor , Paddle 无此参数,需要进行转写。 | + + +### 转写示例 +#### out:指定输出 +```python +# Pytorch 写法 +torch.nan_to_num(x, n, pos, neg, out = y) + +# Paddle 写法 +paddle.assign(paddle.nan_to_num(x, n, pos, neg), y) +``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.neg.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.neg.md new file mode 100644 index 00000000000..a0f50030c6e --- /dev/null +++ b/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.neg.md @@ -0,0 +1,32 @@ +## [ torch 参数更多 ]torch.neg + +### [torch.neg](https://pytorch.org/docs/1.13/generated/torch.neg.html?highlight=neg#torch.neg) + +```python +torch.neg(input, *, out=None) +``` + +### [paddle.neg](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/neg_cn.html) + +```python +paddle.neg(x, name=None) +``` + +Pytorch 相比 Paddle 支持更多其他参数,具体如下: + +### 参数映射 + +| PyTorch | PaddlePaddle | 备注 | +| ----------------------------------- | ------------ | ----------------------------------------------------------------------- | +| input | x | 表示输入的 Tensor ,仅参数名不一致。 | +| out | - | 表示输出的 Tensor , Paddle 无此参数,需要进行转写。 | + +### 转写示例 +#### out:指定输出 +```python +# Pytorch 写法 +torch.neg(x , out=y) + +# Paddle 写法 +paddle.assign(paddle.neg(x) , y) +``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.negative.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.negative.md new file mode 100644 index 00000000000..4a788baf365 --- /dev/null +++ b/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.negative.md @@ -0,0 +1,32 @@ +## [ torch 参数更多 ]torch.negative + +### [torch.negative](https://pytorch.org/docs/1.13/generated/torch.negative.html?highlight=torch+negative#torch.negative) + +```python +torch.negative(input, *, out=None) +``` + +### [paddle.neg](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/neg_cn.html) + +```python +paddle.neg(x, name=None) +``` + +Pytorch 相比 Paddle 支持更多其他参数,具体如下: + +### 参数映射 + +| PyTorch | PaddlePaddle | 备注 | +| ----------------------------------- | ------------ | ----------------------------------------------------------------------- | +| input | x | 表示输入的 Tensor ,仅参数名不一致。 | +| out | - | 表示输出的 Tensor , Paddle 无此参数,需要进行转写。 | + +### 转写示例 +#### out:指定输出 +```python +# Pytorch 写法 +torch.negative(x ,out = y) + +# Paddle 写法 +paddle.assign(paddle.neg(x), y) +``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.pow.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.pow.md index e1e7fa7b4d0..e389e5613ec 100644 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.pow.md +++ b/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.pow.md @@ -1,5 +1,6 @@ ## [torch 参数更多 ]torch.pow -### [torch.pow](https://pytorch.org/docs/stable/generated/torch.pow.html?highlight=pow#torch.pow) + +### [torch.pow](https://pytorch.org/docs/1.13/generated/torch.pow.html?highlight=pow#torch.pow) ```python torch.pow(input, @@ -8,7 +9,7 @@ torch.pow(input, out=None) ``` -### [paddle.pow](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/pow_cn.html#pow) +### [paddle.pow](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/pow_cn.html) ```python paddle.pow(x, @@ -20,9 +21,9 @@ paddle.pow(x, ### 参数映射 | PyTorch | PaddlePaddle | 备注 | | ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| exponent | y | 表示输入的 Tensor ,仅参数名不一致。 | -| out | - | 表示输出的 Tensor , Paddle 无此参数,需要进行转写。 | +| input | x | 表示输入的 Tensor ,仅参数名不一致。 | +| exponent | y | 表示输入的 Tensor ,仅参数名不一致。 | +| out | - | 表示输出的 Tensor , Paddle 无此参数,需要进行转写。 | ### 转写示例 diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.rad2deg.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.rad2deg.md new file mode 100644 index 00000000000..ac79916435b --- /dev/null +++ b/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.rad2deg.md @@ -0,0 +1,31 @@ +## [torch 参数更多 ]torch.rad2deg + +### [torch.rad2deg](https://pytorch.org/docs/1.13/generated/torch.rad2deg.html?highlight=torch+rad2deg#torch.rad2deg) + +```python +torch.rad2deg(input, *, out=None) +``` + +### [paddle.rad2deg](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/rad2deg_cn.html) + +```python +paddle.rad2deg(x, name=None) +``` + +其中 Pytorch 相比 Paddle 支持更多其他参数,具体如下: +### 参数映射 +| PyTorch | PaddlePaddle | 备注 | +| ------------- | ------------ | ------------------------------------------------------ | +| input | x | 表示输入的 Tensor ,仅参数名不一致。 | +| out | - | 表示输出的 Tensor , Paddle 无此参数,需要进行转写。 | + + +### 转写示例 +#### out:指定输出 +```python +# Pytorch 写法 +torch.rad2deg(x, out=y) + +# Paddle 写法 +paddle.assign(paddle.rad2deg(x), y) +``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.reciprocal.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.reciprocal.md index dafca099f53..aec3cd1459b 100644 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.reciprocal.md +++ b/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.reciprocal.md @@ -1,5 +1,6 @@ ## [torch 参数更多]torch.reciprocal -### [torch.reciprocal](https://pytorch.org/docs/stable/generated/torch.reciprocal.html?highlight=reciprocal#torch.reciprocal) + +### [torch.reciprocal](https://pytorch.org/docs/1.13/generated/torch.reciprocal.html?highlight=torch+reciprocal#torch.reciprocal) ```python torch.reciprocal(input, @@ -7,7 +8,7 @@ torch.reciprocal(input, out=None) ``` -### [paddle.reciprocal](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/reciprocal_cn.html#reciprocal) +### [paddle.reciprocal](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/reciprocal_cn.html) ```python paddle.reciprocal(x,