diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_default_value_diff/torch.cuda.amp.GradScaler.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_default_value_diff/torch.cuda.amp.GradScaler.md deleted file mode 100644 index b0cd6b59631..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_default_value_diff/torch.cuda.amp.GradScaler.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 参数默认值不一致 ]torch.cuda.amp.GradScaler - -### [torch.cuda.amp.GradScaler](https://docs.pytorch.org/docs/stable/amp.html#torch.cuda.amp.GradScaler) -```python -torch.cuda.amp.GradScaler(init_scale=65536.0, growth_factor=2.0, backoff_factor=0.5, growth_interval=2000, enabled=True) -``` - -### [paddle.amp.GradScaler](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/amp/GradScaler_cn.html#paddle.amp.GradScaler) -```python -paddle.amp.GradScaler(enable=True, init_loss_scaling=65536.0, incr_ratio=2.0, decr_ratio=0.5, incr_every_n_steps=2000, decr_every_n_nan_or_inf=2, use_dynamic_loss_scaling=True) -``` - -其中 Paddle 相比 PyTorch 支持更多其他参数且参数默认值不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| --------------- | ------------------------ |-----------------------------------------------------------------------------| -| init_scale | init_loss_scaling | 初始 loss scaling 因子。Paddle 与 PyTorch 默认值不同,Paddle 应设置为 65536.0。 | -| growth_factor | incr_ratio | 增大 loss scaling 时使用的乘数。 | -| backoff_factor | decr_ratio | 减小 loss scaling 时使用的小于 1 的乘数。 | -| growth_interval | incr_every_n_steps | 连续 n 个 steps 的梯度都是有限值时,增加 loss scaling。Paddle 与 PyTorch 默认值不同,Paddle 应设置为 2000。| -| enabled | enable | 是否使用 loss scaling。 | -| - | decr_every_n_nan_or_inf | 累计出现 n 个 steps 的梯度为 nan 或者 inf 时,减小 loss scaling,PyTorch 无此参数,Paddle 保持默认即可。 | -| - | use_dynamic_loss_scaling | 是否使用动态的 loss scaling,PyTorch 无此参数,Paddle 保持默认即可。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.as_strided.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.as_strided.md deleted file mode 100644 index bd0da60db2b..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.as_strided.md +++ /dev/null @@ -1,24 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.as_strided -### [torch.Tensor.as\_strided](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.as_strided.html#torch.Tensor.as_strided) -```python -torch.Tensor.as_strided(size, - stride, - storage_offset=None) -``` - -### [paddle.Tensor.as\_strided](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#as-strided-x-shape-stride-offset-0-name-none) -```python -paddle.Tensor.as_strided(shape, - stride, - offset=0, - name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| size | shape | 表示输出 Tensor 的维度, 仅参数名不一致。 | -| stride | stride | 表示输出 Tensor 的 stride。 | -| storage_offset | offset | 表示偏移量, 仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.atan2.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.atan2.md deleted file mode 100644 index e806ba8d8f6..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.atan2.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.atan2 -### [torch.Tensor.atan2](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.atan2.html#torch.Tensor.atan2) -```python -torch.Tensor.atan2(other) -``` - -### [paddle.Tensor.atan2](https://www.paddlepaddle.org.cn/documentation/docs/en/develop/api/paddle/Tensor_en.html) -```python -paddle.Tensor.atan2(y, name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| --------- | ------------ | --------------------------------- | -| other | y | 表示输入的 Tensor ,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.cross.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.cross.md deleted file mode 100644 index a57c0ab2aea..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.cross.md +++ /dev/null @@ -1,19 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.cross -### [torch.Tensor.cross](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.cross.html#torch.Tensor.cross) -```python -torch.Tensor.cross(other, dim=None) -``` - -### [paddle.Tensor.cross](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#cross-y-axis-none-name-none) -```python -paddle.Tensor.cross(y, axis=None, name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | -------------------------------------- | -| other | y | 输入 Tensor,仅参数名不一致。 | -| dim | axis | 沿此维度进行向量积操作,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.cumsum_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.cumsum_.md deleted file mode 100644 index 94008ad2219..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.cumsum_.md +++ /dev/null @@ -1,19 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.cumsum_ -### [torch.Tensor.cumsum\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.cumsum_.html#torch.Tensor.cumsum_) -```python -torch.Tensor.cumsum_(dim, *, dtype=None) -``` - -### [paddle.Tensor.cumsum_]() -```python -paddle.Tensor.cumsum_(axis=None, dtype=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ------------------------------ | -| dim | axis | 需要累加的维度,仅参数名不一致。 | -| dtype | dtype | 输出 Tensor 的数据类型。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.diagonal.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.diagonal.md deleted file mode 100644 index f99221b3759..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.diagonal.md +++ /dev/null @@ -1,20 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.diagonal -### [torch.Tensor.diagonal](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.diagonal.html#torch.Tensor.diagonal) -```python -torch.Tensor.diagonal(offset=0, dim1=0, dim2=1) -``` - -### [paddle.Tensor.diagonal](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#diagonal-offset-0-axis1-0-axis2-1-name-none) -```python -paddle.Tensor.diagonal(offset=0, axis1=0, axis2=1, name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | -------------------------------------------------------------------------- | -| offset | offset | 从指定的二维平面中获取对角线的位置,默认值为 0,既主对角线,仅参数名不一致。 | -| dim1 | axis1 | 获取对角线的二维平面的第一维,默认值为 0,仅参数名不一致。 | -| dim2 | axis2 | 获取对角线的二维平面的第二维,默认值为 1,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.diagonal_scatter.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.diagonal_scatter.md deleted file mode 100644 index 0f2d2e02631..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.diagonal_scatter.md +++ /dev/null @@ -1,21 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.diagonal_scatter -### [torch.Tensor.diagonal\_scatter](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.diagonal_scatter.html#torch.Tensor.diagonal_scatter) -```python -torch.Tensor.diagonal_scatter(src, offset=0, dim1=0, dim2=1) -``` - -### [paddle.Tensor.diagonal_scatter](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor_cn.html#diagonal-scatter-x-y-offset-0-axis1-0-axis2-1-name-none) -```python -paddle.Tensor.diagonal_scatter(y, offset=0, axis1=0, axis2=1) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -|---------|--------------| -------------------------------------------------- | -| src | y | 用于嵌入的张量,仅参数名不一致。 | -| offset | offset | 从指定的二维平面嵌入对角线的位置,默认值为 0,即主对角线。 | -| dim1 | axis1 | 对角线的第一个维度,默认值为 0,仅参数名不一致。 | -| dim2 | axis2 | 对角线的第二个维度,默认值为 1,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.dist.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.dist.md deleted file mode 100644 index cb55262f949..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.dist.md +++ /dev/null @@ -1,19 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.dist -### [torch.Tensor.dist](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.dist.html#torch.Tensor.dist) -```python -torch.Tensor.dist(other, p=2) -``` - -### [paddle.Tensor.dist](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#dist-y-p-2) -```python -paddle.Tensor.dist(y, p=2) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | --------------------------- | -| other | y | 输入 Tensor,仅参数名不一致。 | -| p | p | 需要计算的范数。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.flip.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.flip.md deleted file mode 100644 index 6db0ce72f60..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.flip.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.flip -### [torch.Tensor.flip](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.flip.html#torch.Tensor.flip) -```python -torch.Tensor.flip(dims) -``` - -### [paddle.Tensor.flip](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#flip-axis-name-none) -```python -paddle.Tensor.flip(axis, name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ---------------------------- | -| dims | axis | 需要翻转的轴,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.gcd.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.gcd.md deleted file mode 100644 index 364ef967de0..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.gcd.md +++ /dev/null @@ -1,17 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.gcd -### [torch.Tensor.gcd](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.gcd.html#torch.Tensor.gcd) -```python -torch.Tensor.gcd(other) -``` - -### [paddle.Tensor.gcd](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#gcd-x-y-name-none) -```python -paddle.Tensor.gcd(y, name=None) -``` - -两者功能一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -|----------------------------------|------------------------------| ------------------------------------------------------ | -| other | y | 输入的 Tensor ,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.gcd_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.gcd_.md deleted file mode 100644 index a6e880557f5..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.gcd_.md +++ /dev/null @@ -1,17 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.gcd_ -### [torch.Tensor.gcd\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.gcd_.html#torch.Tensor.gcd_) -```python -torch.Tensor.gcd_(other) -``` - -### [paddle.Tensor.gcd_]() -```python -paddle.Tensor.gcd_(y) -``` - -两者功能一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -|----------------------------------|------------------------------| ------------------------------------------------------ | -| other | y | 输入的 Tensor ,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.hypot.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.hypot.md deleted file mode 100644 index b4441e3866b..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.hypot.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.hypot -### [torch.Tensor.hypot](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.hypot.html#torch.Tensor.hypot) -```python -torch.Tensor.hypot(other) -``` - -### [paddle.Tensor.hypot](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/hypot_cn.html) -```python -paddle.Tensor.hypot(y) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ----------------------------- | -| other | y | 输入 Tensor,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.hypot_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.hypot_.md deleted file mode 100644 index 107b63ebbb7..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.hypot_.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.hypot_ -### [torch.Tensor.hypot\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.hypot_.html#torch.Tensor.hypot_) -```python -torch.Tensor.hypot_(other) -``` - -### [paddle.Tensor.hypot_](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/hypot__cn.html) -```python -paddle.Tensor.hypot_(y) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ----------------------------- | -| other | y | 输入 Tensor,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.index_fill.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.index_fill.md deleted file mode 100644 index d90e2329f1e..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.index_fill.md +++ /dev/null @@ -1,20 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.index_fill -### [torch.Tensor.index\_fill](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.index_fill.html#torch.Tensor.index_fill) -```python -torch.Tensor.index_fill(dim, index, value) -``` - -### [paddle.Tensor.index_fill](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/index_fill_cn.html#index-fill) -```python -paddle.Tensor.index_fill(index, axis, value, name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| dim | axis | 表示进行运算的轴,仅参数名不一致。 | -| index | index | 包含索引下标的 1-D Tensor。 | -| value | value | 填充的值。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.index_fill_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.index_fill_.md deleted file mode 100644 index d6079969e31..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.index_fill_.md +++ /dev/null @@ -1,20 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.index_fill_ -### [torch.Tensor.index\_fill\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.index_fill_.html#torch.Tensor.index_fill_) -```python -torch.Tensor.index_fill_(dim, index, value) -``` - -### [paddle.Tensor.index_fill_]() -```python -paddle.Tensor.index_fill_(index, axis, value, name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| dim | axis | 表示进行运算的轴,仅参数名不一致。 | -| index | index | 包含索引下标的 1-D Tensor。 | -| value | value | 填充的值。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.index_put.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.index_put.md deleted file mode 100644 index 179a2eba3d1..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.index_put.md +++ /dev/null @@ -1,20 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.index_put -### [torch.Tensor.index\_put](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.index_put.html#torch.Tensor.index_put) -```python -torch.Tensor.index_put(indices, values, accumulate=False) -``` - -### [paddle.Tensor.index\_put](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#index-put-indices-value-accumulate-false-name-none) -```python -paddle.Tensor.index_put(indices, value, accumulate=False, name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| indices | indices | 包含用来索引的 tensors 的元组。数据类型为 int32,int64,bool。 | -| values | value | 用来给 x 赋值的 Tensor,仅参数名不一致。 | -| accumulate | accumulate | 指定是否将 value 加到 x 的参数。 默认值为 False。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.index_put_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.index_put_.md deleted file mode 100644 index 9fc8fe9af4f..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.index_put_.md +++ /dev/null @@ -1,20 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.index_put_ -### [torch.Tensor.index\_put\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.index_put_.html#torch.Tensor.index_put_) -```python -torch.Tensor.index_put_(indices, values, accumulate=False) -``` - -### [paddle.Tensor.index_put_]() -```python -paddle.Tensor.index_put_(indices, value, accumulate=False) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| indices | indices | 包含用来索引的 tensors 的元组。数据类型为 int32,int64,bool。 | -| values | value | 用来给 x 赋值的 Tensor,仅参数名不一致。 | -| accumulate | accumulate | 指定是否将 value 加到 x 的参数。 默认值为 False。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.inner.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.inner.md deleted file mode 100644 index e17beef7fda..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.inner.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.inner -### [torch.Tensor.inner](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.inner.html#torch.Tensor.inner) -```python -torch.Tensor.inner(other) -``` - -### [paddle.Tensor.inner]() -```python -paddle.Tensor.inner(y, name=None) -``` - -其中 PyTorch 和 Paddle 功能一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | -- | -| other | y | 计算内积的第二个 Tensor,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.kthvalue.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.kthvalue.md deleted file mode 100644 index 9675fcb1b10..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.kthvalue.md +++ /dev/null @@ -1,20 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.kthvalue -### [torch.Tensor.kthvalue](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.kthvalue.html#torch.Tensor.kthvalue) -```python -torch.Tensor.kthvalue(k, dim=None, keepdim=False) -``` - -### [paddle.Tensor.kthvalue](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#kthvalue-k-axis-none-keepdim-false-name-none) -```python -paddle.Tensor.kthvalue(k, axis=None, keepdim=False, name=None) -``` - -其中 PyTorch 和 Paddle 功能一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | -- | -| k | k | 需要沿轴查找的第 k 小,所对应的 k 值。 | -| dim | axis | 指定对输入 Tensor 进行运算的轴,仅参数名不一致。 | -| keepdim | keepdim | 是否保留指定的轴。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.lcm.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.lcm.md deleted file mode 100644 index 8bef9819819..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.lcm.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.lcm -### [torch.Tensor.lcm](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.lcm.html#torch.Tensor.lcm) -```python -torch.Tensor.lcm(other) -``` - -### [paddle.Tensor.lcm](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#lcm-x-y-name-none) -```python -paddle.Tensor.lcm(y) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| other | y | 表示输入的 Tensor ,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.lcm_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.lcm_.md deleted file mode 100644 index d23a7a0fb28..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.lcm_.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.lcm_ -### [torch.Tensor.lcm\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.lcm_.html#torch.Tensor.lcm_) -```python -torch.Tensor.lcm_(other) -``` - -### [paddle.Tensor.lcm_]() -```python -paddle.Tensor.lcm_(y) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| other | y | 表示输入的 Tensor ,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.ldexp.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.ldexp.md deleted file mode 100644 index aae0faa268f..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.ldexp.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.ldexp -### [torch.Tensor.ldexp](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.ldexp.html#torch.Tensor.ldexp) -```python -torch.Tensor.ldexp(other) -``` - -### [paddle.Tensor.ldexp](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor_cn.html#tensor) -```python -paddle.Tensor.ldexp(y) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ------------------------------------------ | -| other | y | 表示输入的 Tensor ,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.ldexp_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.ldexp_.md deleted file mode 100644 index c4d9254ca92..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.ldexp_.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.ldexp_ -### [torch.Tensor.ldexp\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.ldexp_.html#torch.Tensor.ldexp_) -```python -torch.Tensor.ldexp_(other) -``` - -### [paddle.Tensor.ldexp_]() -```python -paddle.Tensor.ldexp_(y) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| other | y | 表示输入的 Tensor ,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.lerp.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.lerp.md deleted file mode 100644 index 5741676e52c..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.lerp.md +++ /dev/null @@ -1,19 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.lerp -### [torch.Tensor.lerp](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.lerp.html#torch.Tensor.lerp) -```python -torch.Tensor.lerp(end, weight) -``` - -### [paddle.Tensor.lerp](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#lerp-x-y-weight-name-none) -```python -paddle.Tensor.lerp(y, weight, name=None) -``` - -其中 PyTorch 和 Paddle 功能一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | -- | -| end | y | 输入的 Tensor,作为线性插值结束的点,仅参数名不一致。 | -| weight | weight | 给定的权重值。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.lerp_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.lerp_.md deleted file mode 100644 index 8c3a73b67b9..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.lerp_.md +++ /dev/null @@ -1,19 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.lerp_ -### [torch.Tensor.lerp\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.lerp_.html#torch.Tensor.lerp_) -```python -torch.Tensor.lerp_(end, weight) -``` - -### [paddle.Tensor.lerp\_](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#lerp-y-weight-name-none) -```python -paddle.Tensor.lerp_(y, weight, name=None) -``` - -其中 PyTorch 和 Paddle 功能一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | -- | -| end | y | 输入的 Tensor,作为线性插值结束的点,仅参数名不一致。 | -| weight | weight | 给定的权重值。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.logaddexp.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.logaddexp.md deleted file mode 100644 index ea25d17ff87..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.logaddexp.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.logaddexp -### [torch.Tensor.logaddexp](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.logaddexp.html#torch.Tensor.logaddexp) -```python -torch.Tensor.logaddexp(other) -``` - -### [paddle.Tensor.logaddexp](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor_cn.html#tensor) -```python -paddle.Tensor.logaddexp(y) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ------------------------------------------ | -| other | y | 表示输入的 Tensor ,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.mode.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.mode.md deleted file mode 100644 index 19e7921318f..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.mode.md +++ /dev/null @@ -1,19 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.mode -### [torch.Tensor.mode](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.mode.html#torch.Tensor.mode) -```python -torch.Tensor.mode(dim=None, keepdim=False) -``` - -### [paddle.Tensor.mode](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#mode-axis-1-keepdim-false-name-none) -```python -paddle.Tensor.mode(axis=-1, keepdim=False, name=None) -``` - -其中 PyTorch 和 Paddle 功能一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | -- | -| dim | axis | 指定对输入 Tensor 进行运算的轴,仅参数名不一致。 | -| keepdim | keepdim | 是否保留指定的轴。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.nanquantile.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.nanquantile.md deleted file mode 100644 index 12d69b9f63f..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.nanquantile.md +++ /dev/null @@ -1,21 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.nanquantile -### [torch.Tensor.nanquantile](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.nanquantile.html#torch.Tensor.nanquantile) -```python -torch.Tensor.nanquantile(q, dim=None, keepdim=False, *, interpolation='linear') -``` - -### [paddle.Tensor.nanquantile](https://github.com/PaddlePaddle/Paddle/pull/41343) -```python -paddle.Tensor.nanquantile(q, axis=None, keepdim=False, interpolation='linear') -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ |-----------------------------------------------------------------------------------------------------------------------------------| -| q | q | 待计算的分位数。| -| dim | axis | 求乘积运算的维度,仅参数名不一致。 | -| keepdim | keepdim | 是否在输出 Tensor 中保留输入的维度。 | -| interpolation | interpolation | 指定当所需分位数位于两个数据点之间时使用的插值方法。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.nansum.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.nansum.md deleted file mode 100644 index f2edff5e024..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.nansum.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.nansum -### [torch.Tensor.nansum](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.nansum.html#torch.Tensor.nansum) -```python -torch.Tensor.nansum(dim=None, - keepdim=False, - *, - dtype=None) -``` - -### [paddle.Tensor.nansum]() -```python -paddle.Tensor.nansum(axis=None, - keepdim=False, - dtype=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| dim | axis | 需要求和的维度,仅参数名不一致。 | -| keepdim | keepdim | 结果是否需要保持维度不变,仅参数名不一致。 | -| dtype | dtype | 返回的 Tensor 的类型,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.pow_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.pow_.md deleted file mode 100644 index b8adaad4893..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.pow_.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.pow_ -### [torch.Tensor.pow\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.pow_.html#torch.Tensor.pow_) -```python -torch.Tensor.pow_(exponent) -``` - -### [paddle.Tensor.pow_]() -```python -paddle.Tensor.pow_(y) -``` - -两者功能一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| -------- | ------------ | -------------------------------------------------- | -| exponent | y | 一个标量 Tensor,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.quantile.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.quantile.md deleted file mode 100644 index 25af8727748..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.quantile.md +++ /dev/null @@ -1,21 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.quantile -### [torch.Tensor.quantile](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.quantile.html#torch.Tensor.quantile) -```python -torch.Tensor.quantile(q, dim=None, keepdim=False, *, interpolation='linear') -``` - -### [paddle.Tensor.quantile](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#quantile-q-axis-none-keepdim-false-interpolation-linear-name-none) -```python -paddle.Tensor.quantile(q, axis=None, keepdim=False, interpolation='linear', name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ------------------------ | -| q | q | 待计算的分位数。 | -| dim | axis | 指定对 x 进行计算的轴,仅参数名不一致。| -| keepdim | keepdim | 是否在输出 Tensor 中保留减小的维度。| -| interpolation | interpolation | 两个数据点的插补取值方法。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.renorm.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.renorm.md deleted file mode 100644 index 2a7a21396d4..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.renorm.md +++ /dev/null @@ -1,20 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.renorm -### [torch.Tensor.renorm](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.renorm.html#torch.Tensor.renorm) -```python -torch.Tensor.renorm(p, dim, maxnorm) -``` - -### [paddle.Tensor.renorm]() -```python -paddle.Tensor.renorm(p, axis, max_norm) -``` - -两者功能一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | --------------------------------------------------- | -| p | p | 表示 p-范数计算的 p 值。| -| dim | axis | 表示切分的维度,仅参数名不一致。 | -| maxnorm | max_norm | 表示子张量的 p-范数最大值,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.renorm_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.renorm_.md deleted file mode 100644 index 916fbd8bdca..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.renorm_.md +++ /dev/null @@ -1,20 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.renorm_ -### [torch.Tensor.renorm\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.renorm_.html#torch.Tensor.renorm_) -```python -torch.Tensor.renorm_(p, dim, maxnorm) -``` - -### [paddle.Tensor.renorm_]() -```python -paddle.Tensor.renorm_(p, axis, max_norm) -``` - -两者功能一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | --------------------------------------------------- | -| p | p | 表示 p-范数计算的 p 值。| -| dim | axis | 表示切分的维度,仅参数名不一致。 | -| maxnorm | max_norm | 表示子张量的 p-范数最大值,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.rot90.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.rot90.md deleted file mode 100644 index e9733d34bdc..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.rot90.md +++ /dev/null @@ -1,19 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.rot90 -### [torch.Tensor.rot90](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.rot90.html#torch.Tensor.rot90) -```python -torch.Tensor.rot90(k, dims) -``` - -### [paddle.Tensor.rot90](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#rot90-k-1-axis-0-1-name-none) -```python -paddle.Tensor.rot90(k=1, axes=[0, 1]) -``` - -两者功能一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| k | k | 旋转方向和次数。 | -| dims | axes | 指定旋转的平面,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.select_scatter.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.select_scatter.md deleted file mode 100644 index 68cf9ac0fb6..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.select_scatter.md +++ /dev/null @@ -1,20 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.select_scatter -### [torch.Tensor.select\_scatter](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.select_scatter.html#torch.Tensor.select_scatter) -```python -torch.Tensor.select_scatter(src, dim, index) -``` - -### [paddle.Tensor.select\_scatter](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#select-scatter-x-values-axis-index-name-none) -```python -paddle.Tensor.select_scatter(values, axis, index, name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ---------------------------------------- | -| src | values | 用于嵌入的张量,仅参数名不一致。 | -| dim | axis | 嵌入的维度,仅参数名不一致。 | -| index | index | 选择的索引。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.squeeze_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.squeeze_.md deleted file mode 100644 index 1ace11e1a33..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.squeeze_.md +++ /dev/null @@ -1,17 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.squeeze_ -### [torch.Tensor.squeeze\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.squeeze_.html#torch.Tensor.squeeze_) -```python -torch.Tensor.squeeze_(dim=None) -``` - -### [paddle.Tensor.squeeze\_](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#id22) -```python -paddle.Tensor.squeeze_(axis=None) -``` -两者功能一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| dim | axis | 输入一个或一列整数,代表要压缩的轴,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.true_divide_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.true_divide_.md deleted file mode 100644 index af45e617ed3..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.true_divide_.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.true_divide_ -### [torch.Tensor.true\_divide\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.true_divide_.html#torch.Tensor.true_divide_) -```python -torch.Tensor.true_divide_(other) -``` - -### [paddle.Tensor.divide_]() -```python -paddle.Tensor.divide_(y) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| -------- | ------------ | -------------------------------- | -| other | y | 表示输入的 Tensor,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.unflatten.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.unflatten.md deleted file mode 100644 index e96c958fcfd..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.unflatten.md +++ /dev/null @@ -1,19 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.unflatten -### [torch.Tensor.unflatten](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.unflatten.html#torch.Tensor.unflatten) -```python -torch.Tensor.unflatten(dim, sizes) -``` - -### [paddle.Tensor.unflatten](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#unflatten-axis-shape-name-none) -```python -paddle.Tensor.unflatten(axis, shape, name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| dim | axis | 需要变换的维度,仅参数名不一致。 | -| sizes | shape | 维度变换的新形状,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.unfold.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.unfold.md deleted file mode 100644 index 26a4a5025cc..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.unfold.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.unfold -### [torch.Tensor.unfold](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.unfold.html#torch.Tensor.unfold) -```python -torch.Tensor.unfold(dimension, - size, - step) -``` - -### [paddle.Tensor.unfold](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#unfold-x-axis-size-step-name-none) -```python -paddle.Tensor.unfold(axis, - size, - step, - name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ------------------------------------------------------------ | -| dimension | axis | 表示需要提取的维度,仅参数名不一致。 | -| size | size | 表示需要提取的窗口长度。 | -| step | step | 表示每次提取跳跃的步长。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.unsqueeze_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.unsqueeze_.md deleted file mode 100644 index 7be69568db4..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.Tensor.unsqueeze_.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 仅参数名不一致 ]torch.Tensor.unsqueeze_ -### [torch.Tensor.unsqueeze\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.unsqueeze_.html#torch.Tensor.unsqueeze_) -```python -torch.Tensor.unsqueeze_(dim) -``` - -### [paddle.Tensor.unsqueeze\_](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#id28) -```python -paddle.Tensor.unsqueeze_(axis, name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ---------------------------------- | -| dim | axis | 表示进行运算的轴,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.as_strided.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.as_strided.md deleted file mode 100644 index c4906206e9c..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.as_strided.md +++ /dev/null @@ -1,27 +0,0 @@ -## [ 仅参数名不一致 ]torch.as_strided -### [torch.as\_strided](https://docs.pytorch.org/docs/stable/generated/torch.as_strided.html#torch.as_strided) -```python -torch.as_strided(input, - size, - stride, - storage_offset=None) -``` - -### [paddle.as\_strided](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/as_strided_cn.html#paddle.as_strided) -```python -paddle.as_strided(x, - shape, - stride, - offset=0, - name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor, 仅参数名不一致。 | -| size | shape | 表示输出 Tensor 的维度, 仅参数名不一致。 | -| stride | stride | 表示输出 Tensor 的 stride。 | -| storage_offset | offset | 表示偏移量, 仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.combinations.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.combinations.md deleted file mode 100644 index a4162d64cc0..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.combinations.md +++ /dev/null @@ -1,20 +0,0 @@ -## [ 仅参数名不一致 ]torch.combinations -### [torch.combinations](https://docs.pytorch.org/docs/stable/generated/torch.combinations.html#torch.combinations) -```python -torch.combinations(input, r=2, with_replacement=False) -``` - -### [paddle.combinations](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/combinations_cn.html#paddle.combinations) -```python -paddle.combinations(x, r=2, with_replacement=False, name=None) -``` - -两者功能一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ---------------- | ---------------- | ----------------------------- | -| input | x | 输入 Tensor,仅参数名不一致。 | -| r | r | 需要合并元素数量。 | -| with_replacement | with_replacement | 是否允许合并中替换。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.conj.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.conj.md deleted file mode 100644 index 750732de1f6..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.conj.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 仅参数名不一致 ]torch.conj -### [torch.conj](https://docs.pytorch.org/docs/stable/generated/torch.conj.html#torch.conj) -```python -torch.conj(input) -``` - -### [paddle.conj](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/conj_cn.html#paddle.conj) -```python -paddle.conj(x, - name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.cumulative_trapezoid.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.cumulative_trapezoid.md deleted file mode 100644 index 48d09b610d9..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.cumulative_trapezoid.md +++ /dev/null @@ -1,21 +0,0 @@ -## [ 仅参数名不一致 ]torch.cumulative_trapezoid -### [torch.cumulative\_trapezoid](https://docs.pytorch.org/docs/stable/generated/torch.cumulative_trapezoid.html#torch.cumulative_trapezoid) -```python -torch.cumulative_trapezoid(y, x=None, *, dx=None, dim=-1) -``` - -### [paddle.cumulative\_trapezoid](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/cumulative_trapezoid_cn.html#paddle.cumulative_trapezoid) -```python -paddle.cumulative_trapezoid(y, x=None, dx=None, axis=-1, name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ------------------------------------------------- | -| y | y | 输入多维 Tensor。 | -| x | x | y 中数值对应的浮点数所组成的 Tensor。 | -| dx | dx | 相邻采样点之间的常数间隔。 | -| dim | axis | 计算 trapezoid rule 时 y 的维度,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.det.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.det.md deleted file mode 100644 index b9dbbe2ddb8..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.det.md +++ /dev/null @@ -1,17 +0,0 @@ -## [ 仅参数名不一致 ]torch.det -### [torch.det](https://docs.pytorch.org/docs/stable/generated/torch.det.html#torch.det) -```python -torch.det(input) -``` - -### [paddle.linalg.det](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/linalg/det_cn.html#paddle.linalg.det) -```python -paddle.linalg.det(x) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.diagflat.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.diagflat.md deleted file mode 100644 index f2fe27c66e1..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.diagflat.md +++ /dev/null @@ -1,21 +0,0 @@ -## [ 仅参数名不一致 ]torch.diagflat -### [torch.diagflat](https://docs.pytorch.org/docs/stable/generated/torch.diagflat.html#torch.diagflat) -```python -torch.diagflat(input, - offset=0) -``` - -### [paddle.diagflat](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/diagflat_cn.html#paddle.diagflat) -```python -paddle.diagflat(x, - offset=0, - name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| offset | offset | 表示对角线偏移量。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.diagonal.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.diagonal.md deleted file mode 100644 index 9792c92f2e5..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.diagonal.md +++ /dev/null @@ -1,27 +0,0 @@ -## [ 仅参数名不一致 ]torch.diagonal -### [torch.diagonal](https://docs.pytorch.org/docs/stable/generated/torch.diagonal.html#torch.diagonal) -```python -torch.diagonal(input, - offset=0, - dim1=0, - dim2=1) -``` - -### [paddle.diagonal](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/diagonal_cn.html#paddle.diagonal) -```python -paddle.diagonal(x, - offset=0, - axis1=0, - axis2=1, - name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| offset | offset | 表示对角线偏移量。 | -| dim1 | axis1 | 获取对角线的二维平面的第一维,仅参数名不一致。 | -| dim2 | axis2 | 获取对角线的二维平面的第二维,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.diagonal_scatter.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.diagonal_scatter.md deleted file mode 100644 index f63590da6e5..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.diagonal_scatter.md +++ /dev/null @@ -1,30 +0,0 @@ -## [ 仅参数名不一致 ]torch.diagonal_scatter -### [torch.diagonal\_scatter](https://docs.pytorch.org/docs/stable/generated/torch.diagonal_scatter.html#torch.diagonal_scatter) -```python -torch.diagonal_scatter(input, - src, - offset=0, - dim1=0, - dim2=1) -``` - -### [paddle.diagonal\_scatter](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/diagonal_scatter_cn.html#paddle.diagonal_scatter) -```python -paddle.diagonal_scatter(x, - y, - offset=0, - axis1=0, - axis2=1) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -|---------|--------------| -------------------------------------------------- | -| input | x | 输入张量,被嵌入的张量,仅参数名不一致。 | -| src | y | 用于嵌入的张量,仅参数名不一致。 | -| offset | offset | 从指定的二维平面嵌入对角线的位置,默认值为 0,即主对角线。 | -| dim1 | axis1 | 对角线的第一个维度,默认值为 0,仅参数名不一致。 | -| dim2 | axis2 | 对角线的第二个维度,默认值为 1,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.dist.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.dist.md deleted file mode 100644 index eda1efb9e08..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.dist.md +++ /dev/null @@ -1,23 +0,0 @@ -## [ 仅参数名不一致 ]torch.dist -### [torch.dist](https://docs.pytorch.org/docs/stable/generated/torch.dist.html#torch.dist) -```python -torch.dist(input, - other, - p=2) -``` - -### [paddle.dist](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/dist_cn.html#paddle.dist) -```python -paddle.dist(x, - y, - p=2) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| other | y | 表示输入的 Tensor ,仅参数名不一致。 | -| p | p | 表示需要计算的范数。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.distributions.distribution.Distribution.rsample.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.distributions.distribution.Distribution.rsample.md deleted file mode 100644 index d2690c3eca6..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.distributions.distribution.Distribution.rsample.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 仅参数名不一致 ]torch.distributions.distribution.Distribution.rsample -### [torch.distributions.distribution.Distribution.rsample](https://docs.pytorch.org/docs/stable/distributions.html#torch.distributions.distribution.Distribution.rsample) -```python -torch.distributions.distribution.Distribution.rsample(sample_shape=torch.Size([])) -``` - -### [paddle.distribution.Distribution.rsample](https://github.com/PaddlePaddle/Paddle/blob/2bbd6f84c1db3e7401732869ee50aef2d9c97bdc/python/paddle/distribution/distribution.py#L96) -```python -paddle.distribution.Distribution.rsample(shape=()) -``` - -其中 PyTorch 和 Paddle 功能一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------ | ------------ | ---- | -| sample_shape | shape | 重参数化的样本形状,仅参数名不同。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.distributions.distribution.Distribution.sample.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.distributions.distribution.Distribution.sample.md deleted file mode 100644 index 441a4023217..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.distributions.distribution.Distribution.sample.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 仅参数名不一致 ]torch.distributions.distribution.Distribution.sample -### [torch.distributions.distribution.Distribution.sample](https://docs.pytorch.org/docs/stable/distributions.html#torch.distributions.distribution.Distribution.sample) -```python -torch.distributions.distribution.Distribution.sample(sample_shape=torch.Size([])) -``` - -### [paddle.distribution.Distribution.sample](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/distribution/Distribution_cn.html#sample) -```python -paddle.distribution.Distribution.sample(shape=()) -``` - -其中 PyTorch 和 Paddle 功能一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------ | ------------ | -- | -| sample_shape | shape | 采样形状,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.fft.fftshift.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.fft.fftshift.md deleted file mode 100644 index 6017850caa3..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.fft.fftshift.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 仅参数名不一致 ]torch.fft.fftshift -### [torch.fft.fftshift](https://docs.pytorch.org/docs/stable/generated/torch.fft.fftshift.html#torch.fft.fftshift) -```python -torch.fft.fftshift(input, dim=None) -``` - -### [paddle.fft.fftshift](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/fft/fftshift_cn.html#paddle.fft.fftshift) -```python -paddle.fft.fftshift(x, axes=None, name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 输入 Tensor,仅参数名不一致。 | -| dim | axes | 进行移动的轴,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.fft.ifftshift.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.fft.ifftshift.md deleted file mode 100644 index 870bba789ff..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.fft.ifftshift.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 仅参数名不一致 ]torch.fft.ifftshift -### [torch.fft.ifftshift](https://docs.pytorch.org/docs/stable/generated/torch.fft.ifftshift.html#torch.fft.ifftshift) -```python -torch.fft.ifftshift(input, dim=None) -``` - -### [paddle.fft.ifftshift](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/fft/ifftshift_cn.html#paddle.fft.ifftshift) -```python -paddle.fft.ifftshift(x, axes=None, name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 输入 Tensor,仅参数名不一致。 | -| dim | axes | 进行移动的轴,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.flip.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.flip.md deleted file mode 100644 index c0cbdcfd1de..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.flip.md +++ /dev/null @@ -1,21 +0,0 @@ -## [ 仅参数名不一致 ]torch.flip -### [torch.flip](https://docs.pytorch.org/docs/stable/generated/torch.flip.html#torch.flip) -```python -torch.flip(input, - dims) -``` - -### [paddle.flip](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/flip_cn.html#paddle.flip) -```python -paddle.flip(x, - axis, - name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| dims | axis | 表示进行运算的轴,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.hstack.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.hstack.md deleted file mode 100644 index b2a41d312cf..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.hstack.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 仅参数名不一致 ]torch.hstack -### [torch.hstack](https://docs.pytorch.org/docs/stable/generated/torch.hstack.html#torch.hstack) -```python -torch.hstack(tensors, *, out=None) -``` - -### [paddle.hstack](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/hstack_cn.html#paddle.hstack) -```python -paddle.hstack(x, name=None) -``` - -其中 Paddle 相比 PyTorch 仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| tensors | x | 表示输入的 Tensor ,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.iinfo.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.iinfo.md deleted file mode 100644 index f714bcf78cd..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.iinfo.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 仅参数名不一致 ]torch.iinfo -### [torch.iinfo](https://pytorch.org/docs/stable/type_info.html#torch-iinfo) -```python -torch.iinfo(type) -``` - -### [paddle.iinfo](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/iinfo_cn.html#paddle.iinfo) -```python -paddle.iinfo(dtype) -``` - -paddle 参数和 torch 参数完全一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | -------------------------------- | -| type | dtype | 输入的数据类型,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.imag.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.imag.md deleted file mode 100644 index adabf1dca2b..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.imag.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 仅参数名不一致 ]torch.imag -### [torch.imag](https://docs.pytorch.org/docs/stable/generated/torch.imag.html#torch.imag) -```python -torch.imag(input) -``` - -### [paddle.imag](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/imag_cn.html#paddle.imag) -```python -paddle.imag(x) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.index_fill.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.index_fill.md deleted file mode 100644 index ab026147205..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.index_fill.md +++ /dev/null @@ -1,21 +0,0 @@ -## [ 仅参数名不一致 ]torch.index_fill -### [torch.index_fill](https://pytorch.org/docs/stable/generated/torch.Tensor.index_fill.html#torch.Tensor.index_fill) -```python -torch.index_fill(input, dim, index, value) -``` - -### [paddle.index\_fill](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/index_fill_cn.html#paddle.index_fill) -```python -paddle.index_fill(x, index, axis, value, name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ---------------------------------- | -| input | x | 输入的 Tensor,仅参数名不一致。 | -| dim | axis | 表示进行运算的轴,仅参数名不一致。 | -| index | index | 包含索引下标的 1-D Tensor。 | -| value | value | 填充的值。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.isclose.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.isclose.md deleted file mode 100644 index 04d9f60b659..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.isclose.md +++ /dev/null @@ -1,30 +0,0 @@ -## [ 仅参数名不一致 ]torch.isclose -### [torch.isclose](https://docs.pytorch.org/docs/stable/generated/torch.isclose.html#torch.isclose) -```python -torch.isclose(input, - other, - rtol=1e-05, - atol=1e-08, - equal_nan=False) -``` - -### [paddle.isclose](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/isclose_cn.html#paddle.isclose) -```python -paddle.isclose(x, - y, - rtol=1e-05, - atol=1e-08, - equal_nan=False, - name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| other | y | 表示输入的 Tensor ,仅参数名不一致。 | -| rtol | rtol | 表示相对容忍误差。 | -| atol | atol | 表示绝对容忍误差。 | -| equal_nan | equal_nan | 表示是否将两个 NaN 数值视为相等。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.isreal.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.isreal.md deleted file mode 100644 index 0268efa9c7e..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.isreal.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 仅参数名不一致 ]torch.isreal -### [torch.isreal](https://docs.pytorch.org/docs/stable/generated/torch.isreal.html#torch.isreal) -```python -torch.isreal(input) -``` - -### [paddle.isreal](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/isreal_cn.html#paddle.isreal) -```python -paddle.isreal(x, name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ---------------------------------- | -| input | x | 表示输入的 Tensor,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.kron.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.kron.md deleted file mode 100644 index 227faff5631..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.kron.md +++ /dev/null @@ -1,20 +0,0 @@ -## [ 仅参数名不一致 ]torch.kron -### [torch.kron](https://docs.pytorch.org/docs/stable/generated/torch.kron.html#torch.kron) -```python -torch.kron(input, other, *, out=None) -``` - -### [paddle.kron](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/kron_cn.html#paddle.kron) -```python -paddle.kron(x, y, out=None, name=None) -``` - -两者功能一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | --------------------------------------------------- | -| input | x | 表示 Kron OP 输入的第一个 Tensor ,仅参数名不一致。 | -| other | y | 表示 Kron OP 输入的第二个 Tensor ,仅参数名不一致。 | -| out | out | 表示输出的 Tensor。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.kthvalue.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.kthvalue.md deleted file mode 100644 index 64ba289c98e..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.kthvalue.md +++ /dev/null @@ -1,31 +0,0 @@ -## [ 仅参数名不一致 ]torch.kthvalue -### [torch.kthvalue](https://docs.pytorch.org/docs/stable/generated/torch.kthvalue.html#torch.kthvalue) -```python -torch.kthvalue(input, - k, - dim=None, - keepdim=False, - *, - out=None) -``` - -### [paddle.kthvalue](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/kthvalue_cn.html#paddle.kthvalue) -```python -paddle.kthvalue(x, - k, - axis=None, - keepdim=False, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| k | k | 表示需要沿轴查找的第 k 小值。 | -| dim | axis | 指定对输入 Tensor 进行运算的轴,仅参数名不一致。 | -| keepdim | keepdim | 是否在输出 Tensor 中保留减小的维度。 | -| out | - | 表示输出的 Tensor , Paddle 无此参数,需要转写 。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.moveaxis.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.moveaxis.md deleted file mode 100644 index ee0f1f84d39..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.moveaxis.md +++ /dev/null @@ -1,24 +0,0 @@ -## [ 仅参数名不一致 ]torch.moveaxis -### [torch.moveaxis](https://docs.pytorch.org/docs/stable/generated/torch.moveaxis.html#torch.moveaxis) -```python -torch.moveaxis(input, - source, - destination) -``` - -### [paddle.moveaxis](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/moveaxis_cn.html#paddle.moveaxis) -```python -paddle.moveaxis(x, - source, - destination, - name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| source | source | 表示将被移动的轴的位置,仅参数名不一致。 | -| destination | destination | 表示轴被移动后的目标位置,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.movedim.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.movedim.md deleted file mode 100644 index 1bdc7968b4d..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.movedim.md +++ /dev/null @@ -1,24 +0,0 @@ -## [ 仅参数名不一致 ]torch.movedim -### [torch.movedim](https://docs.pytorch.org/docs/stable/generated/torch.movedim.html#torch.movedim) -```python -torch.movedim(input, - source, - destination) -``` - -### [paddle.moveaxis](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/moveaxis_cn.html#paddle.moveaxis) -```python -paddle.moveaxis(x, - source, - destination, - name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| source | source | 表示将被移动的轴的位置,仅参数名不一致。 | -| destination | destination | 表示轴被移动后的目标位置,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.AdaptiveMaxPool1d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.AdaptiveMaxPool1d.md deleted file mode 100644 index f71d79561b7..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.AdaptiveMaxPool1d.md +++ /dev/null @@ -1,21 +0,0 @@ -## [ 仅参数名不一致 ]torch.nn.AdaptiveMaxPool1d -### [torch.nn.AdaptiveMaxPool1d](https://docs.pytorch.org/docs/stable/generated/torch.nn.AdaptiveMaxPool1d.html#torch.nn.AdaptiveMaxPool1d) -```python -torch.nn.AdaptiveMaxPool1d(output_size, - return_indices=False) -``` - -### [paddle.nn.AdaptiveMaxPool1D](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/AdaptiveMaxPool1D_cn.html#paddle.nn.AdaptiveMaxPool1D) -```python -paddle.nn.AdaptiveMaxPool1D(output_size, - return_mask=False, - name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| output_size | output_size | 表示输出 Tensor 的大小。 | -| return_indices | return_mask | 如果设置为 True,则会与输出一起返回最大值的索引,默认为 False,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.AdaptiveMaxPool2d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.AdaptiveMaxPool2d.md deleted file mode 100644 index 881822f6227..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.AdaptiveMaxPool2d.md +++ /dev/null @@ -1,21 +0,0 @@ -## [ 仅参数名不一致 ]torch.nn.AdaptiveMaxPool2d -### [torch.nn.AdaptiveMaxPool2d](https://docs.pytorch.org/docs/stable/generated/torch.nn.AdaptiveMaxPool2d.html#torch.nn.AdaptiveMaxPool2d) -```python -torch.nn.AdaptiveMaxPool2d(output_size, - return_indices=False) -``` - -### [paddle.nn.AdaptiveMaxPool2D](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/AdaptiveMaxPool2D_cn.html#paddle.nn.AdaptiveMaxPool2D) -```python -paddle.nn.AdaptiveMaxPool2D(output_size, - return_mask=False, - name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| output_size | output_size | 表示输出 Tensor 的大小。 | -| return_indices | return_mask | 如果设置为 True,则会与输出一起返回最大值的索引,默认为 False,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.AdaptiveMaxPool3d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.AdaptiveMaxPool3d.md deleted file mode 100644 index f066d473d14..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.AdaptiveMaxPool3d.md +++ /dev/null @@ -1,21 +0,0 @@ -## [ 仅参数名不一致 ]torch.nn.AdaptiveMaxPool3d -### [torch.nn.AdaptiveMaxPool3d](https://docs.pytorch.org/docs/stable/generated/torch.nn.AdaptiveMaxPool3d.html#torch.nn.AdaptiveMaxPool3d) -```python -torch.nn.AdaptiveMaxPool3d(output_size, - return_indices=False) -``` - -### [paddle.nn.AdaptiveMaxPool3D](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/AdaptiveMaxPool3D_cn.html#paddle.nn.AdaptiveMaxPool3D) -```python -paddle.nn.AdaptiveMaxPool3D(output_size, - return_mask=False, - name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| output_size | output_size | 表示输出 Tensor 的大小。 | -| return_indices| return_mask | 如果设置为 True,则会与输出一起返回最大值的索引,默认为 False,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.CosineSimilarity.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.CosineSimilarity.md deleted file mode 100644 index c89dac230b5..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.CosineSimilarity.md +++ /dev/null @@ -1,20 +0,0 @@ -## [ 仅参数名不一致 ]torch.nn.CosineSimilarity -### [torch.nn.CosineSimilarity](https://docs.pytorch.org/docs/stable/generated/torch.nn.CosineSimilarity.html#torch.nn.CosineSimilarity) -```python -torch.nn.CosineSimilarity(dim=1, - eps=1e-08) -``` - -### [paddle.nn.CosineSimilarity](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/CosineSimilarity_cn.html#paddle.nn.CosineSimilarity) -```python -paddle.nn.CosineSimilarity(axis=1, - eps=1e-8) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| dim | axis | 指定计算的维度,会在该维度上计算余弦相似度,默认值为 1。 | -| eps | eps | 表示计算余弦相似度公式中的超参数。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.Flatten.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.Flatten.md deleted file mode 100644 index c1c73201ac1..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.Flatten.md +++ /dev/null @@ -1,20 +0,0 @@ -## [ 仅参数名不一致 ]torch.nn.Flatten -### [torch.nn.Flatten](https://docs.pytorch.org/docs/stable/generated/torch.nn.modules.flatten.Flatten.html) -```python -torch.nn.Flatten(start_dim=1, - end_dim=-1) -``` - -### [paddle.nn.Flatten](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/Flatten_cn.html#paddle.nn.Flatten) -```python -paddle.nn.Flatten(start_axis=1, - stop_axis=-1) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| start_dim | start_axis | 展开的起始维度,默认值为 1。 | -| end_dim | stop_axis | 展开的结束维度,默认值为 -1。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.Fold.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.Fold.md deleted file mode 100644 index ac6001414b9..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.Fold.md +++ /dev/null @@ -1,30 +0,0 @@ -## [ 仅参数名不一致 ]torch.nn.Fold -### [torch.nn.Fold](https://docs.pytorch.org/docs/stable/generated/torch.nn.Fold.html#torch.nn.Fold) -```python -torch.nn.Fold(output_size, - kernel_size, - dilation=1, - padding=0, - stride=1) -``` - -### [paddle.nn.Fold](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/Fold_cn.html#paddle.nn.Fold) -```python -paddle.nn.Fold(output_sizes, - kernel_sizes, - dilations=1, - paddings=0, - strides=1, - name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| output_size | output_sizes | 输出尺寸,整数或者整型列表。 | -| kernel_size | kernel_sizes | 卷积核大小,整数或者整型列表。 | -| dilation | dilations | 卷积膨胀,整型列表或者整数。 | -| padding | paddings | 每个维度的扩展,整数或者整型列表。 | -| stride | strides | 步长大小,整数或者整型列表。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.GLU.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.GLU.md deleted file mode 100644 index 53bca7d0aeb..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.GLU.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 仅参数名不一致 ]torch.nn.GLU -### [torch.nn.GLU](https://docs.pytorch.org/docs/stable/generated/torch.nn.GLU.html#torch.nn.GLU) -```python -torch.nn.GLU(dim=-1) -``` - -### [paddle.nn.GLU](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/GLU_cn.html#paddle.nn.GLU) -```python -paddle.nn.GLU(axis=-1, name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | --------------------------------------------------------------------------------------------------------------- | -| dim | axis | GLU 划分输入的轴,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.GaussianNLLLoss.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.GaussianNLLLoss.md deleted file mode 100644 index 041d10c21e6..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.GaussianNLLLoss.md +++ /dev/null @@ -1,20 +0,0 @@ -## [ 仅参数名不一致 ]torch.nn.GaussianNLLLoss -### [torch.nn.GaussianNLLLoss](https://docs.pytorch.org/docs/stable/generated/torch.nn.GaussianNLLLoss.html#torch.nn.GaussianNLLLoss) -```python -torch.nn.GaussianNLLLoss(*, full=False, eps=1e-06, reduction='mean') -``` - -### [paddle.nn.GaussianNLLLoss](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/GaussianNLLLoss_cn.html#paddle.nn.GaussianNLLLoss) -```python -paddle.nn.GaussianNLLLoss(full=False, epsilon=1e-6, reduction='mean', name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------------ | ------------------ | ---------------------------------------------------------------------------------- | -| full | full | 是否在损失计算中包括常数项。默认情况下为 False,表示忽略最后的常数项。 | -| eps | epsilon | 一个很小的数字,用于限制 variance 的值,使其不会导致除 0 的出现。默认值为 1e-6,仅参数名不一致。 | -| reduction | reduction | 指定应用于输出结果的计算方式,可选值有 `none`、`mean` 和 `sum`。默认为 `mean`,计算 mini-batch loss 均值。设置为 `sum` 时,计算 mini-batch loss 的总和。设置为 `none` 时,则返回 loss Tensor。默认值下为 `mean`。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.Hardshrink.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.Hardshrink.md deleted file mode 100644 index 4f8a05ae690..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.Hardshrink.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 仅参数名不一致 ]torch.nn.Hardshrink -### [torch.nn.Hardshrink](https://docs.pytorch.org/docs/stable/generated/torch.nn.Hardshrink.html#torch.nn.Hardshrink) -```python -torch.nn.Hardshrink(lambd=0.5) -``` - -### [paddle.nn.Hardshrink](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/Hardshrink_cn.html#paddle.nn.Hardshrink) -```python -paddle.nn.Hardshrink(threshold=0.5, - name=None) -``` -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| lambd | threshold | Hardshrink 激活计算公式中的阈值,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.PairwiseDistance.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.PairwiseDistance.md deleted file mode 100644 index d028bb1c276..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.PairwiseDistance.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅参数名不一致 ]torch.nn.PairwiseDistance -### [torch.nn.PairwiseDistance](https://docs.pytorch.org/docs/stable/generated/torch.nn.PairwiseDistance.html#torch.nn.PairwiseDistance) -```python -torch.nn.PairwiseDistance(p=2.0, - eps=1e-06, - keepdim=False) -``` - -### [paddle.nn.PairwiseDistance](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/PairwiseDistance_cn.html#paddle.nn.PairwiseDistance) -```python -paddle.nn.PairwiseDistance(p=2., - epsilon=1e-6, - keepdim=False, - name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| p | p | 指定 p 阶的范数。 | -| eps | epsilon | 添加到分母的一个很小值,避免发生除零错误,仅参数名不一致。 | -| keepdim | keepdim | 表示是否在输出 Tensor 中保留减小的维度。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.ParameterDict.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.ParameterDict.md deleted file mode 100644 index 1830f37b970..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.ParameterDict.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 仅参数名不一致 ]torch.nn.ParameterDict -### [torch.nn.ParameterDict](https://docs.pytorch.org/docs/stable/generated/torch.nn.ParameterDict.html#torch.nn.ParameterDict) -```python -torch.nn.ParameterDict(values=None) -``` - -### [paddle.nn.ParameterDict](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/ParameterDict_cn.html#paddle.nn.ParameterDict) -```python -paddle.nn.ParameterDict(parameters=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ------------------------------------- | -| values | parameters | 可迭代的 Parameters,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.ParameterList.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.ParameterList.md deleted file mode 100644 index 964f4b18993..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.ParameterList.md +++ /dev/null @@ -1,17 +0,0 @@ -## [ 仅参数名不一致 ]torch.nn.ParameterList -### [torch.nn.ParameterList](https://docs.pytorch.org/docs/stable/generated/torch.nn.ParameterList.html#torch.nn.ParameterList) -```python -torch.nn.ParameterList(values=None) -``` - -### [paddle.nn.ParameterList](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/ParameterList_cn.html#paddle.nn.ParameterList) -```python -paddle.nn.ParameterList(parameters=None) -``` -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| values | parameters | 可迭代的 Parameters,参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.Softshrink.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.Softshrink.md deleted file mode 100644 index 24007456cc4..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.Softshrink.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 仅参数名不一致 ]torch.nn.Softshrink -### [torch.nn.Softshrink](https://docs.pytorch.org/docs/stable/generated/torch.nn.Softshrink.html#torch.nn.Softshrink) -```python -torch.nn.Softshrink(lambd=0.5) -``` - -### [paddle.nn.Softshrink](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/Softshrink_cn.html#paddle.nn.Softshrink) -```python -paddle.nn.Softshrink(threshold=0.5, - name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| lambd | threshold | Softshrink 激活计算公式中的阈值,必须大于等于零,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.adaptive_avg_pool1d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.adaptive_avg_pool1d.md deleted file mode 100644 index 522ed76963b..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.adaptive_avg_pool1d.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 仅参数名不一致 ]torch.nn.functional.adaptive_avg_pool1d -### [torch.nn.functional.adaptive\_avg\_pool1d](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.adaptive_avg_pool1d.html#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/develop/api/paddle/nn/functional/adaptive_avg_pool1d_cn.html#paddle.nn.functional.adaptive_avg_pool1d) -```python -paddle.nn.functional.adaptive_avg_pool1d(x, output_size, name=None) -``` - -两者功能一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| output_size | output_size | 表示输出 Tensor 的大小。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.adaptive_avg_pool2d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.adaptive_avg_pool2d.md deleted file mode 100644 index d9b7c90cbad..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.adaptive_avg_pool2d.md +++ /dev/null @@ -1,22 +0,0 @@ -## [ 仅参数名不一致 ]torch.nn.functional.adaptive_avg_pool2d -### [torch.nn.functional.adaptive\_avg\_pool2d](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.adaptive_avg_pool2d.html#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/develop/api/paddle/nn/functional/adaptive_avg_pool2d_cn.html#paddle.nn.functional.adaptive_avg_pool2d) -```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 保持默认即可。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.adaptive_avg_pool3d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.adaptive_avg_pool3d.md deleted file mode 100644 index 28ccab8b6be..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.adaptive_avg_pool3d.md +++ /dev/null @@ -1,23 +0,0 @@ -## [ 仅参数名不一致 ]torch.nn.functional.adaptive_avg_pool3d -### [torch.nn.functional.adaptive\_avg\_pool3d](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.adaptive_avg_pool3d.html#torch.nn.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/develop/api/paddle/nn/functional/adaptive_avg_pool3d_cn.html#paddle.nn.functional.adaptive_avg_pool3d) -```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 保持默认即可。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.adaptive_max_pool1d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.adaptive_max_pool1d.md deleted file mode 100644 index 12bd125d15a..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.adaptive_max_pool1d.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅参数名不一致 ]torch.nn.functional.adaptive_max_pool1d -### [torch.nn.functional.adaptive\_max\_pool1d](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.adaptive_max_pool1d.html#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/develop/api/paddle/nn/functional/adaptive_max_pool1d_cn.html#paddle.nn.functional.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 | 表示是否返回最大值的索引,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.adaptive_max_pool2d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.adaptive_max_pool2d.md deleted file mode 100644 index e62dfd9296f..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.adaptive_max_pool2d.md +++ /dev/null @@ -1,24 +0,0 @@ -## [ 仅参数名不一致 ]torch.nn.functional.adaptive_max_pool2d -### [torch.nn.functional.adaptive\_max\_pool2d](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.adaptive_max_pool2d.html#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/develop/api/paddle/nn/functional/adaptive_max_pool2d_cn.html#paddle.nn.functional.adaptive_max_pool2d) -```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 | 表示是否返回最大值的索引,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.adaptive_max_pool3d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.adaptive_max_pool3d.md deleted file mode 100644 index 53c456c9d29..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.adaptive_max_pool3d.md +++ /dev/null @@ -1,24 +0,0 @@ -## [ 仅参数名不一致 ]torch.nn.functional.adaptive_max_pool3d -### [torch.nn.functional.adaptive\_max\_pool3d](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.adaptive_max_pool3d.html#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/develop/api/paddle/nn/functional/adaptive_max_pool3d_cn.html#paddle.nn.functional.adaptive_max_pool3d) -```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 | 表示是否返回最大值的索引,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.cosine_similarity.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.cosine_similarity.md deleted file mode 100644 index 936a94d252b..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.cosine_similarity.md +++ /dev/null @@ -1,29 +0,0 @@ -## [ 仅参数名不一致 ]torch.nn.functional.cosine_similarity -### [torch.nn.functional.cosine\_similarity](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.cosine_similarity.html#torch.nn.functional.cosine_similarity) -```python -torch.nn.functional.cosine_similarity(x1, - x2, - dim=1, - eps=1e-08, - *, - axis) -``` - -### [paddle.nn.functional.cosine\_similarity](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/cosine_similarity_cn.html#paddle.nn.functional.cosine_similarity) -```python -paddle.nn.functional.cosine_similarity(x1, - x2, - axis=1, - eps=1e-8) -``` - -两者功能一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| x1 | x1 | 表示第一个输入的 Tensor 。 | -| x2 | x2 | 表示第二个输入的 Tensor 。 | -| dim | axis | 表示计算的维度,仅参数名不一致。 | -| eps | eps | 表示加到分母上的超参数 。 | -| axis | axis | 表示计算的维度,dim 参数的替代。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.fold.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.fold.md deleted file mode 100644 index 1d430508a58..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.fold.md +++ /dev/null @@ -1,33 +0,0 @@ -## [ 仅参数名不一致 ]torch.nn.functional.fold -### [torch.nn.functional.fold](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.fold.html#torch.nn.functional.fold) -```python -torch.nn.functional.fold(input, - output_size, - kernel_size, - dilation=1, - padding=0, - stride=1) -``` - -### [paddle.nn.functional.fold](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/fold_cn.html#paddle.nn.functional.fold) -```python -paddle.nn.functional.fold(x, - output_sizes, - kernel_sizes, - strides=1, - paddings=0, - dilations=1, - name=None) -``` - -两者功能一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor 。 | -| output_size | output_sizes | 表示输出 Tensor 的尺寸。 | -| kernel_size | kernel_sizes | 表示卷积核大小。 | -| dilation | dilations | 表示卷积膨胀的大小。 | -| padding | paddings | 表示每个维度的填充大小。 | -| stride | strides | 表示卷积核步长。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.gaussian_nll_loss.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.gaussian_nll_loss.md deleted file mode 100644 index 2933cd87247..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.gaussian_nll_loss.md +++ /dev/null @@ -1,23 +0,0 @@ -## [ 仅参数名不一致 ]torch.nn.functional.gaussian_nll_loss -### [torch.nn.functional.gaussian\_nll\_loss](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.gaussian_nll_loss.html#torch.nn.functional.gaussian_nll_loss) -```python -torch.nn.functional.gaussian_nll_loss(input, target, var, full=False, eps=1e-06, reduction='mean') -``` - -### [paddle.nn.functional.gaussian\_nll\_loss](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/gaussian_nll_loss_cn.html#paddle.nn.functional.gaussian_nll_loss) -```python -paddle.nn.functional.gaussian_nll_loss(input, label, variance, full=False, epsilon=1e-6, reduction='mean', name=None) -``` - -两者功能一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| --------- | ------------ | ----------------------------------------------------------------- | -| input | input | 输入 Tensor。 | -| target | label | 输入 Tensor,仅参数名不一致。 | -| var | variance | 输入 Tensor,仅参数名不一致。 | -| full | full | 是否在损失计算中包括常数项。 | -| eps | epsilon | 用于限制 variance 的值,使其不会导致除 0 的出现,仅参数名不一致。 | -| reduction | reduction | 指定应用于输出结果的计算方式。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.glu.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.glu.md deleted file mode 100644 index 4ba487acdb5..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.glu.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 仅参数名不一致 ]torch.nn.functional.glu -### [torch.nn.functional.glu](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.glu.html#torch.nn.functional.glu) -```python -torch.nn.functional.glu(input, dim=-1) -``` - -### [paddle.nn.functional.glu](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/glu_cn.html#paddle.nn.functional.glu) -```python -paddle.nn.functional.glu(x, axis=-1, name=None) -``` - -两者功能一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| dim | axis | 表示划分输入 Tensor 的维度,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.grid_sample.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.grid_sample.md deleted file mode 100644 index 2e19dc28a5d..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.grid_sample.md +++ /dev/null @@ -1,30 +0,0 @@ -## [ 仅参数名不一致 ]torch.nn.functional.grid_sample -### [torch.nn.functional.grid\_sample](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.grid_sample.html#torch.nn.functional.grid_sample) -```python -torch.nn.functional.grid_sample(input, - grid, - mode='bilinear', - padding_mode='zeros', - align_corners=None) -``` - -### [paddle.nn.functional.grid\_sample](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/grid_sample_cn.html#paddle.nn.functional.grid_sample) -```python -paddle.nn.functional.grid_sample(x, - grid, - mode='bilinear', - padding_mode='zeros', - align_corners=True, - name=None) -``` - -两者功能一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor,仅参数名不一致。 | -| grid | grid | 输入网格数据张量。 | -| mode | mode | 指定插值方式。 | -| padding_mode | padding_mode | 指定超出边界的填充方式。 | -| align_corners | align_corners | 是否将角落的点进行中心对齐。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.hardshrink.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.hardshrink.md deleted file mode 100644 index cf86e4d0825..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.hardshrink.md +++ /dev/null @@ -1,21 +0,0 @@ -## [ 仅参数名不一致 ]torch.nn.functional.hardshrink -### [torch.nn.functional.hardshrink](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.hardshrink.html#torch.nn.functional.hardshrink) -```python -torch.nn.functional.hardshrink(input, - lambd=0.5) -``` - -### [paddle.nn.functional.hardshrink](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/hardshrink_cn.html#paddle.nn.functional.hardshrink) -```python -paddle.nn.functional.hardshrink(x, - threshold=0.5, - name=None) -``` - -两者功能一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| lambd | threshold | 表示 hard_shrink 激活计算公式中的 threshold 值 ,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.huber_loss.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.huber_loss.md deleted file mode 100644 index 6d8d1e6b96b..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.huber_loss.md +++ /dev/null @@ -1,21 +0,0 @@ -## [ 仅参数名不一致 ]torch.nn.functional.huber_loss -### [torch.nn.functional.huber\_loss](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.huber_loss.html#torch.nn.functional.huber_loss) -```python -torch.nn.functional.huber_loss(input, target, reduction='mean', delta=1.0) -``` - -### [paddle.nn.functional.smooth\_l1\_loss](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/smooth_l1_loss_cn.html#paddle.nn.functional.smooth_l1_loss) -```python -paddle.nn.functional.smooth_l1_loss(input, label, reduction='mean', delta=1.0, name=None) -``` - -功能一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| --------- | ------------ | ----------------------------------------- | -| input | input | 输入 Tensor。 | -| target | label | 输入 input 对应的标签值,仅参数名不一致。 | -| reduction | reduction | 指定应用于输出结果的计算方式。 | -| delta | delta | 损失的阈值参数。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.leaky_relu_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.leaky_relu_.md deleted file mode 100644 index 3f0a8d9320d..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.leaky_relu_.md +++ /dev/null @@ -1,19 +0,0 @@ -## [ 仅参数名不一致 ]torch.nn.functional.leaky_relu_ -### [torch.nn.functional.leaky\_relu\_](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.leaky_relu_.html#torch.nn.functional.leaky_relu_) -```python -torch.nn.functional.leaky_relu_(input, negative_slope=0.01) -``` - -### [paddle.nn.functional.leaky\_relu\_](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/leaky_relu__cn.html#paddle.nn.functional.leaky_relu_) -```python -paddle.nn.functional.leaky_relu_(x, negative_slope=0.01) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| -------------- | -------------- | --------------------------------------------------------------------------------------------------------------- | -| input | x | 输入的 Tensor,仅参数名不一致。 | -| negative_slope | negative_slope | x<0 时的斜率。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.logsigmoid.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.logsigmoid.md deleted file mode 100644 index eb78d790ac6..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.logsigmoid.md +++ /dev/null @@ -1,17 +0,0 @@ -## [ 仅参数名不一致 ]torch.nn.functional.logsigmoid -### [torch.nn.functional.logsigmoid](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.logsigmoid.html#torch.nn.functional.logsigmoid) -```python -torch.nn.functional.logsigmoid(input) -``` - -### [paddle.nn.functional.log\_sigmoid](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/log_sigmoid_cn.html#paddle.nn.functional.log_sigmoid) -```python -paddle.nn.functional.log_sigmoid(x, name=None) -``` - -两者功能一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.pairwise_distance.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.pairwise_distance.md deleted file mode 100644 index 42d04ada677..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.pairwise_distance.md +++ /dev/null @@ -1,22 +0,0 @@ -## [ 仅参数名不一致 ]torch.nn.functional.pairwise_distance -### [torch.nn.functional.pairwise\_distance](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.pairwise_distance.html#torch.nn.functional.pairwise_distance) -```python -torch.nn.functional.pairwise_distance(x1, x2, p=2.0, eps=1e-6, keepdim=False) -``` - -### [paddle.nn.functional.pairwise\_distance](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/pairwise_distance_cn.html#paddle.nn.functional.pairwise_distance) -```python -paddle.nn.functional.pairwise_distance(x, y, p=2., epsilon=1e-6, keepdim=False, name=None) -``` - -其中 PyTorch 和 Paddle 功能一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | -- | -| x1 | x | 输入 Tensor,仅参数名不一致。 | -| x2 | y | 输入 Tensor,仅参数名不一致。 | -| p | p | 指定 p 阶的范数。 | -| eps | epsilon | 添加到分母的一个很小值,避免发生除零错误。仅参数名不一致。 | -| keepdim | keepdim | 是否保留输出 Tensor 减少的维度。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.relu6.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.relu6.md deleted file mode 100644 index 8e41a8edc8d..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.relu6.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 仅参数名不一致 ]torch.nn.functional.relu6 -### [torch.nn.functional.relu6](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.relu6.html#torch.nn.functional.relu6) -```python -torch.nn.functional.relu6(input, inplace=False) -``` - -### [paddle.nn.functional.relu6](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/relu6_cn.html#paddle.nn.functional.relu6) -```python -paddle.nn.functional.relu6(x, name=None) -``` - -两者功能一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| inplace | - | 表示在不更改变量的内存地址的情况下,直接修改变量的值,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.relu_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.relu_.md deleted file mode 100644 index 8b343207f11..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.relu_.md +++ /dev/null @@ -1,17 +0,0 @@ -## [ 仅参数名不一致 ]torch.nn.functional.relu_ -### [torch.nn.functional.relu\_](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.relu_.html#torch.nn.functional.relu_) -```python -torch.nn.functional.relu_(input) -``` - -### [paddle.nn.functional.relu\_](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/relu__cn.html#paddle.nn.functional.relu_) -```python -paddle.nn.functional.relu_(x, name=None) -``` - -两者功能一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor 。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.softplus.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.softplus.md deleted file mode 100644 index 63304ecb64b..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.softplus.md +++ /dev/null @@ -1,24 +0,0 @@ -## [ 仅参数名不一致 ]torch.nn.functional.softplus -### [torch.nn.functional.softplus](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.softplus.html#torch.nn.functional.softplus) -```python -torch.nn.functional.softplus(input, - beta=1, - threshold=20) -``` - -### [paddle.nn.functional.softplus](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/softplus_cn.html#paddle.nn.functional.softplus) -```python -paddle.nn.functional.softplus(x, - beta=1, - threshold=20, - name=None) -``` - -两者功能一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示 Softplus 激活计算公式中的 beta 值 ,仅参数名不一致。 | -| beta | beta | 表示 Softplus 激活计算公式中的 threshold 值 。 | -| threshold | threshold | 表示输入的 Tensor 。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.softshrink.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.softshrink.md deleted file mode 100644 index b03928fd015..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.softshrink.md +++ /dev/null @@ -1,21 +0,0 @@ -## [ 仅参数名不一致 ]torch.nn.functional.softshrink -### [torch.nn.functional.softshrink](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.softshrink.html#torch.nn.functional.softshrink) -```python -torch.nn.functional.softshrink(input, - lambd=0.5) -``` - -### [paddle.nn.functional.softshrink](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/softshrink_cn.html#paddle.nn.functional.softshrink) -```python -paddle.nn.functional.softshrink(x, - threshold=0.5, - name=None) -``` - -两者功能一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入 Tensor ,仅参数名不一致。 | -| lambd | threshold | 表示 Softshrink 公式的 threshold 值,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.tanh.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.tanh.md deleted file mode 100644 index 48d7c22dba9..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.tanh.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 仅参数名不一致 ]torch.nn.functional.tanh -### [torch.nn.functional.tanh](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.tanh.html#torch.nn.functional.tanh) -```python -torch.nn.functional.tanh(input) -``` - -### [paddle.nn.functional.tanh](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/tanh_cn.html#tanh) -```python -paddle.nn.functional.tanh(x) -``` - -其中 PyTorch 和 Paddle 功能一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | -- | -| input | x | 输入 Tensor,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.triplet_margin_with_distance_loss.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.triplet_margin_with_distance_loss.md deleted file mode 100644 index 92d50300cf3..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.functional.triplet_margin_with_distance_loss.md +++ /dev/null @@ -1,36 +0,0 @@ -## [ 仅参数名不一致 ]torch.nn.functional.triplet_margin_with_distance_loss -### [torch.nn.functional.triplet\_margin\_with\_distance\_loss](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.triplet_margin_with_distance_loss.html#torch.nn.functional.triplet_margin_with_distance_loss) -```python -torch.nn.functional.triplet_margin_with_distance_loss(anchor, - positive, - negative, *, - distance_function=None, - margin=1.0, - swap=False, - reduction='mean') -``` - -### [paddle.nn.functional.triplet\_margin\_with\_distance\_loss](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/triplet_margin_with_distance_loss_cn.html#paddle.nn.functional.triplet_margin_with_distance_loss) -```python -paddle.nn.functional.triplet_margin_with_distance_loss(input, - positive, - negative, - distance_function=None, - margin: float = 1.0, - swap: bool = False, - reduction: str = 'mean', - name: str = None) -``` - -两者功能一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| anchor | input | 输入 Tensor,仅参数名不一致。 | -| positive | positive | 输入正样本。 | -| negative | negative | 输入负样本。 | -| distance_function | distance_function | 指定两个张量距离的函数。 | -| margin | margin | 手动指定间距。 | -| swap | swap | 是否进行交换。 | -| reduction | reduction | 表示应用于输出结果的规约方式,可选值有:'none', 'mean', 'sum'。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.utils.weight_norm.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.utils.weight_norm.md deleted file mode 100644 index f8a308d546f..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.nn.utils.weight_norm.md +++ /dev/null @@ -1,20 +0,0 @@ -## [ 仅参数名不一致 ]torch.nn.utils.weight_norm -### [torch.nn.utils.weight\_norm](https://docs.pytorch.org/docs/stable/generated/torch.nn.utils.weight_norm.html#torch.nn.utils.weight_norm) -```python -torch.nn.utils.weight_norm(module, - name='weight', - dim=0) -``` - -### [paddle.nn.utils.weight\_norm](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/utils/weight_norm_cn.html#paddle.nn.utils.weight_norm) -```python -paddle.nn.utils.weight_norm(layer, - name='weight', - dim=0) -``` -两者功能一致,参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| module | layer | 要添加权重归一化的层,参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.pinverse.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.pinverse.md deleted file mode 100644 index f5f321dee27..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.pinverse.md +++ /dev/null @@ -1,23 +0,0 @@ -## [ 仅参数名不一致 ]torch.pinverse -### [torch.pinverse](https://docs.pytorch.org/docs/stable/generated/torch.pinverse.html#torch.pinverse) -```python -torch.pinverse(input, - rcond=1e-15) -``` - -### [paddle.linalg.pinv](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/linalg/pinv_cn.html#paddle.linalg.pinv) -```python -paddle.linalg.pinv(x, - rcond=1e-15, - hermitian=False, - name=None) -``` - -其中 Paddle 相比 PyTorch 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 输入的 Tensor,仅参数名不一致。 | -| rcond | rcond | 奇异值(特征值)被截断的阈值,仅参数名不一致。 | -| - | hermitian | 是否为 hermitian 矩阵或者实对称矩阵,PyTorch 无,Paddle 保持默认即可。| diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.positive.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.positive.md deleted file mode 100644 index 0b0f7ffe48d..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.positive.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 仅参数名不一致 ]torch.positive -### [torch.positive](https://docs.pytorch.org/docs/stable/generated/torch.positive.html#torch.positive) -```python -torch.positive(input) -``` - -### [paddle.positive](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/positive_cn.html#paddle.positive) -```python -paddle.positive(x) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.real.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.real.md deleted file mode 100644 index 8bb1005cd7d..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.real.md +++ /dev/null @@ -1,17 +0,0 @@ -## [ 仅参数名不一致 ]torch.real -### [torch.real](https://docs.pytorch.org/docs/stable/generated/torch.real.html#torch.real) -```python -torch.real(input) -``` - -### [paddle.real](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/real_cn.html#paddle.real) -```python -paddle.real(x) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 输入的 Tensor , 仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.relu.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.relu.md deleted file mode 100644 index de4c409cd3f..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.relu.md +++ /dev/null @@ -1,17 +0,0 @@ -## [ 仅参数名不一致 ]torch.relu -### [torch.relu]() -```python -torch.relu(input) -``` - -### [paddle.nn.functional.relu](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/relu_cn.html#paddle.nn.functional.relu) -```python -paddle.nn.functional.relu(x, name=None) -``` - -两者功能一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor 。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.rot90.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.rot90.md deleted file mode 100644 index 8b476b67f75..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.rot90.md +++ /dev/null @@ -1,24 +0,0 @@ -## [ 仅参数名不一致 ]torch.rot90 -### [torch.rot90](https://docs.pytorch.org/docs/stable/generated/torch.rot90.html#torch.rot90) -```python -torch.rot90(input, - k=1, - dims=[0, 1]) -``` - -### [paddle.rot90](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/rot90_cn.html#paddle.rot90) -```python -paddle.rot90(x, - k=1, - axes=[0, 1], - name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 输入的 Tensor ,仅参数名不一致。 | -| k | k | 表示旋转方向和次数。 | -| dims | axes | axes 指定旋转的平面,维度必须为 2 ,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.select_scatter.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.select_scatter.md deleted file mode 100644 index 602fbc38f60..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.select_scatter.md +++ /dev/null @@ -1,21 +0,0 @@ -## [ 仅参数名不一致 ]torch.select_scatter -### [torch.select\_scatter](https://docs.pytorch.org/docs/stable/generated/torch.select_scatter.html#torch.select_scatter) -```python -torch.select_scatter(input, src, dim, index) -``` - -### [paddle.select\_scatter](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/select_scatter_cn.html#paddle.select_scatter) -```python -paddle.select_scatter(x, values, axis, index, name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ---------------------------------------- | -| input | x | 输入张量,被嵌入的张量,仅参数名不一致。 | -| src | values | 用于嵌入的张量,仅参数名不一致。 | -| dim | axis | 嵌入的维度,仅参数名不一致。 | -| index | index | 选择的索引。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.special.log_softmax.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.special.log_softmax.md deleted file mode 100644 index 0a91a7cf9c6..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.special.log_softmax.md +++ /dev/null @@ -1,20 +0,0 @@ -## [ 仅参数名不一致 ]torch.special.log_softmax -### [torch.special.log\_softmax](https://docs.pytorch.org/docs/stable/special.html#torch.special.log_softmax) -```python -torch.special.log_softmax(input, dim, *, dtype=None) -``` - -### [paddle.nn.functional.log\_softmax](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/log_softmax_cn.html#paddle.nn.functional.log_softmax) -```python -paddle.nn.functional.log_softmax(x, axis=- 1, dtype=None, name=None) -``` - -其中功能一致, 仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ------------------------------------------- | -| input | x | 输入的 Tensor,仅参数名不一致。 | -| dim | axis | 指定对输入 x 进行运算的轴,仅参数名不一致。 | -| dtype | dtype | 输出 Tensor 的数据类型。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.take.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.take.md deleted file mode 100644 index 431c2264656..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.take.md +++ /dev/null @@ -1,19 +0,0 @@ -## [ 仅参数名不一致 ]torch.take -### [torch.take](https://docs.pytorch.org/docs/stable/generated/torch.take.html#torch.take) -```python -torch.take(input, index) -``` - -### [paddle.take](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/take_cn.html#paddle.take) -```python -paddle.take(x, index, mode='raise', name=None) -``` - -其中 Paddle 相比 PyTorch 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| index | index | 表示索引矩阵,仅参数名不一致。 | -| - | mode | 表示索引越界后的处理方式, PyTorch 无此参数, Paddle 保持默认即可。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.tile.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.tile.md deleted file mode 100644 index 6cca8d92c28..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.tile.md +++ /dev/null @@ -1,21 +0,0 @@ -## [ 仅参数名不一致 ]torch.tile -### [torch.tile](https://docs.pytorch.org/docs/stable/generated/torch.tile.html#torch.tile) -```python -torch.tile(input, - dims) -``` - -### [paddle.tile](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/tile_cn.html#paddle.tile) -```python -paddle.tile(x, - repeat_times, - name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 输入的 Tensor ,仅参数名不一致。 | -| dims | repeat_times | 指定输入 x 每个维度的复制次数,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.trapezoid.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.trapezoid.md deleted file mode 100644 index b87c2e002fd..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.trapezoid.md +++ /dev/null @@ -1,21 +0,0 @@ -## [ 仅参数名不一致 ]torch.trapezoid -### [torch.trapezoid](https://docs.pytorch.org/docs/stable/generated/torch.trapezoid.html#torch.trapezoid) -```python -torch.trapezoid(y, x=None, *, dx=None, dim=- 1) -``` - -### [paddle.trapezoid](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/trapezoid_cn.html#paddle.trapezoid) -```python -paddle.trapezoid(y, x=None, dx=None, axis=- 1, name=None) -``` - -两者功能一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ------------------------------------------------- | -| y | y | 输入多维 Tensor。 | -| x | x | y 中数值对应的浮点数所组成的 Tensor。 | -| dx | dx | 相邻采样点之间的常数间隔。 | -| dim | axis | 计算 trapezoid rule 时 y 的维度,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.unflatten.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.unflatten.md deleted file mode 100644 index 25cc3618788..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.unflatten.md +++ /dev/null @@ -1,20 +0,0 @@ -## [ 仅参数名不一致 ]torch.unflatten -### [torch.unflatten](https://docs.pytorch.org/docs/stable/generated/torch.unflatten.html#torch.unflatten) -```python -torch.unflatten(input, dim, sizes) -``` - -### [paddle.unflatten](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/unflatten_cn.html#paddle.unflatten) -```python -paddle.unflatten(x, axis, shape, name=None) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 输入 Tensor,仅参数名不一致。 | -| dim | axis | 需要变换的维度,仅参数名不一致。 | -| sizes | shape | 维度变换的新形状,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.vander.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.vander.md deleted file mode 100644 index 4d004528365..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.vander.md +++ /dev/null @@ -1,24 +0,0 @@ -## [ 仅参数名不一致 ]torch.vander -### [torch.vander](https://docs.pytorch.org/docs/stable/generated/torch.vander.html#torch.vander) -```python -torch.vander(x, - N, - increasing) -``` - -### [paddle.vander](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/vander_cn.html#paddle.vander) -```python -paddle.vander(x, - n, - increasing) -``` - -两者功能一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| x | x | 表示输入的 Tensor。 | -| N | n | 用于指定输出的列数, 仅参数名大小写的区别。 | -| increasing | increasing | 指定输出列的幂次顺序。如果为 True,则幂次从左到右增加。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.vstack.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.vstack.md deleted file mode 100644 index 8b2a0143cb3..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/args_name_diff/torch.vstack.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 仅参数名不一致 ]torch.vstack -### [torch.vstack](https://docs.pytorch.org/docs/stable/generated/torch.vstack.html#torch.vstack) -```python -torch.vstack(tensors, *, out=None) -``` - -### [paddle.vstack](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/vstack_cn.html#paddle.vstack) -```python -paddle.vstack(x, name=None) -``` - -其中 Paddle 相比 PyTorch 仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| tensors | x | 表示输入的 Tensor ,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Generator.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Generator.md deleted file mode 100644 index 96b28b3623e..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Generator.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 组合替代实现 ]torch.Generator -### [torch.Generator](https://docs.pytorch.org/docs/stable/generated/torch.Generator.html#torch.Generator) -```python -torch.Generator(device='cpu') -``` - -Paddle 无此 API,需要组合实现。 - -### 转写示例 -```python -# PyTorch 写法 -torch.Generator() - -# Paddle 写法 -paddle.framework.core.default_cpu_generator() -``` - -```python -# PyTorch 写法 -torch.Generator(device="cuda") - -# Paddle 写法 -device = paddle.device.get_device() -paddle.framework.core.default_cuda_generator(int(device[-1])) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Tensor.H.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Tensor.H.md deleted file mode 100644 index 9294eb72970..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Tensor.H.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 组合替代实现 ]torch.Tensor.H -### [torch.Tensor.H](https://docs.pytorch.org/docs/stable/tensors.html#torch.Tensor.H) -```python -torch.Tensor.H -``` - -Paddle 无此 API,需要组合实现。 -PyTorch 中等于 x.transpose(0, 1).conj(),Paddle 中 transpose 参数 perm 为转换后的维度位置。 -该 API 仅针对 2D。 - -### 转写示例 -```python -# PyTorch 写法 -y = x.H - -# Paddle 写法 -y = x.transpose(perm=[1, 0]).conj() -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Tensor.addcdiv.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Tensor.addcdiv.md deleted file mode 100644 index f4521743989..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Tensor.addcdiv.md +++ /dev/null @@ -1,20 +0,0 @@ -## [ 组合替代实现 ]torch.Tensor.addcdiv -### [torch.Tensor.addcdiv](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.addcdiv.html#torch.Tensor.addcdiv) -```python -torch.Tensor.addcdiv(tensor1, tensor2, *, value=1) -``` - -用于实现矩阵 `tensor1` 与矩阵 `tensor2` 相除,再加上输入 `input` ,公式为: - -$ out = input + value * (tensor1 / tensor2) $ - -PaddlePaddle 目前无对应 API,可使用如下代码组合实现该 API。 - -### 转写示例 -```python -# PyTorch 写法 -y = input.addcdiv(tensor1, tensor2, value=value) - -# Paddle 写法 -y = input + value * tensor1 / tensor2 -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Tensor.addcdiv_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Tensor.addcdiv_.md deleted file mode 100644 index 8c5d0173cb1..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Tensor.addcdiv_.md +++ /dev/null @@ -1,20 +0,0 @@ -## [ 组合替代实现 ]torch.Tensor.addcdiv_ -### [torch.Tensor.addcdiv\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.addcdiv_.html#torch.Tensor.addcdiv_) -```python -torch.Tensor.addcdiv_(tensor1, tensor2, *, value=1) -``` - -用于实现矩阵 `tensor1` 与矩阵 `tensor2` 相除,再加上输入 `input` ,公式为: - -$ out = input + value * (tensor1 / tensor2) $ - -PaddlePaddle 目前无对应 API,可使用如下代码组合实现该 API。 - -### 转写示例 -```python -# PyTorch 写法 -input.addcdiv_(tensor1, tensor2, value=value) - -# Paddle 写法 -input.add_(value * tensor1 / tensor2) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Tensor.addmv_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Tensor.addmv_.md deleted file mode 100644 index 776f53402a5..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Tensor.addmv_.md +++ /dev/null @@ -1,16 +0,0 @@ -## [ 组合替代实现 ]torch.Tensor.addmv_ -### [torch.Tensor.addmv\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.addmv_.html#torch.Tensor.addmv_) -```python -torch.Tensor.addmv_(mat, vec, beta=1, alpha=1, out=None) -``` - -Paddle 无此 API,需要组合实现。 - -### 转写示例 -```python -# PyTorch 写法 -input.addmv_(mat, vec, beta=beta, alpha=alpha) - -# Paddle 写法 -input.multiply_(paddle.to_tensor(beta, dtype=input.dtype)).add_(alpha * paddle.mm(mat, vec)) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Tensor.addr_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Tensor.addr_.md deleted file mode 100644 index 618e7a372b2..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Tensor.addr_.md +++ /dev/null @@ -1,16 +0,0 @@ -## [ 组合替代实现 ]torch.Tensor.addr_ -### [torch.Tensor.addr\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.addr_.html#torch.Tensor.addr_) -```python -torch.Tensor.addr_(vec1, vec2, beta=1, alpha=1) -``` - -Paddle 无此 API,需要组合实现。 - -### 转写示例 -```python -# PyTorch 写法 -y = input.addr_(vec1, vec2, beta=beta, alpha=alpha) - -# Paddle 写法 -input.multiply_(paddle.to_tensor(beta, dtype=input.dtype)).add_(alpha * paddle.outer(vec1, vec2)) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Tensor.aminmax.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Tensor.aminmax.md deleted file mode 100644 index 3b785b66e17..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Tensor.aminmax.md +++ /dev/null @@ -1,15 +0,0 @@ -## [ 组合替代实现 ]torch.Tensor.aminmax -### [torch.Tensor.aminmax](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.aminmax.html#torch.Tensor.aminmax) -```python -torch.Tensor.aminmax(*, dim=None, keepdim=False) -``` -Paddle 无此 API,需要组合实现。 - -### 转写示例 -```python -# PyTorch 写法 -input.aminmax(dim=-1, keepdim=True) - -# Paddle 写法 -y = tuple([paddle.amin(input, axis=-1, keepdim=True), paddle.amax(input, axis=-1, keepdim=True)]) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Tensor.index_copy_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Tensor.index_copy_.md deleted file mode 100644 index 258d0ac2854..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Tensor.index_copy_.md +++ /dev/null @@ -1,29 +0,0 @@ -## [ 组合替代实现 ]torch.Tensor.index_copy_ -### [torch.Tensor.index\_copy\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.index_copy_.html#torch.Tensor.index_copy_) -```python -torch.Tensor.index_copy_(dim, index, source) -``` - -Paddle 无此 API,需要组合实现。 - -### 转写示例 -```python -# PyTorch 写法,dim=0 -y = x.index_copy_(0, index, source) - -# Paddle 写法 -y = x.scatter_(index, source) - -# PyTorch 写法,dim>0 -y = x.index_copy_(dim, index, source) - -# Paddle 写法 -shape = x.shape -new_index = [] -for i in range(0, np.prod(shape[:dim])): - new_index.append(index + i * len(index)) -new_index = paddle.concat(new_index) -new_x = x.reshape_([-1] + shape[dim + 1:]) -new_source = source.reshape([-1] + shape[dim + 1:]) -y = new_x.scatter_(new_index, new_source).reshape_(shape) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Tensor.mH.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Tensor.mH.md deleted file mode 100644 index be43094092f..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Tensor.mH.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 组合替代实现 ]torch.Tensor.mH -### [torch.Tensor.mH](https://docs.pytorch.org/docs/stable/tensors.html#torch.Tensor.mH) -```python -torch.Tensor.mH -``` - -Paddle 无此 API,需要组合实现。 -PyTorch 中等于 x.transpose(-2, -1).conj(),Paddle 中 transpose 参数 perm 为转换后的维度位置。 - -### 转写示例 -```python -# 假设 x 为 4D -# PyTorch 写法 -y = x.mH - -# Paddle 写法 -y = x.transpose(perm=[0, 1, 3, 2]).conj() -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Tensor.nbytes.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Tensor.nbytes.md deleted file mode 100644 index c132bcd4a0d..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Tensor.nbytes.md +++ /dev/null @@ -1,16 +0,0 @@ -## [ 组合替代实现 ]torch.Tensor.nbytes -### [torch.Tensor.nbytes](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.nbytes.html#torch.Tensor.nbytes) -```python -torch.Tensor.nbytes -``` - -Paddle 无此 API,需要组合实现。 - -### 转写示例 -```python -# PyTorch 写法 -y = a.nbytes - -# Paddle 写法 -y = a.size * a.element_size() -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Tensor.requires_grad_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Tensor.requires_grad_.md deleted file mode 100644 index af70458b382..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Tensor.requires_grad_.md +++ /dev/null @@ -1,34 +0,0 @@ -## [ 组合替代实现 ]torch.Tensor.requires_grad_ -### [torch.Tensor.requires\_grad\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.requires_grad_.html#torch.Tensor.requires_grad_) -```python -torch.Tensor.requires_grad_(requires_grad=True) -``` - -### [paddle.Tensor.stop\_gradient](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#stop-gradient) -```python -paddle.Tensor.stop_gradient = False -``` - -两者功能一致,torch 为 function 调用方式,paddle 为 attribution 赋值方式,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| requires_grad | - | 是否计算梯度,Paddle 无此参数,需要转写。 | - - -### 转写示例 -#### requires_grad:是否计算梯度 -```python -# 当 requires_grad 为‘True’时,torch 写法 -x.requires_grad_(requires_grad=True) - -# paddle 写法 -x.stop_gradient = False - -# 当 requires_grad 为‘False’时,torch 写法 -x.requires_grad_(requires_grad=False) - -# paddle 写法 -x.stop_gradient = True -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Tensor.reshape_as.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Tensor.reshape_as.md deleted file mode 100644 index 57d69c44882..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Tensor.reshape_as.md +++ /dev/null @@ -1,16 +0,0 @@ -## [ 组合替代实现 ]torch.Tensor.reshape_as -### [torch.Tensor.reshape\_as](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.reshape_as.html#torch.Tensor.reshape_as) -```python -torch.Tensor.reshape_as(other) -``` - -Paddle 无此 API,需要组合实现。 - -### 转写示例 -```python -# PyTorch 写法 -y = a.reshape_as(b) - -# Paddle 写法 -y = paddle.reshape(a, b.shape) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Tensor.resize_as_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Tensor.resize_as_.md deleted file mode 100644 index 917e5b21ac4..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.Tensor.resize_as_.md +++ /dev/null @@ -1,17 +0,0 @@ -## [ 组合替代实现 ]torch.Tensor.resize_as_ -### [torch.Tensor.resize\_as\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.resize_as_.html#torch.Tensor.resize_as_) -```python -# PyTorch 文档有误,测试第一个参数为 the_template -torch.Tensor.resize_as_(the_template, *, memory_format=torch.contiguous_format) -``` - -Paddle 无此 API,需要组合实现。 - -### 转写示例 -```python -# PyTorch 写法 -y = a.resize_as_(b) - -# Paddle 写法 -y = a.reshape_(b.shape) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch._assert.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch._assert.md deleted file mode 100644 index 4868dee39d2..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch._assert.md +++ /dev/null @@ -1,16 +0,0 @@ -## [ 组合替代实现 ]torch._assert -### [torch.\_assert](https://docs.pytorch.org/docs/stable/generated/torch._assert.html#torch._assert) -```python -torch._assert(condition, message) -``` - -Paddle 无此 API,需要组合实现。 - -### 转写示例 -```python -# PyTorch 写法 -torch._assert(condition=1==2, message='error message') - -# Paddle 写法 -assert 1==2, 'error message' -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.addmv.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.addmv.md deleted file mode 100644 index 9aea992f3cb..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.addmv.md +++ /dev/null @@ -1,16 +0,0 @@ -## [ 组合替代实现 ]torch.addmv -### [torch.addmv](https://docs.pytorch.org/docs/stable/generated/torch.addmv.html#torch.addmv) -```python -torch.addmv(input, mat, vec, beta=1, alpha=1, out=None) -``` - -Paddle 无此 API,需要组合实现。 - -### 转写示例 -```python -# PyTorch 写法 -y = torch.addmv(input, mat, vec, beta=beta, alpha=alpha) - -# Paddle 写法 -y = beta * input + alpha * paddle.mm(mat, vec) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.addr.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.addr.md deleted file mode 100644 index 168dcc88fbd..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.addr.md +++ /dev/null @@ -1,16 +0,0 @@ -## [ 组合替代实现 ]torch.addr -### [torch.addr](https://docs.pytorch.org/docs/stable/generated/torch.addr.html#torch.addr) -```python -torch.addr(input, vec1, vec2, beta=1, alpha=1, out=None) -``` - -Paddle 无此 API,需要组合实现。 - -### 转写示例 -```python -# PyTorch 写法 -y = torch.addr(input, vec1, vec2, beta=beta, alpha=alpha) - -# Paddle 写法 -y = beta * input + alpha * paddle.outer(vec1, vec2) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.aminmax.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.aminmax.md deleted file mode 100644 index 164ad7cb0a3..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.aminmax.md +++ /dev/null @@ -1,15 +0,0 @@ -## [ 组合替代实现 ]torch.aminmax -### [torch.aminmax](https://docs.pytorch.org/docs/stable/generated/torch.aminmax.html#torch.aminmax) -```python -torch.aminmax(input, *, dim=None, keepdim=False, out=None) -``` -Paddle 无此 API,需要组合实现。 - -### 转写示例 -```python -# PyTorch 写法 -y = torch.aminmax(input, dim=-1, keepdim=True) - -# Paddle 写法 -y = tuple([paddle.amin(input, axis=-1, keepdim=True), paddle.amax(input, axis=-1, keepdim=True)]) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.inference_mode.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.inference_mode.md deleted file mode 100644 index 3970ffed1c5..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.inference_mode.md +++ /dev/null @@ -1,23 +0,0 @@ -## [ 组合替代实现 ]torch.inference_mode -### [torch.inference_mode](https://docs.pytorch.org/docs/stable/generated/torch.autograd.grad_mode.inference_mode.html#torch.inference_mode) -```python -torch.inference_mode(mode=True) -``` - -Paddle 无此 API,需要组合实现。 - -### 转写示例 -```python -# PyTorch 写法 -@torch.inference_mode(False) - -# Paddle 写法 -# 当 mode 为 False 时,可以直接删去 - - -# PyTorch 写法 -@torch.inference_mode(True) - -# Paddle 写法 -@paddle.no_grad() -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.initial_seed.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.initial_seed.md deleted file mode 100644 index 699e4bf980c..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.initial_seed.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 组合替代实现 ]torch.initial_seed -### [torch.initial\_seed](https://docs.pytorch.org/docs/stable/generated/torch.initial_seed.html#torch.initial_seed) -```python -torch.initial_seed() -``` - -获取当前随机数种子。返回一个用于播种 RNG 的 64 位数字。 - -PaddlePaddle 目前无对应 API,可使用如下代码组合实现该 API。 - -### 转写示例 -```python -# PyTorch 写法 -torch.initial_seed() - -# Paddle 写法 -paddle.get_rng_state()[0].current_seed() -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.logdet.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.logdet.md deleted file mode 100644 index 83922409ec9..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.logdet.md +++ /dev/null @@ -1,15 +0,0 @@ -## [ 组合替代实现 ]torch.logdet -### [torch.logdet](https://docs.pytorch.org/docs/stable/generated/torch.logdet.html#torch.logdet) -```python -torch.logdet(input) -``` -Paddle 无此 API,需要组合实现。 - -### 转写示例 -```python -# PyTorch 写法 -y = torch.logdet(input) - -# Paddle 写法 -y = paddle.log(paddle.linalg.det(input)) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.nn.Module.get_buffer.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.nn.Module.get_buffer.md deleted file mode 100644 index 4611672036e..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.nn.Module.get_buffer.md +++ /dev/null @@ -1,16 +0,0 @@ -## [ 组合替代实现 ]torch.nn.Module.get_buffer -### [torch.nn.Module.get\_buffer](https://docs.pytorch.org/docs/stable/generated/torch.nn.Module.html#torch.nn.Module.get_buffer) -```python -torch.nn.Module.get_buffer(target) -``` - -Paddle 无此 API,需要组合实现。 - -### 转写示例 -```python -# PyTorch 写法 -module.get_buffer("target") - -# Paddle 写法 -getattr(module, "target") -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.nn.Module.get_parameter.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.nn.Module.get_parameter.md deleted file mode 100644 index 1242779a906..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.nn.Module.get_parameter.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 组合替代实现 ]torch.nn.Module.get_parameter - -### [torch.nn.Module.get\_parameter](https://docs.pytorch.org/docs/stable/generated/torch.nn.Module.html#torch.nn.Module.get_parameter) - -```python -torch.nn.Module.get_parameter(target) -``` - -Paddle 无此 API,需要组合实现。 - -### 转写示例 -```python -# PyTorch 写法 -module.get_parameter("target") - -# Paddle 写法 -getattr(module, "target") -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.nn.Module.get_submodule.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.nn.Module.get_submodule.md deleted file mode 100644 index d28dd38ff96..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.nn.Module.get_submodule.md +++ /dev/null @@ -1,16 +0,0 @@ -## [ 组合替代实现 ]torch.nn.Module.get_submodule -### [torch.nn.Module.get\_submodule](https://docs.pytorch.org/docs/stable/generated/torch.nn.Module.html#torch.nn.Module.get_submodule) -```python -torch.nn.Module.get_submodule(target) -``` - -Paddle 无此 API,需要组合实现。 - -### 转写示例 -```python -# PyTorch 写法 -module.get_submodule("target") - -# Paddle 写法 -getattr(module, "target") -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.nn.modules.utils._pair.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.nn.modules.utils._pair.md deleted file mode 100644 index ba966f0d6b4..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.nn.modules.utils._pair.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 组合替代实现 ]torch.nn.modules.utils._pair -### [torch.nn.modules.utils._pair](https://github.com/pytorch/pytorch/blob/1f4d4d3b7836d38d936a21665e6b2ab0b39d7092/torch/nn/modules/utils.py#L198) -```python -torch.nn.modules.utils._pair(x) -``` - -Paddle 无此 API,需要组合实现。 - -### 转写示例 -```python -# PyTorch 写法 -torch.nn.modules.utils._pair(x) - -# Paddle 写法 -def _ntuple(n, name="parse"): - def parse(x): - if isinstance(x, collections.abc.Iterable): - return tuple(x) - return tuple(repeat(x, n)) - - parse.__name__ = name - return parse - -_ntuple(n=2, name="parse")(x) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.optim.lr_scheduler.CosineAnnealingLR.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.optim.lr_scheduler.CosineAnnealingLR.md deleted file mode 100644 index c7616743722..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.optim.lr_scheduler.CosineAnnealingLR.md +++ /dev/null @@ -1,44 +0,0 @@ -## [ 组合替代实现 ]torch.optim.lr_scheduler.CosineAnnealingLR -### [torch.optim.lr\_scheduler.CosineAnnealingLR](https://docs.pytorch.org/docs/stable/generated/torch.optim.lr_scheduler.CosineAnnealingLR.html#torch.optim.lr_scheduler.CosineAnnealingLR) -```python -torch.optim.lr_scheduler.CosineAnnealingLR(optimizer, - T_max, - eta_min=0, - last_epoch=-1, - verbose=False) -``` - -### [paddle.optimizer.lr.CosineAnnealingDecay](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/optimizer/lr/CosineAnnealingDecay_cn.html#paddle.optimizer.lr.CosineAnnealingDecay) -```python -paddle.optimizer.lr.CosineAnnealingDecay(learning_rate, - T_max, - eta_min=0, - last_epoch=-1, - verbose=False) -``` - -两者 API 功能一致, 参数用法不一致,PyTorch 是 Scheduler 实例持有 Optimizer 实例,Paddle 是 Optimizer 实例持有 Scheduler 实例。由于持有关系相反,因此 Paddle 使用 Optimizer.set_lr_scheduler 来设置这种持有关系。具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ------------------------------------------------------------------------------------------ | -| optimizer | learning_rate | PyTorch 的 optimizer 类型是 torch.optim.Optimizer,Paddle 的 learning_rate 类型是 float,两者功能上不直接一致,但可通过设置 leaning_rate = optimizer.get_lr() 来对应一致。 | -| T_max | T_max | 表示训练的上限轮数,是余弦衰减周期的一半。参数完全一致。 | -| eta_min | eta_min | 表示学习率的最小值。参数完全一致。 | -| last_epoch | last_epoch | 上一轮的轮数,重启训练时设置为上一轮的 epoch 数。参数完全一致。 | -| verbose | verbose | 如果是 True,则在每一轮更新时在标准输出 stdout 输出一条信息。参数完全一致。 | - -### 转写示例 -```python -# PyTorch 写法 -linear = torch.nn.Linear(10, 10) -sgd = torch.optimizer.SGD(lr=0.5, parameters=linear.parameters()) -scheduler = torch.optim.lr_scheduler.CosineAnnealingLR(optimizer=sgd, T_max=10) - -# Paddle 写法 -linear = paddle.nn.linear(10, 10) -sgd = paddle.optimizer.SGD(learning_rate=0.5, parameters=linear.parameters()) -scheduler = paddle.optimizer.lr.CosineAnnealingDecay(learning_rate=sgd.get_lr(), T_max=10) -sgd.set_lr_scheduler(scheduler) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.optim.lr_scheduler.CosineAnnealingWarmRestarts.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.optim.lr_scheduler.CosineAnnealingWarmRestarts.md deleted file mode 100644 index bdc5d7d2237..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.optim.lr_scheduler.CosineAnnealingWarmRestarts.md +++ /dev/null @@ -1,42 +0,0 @@ -## [ 组合替代实现 ]torch.optim.lr_scheduler.CosineAnnealingWarmRestarts -### [torch.optim.lr\_scheduler.CosineAnnealingWarmRestarts](https://docs.pytorch.org/docs/stable/generated/torch.optim.lr_scheduler.CosineAnnealingWarmRestarts.html#torch.optim.lr_scheduler.CosineAnnealingWarmRestarts) -```python -torch.optim.lr_scheduler.CosineAnnealingWarmRestarts(optimizer, T_0, T_mult=1, eta_min=0, last_epoch=-1, verbose=False) -``` - -### [paddle.optimizer.lr.CosineAnnealingWarmRestarts](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/optimizer/lr/CosineAnnealingWarmRestarts_cn.html#paddle.optimizer.lr.CosineAnnealingWarmRestarts) -```python -paddle.optimizer.lr.CosineAnnealingWarmRestarts(learning_rate, - T_0, - T_mult=1, - eta_min=0, - last_epoch=-1, - verbose=False) -``` - -两者 API 功能一致, 参数用法不一致,PyTorch 是 Scheduler 实例持有 Optimizer 实例,Paddle 是 Optimizer 实例持有 Scheduler 实例。由于持有关系相反,因此 Paddle 使用 Optimizer.set_lr_scheduler 来设置这种持有关系。具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ---------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| optimizer | learning_rate | PyTorch 的 optimizer 类型是 torch.optim.Optimizer,Paddle 的 learning_rate 类型是 float,两者功能上不直接一致,但可通过设置 leaning_rate = optimizer.get_lr() 来对应一致。 | -| T_0 | T_0 | 首次重启迭代数。 | -| T_mult | T_mult | 重启后变量增加因子。 | -| eta_min | eta_min | 表示学习率的最小值。 | -| last_epoch | last_epoch | 上一轮的轮数,重启训练时设置为上一轮的 epoch 数。 | -| verbose | verbose | 如果是 True,则在每一轮更新时在标准输出 stdout 输出一条信息。 | - -### 转写示例 -```python -# PyTorch 写法 -linear = torch.nn.Linear(10, 10) -sgd = torch.optimizer.SGD(lr=0.5, parameters=linear.parameters()) -scheduler = torch.optim.lr_scheduler.CosineAnnealingWarmRestarts(optimizer=sgd, T_0=1) - -# Paddle 写法 -linear = paddle.nn.linear(10, 10) -sgd = paddle.optimizer.SGD(learning_rate=0.5, parameters=linear.parameters()) -scheduler = paddle.optimizer.lr.CosineAnnealingWarmRestarts(learning_rate=sgd.get_lr(), T_0=1) -sgd.set_lr_scheduler(scheduler) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.optim.lr_scheduler.ExponentialLR.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.optim.lr_scheduler.ExponentialLR.md deleted file mode 100644 index 2790d493d39..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.optim.lr_scheduler.ExponentialLR.md +++ /dev/null @@ -1,41 +0,0 @@ -## [ 组合替代实现 ]torch.optim.lr_scheduler.ExponentialLR -### [torch.optim.lr\_scheduler.ExponentialLR](https://docs.pytorch.org/docs/stable/generated/torch.optim.lr_scheduler.ExponentialLR.html#torch.optim.lr_scheduler.ExponentialLR) -```python -torch.optim.lr_scheduler.ExponentialLR(optimizer, - gamma, - last_epoch=-1, - verbose=False) -``` - -### [paddle.optimizer.lr.ExponentialDecay](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/optimizer/lr/ExponentialDecay_cn.html#paddle.optimizer.lr.ExponentialDecay) -```python -paddle.optimizer.lr.ExponentialDecay(learning_rate, - gamma, - last_epoch=-1, - verbose=False) -``` - -两者 API 功能一致, 参数用法不一致,PyTorch 是 Scheduler 实例持有 Optimizer 实例,Paddle 是 Optimizer 实例持有 Scheduler 实例。由于持有关系相反,因此 Paddle 使用 Optimizer.set_lr_scheduler 来设置这种持有关系。具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ------------------------------------------------------------------------------------------ | -| optimizer | learning_rate | PyTorch 的 optimizer 类型是 torch.optim.Optimizer,Paddle 的 learning_rate 类型是 float,两者功能上不直接一致,但可通过设置 leaning_rate = optimizer.get_lr() 来对应一致。 | -| gamma | gamma | 表示衰减率。参数完全一致。 | -| last_epoch | last_epoch | 上一轮的轮数,重启训练时设置为上一轮的 epoch 数。参数完全一致。 | -| verbose | verbose | 如果是 True,则在每一轮更新时在标准输出 stdout 输出一条信息。参数完全一致。 | - -### 转写示例 -```python -# PyTorch 写法 -linear = torch.nn.Linear(10, 10) -sgd = torch.optimizer.SGD(lr=0.5, parameters=linear.parameters()) -scheduler = torch.optim.lr_scheduler.ExponentialLR(optimizer=sgd, gamma=0.5) - -# Paddle 写法 -linear = paddle.nn.linear(10, 10) -sgd = paddle.optimizer.SGD(learning_rate=0.5, parameters=linear.parameters()) -scheduler = paddle.optimizer.lr.ExponentialDecay(learning_rate=sgd.get_lr(), gamma=0.5) -sgd.set_lr_scheduler(scheduler) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.optim.lr_scheduler.LRScheduler.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.optim.lr_scheduler.LRScheduler.md deleted file mode 100644 index 9df7ee68914..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.optim.lr_scheduler.LRScheduler.md +++ /dev/null @@ -1,50 +0,0 @@ -## [ 组合替代实现 ]torch.optim.lr_scheduler.LRScheduler -### [torch.optim.lr\_scheduler.LRScheduler](https://docs.pytorch.org/docs/stable/generated/torch.optim.lr_scheduler.LRScheduler.html#torch.optim.lr_scheduler.LRScheduler) -```python -torch.optim.lr_scheduler.LRScheduler(optimizer, - last_epoch=-1) -``` - -### [paddle.optimizer.lr.LRScheduler](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/optimizer/lr/LRScheduler_cn.html#paddle.optimizer.lr.LRScheduler) -```python -paddle.optimizer.lr.LRScheduler(learning_rate=0.1, - last_epoch=-1, - verbose=False) -``` - -两者 API 功能一致, 参数用法不一致,PyTorch 是 Scheduler 实例持有 Optimizer 实例,Paddle 是 Optimizer 实例持有 Scheduler 实例。由于持有关系相反,因此 Paddle 使用 Optimizer.set_lr_scheduler 来设置这种持有关系。具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ------------------------------------------------------------------------------------------ | -| optimizer | learning_rate | PyTorch 的 optimizer 类型是 torch.optim.Optimizer,Paddle 的 learning_rate 类型是 float,两者功能上不直接一致,但可通过设置 leaning_rate = optimizer.get_lr() 来对应一致。 | -| last_epoch | last_epoch | 上一轮的轮数,重启训练时设置为上一轮的 epoch 数。参数完全一致。 | -| - | verbose | 如果是 True,则在每一轮更新时在标准输出 stdout 输出一条信息。| - -### 转写示例 -```python -# PyTorch 写法 -linear = torch.nn.Linear(10, 10) -class CustomScheduler(torch.optim.lr_scheduler.LRScheduler): - def __init__( - self, optimizer: Optimizer, last_epoch=-1, verbose="deprecated" - ): - ... -sgd = torch.optimizer.SGD(lr=0.5, parameters=linear.parameters()) -scheduler = CustomScheduler(optimizer=sgd, lr_lambda=lambda x:0.95**x) - -# Paddle 写法 -linear = paddle.nn.linear(10, 10) -class CustomScheduler(paddle.optimizer.lr.LRScheduler): - def __init__( - self, - learning_rate: float = 0.1, - last_epoch: int = -1, - verbose: bool = False, - ) -> None: - ... -sgd = paddle.optimizer.SGD(learning_rate=0.5, parameters=linear.parameters()) -scheduler = CustomScheduler(learning_rate=sgd.get_lr(), lr_lambda=lambda x:0.95**x) -sgd.set_lr_scheduler(scheduler) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.optim.lr_scheduler.LambdaLR.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.optim.lr_scheduler.LambdaLR.md deleted file mode 100644 index 30f75fe1eee..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.optim.lr_scheduler.LambdaLR.md +++ /dev/null @@ -1,41 +0,0 @@ -## [ 组合替代实现 ]torch.optim.lr_scheduler.LambdaLR -### [torch.optim.lr\_scheduler.LambdaLR](https://docs.pytorch.org/docs/stable/generated/torch.optim.lr_scheduler.LambdaLR.html#torch.optim.lr_scheduler.LambdaLR) -```python -torch.optim.lr_scheduler.LambdaLR(optimizer, - lr_lambda, - last_epoch=-1, - verbose=False) -``` - -### [paddle.optimizer.lr.LambdaDecay](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/optimizer/lr/LambdaDecay_cn.html#paddle.optimizer.lr.LambdaDecay) -```python -paddle.optimizer.lr.LambdaDecay(learning_rate, - lr_lambda, - last_epoch=-1, - verbose=False) -``` - -两者 API 功能一致, 参数用法不一致,PyTorch 是 Scheduler 实例持有 Optimizer 实例,Paddle 是 Optimizer 实例持有 Scheduler 实例。由于持有关系相反,因此 Paddle 使用 Optimizer.set_lr_scheduler 来设置这种持有关系。具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ------------------------------------------------------------------------------------------ | -| optimizer | learning_rate | PyTorch 的 optimizer 类型是 torch.optim.Optimizer,Paddle 的 learning_rate 类型是 float,两者功能上不直接一致,但可通过设置 leaning_rate = optimizer.get_lr() 来对应一致。 | -| lr_lambda | lr_lambda | 表示 lambda 函数,其通过 epoch 计算出一个因子,该因子会乘以初始学习率。PyTorch 可以是 lambda 函数的列表, Paddle 只能表示 lambda 函数。当 PyTorch 是 lambda 函数的列表时,暂无转写方式。 | -| last_epoch | last_epoch | 上一轮的轮数,重启训练时设置为上一轮的 epoch 数。参数完全一致。 | -| verbose | verbose | 如果是 True,则在每一轮更新时在标准输出 stdout 输出一条信息。参数完全一致。 | - -### 转写示例 -```python -# PyTorch 写法 -linear = torch.nn.Linear(10, 10) -sgd = torch.optimizer.SGD(lr=0.5, parameters=linear.parameters()) -scheduler = torch.optim.lr_scheduler.LambdaLR(optimizer=sgd, lr_lambda=lambda x:0.95**x) - -# Paddle 写法 -linear = paddle.nn.linear(10, 10) -sgd = paddle.optimizer.SGD(learning_rate=0.5, parameters=linear.parameters()) -scheduler = paddle.optimizer.lr.LambdaDecay(learning_rate=sgd.get_lr(), lr_lambda=lambda x:0.95**x) -sgd.set_lr_scheduler(scheduler) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.optim.lr_scheduler.MultiStepLR.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.optim.lr_scheduler.MultiStepLR.md deleted file mode 100644 index 635861d98f8..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.optim.lr_scheduler.MultiStepLR.md +++ /dev/null @@ -1,44 +0,0 @@ -## [ 组合替代实现 ]torch.optim.lr_scheduler.MultiStepLR -### [torch.optim.lr\_scheduler.MultiStepLR](https://docs.pytorch.org/docs/stable/generated/torch.optim.lr_scheduler.MultiStepLR.html#torch.optim.lr_scheduler.MultiStepLR) -```python -torch.optim.lr_scheduler.MultiStepLR(optimizer, - milestones, - gamma=0.1, - last_epoch=-1, - verbose=False) -``` - -### [paddle.optimizer.lr.MultiStepDecay](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/optimizer/lr/MultiStepDecay_cn.html#paddle.optimizer.lr.MultiStepDecay) -```python -paddle.optimizer.lr.MultiStepDecay(learning_rate, - milestones, - gamma=0.1, - last_epoch=-1, - verbose=False) -``` - -两者 API 功能一致, 参数用法不一致,PyTorch 是 Scheduler 实例持有 Optimizer 实例,Paddle 是 Optimizer 实例持有 Scheduler 实例。由于持有关系相反,因此 Paddle 使用 Optimizer.set_lr_scheduler 来设置这种持有关系。具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ------------------------------------------------------------------------------------------ | -| optimizer | learning_rate | PyTorch 的 optimizer 类型是 torch.optim.Optimizer,Paddle 的 learning_rate 类型是 float,两者功能上不直接一致,但可通过设置 leaning_rate = optimizer.get_lr() 来对应一致。 | -| milestones | milestones | 表示轮数下标列表,必须递增。参数完全一致。 | -| gamma | gamma | 表示学习率衰减率。参数完全一致。 | -| last_epoch | last_epoch | 上一轮的轮数,重启训练时设置为上一轮的 epoch 数。参数完全一致。 | -| verbose | verbose | 如果是 True,则在每一轮更新时在标准输出 stdout 输出一条信息。参数完全一致。 | - -### 转写示例 -```python -# PyTorch 写法 -linear = torch.nn.Linear(10, 10) -sgd = torch.optimizer.SGD(lr=0.5, parameters=linear.parameters()) -scheduler = torch.optim.lr_scheduler.MultiStepLR(optimizer=sgd, milestones=[2,4,6]) - -# Paddle 写法 -linear = paddle.nn.linear(10, 10) -sgd = paddle.optimizer.SGD(learning_rate=0.5, parameters=linear.parameters()) -scheduler = paddle.optimizer.lr.MultiStepDecay(learning_rate=sgd.get_lr(), milestones=[2,4,6]) -sgd.set_lr_scheduler(scheduler) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.optim.lr_scheduler.ReduceLROnPlateau.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.optim.lr_scheduler.ReduceLROnPlateau.md deleted file mode 100644 index 5b6b8b3bb05..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.optim.lr_scheduler.ReduceLROnPlateau.md +++ /dev/null @@ -1,59 +0,0 @@ -## [ 组合替代实现 ]torch.optim.lr_scheduler.ReduceLROnPlateau -### [torch.optim.lr\_scheduler.ReduceLROnPlateau](https://docs.pytorch.org/docs/stable/generated/torch.optim.lr_scheduler.ReduceLROnPlateau.html#torch.optim.lr_scheduler.ReduceLROnPlateau) -```python -torch.optim.lr_scheduler.ReduceLROnPlateau(optimizer, - mode='min', - factor=0.1, - patience=10, - threshold=0.0001, - threshold_mode='rel', - cooldown=0, - min_lr=0, - eps=1e-08, - verbose=False) -``` - -### [paddle.optimizer.lr.ReduceOnPlateau](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/optimizer/lr/ReduceOnPlateau_cn.html#paddle.optimizer.lr.ReduceOnPlateau) -```python -paddle.optimizer.lr.ReduceOnPlateau(learning_rate, - mode='min', - factor=0.1, - patience=10, - threshold=1e-4, - threshold_mode='rel', - cooldown=0, - min_lr=0, - epsilon=1e-8, - verbose=False) -``` - -两者 API 功能一致, 参数用法不一致,PyTorch 是 Scheduler 实例持有 Optimizer 实例,Paddle 是 Optimizer 实例持有 Scheduler 实例。由于持有关系相反,因此 Paddle 使用 Optimizer.set_lr_scheduler 来设置这种持有关系。具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ------------------------------------------------------------------------------------------ | -| optimizer | learning_rate | PyTorch 的 optimizer 类型是 torch.optim.Optimizer,Paddle 的 learning_rate 类型是 float,两者功能上不直接一致,但可通过设置 leaning_rate = optimizer.get_lr() 来对应一致。 | -| mode | mode | 'min' 和 'max' 之一。通常情况下,为 'min',此时当 loss 停止下降时学习率将衰减。参数完全一致。 | -| factor | factor | 表示学习率衰减的比例。参数完全一致。 | -| patience | patience | 当 loss 连续 patience 个 epoch 没有下降(对应 mode: 'min')或上升(对应 mode: 'max')时,学习率才会衰减。参数完全一致。 | -| threshold | threshold | threshold 和 threshold_mode 两个参数将会决定 loss 最小变化的阈值。小于该阈值的变化将会被忽视。参数完全一致。 | -| threshold_mode | threshold_mode | 'rel' 和 'abs' 之一。在 'rel' 模式下,loss 最小变化的阈值是 last_loss * threshold,其中 last_loss 是 loss 在上个 epoch 的值。在 'abs' 模式下,loss 最小变化的阈值是 threshold。参数完全一致。 | -| cooldown | cooldown | 在学习率每次衰减之后,会进入时长为 cooldown 个 step 的冷静期。参数完全一致。 | -| min_lr | min_lr | 最小的学习率。衰减后的学习率最低下界限。参数完全一致。 | -| eps | epsilon | 如果新旧学习率间的差异小于 epsilon,则不会更新。仅参数名不一致。 | -| verbose | verbose | 如果是 True,则在每一轮更新时在标准输出 stdout 输出一条信息。参数完全一致。 | - -### 转写示例 -```python -# PyTorch 写法 -linear = torch.nn.Linear(10, 10) -sgd = torch.optimizer.SGD(lr=0.5, parameters=linear.parameters()) -scheduler = torch.optim.lr_scheduler.ReduceLROnPlateau(optimizer=sgd, 'min') - -# Paddle 写法 -linear = paddle.nn.linear(10, 10) -sgd = paddle.optimizer.SGD(learning_rate=0.5, parameters=linear.parameters()) -scheduler = paddle.optimizer.lr.ReduceOnPlateau(learning_rate=sgd.get_lr(), 'min') -sgd.set_lr_scheduler(scheduler) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.optim.lr_scheduler.StepLR.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.optim.lr_scheduler.StepLR.md deleted file mode 100644 index 7ce554ef116..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.optim.lr_scheduler.StepLR.md +++ /dev/null @@ -1,44 +0,0 @@ -## [ 组合替代实现 ]torch.optim.lr_scheduler.StepLR -### [torch.optim.lr\_scheduler.StepLR](https://docs.pytorch.org/docs/stable/generated/torch.optim.lr_scheduler.StepLR.html#torch.optim.lr_scheduler.StepLR) -```python -torch.optim.lr_scheduler.StepLR(optimizer, - step_size, - gamma=0.1, - last_epoch=-1, - verbose=False) -``` - -### [paddle.optimizer.lr.StepDecay](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/optimizer/lr/StepDecay_cn.html#paddle.optimizer.lr.StepDecay) -```python -paddle.optimizer.lr.StepDecay(learning_rate, - step_size, - gamma=0.1, - last_epoch=-1, - verbose=False) -``` - -两者 API 功能一致, 参数用法不一致,PyTorch 是 Scheduler 实例持有 Optimizer 实例,Paddle 是 Optimizer 实例持有 Scheduler 实例。由于持有关系相反,因此 Paddle 使用 Optimizer.set_lr_scheduler 来设置这种持有关系。具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ------------------------------------------------------------------------------------------ | -| optimizer | learning_rate | PyTorch 的 optimizer 类型是 torch.optim.Optimizer,Paddle 的 learning_rate 类型是 float,两者功能上不直接一致,但可通过设置 leaning_rate = optimizer.get_lr() 来对应一致。 | -| step_size | step_size | 表示学习率衰减轮数间隔。参数完全一致。 | -| gamma | gamma | 表示学习率衰减率。参数完全一致。 | -| last_epoch | last_epoch | 上一轮的轮数,重启训练时设置为上一轮的 epoch 数。参数完全一致。 | -| verbose | verbose | 如果是 True,则在每一轮更新时在标准输出 stdout 输出一条信息。参数完全一致。 | - -### 转写示例 -```python -# PyTorch 写法 -linear = torch.nn.Linear(10, 10) -sgd = torch.optimizer.SGD(lr=0.5, parameters=linear.parameters()) -scheduler = torch.optim.lr_scheduler.StepLR(optimizer=sgd, step_size=2) - -# Paddle 写法 -linear = paddle.nn.linear(10, 10) -sgd = paddle.optimizer.SGD(learning_rate=0.5, parameters=linear.parameters()) -scheduler = paddle.optimizer.lr.StepDecay(learning_rate=sgd.get_lr(), step_size=2) -sgd.set_lr_scheduler(scheduler) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.seed.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.seed.md deleted file mode 100644 index 83325acdba9..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.seed.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ 组合替代实现 ]torch.seed -### [torch.seed](https://docs.pytorch.org/docs/stable/generated/torch.seed.html#torch.seed) -```python -torch.seed() -``` - -将生成随机数的种子设置为非确定性随机数。返回一个用于播种 RNG 的 64 位数字。 - -PaddlePaddle 目前无对应 API,可使用如下代码组合实现该 API。 - -### 转写示例 -```python -# PyTorch 写法 -torch.seed() - -# Paddle 写法 -paddle.get_rng_state()[0].current_seed() -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.testing.assert_allclose.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.testing.assert_allclose.md deleted file mode 100644 index 097111f2e60..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.testing.assert_allclose.md +++ /dev/null @@ -1,16 +0,0 @@ -## [ 组合替代实现 ]torch.testing.assert_allclose -### [torch.testing.assert\_allclose](https://docs.pytorch.org/docs/stable/testing.html#torch.testing.assert_allclose) -```python -torch.testing.assert_allclose(actual, expected, rtol=None, atol=None, equal_nan=True, msg='') -``` - -Paddle 无此 API,需要组合实现。 - -### 转写示例 -```python -# PyTorch 写法 -torch.testing.assert_allclose(actual, expected, rtol=rtol, atol=atol, equal_nan=True, msg='error message') - -# Paddle 写法 -assert paddle.allclose(actual, expected, rtol=rtol, atol=atol, equal_nan=True).item(), 'error message' -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.testing.assert_close.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.testing.assert_close.md deleted file mode 100644 index e55ce4a3ff5..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/composite_implement/torch.testing.assert_close.md +++ /dev/null @@ -1,16 +0,0 @@ -## [ 组合替代实现 ]torch.testing.assert_close -### [torch.testing.assert\_close](https://docs.pytorch.org/docs/stable/testing.html#torch.testing.assert_close) -```python -torch.testing.assert_close(actual, expected, *, allow_subclasses=True, rtol=None, atol=None, equal_nan=False, check_device=True, check_dtype=True, check_layout=True, check_stride=False, msg=None) -``` - -Paddle 无此 API,需要组合实现。 - -### 转写示例 -```python -# PyTorch 写法 -torch.testing.assert_close(actual, expected, rtol=rtol, atol=atol, equal_nan=True, msg='error message') - -# Paddle 写法 -assert paddle.allclose(actual, expected, rtol=rtol, atol=atol, equal_nan=True).item(), 'error message' -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_type_diff/torch.Tensor.copysign.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_type_diff/torch.Tensor.copysign.md deleted file mode 100644 index b12e20664eb..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_type_diff/torch.Tensor.copysign.md +++ /dev/null @@ -1,28 +0,0 @@ -## [ 输入参数类型不一致 ]torch.Tensor.copysign -### [torch.Tensor.copysign](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.copysign.html#torch.Tensor.copysign) -```python -torch.Tensor.copysign(other) -``` - -### [paddle.Tensor.copysign]() -```python -paddle.Tensor.copysign(y, name=None) -``` - -其中,PyTorch 与 Paddle 的 `other` 参数所支持类型不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ----------------------------- | -| other | y | 表示输入的 Tensor ,PyTorch 支持 Python Number 和 Tensor 类型, Paddle 仅支持 Tensor 类型。当输入为 Python Number 类型时,需要转写。 | - -### 转写示例 -#### other -```python -# PyTorch 写法 -result = x.copysign(other=2.) - -# Paddle 写法 -result = x.copysign(y=paddle.to_tensor(2.)) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_type_diff/torch.Tensor.copysign_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_type_diff/torch.Tensor.copysign_.md deleted file mode 100644 index 49cdbb7f747..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_type_diff/torch.Tensor.copysign_.md +++ /dev/null @@ -1,28 +0,0 @@ -## [ 输入参数类型不一致 ]torch.Tensor.copysign_ -### [torch.Tensor.copysign\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.copysign_.html#torch.Tensor.copysign_) -```python -torch.Tensor.copysign_(other) -``` - -### [paddle.Tensor.copysign_]() -```python -paddle.Tensor.copysign_(y, name=None) -``` - -其中,PyTorch 与 Paddle 的 `other` 参数所支持类型不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ----------------------------- | -| other | y | 表示输入的 Tensor ,PyTorch 支持 Python Number 和 Tensor 类型, Paddle 仅支持 Tensor 类型。当输入为 Python Number 类型时,需要转写。 | - -### 转写示例 -#### other -```python -# PyTorch 写法 -result = x.copysign_(other=2.) - -# Paddle 写法 -result = x.copysign_(y=paddle.to_tensor(2.)) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_type_diff/torch.Tensor.cuda.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_type_diff/torch.Tensor.cuda.md deleted file mode 100644 index 2b33168e385..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_type_diff/torch.Tensor.cuda.md +++ /dev/null @@ -1,46 +0,0 @@ -## [ 输入参数类型不一致 ]torch.Tensor.cuda -### [torch.Tensor.cuda](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.cuda.html#torch.Tensor.cuda) -```python -torch.Tensor.cuda(device=None, non_blocking=False, memory_format=torch.preserve_format) -``` - -### [paddle.Tensor.cuda](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#cuda-device-id-none-blocking-false) -```python -paddle.Tensor.cuda(device_id=None, blocking=False) -``` - -两者功能一致但参数类型不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------------------------ | -| device | device_id | 目标 GPU 设备,输入参数类型不一致,需要转写。 | -| non_blocking | blocking | 是否同步或异步拷贝,PyTorch 和 Paddle 取值相反,需要转写。 | -| memory_format | - | 表示内存格式, Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | - - -### 转写示例 -#### non_blocking: 同步或异步拷贝 -```python -# PyTorch 写法 -tensor.cuda(non_blocking=True) - -# Paddle 写法 -tensor.cuda(blocking=False) -``` - -#### device: 目标 GPU 设备 -```python -# PyTorch 写法 -tensor.cuda("cuda:0") - -# Paddle 写法 -tensor.cuda(0) - -# PyTorch 写法 -tensor.cuda(0) - -# Paddle 写法 -tensor.cuda(0) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_type_diff/torch.Tensor.floor_divide_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_type_diff/torch.Tensor.floor_divide_.md deleted file mode 100644 index e4bd26f000e..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_type_diff/torch.Tensor.floor_divide_.md +++ /dev/null @@ -1,28 +0,0 @@ -## [ 输入参数类型不一致 ]torch.Tensor.floor_divide_ -### [torch.Tensor.floor\_divide\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.floor_divide_.html#torch.Tensor.floor_divide_) -```python -torch.Tensor.floor_divide_(other) -``` - -### [paddle.Tensor.floor_divide_]() -```python -paddle.Tensor.floor_divide_(y) -``` - -其中,PyTorch 与 Paddle 的 `other` 参数所支持类型不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | --------------------------- | -| other | y | 多维 Tensor,PyTorch 支持 Tensor 和 Python Number,Paddle 仅支持 Tensor,需要转写。 | - -### 转写示例 -#### other -```python -# PyTorch 写法 -result = x.floor_divide_(other=2.) - -# Paddle 写法 -result = x.floor_divide_(y=paddle.to_tensor(2.)) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_type_diff/torch.Tensor.remainder_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_type_diff/torch.Tensor.remainder_.md deleted file mode 100644 index 0b218e683b0..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_type_diff/torch.Tensor.remainder_.md +++ /dev/null @@ -1,28 +0,0 @@ -## [ 输入参数类型不一致 ]torch.Tensor.remainder_ -### [torch.Tensor.remainder\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.remainder_.html#torch.Tensor.remainder_) -```python -torch.Tensor.remainder_(other) -``` - -### [paddle.Tensor.remainder\_](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#id15) -```python -paddle.Tensor.remainder_(y, name=None) -``` - -其中 Paddle 与 PyTorch 运算除数参数所支持的类型不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| other | y | 除数,PyTorch 可为 Tensor or Scalar,Paddle 仅可为 Tensor,需要转写。 | - -### 转写示例 -#### other:除数为 Scalar -```python -# PyTorch 写法 -x.remainder_(1) - -# Paddle 写法 -x.remainder_(y=paddle.to_tensor(1)) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_type_diff/torch.Tensor.slice_scatter.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_type_diff/torch.Tensor.slice_scatter.md deleted file mode 100644 index b25a229c5e0..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_type_diff/torch.Tensor.slice_scatter.md +++ /dev/null @@ -1,32 +0,0 @@ -## [ 输入参数类型不一致 ]torch.Tensor.slice_scatter -### [torch.Tensor.slice\_scatter](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.slice_scatter.html#torch.Tensor.slice_scatter) -```python -torch.Tensor.slice_scatter(src, dim=0, start=None, end=None, step=1) -``` - -### [paddle.Tensor.slice\_scatter](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#slice-scatter-value-axes-starts-ends-strides-name-none) -```python -paddle.Tensor.slice_scatter(value, axes, starts, ends, strides, name=None) -``` - -两者功能一致,参数不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| src | value | 嵌入的值,仅参数名不一致。 | -| dim | axes | 嵌入的维度,PyTorch 为 int 类型,Paddle 为 list of int。需要转写。 | -| start | starts | 嵌入起始索引,PyTorch 为 int 类型,Paddle 为 list of int。需要转写。 | -| end | ends | 嵌入截至索引,PyTorch 为 int 类型,Paddle 为 list of int。需要转写。 | -| step | strides | 嵌入步长,PyTorch 为 int 类型,Paddle 为 list of int。需要转写。 | - -### 转写示例 -#### dim、start、end、step 转写 -```python -# PyTorch 写法 -x.slice_scatter(src, dim=0, start=1, end=5, step=2) - -# Paddle 写法 -x.slice_scatter(value, axes=[0], starts=[1], ends=[5], strides=[2]) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_type_diff/torch.block_diag.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_type_diff/torch.block_diag.md deleted file mode 100644 index 4828a2f7264..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_type_diff/torch.block_diag.md +++ /dev/null @@ -1,28 +0,0 @@ -## [ 输入参数类型不一致 ]torch.block_diag -### [torch.block\_diag](https://docs.pytorch.org/docs/stable/generated/torch.block_diag.html#torch.block_diag) -```python -torch.block_diag(*tensors) -``` - -### [paddle.block\_diag](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/block_diag_cn.html#paddle.block_diag) -```python -paddle.block_diag(inputs, name=None) -``` - -二者功能一致但参数类型不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| -------- | ------------ | ------------------------------------------------------------ | -| *tensors | inputs | 一组输入 Tensor,PyTorch 参数 tensors 为可变参数,Paddle 参数 inputs 为 list(Tensor) 或 tuple(Tensor) 的形式。需要转写。 | - -### 转写示例 -#### *tensors:一组输入 Tensor -```python -# PyTorch 写法 -torch.block_diag(x, y, z) - -# Paddle 写法 -paddle.block_diag([x, y, z]) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_type_diff/torch.broadcast_tensors.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_type_diff/torch.broadcast_tensors.md deleted file mode 100644 index 52d0f4cc487..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_type_diff/torch.broadcast_tensors.md +++ /dev/null @@ -1,29 +0,0 @@ -## [ 输入参数类型不一致 ]torch.broadcast_tensors -### [torch.broadcast\_tensors](https://docs.pytorch.org/docs/stable/generated/torch.broadcast_tensors.html#torch.broadcast_tensors) -```python -torch.broadcast_tensors(*tensors) -``` - -### [paddle.broadcast\_tensors](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/broadcast_tensors_cn.html#paddle.broadcast_tensors) -```python -paddle.broadcast_tensors(input, - name=None) -``` - -两者功能一致但参数类型不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| *tensors | input | 一组输入 Tensor , PyTorch 参数 tensors 为可变参, Paddle 参数 inputs 为 list(Tensor) 或 tuple(Tensor) 的形式。 需要转写。 | - - -### 转写示例 -#### *tensors: 一组输入 Tensor -```python -# PyTorch 写法 -torch.broadcast_tensors(x, y) - -# Paddle 写法 -paddle.broadcast_tensors([x, y]) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_type_diff/torch.cartesian_prod.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_type_diff/torch.cartesian_prod.md deleted file mode 100644 index 0b3ff421f5c..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_type_diff/torch.cartesian_prod.md +++ /dev/null @@ -1,28 +0,0 @@ -## [ 输入参数类型不一致 ]torch.cartesian_prod -### [torch.cartesian\_prod](https://docs.pytorch.org/docs/stable/generated/torch.cartesian_prod.html#torch.cartesian_prod) -```python -torch.cartesian_prod(*tensors) -``` - -### [paddle.cartesian\_prod](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/cartesian_prod_cn.html#paddle.cartesian_prod) -```python -paddle.cartesian_prod(x, name=None) -``` - -两者功能一致但参数类型不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| -------- | ------------ | ------------------------------------------------------------ | -| *tensors | x | 一组输入 Tensor , PyTorch 参数 tensors 为可变参, Paddle 参数 x 为 list(Tensor) 或 tuple(Tensor) 的形式。需要转写。 | - -### 转写示例 -#### *tensors:一组输入 Tensor -```python -# PyTorch 写法 -torch.cartesian_prod(a, b) - -# Paddle 写法 -paddle.cartesian_prod([a, b]) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_type_diff/torch.cuda.synchronize.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_type_diff/torch.cuda.synchronize.md deleted file mode 100644 index e28f2c5fc0b..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_type_diff/torch.cuda.synchronize.md +++ /dev/null @@ -1,34 +0,0 @@ -## [ 输入参数类型不一致 ]torch.cuda.synchronize -### [torch.cuda.synchronize](https://docs.pytorch.org/docs/stable/generated/torch.cuda.synchronize.html#torch.cuda.synchronize) -```python -torch.cuda.synchronize(device) -``` - -### [paddle.device.synchronize](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/device/synchronize_cn.html#paddle.device.synchronize) -```python -paddle.device.synchronize(device) -``` - -两者功能一致但参数类型不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ |-----------------------------------------------------------------------| -| device | device | PyTorch 支持 torch.device 和 int。 PaddlePaddle 支持 paddle.CUDAPlace、int 、str,需要转写。 | - -### 转写示例 -#### device: 特定的运行设备 -```python -# PyTorch 写法 -torch.cuda.synchronize('cuda:0') - -# Paddle 写法 -paddle.device.synchronize('gpu:0') - -# PyTorch 写法 -torch.cuda.synchronize(2) - -# Paddle 写法 -paddle.device.synchronize('gpu:2') -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_type_diff/torch.set_default_device.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_type_diff/torch.set_default_device.md deleted file mode 100644 index 6ad5ad0654b..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_type_diff/torch.set_default_device.md +++ /dev/null @@ -1,40 +0,0 @@ -## [ 输入参数类型不一致 ]torch.set_default_device -### [torch.set\_default\_device](https://docs.pytorch.org/docs/stable/generated/torch.set_default_device.html#torch.set_default_device) -```python -torch.set_default_device(device) -``` - -### [paddle.device.set\_device](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/device/set_device_cn.html#paddle.device.set_device) -```python -paddle.device.set_device(device) -``` - -功能一致,参数类型不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ |------------------------------------------------| -| device | device | PyTorch 支持 torch.device 。PaddlePaddle 支持 str。需要转写。 | - - -### 转写示例 -#### device: 特定的运行设备 -```python -# PyTorch 写法 -torch.set_default_device('cuda:0') - -# Paddle 写法 -paddle.device.set_device('gpu:0') - -# PyTorch 写法 -torch.set_default_device(2) - -# Paddle 写法 -paddle.device.set_device('gpu:2') - -# PyTorch 写法 -torch.set_default_device("cpu") - -# Paddle 写法 -paddle.device.set_device("cpu") -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_type_diff/torch.set_default_tensor_type.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_type_diff/torch.set_default_tensor_type.md deleted file mode 100644 index 8f4d1dc5a7b..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_type_diff/torch.set_default_tensor_type.md +++ /dev/null @@ -1,28 +0,0 @@ -## [ 输入参数类型不一致 ]torch.set_default_tensor_type -### [torch.set\_default\_tensor\_type](https://docs.pytorch.org/docs/stable/generated/torch.set_default_tensor_type.html#torch.set_default_tensor_type) -```python -torch.set_default_tensor_type(t) -``` - -### [paddle.set\_default\_dtype](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/set_default_dtype_cn.html#paddle.set_default_dtype) -```python -paddle.set_default_dtype(d) -``` - -两者功能一致但输入参数类型不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | -- | -| t | d | 浮点张量类型或其名称。PyTorch 支持 `torch.FloatTensor` 或 "torch.FloatTensor",Paddle 只支持 `dtype`(如 `paddle.float32`),需要转写。 | - -### 转写示例 -#### t 浮点张量类型或其名称 -```python -# PyTorch -torch.set_default_tensor_type(torch.FloatTensor) - -# Paddle -paddle.set_default_dtype(paddle.float32) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.Tensor.split.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.Tensor.split.md deleted file mode 100644 index a701a71958b..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.Tensor.split.md +++ /dev/null @@ -1,30 +0,0 @@ -## [ 输入参数用法不一致 ]torch.Tensor.split -### [torch.Tensor.split](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.split.html#torch.Tensor.split) -```python -torch.Tensor.split(split_size, dim=0) -``` - -### [paddle.Tensor.split](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#split-num-or-sections-axis-0-name-none) -```python -paddle.Tensor.split(num_or_sections, axis=0, name=None) -``` - -PyTorch 的 `split_size` 与 Paddle 的 `num_or_sections` 用法不同,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| split_size | num_or_sections | torch:int 时表示块的大小, list 时表示块的大小; paddle: int 时表示块的个数, list 时表示块的大小。因此对于 int 时,两者用法不同,需要转写。| -| dim | axis | 表示需要分割的维度,仅参数名不一致。 | - -### 转写示例 -#### split_size: 为 int 时 torch 表示块的大小,paddle 表示块的个数 -```python -# pytorch -x = torch.randn(8, 2) -y = x.split(4) - -# paddle -x = paddle.randn([8, 2]) -y = x.split(2) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.Tensor.tile.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.Tensor.tile.md deleted file mode 100644 index 3a2c3fb3a93..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.Tensor.tile.md +++ /dev/null @@ -1,29 +0,0 @@ -## [ 输入参数用法不一致 ]torch.Tensor.tile -### [torch.Tensor.tile](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.tile.html#torch.Tensor.tile) -```python -torch.Tensor.tile(*dims) -``` - -### [paddle.Tensor.tile](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#tile-repeat-times-name-none) -```python -paddle.Tensor.tile(repeat_times, name=None) -``` - -两者功能一致,但 pytorch 的 `reps` 和 paddle 的 `repeat_times` 参数用法不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ------------------------------------------------------------ | -| *dims | repeat_times | 维度复制次数, PyTorch 参数 dims 既可以是可变参数,也可以是 list/tuple/tensor 的形式, Paddle 参数 repeat_times 为 list/tuple/tensor 的形式。当 Pytorch 为可变参数的用法时,需要转写。 | - -### 转写示例 -#### \*dims: 维度复制次数 -```python -# PyTorch 写法 -x = torch.tensor([1, 2, 3]) -x.tile(2,3) -# Paddle 写法 -y= paddle.to_tensor([1, 2, 3], dtype='int32') -y.tile([2,3]) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.Tensor.transpose_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.Tensor.transpose_.md deleted file mode 100644 index 316a18c792e..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.Tensor.transpose_.md +++ /dev/null @@ -1,30 +0,0 @@ -## [ 输入参数用法不一致 ]torch.Tensor.transpose_ -### [torch.Tensor.transpose\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.transpose_.html#torch.Tensor.transpose_) -```python -torch.Tensor.transpose_(dim0, dim1) -``` - -### [paddle.Tensor.transpose_]() -```python -paddle.Tensor.transpose_(perm, name=None) -``` - -PyTorch 的 `dim0, dim1` 与 Paddle 的 `perm` 用法不同,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| dim0 | perm | torch 的 dim0 与 dim1 表示要交换的两个维度, 为整数。 paddle 的 perm 表示重排的维度序列,为 list/tuple 。需要转写。| -| dim1 | perm | torch 的 dim0 与 dim1 表示要交换的两个维度, 为整数。 paddle 的 perm 表示重排的维度序列,为 list/tuple 。需要转写。| - -### 转写示例 -#### dim0, dim1: 表示要交换的两个维度 -```python -# pytorch -x = torch.randn(2, 3, 5) -x.transpose_(0, 1) - -# paddle -x = paddle.randn([2, 3, 5]) -x.transpose_(perm=[1, 0, 2]) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.cuda.Stream.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.cuda.Stream.md deleted file mode 100644 index 5c43f4c4011..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.cuda.Stream.md +++ /dev/null @@ -1,44 +0,0 @@ -## [ 输入参数用法不一致 ]torch.cuda.Stream -### [torch.cuda.Stream](https://docs.pytorch.org/docs/stable/generated/torch.cuda.Stream_class.html#torch.cuda.Stream) -```python -torch.cuda.Stream(device=None, priority=0, **kwargs) -``` - -### [paddle.device.Stream](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/device/Stream_cn.html#paddle.device.Stream) -```python -paddle.device.Stream(device=None, priority=None) -``` - -两者功能一致,参数用法不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| -------- | ------------ | ----------------------------------------------------------------------------------------- | -| device | device | 希望分配 stream 的设备。 | -| priority | priority | stream 的优先级,PyTorch 取值范围为-1、0,Paddle 的取值范围为 1、2,需要转写。 | - -### 转写示例 -#### priority: stream 的优先级 -```python -# PyTorch 写法 -torch.cuda.Stream(priority=0) - -# Paddle 写法 -paddle.device.Stream(priority=2) -``` - -#### device: 希望分配 stream 的设备 -```python -# PyTorch 写法 -torch.cuda.Stream('cuda:0') - -# Paddle 写法 -paddle.device.Stream('gpu:0') - -# PyTorch 写法 -torch.cuda.Stream(2) - -# Paddle 写法 -paddle.device.Stream(device='gpu:2') -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.distributed.all_gather_object.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.distributed.all_gather_object.md deleted file mode 100644 index d9a10a5e833..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.distributed.all_gather_object.md +++ /dev/null @@ -1,42 +0,0 @@ -## [ 输入参数用法不一致 ]torch.distributed.all_gather_object -### [torch.distributed.all\_gather\_object](https://docs.pytorch.org/docs/stable/distributed.html#torch.distributed.all_gather_object) -```python -torch.distributed.all_gather_object(object_list, obj, group=None) -``` - -### [paddle.distributed.all\_gather\_object](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/distributed/all_gather_object_cn.html#paddle.distributed.all_gather_object) -```python -paddle.distributed.all_gather_object(object_list, obj, group=None) -``` - -功能一致,参数几乎完全一致。但`object_list`的初始化方式不同。具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| -------- | ------------ | --------------------------------------------- | -| object_list | object_list | 表示用于保存聚合结果的列表。PyTorch 需初始化成与 `group` 等长的列表, Paddle 需初始化为空列表,需要转写。 | -| obj | obj | 表示待聚合的对象。 | -| group | group | 表示执行该操作的进程组实例。 | - -### 转写示例 -#### object_list:保存聚合结果列表 -```python -# PyTorch 写法 -import torch.distributed as dist -object_list = [{}, {}] # NOTE: world size is 2 -if dist.get_rank() == 0: - obj = {"foo": [1, 2, 3]} -else: - obj = {"bar": [4, 5, 6]} -dist.all_gather_object(object_list, obj) - -# Paddle 写法 -import paddle.distributed as dist -object_list = [] # No need to pre-allocate -if dist.get_rank() == 0: - obj = {"foo": [1, 2, 3]} -else: - obj = {"bar": [4, 5, 6]} -dist.all_gather_object(object_list, obj) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.nn.BatchNorm1d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.nn.BatchNorm1d.md deleted file mode 100644 index 72935e4fd67..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.nn.BatchNorm1d.md +++ /dev/null @@ -1,90 +0,0 @@ -## [ 输入参数用法不一致 ]torch.nn.BatchNorm1d -### [torch.nn.BatchNorm1d](https://docs.pytorch.org/docs/stable/generated/torch.nn.BatchNorm1d.html#torch.nn.BatchNorm1d) -```python -torch.nn.BatchNorm1d(num_features, - eps=1e-05, - momentum=0.1, - affine=True, - track_running_stats=True, - device=None, - dtype=None) -``` - -### [paddle.nn.BatchNorm1D](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/BatchNorm1D_cn.html#paddle.nn.BatchNorm1D) -```python -paddle.nn.BatchNorm1D(num_features, - momentum=0.9, - epsilon=1e-05, - weight_attr=None, - bias_attr=None, - data_format='NCL', - use_global_stats=True, - name=None) -``` - -两者功能一致但参数不一致,部分参数名不同,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ |-----------------------------------------------------------------------------------------------------------------------------| -| num_features | num_features | 表示输入 Tensor 通道数。 | -| eps | epsilon | 为了数值稳定加在分母上的值,仅参数名不一致。 | -| momentum | momentum | 表示归一化函数中的超参数, PyTorch 和 Paddle 公式实现细节不一致,两者正好是相反的,需要转写。 | -| - | data_format | 指定输入数据格式,PyTorch 无此参数,Paddle 保持默认即可。 | -| affine | weight_attr, bias_attr | 是否创建并使用可学习的仿射参数,Paddle 可以使用 weight_attr、bias_attr 分别控制权重和偏置项的行为, PyTorch 只有一个开关,且默认值为 None,即不启用,需要转写。 | -| track_running_stats | use_global_stats | 指示是否使用全局均值和方差,PyTorch 设置为 True,Paddle 需设置为 False;PyTorch 设置为 None,Paddle 需设置为 True;PyTorch 设置为 False,Paddle 需设置为 True,需要转写。 | -| device | - | 指定 Tensor 的设备,一般对网络训练结果影响不大,可直接删除。 | -| dtype | - | 指定权重参数属性的对象,一般对网络训练结果影响不大,可直接删除。 | - -### 转写示例 -#### affine:是否进行反射变换 -```python -affine=False 时,表示不更新: - -# PyTorch 写法 -m = torch.nn.BatchNorm1D(24, affine=False) - -# Paddle 写法 -m = paddle.nn.BatchNorm1D(24, weight_attr=False, bias_attr=False) - -affine=True 时,表示更新: - -# PyTorch 写法 -m = torch.nn.BatchNorm1D(24) - -# Paddle 写法 -m = paddle.nn.BatchNorm1D(24) -``` - -#### momentum: -```python -# PyTorch 写法 -m = torch.nn.BatchNorm1D(24, momentum=0.2) - -# Paddle 写法 -m = paddle.nn.BatchNorm1D(24, momentum=0.8) -``` - -#### track_running_stats:指示是否使用全局均值和方差 -```python -track_running_stats=None 时: -# PyTorch 写法 -m = torch.nn.BatchNorm1D(24, track_running_stats=None) - -# Paddle 写法 -m = paddle.nn.BatchNorm1D(24, use_global_stats=True) - -track_running_stats=True 时: -# PyTorch 写法 -m = torch.nn.BatchNorm1D(24, track_running_stats=True) - -# Paddle 写法 -m = paddle.nn.BatchNorm1D(24, use_global_stats=False) - -track_running_stats=False 时: -# PyTorch 写法 -m = torch.nn.BatchNorm1D(24, track_running_stats=False) - -# Paddle 写法 -m = paddle.nn.BatchNorm1D(24, use_global_stats=True) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.nn.BatchNorm2d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.nn.BatchNorm2d.md deleted file mode 100644 index eb328176a6c..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.nn.BatchNorm2d.md +++ /dev/null @@ -1,95 +0,0 @@ -## [ 输入参数用法不一致 ]torch.nn.BatchNorm2d -### [torch.nn.BatchNorm2d](https://docs.pytorch.org/docs/stable/generated/torch.nn.BatchNorm2d.html#torch.nn.BatchNorm2d) -```python -torch.nn.BatchNorm2d(num_features, - eps=1e-05, - momentum=0.1, - affine=True, - track_running_stats=True, - device=None, - dtype=None) -``` - -### [paddle.nn.BatchNorm2D](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/BatchNorm2D_cn.html#paddle.nn.BatchNorm2D) -```python -paddle.nn.BatchNorm2D(num_features, - momentum=0.9, - epsilon=1e-05, - weight_attr=None, - bias_attr=None, - data_format='NCHW', - use_global_stats=True, - name=None) -``` - -两者功能一致但参数不一致,部分参数名不同,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -|---------------------|------------------|---------------------------------------------------------------------------------------------------------------------| -| num_features | num_features | 表示输入 Tensor 通道数。 | -| eps | epsilon | 为了数值稳定加在分母上的值,仅参数名不一致。 | -| momentum | momentum | 表示归一化函数中的超参数, PyTorch 和 Paddle 公式实现细节不一致,两者正好是相反的,需要转写。 | -| - | weight_attr | 指定权重参数属性的对象。如果为 False, 则表示每个通道的伸缩固定为 1,不可改变。默认值为 None,表示使用默认的权重参数属性。 | -| - | bias_attr | 指定偏置参数属性的对象。如果为 False, 则表示每一个通道的偏移固定为 0,不可改变。默认值为 None,表示使用默认的偏置参数属性。 | -| - | data_format | 指定输入数据格式, PyTorch 无此参数,Paddle 保持默认即可。 | -| affine | - | 是否进行反射变换, Paddle 无此参数,需要转写。 | -| track_running_stats | use_global_stats | 指示是否使用全局均值和方差,PyTorch 设置为 True,Paddle 需设置为 False;PyTorch 设置为 None,Paddle 需设置为 True;PyTorch 设置为 False,Paddle 需设置为 True,需要转写。 | -| device | - | 指定 Tensor 的设备,一般对网络训练结果影响不大,可直接删除。 | -| dtype | - | 指定权重参数属性的对象,一般对网络训练结果影响不大,可直接删除。 | - -### 转写示例 -#### affine:是否进行反射变换 -```python -affine = False -时,表示不更新: - -# PyTorch 写法 -m = torch.nn.BatchNorm2D(24, affine=False) - -# Paddle 写法 -m = paddle.nn.BatchNorm2D(24, weight_attr=False, bias_attr=False) - -affine = True -时,表示更新: - -# PyTorch 写法 -m = torch.nn.BatchNorm2D(24) - -# Paddle 写法 -m = paddle.nn.BatchNorm2D(24) -``` - -#### momentum: -```python -# PyTorch 写法 -m = torch.nn.BatchNorm2D(24, momentum=0.2) - -# Paddle 写法 -m = paddle.nn.BatchNorm2D(24, momentum=0.8) -``` - -#### track_running_stats:指示是否使用全局均值和方差 -```python -track_running_stats=None 时: -# PyTorch 写法 -m = torch.nn.BatchNorm2D(24, track_running_stats=None) - -# Paddle 写法 -m = paddle.nn.BatchNorm2D(24, use_global_stats=True) - -track_running_stats=True 时: -# PyTorch 写法 -m = torch.nn.BatchNorm1D(24, track_running_stats=True) - -# Paddle 写法 -m = paddle.nn.BatchNorm2D(24, use_global_stats=False) - -track_running_stats=False 时: -# PyTorch 写法 -m = torch.nn.BatchNorm2D(24, track_running_stats=False) - -# Paddle 写法 -m = paddle.nn.BatchNorm2D(24, use_global_stats=True) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.nn.BatchNorm3d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.nn.BatchNorm3d.md deleted file mode 100644 index 1a834effdb5..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.nn.BatchNorm3d.md +++ /dev/null @@ -1,91 +0,0 @@ -## [ 输入参数用法不一致 ]torch.nn.BatchNorm3d -### [torch.nn.BatchNorm3d](https://docs.pytorch.org/docs/stable/generated/torch.nn.BatchNorm3d.html#torch.nn.BatchNorm3d) -```python -torch.nn.BatchNorm3d(num_features, - eps=1e-05, - momentum=0.1, - affine=True, - track_running_stats=True, - device=None, - dtype=None) -``` - -### [paddle.nn.BatchNorm3D](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/BatchNorm3D_cn.html#paddle.nn.BatchNorm3D) -```python -paddle.nn.BatchNorm3D(num_features, - momentum=0.9, - epsilon=1e-05, - weight_attr=None, - bias_attr=None, - data_format='NCDHW', - use_global_stats=True, - name=None) -``` - -两者功能一致但参数不一致,部分参数名不同,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| num_features | num_features | 表示输入 Tensor 通道数。 | -| eps | epsilon | 为了数值稳定加在分母上的值,仅参数名不一致。 | -| momentum | momentum | 表示归一化函数中的超参数, PyTorch 和 Paddle 公式实现细节不一致,两者正好是相反的,需要转写。 | -| - | weight_attr | 指定权重参数属性的对象。如果为 False, 则表示每个通道的伸缩固定为 1,不可改变。默认值为 None,表示使用默认的权重参数属性。 | -| - | bias_attr | 指定偏置参数属性的对象。如果为 False, 则表示每一个通道的偏移固定为 0,不可改变。默认值为 None,表示使用默认的偏置参数属性。 | -| - | data_format | 指定输入数据格式, PyTorch 无此参数,Paddle 保持默认即可。 | -| affine | - | 是否进行反射变换, Paddle 无此参数,需要转写。 | -| track_running_stats | use_global_stats | 指示是否使用全局均值和方差,PyTorch 设置为 True,Paddle 需设置为 False;PyTorch 设置为 None,Paddle 需设置为 True;PyTorch 设置为 False,Paddle 需设置为 True,需要转写。 | -| device | - | 指定 Tensor 的设备,一般对网络训练结果影响不大,可直接删除。 | -| dtype | - | 指定权重参数属性的对象,一般对网络训练结果影响不大,可直接删除。 | - -### 转写示例 -#### affine:是否进行反射变换 -```python -affine=False 时,表示不更新: - -# PyTorch 写法 -m = torch.nn.BatchNorm3D(24, affine=False) - -# Paddle 写法 -m = paddle.nn.BatchNorm3D(24, weight_attr=False, bias_attr=False) - -affine=True 时,表示更新: - -# PyTorch 写法 -m = torch.nn.BatchNorm3D(24) - -# Paddle 写法 -m = paddle.nn.BatchNorm3D(24) -``` - -#### momentum: -```python -# PyTorch 写法 -m = torch.nn.BatchNorm3D(24, momentum=0.2) - -# Paddle 写法 -m = paddle.nn.BatchNorm3D(24, momentum=0.8) -``` -#### track_running_stats:指示是否使用全局均值和方差 -```python -track_running_stats=None 时: -# PyTorch 写法 -m = torch.nn.BatchNorm3D(24, track_running_stats=None) - -# Paddle 写法 -m = paddle.nn.BatchNorm3D(24, use_global_stats=True) - -track_running_stats=True 时: -# PyTorch 写法 -m = torch.nn.BatchNorm3D(24, track_running_stats=True) - -# Paddle 写法 -m = paddle.nn.BatchNorm3D(24, use_global_stats=False) - -track_running_stats=False 时: -# PyTorch 写法 -m = torch.nn.BatchNorm3D(24, track_running_stats=False) - -# Paddle 写法 -m = paddle.nn.BatchNorm3D(24, use_global_stats=True) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.nn.ConvTranspose1d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.nn.ConvTranspose1d.md deleted file mode 100644 index 2a0b9eb5b56..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.nn.ConvTranspose1d.md +++ /dev/null @@ -1,69 +0,0 @@ -## [ 输入参数用法不一致 ]torch.nn.ConvTranspose1d -### [torch.nn.ConvTranspose1d](https://docs.pytorch.org/docs/stable/generated/torch.nn.ConvTranspose1d.html#torch.nn.ConvTranspose1d) -```python -torch.nn.ConvTranspose1d(in_channels, - out_channels, - kernel_size, - stride=1, - padding=0, - output_padding=0, - groups=1, - bias=True, - dilation=1, - padding_mode='zeros', - device=None, - dtype=None) -``` - -### [paddle.nn.Conv1DTranspose](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/Conv1DTranspose_cn.html#paddle.nn.Conv1DTranspose) -```python -paddle.nn.Conv1DTranspose(in_channels, - out_channels, - kernel_size, - stride=1, - padding=0, - output_padding=0, - groups=1, - dilation=1, - weight_attr=None, - bias_attr=None, - data_format='NCL') -``` - -其中 PyTorch 的 `bias` 与 Paddle 的 `bias_attr` 用法不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| in_channels | in_channels | 表示输入 Tensor 通道数。 | -| out_channels | out_channels | 表示输出 Tensor 通道数。 | -| kernel_size | kernel_size | 表示卷积核大小。 | -| stride | stride | 表示卷积核步长。 | -| padding | padding | 表示填充大小。 | -| output_padding | output_padding | 表示输出 Tensor 额外添加的大小。 | -| groups | groups | 表示分组数。 | -| bias | bias_attr | 是否在输出中添加可学习的 bias。 需要转写。 | -| dilation | dilation | 表示空洞大小。 | -| padding_mode | - | 填充模式,Paddle 无此参数,暂无转写方式。 | -| device | - | 指定 Tensor 的设备,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| dtype | - | Tensor 的所需数据类型,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| - | weight_attr | 指定权重参数属性的对象,PyTorch 无此参数,Paddle 保持默认即可。 | -| - | data_format | 输入和输出的数据格式,PyTorch 无此参数,Paddle 保持默认即可。 | - - -### 转写示例 -#### bias: 是否在输出中添加可学习的 bias -```python -# PyTorch 写法 -torch.nn.ConvTranspose1d(2, 1, 2, bias=True) - -# Paddle 写法 -paddle.nn.Conv1DTranspose(2, 1, 2) -``` -```python -# PyTorch 写法 -torch.nn.ConvTranspose1d(2, 1, 2, bias=False) - -# Paddle 写法 -paddle.nn.Conv1DTranspose(2, 1, 2, bias_attr=False) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.nn.ConvTranspose2d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.nn.ConvTranspose2d.md deleted file mode 100644 index 878257ff253..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.nn.ConvTranspose2d.md +++ /dev/null @@ -1,69 +0,0 @@ -## [ 输入参数用法不一致 ]torch.nn.ConvTranspose2d -### [torch.nn.ConvTranspose2d](https://docs.pytorch.org/docs/stable/generated/torch.nn.ConvTranspose2d.html#torch.nn.ConvTranspose2d) -```python -torch.nn.ConvTranspose2d(in_channels, - out_channels, - kernel_size, - stride=1, - padding=0, - output_padding=0, - groups=1, - bias=True, - dilation=1, - padding_mode='zeros', - device=None, - dtype=None) -``` - -### [paddle.nn.Conv2DTranspose](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/Conv2DTranspose_cn.html#paddle.nn.Conv2DTranspose) -```python -paddle.nn.Conv2DTranspose(in_channels, - out_channels, - kernel_size, - stride=1, - padding=0, - output_padding=0, - groups=1, - dilation=1, - weight_attr=None, - bias_attr=None, - data_format='NCHW') -``` - -其中 PyTorch 的 `bias` 与 Paddle 的 `bias_attr` 用法不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| in_channels | in_channels | 表示输入 Tensor 通道数。 | -| out_channels | out_channels | 表示输出 Tensor 通道数。 | -| kernel_size | kernel_size | 表示卷积核大小。 | -| stride | stride | 表示卷积核步长。 | -| padding | padding | 表示填充大小。 | -| output_padding | output_padding | 表示输出 Tensor 额外添加的大小。 | -| groups | groups | 表示分组数。 | -| bias | bias_attr | 是否在输出中添加可学习的 bias。 需要转写。 | -| dilation | dilation | 表示空洞大小。 | -| padding_mode | - | 填充模式,Paddle 无此参数,暂无转写方式。 | -| device | - | 指定 Tensor 的设备,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| dtype | - | Tensor 的所需数据类型,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| - | weight_attr | 指定权重参数属性的对象,PyTorch 无此参数,Paddle 保持默认即可。 | -| - | data_format | 输入和输出的数据格式,PyTorch 无此参数,Paddle 保持默认即可。 | - - -### 转写示例 -#### bias: 是否在输出中添加可学习的 bias -```python -# PyTorch 写法 -torch.nn.ConvTranspose2d(4, 6, (3, 3), bias=True) - -# Paddle 写法 -paddle.nn.Conv2DTranspose(4, 6, (3, 3)) -``` -```python -# PyTorch 写法 -torch.nn.ConvTranspose2d(4, 6, (3, 3), bias=False) - -# Paddle 写法 -paddle.nn.Conv2DTranspose(4, 6, (3, 3), bias_attr=False) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.nn.ConvTranspose3d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.nn.ConvTranspose3d.md deleted file mode 100644 index fd575c661c5..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.nn.ConvTranspose3d.md +++ /dev/null @@ -1,71 +0,0 @@ -## [ 输入参数用法不一致 ]torch.nn.ConvTranspose3d -### [torch.nn.ConvTranspose3d](https://docs.pytorch.org/docs/stable/generated/torch.nn.ConvTranspose3d.html#torch.nn.ConvTranspose3d) -```python -torch.nn.ConvTranspose3d(in_channels, - out_channels, - kernel_size, - stride=1, - padding=0, - output_padding=0, - groups=1, - bias=True, - dilation=1, - padding_mode='zeros', - device=None, - dtype=None) -``` - -### [paddle.nn.Conv3DTranspose](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/Conv3DTranspose_cn.html#paddle.nn.Conv3DTranspose) -```python -paddle.nn.Conv3DTranspose(in_channels, - out_channels, - kernel_size, - stride=1, - padding=0, - output_padding=0, - groups=1, - dilation=1, - weight_attr=None, - bias_attr=None, - data_format='NCDHW') -``` - - -其中 PyTorch 的 `bias` 与 Paddle 的 `bias_attr` 用法不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| in_channels | in_channels | 表示输入 Tensor 通道数。 | -| out_channels | out_channels | 表示输出 Tensor 通道数。 | -| kernel_size | kernel_size | 表示卷积核大小。 | -| stride | stride | 表示卷积核步长。 | -| padding | padding | 表示填充大小。 | -| output_padding | output_padding | 表示输出 Tensor 额外添加的大小。 | -| groups | groups | 表示分组数。 | -| bias | bias_attr | 是否在输出中添加可学习的 bias。需要转写。 | -| dilation | dilation | 表示空洞大小。 | -| padding_mode | - | 填充模式,Paddle 无此参数,暂无转写方式。 | -| device | - | 指定 Tensor 的设备,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| dtype | - | Tensor 的所需数据类型,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| - | weight_attr | 指定权重参数属性的对象,PyTorch 无此参数,Paddle 保持默认即可。 | -| - | data_format | 输入和输出的数据格式,PyTorch 无此参数,Paddle 保持默认即可。 | - - -### 转写示例 -#### bias: 是否在输出中添加可学习的 bias -```python -# PyTorch 写法 -torch.nn.ConvTranspose3d(4, 6, (3, 3, 3), bias=True) - -# Paddle 写法 -paddle.nn.Conv3DTranspose(4, 6, (3, 3, 3)) -``` -```python -# PyTorch 写法 -torch.nn.ConvTranspose3d(4, 6, (3, 3, 3), bias=False) - -# Paddle 写法 -paddle.nn.Conv3DTranspose(4, 6, (3, 3, 3), bias_attr=False) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.nn.GRU.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.nn.GRU.md deleted file mode 100644 index 8b9a4d66a0b..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.nn.GRU.md +++ /dev/null @@ -1,87 +0,0 @@ -## [ 输入参数用法不一致 ]torch.nn.GRU -### [torch.nn.GRU](https://docs.pytorch.org/docs/stable/generated/torch.nn.GRU.html#torch.nn.GRU) -```python -torch.nn.GRU(input_size, - hidden_size, - num_layers=1, - bias=True, - batch_first=False, - dropout=0, - bidirectional=False, - device=None, - dtype=None) -``` - -### [paddle.nn.GRU](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/GRU_cn.html#paddle.nn.GRU) -```python -paddle.nn.GRU(input_size, - hidden_size, - num_layers=1, - direction='forward', - dropout=0., - time_major=False, - weight_ih_attr=None, - weight_hh_attr=None, - bias_ih_attr=None, - bias_hh_attr=None) -``` - -两者功能一致但参数不一致,部分参数名不同,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input_size | input_size | 表示输入 x 的大小。 | -| hidden_size | hidden_size | 表示隐藏状态 h 大小。 | -| num_layers | num_layers | 表示循环网络的层数。 | -| bias | bias_ih_attr, bias_hh_attr | 是否使用偏置, Paddle 的 bias_ih_attr, bias_hh_attr 参数均需与 PyTorch 设置一致,需要转写。 | -| batch_first | time_major | PyTorch 表示 batch size 是否为第一维,PaddlePaddle 表示 time steps 是否为第一维,它们的意义相反。需要转写。 | -| dropout | dropout | 表示 dropout 概率。 | -| bidirectional | direction | PyTorch 表示是否进行双向 GRU,Paddle 使用字符串表示是双向 GRU(`bidirectional`)还是单向 GRU(`forward`)。 | -| device | - | 指定 Tensor 的设备,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| dtype | - | Tensor 的所需数据类型,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| - |weight_ih_attr| weight_ih 的参数, PyTorch 无此参数, Paddle 保持默认即可。 | -| - |weight_hh_attr| weight_hh 的参数, PyTorch 无此参数, Paddle 保持默认即可。 | - - -### 转写示例 -#### bias:是否使用偏置 -```python -# PyTorch 写法 -torch.nn.GRU(16, 32, bias=True) - -# Paddle 写法 -paddle.nn.GRU(16, 32) -``` -```python -# PyTorch 写法 -torch.nn.GRU(16, 32, bias=False) - -# Paddle 写法 -paddle.nn.GRU(16, 32, bias_ih_attr=False, bias_hh_attr=False) -``` - -#### batch_first:batch size 是否为第一维 -```python -# PyTorch 写法 -torch.nn.GRU(16, 32, batch_first=True) - -# Paddle 写法 -paddle.nn.GRU(16, 32, time_major=False) -``` - -#### bidirectional:是否进行双向 -```python -# PyTorch 写法 -torch.nn.GRU(16, 32, bidirectional=True) - -# Paddle 写法 -paddle.nn.GRU(16, 32, direction='bidirectional') -``` -```python -# PyTorch 写法 -torch.nn.GRU(16, 32, bidirectional=False) - -# Paddle 写法 -paddle.nn.GRU(16, 32, direction='forward') -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.nn.functional.instance_norm.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.nn.functional.instance_norm.md deleted file mode 100644 index e957e95ed46..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.nn.functional.instance_norm.md +++ /dev/null @@ -1,37 +0,0 @@ -## [ 输入参数用法不一致 ]torch.nn.functional.instance_norm -### [torch.nn.functional.instance\_norm](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.instance_norm.html#torch.nn.functional.instance_norm) -```python -torch.nn.functional.instance_norm(input, running_mean=None, running_var=None, weight=None, bias=None, use_input_stats=True, momentum=0.1, eps=1e-05) -``` - -### [paddle.nn.functional.instance\_norm](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/instance_norm_cn.html#paddle.nn.functional.instance_norm) -```python -paddle.nn.functional.instance_norm(x, running_mean=None, running_var=None, weight=None, bias=None, training=False, eps=1e-05, momentum=0.9, use_input_stats=True, data_format='NCHW', name=None) -``` - -其中 PyTorch 与 Paddle 参数不一致,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| running_mean | running_mean | 均值的 Tensor。 | -| running_var | running_var | 方差的 Tensor。 | -| weight | weight | 权重的 Tensor。 | -| bias | bias | 偏置的 Tensor。 | -| use_input_stats | use_input_stats | 用于计算 moving_mean 和 moving_var 的布尔值。 | -| momentum | momentum | 此值用于计算 moving_mean 和 moving_var, 值的大小 Paddle = 1 - PyTorch,需要转写。 | -| eps | eps | 为了数值稳定加在分母上的值。 | -| - | training | 是否可训练。 PyTorch 无此参数。保持默认即可。 | -| - | data_format | 指定输入数据格式。 PyTorch 无此参数。保持默认即可。 | - - -### 转写示例 -#### momentum:此值用于计算 moving_mean 和 moving_var -```python -# PyTorch 写法 -torch.nn.functional.instance_norm(input=input, running_mean=running_mean, running_var=running_var, momentum=0.1) - -# Paddle 写法 -paddle.nn.functional.instance_norm(x=input, running_mean=running_mean, running_var=running_var, momentum=0.9) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.set_rng_state.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.set_rng_state.md deleted file mode 100644 index 7ff821df58d..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.set_rng_state.md +++ /dev/null @@ -1,30 +0,0 @@ -## [ 输入参数用法不一致 ]torch.set_rng_state -### [torch.set\_rng\_state](https://docs.pytorch.org/docs/stable/generated/torch.set_rng_state.html#torch.set_rng_state) -```python -torch.set_rng_state(new_state) -``` - -### [paddle.set\_rng\_state](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/set_rng_state_cn.html#paddle.set_rng_state) -```python -paddle.set_rng_state(state_list) -``` - -其中 PyTorch 与 Paddle 的输入参数类型不一致 - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| new_state | state_list | 表示需要设置的新状态,PyTorch 输入类型为 torch.ByteTensor, Paddle 为 list[GeneratorState]。 需要转写。 | - - - -### 转写示例 -#### new_state: 指定输入 -```python -# PyTorch 写法 -torch.set_rng_state(x) - -# Paddle 写法 -paddle.set_rng_state(x) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.slice_scatter.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.slice_scatter.md deleted file mode 100644 index 478181e7669..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.slice_scatter.md +++ /dev/null @@ -1,33 +0,0 @@ -## [ 输入参数用法不一致 ]torch.slice_scatter -### [torch.slice\_scatter](https://docs.pytorch.org/docs/stable/generated/torch.slice_scatter.html#torch.slice_scatter) -```python -torch.slice_scatter(input, src, dim=0, start=None, end=None, step=1) -``` - -### [paddle.slice\_scatter](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/slice_scatter_cn.html#paddle.slice_scatter) -```python -paddle.slice_scatter(x, value, axes, starts, ends, strides, name=None) -``` - -两者功能一致,参数不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 输入的目标矩阵, 仅参数名不一致。 | -| src | value | 嵌入的值,仅参数名不一致。 | -| dim | axes | 嵌入的维度,PyTorch 为 int 类型,Paddle 为 list of int。需要转写。 | -| start | starts | 嵌入起始索引,PyTorch 为 int 类型,Paddle 为 list of int。需要转写。 | -| end | ends | 嵌入截至索引,PyTorch 为 int 类型,Paddle 为 list of int。需要转写。 | -| step | strides | 嵌入步长,PyTorch 为 int 类型,Paddle 为 list of int。需要转写。 | - -### 转写示例 -#### src、dim、start、end、step 转写 -```python -# PyTorch 写法 -torch.slice_scatter(input, src, dim=0, start=1, end=5, step=2) - -# Paddle 写法 -paddle.slice_scatter(x, value, axes=[0], starts=[1], ends=[5], strides=[2]) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.utils.data.TensorDataset.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.utils.data.TensorDataset.md deleted file mode 100644 index 58d4990be54..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/input_args_usage_diff/torch.utils.data.TensorDataset.md +++ /dev/null @@ -1,28 +0,0 @@ -## [ 输入参数用法不一致 ]torch.utils.data.TensorDataset -### [torch.utils.data.TensorDataset](https://docs.pytorch.org/docs/stable/data.html#torch.utils.data.TensorDataset) -```python -torch.utils.data.TensorDataset(*tensors) -``` - -### [paddle.io.TensorDataset](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/io/TensorDataset_cn.html#paddle.io.TensorDataset) -```python -paddle.io.TensorDataset(tensors) -``` - -paddle 参数和 torch 参数用法不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -|----------|--------------|------------------------------------------------| -| *tensors | tensors | 输入的 Tensor, PyTorch 是可变参数用法, Paddle 是列表或元组,需要转写。 | - -### 转写示例 -#### *tensors:输入的 Tensor -```python -# PyTorch 写法 -torch.utils.data.TensorDataset(tensor1, tensor2, tensor3) - -# Paddle 写法 -paddle.io.TensorDataset([tensor1, tensor2, tensor3]) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.bernoulli.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.bernoulli.md deleted file mode 100644 index 04bb5da5a3a..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.bernoulli.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.Tensor.bernoulli - -### [torch.Tensor.bernoulli](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.bernoulli.html#torch.Tensor.bernoulli) - -```python -torch.Tensor.bernoulli(p=0.5, *, generator=None) -``` - -### [paddle.bernoulli](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/bernoulli_cn.html#paddle.bernoulli) - -```python -paddle.bernoulli(x, p=None, name=None) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -result = a.bernoulli() - -# Paddle 写法 -result = paddle.bernoulli(a) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.clamp_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.clamp_.md deleted file mode 100644 index cf6a855753b..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.clamp_.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.Tensor.clamp_ - -### [torch.Tensor.clamp\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.clamp_.html#torch.Tensor.clamp_) - -```python -torch.Tensor.clamp_(min=None, max=None) -``` - -### [paddle.Tensor.clip\_](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#id8) - -```python -paddle.Tensor.clip_(min=None, max=None, name=None) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -result = a.clamp_(-0.5, 0.5) - -# Paddle 写法 -result = a.clip_(-0.5, 0.5) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.col_indices.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.col_indices.md deleted file mode 100644 index 724e299b215..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.col_indices.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.Tensor.col_indices - -### [torch.Tensor.col\_indices](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.col_indices.html#torch.Tensor.col_indices) - -```python -torch.Tensor.col_indices() -``` - -### [paddle.Tensor.cols](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#cols) - -```python -paddle.Tensor.cols() -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -result = a.col_indices() - -# Paddle 写法 -result = a.cols() -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.crow_indices.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.crow_indices.md deleted file mode 100644 index 2f981c4f53d..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.crow_indices.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.Tensor.crow_indices - -### [torch.Tensor.crow\_indices](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.crow_indices.html#torch.Tensor.crow_indices) - -```python -torch.Tensor.crow_indices() -``` - -### [paddle.Tensor.crows](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#crows) - -```python -paddle.Tensor.crows() -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -result = a.crow_indices() - -# Paddle 写法 -result = a.crows() -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.det.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.det.md deleted file mode 100644 index 9761732adcc..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.det.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.Tensor.det - -### [torch.Tensor.det](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.det.html#torch.Tensor.det) - -```python -torch.Tensor.det() -``` - -### [paddle.linalg.det](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/linalg/det_cn.html#paddle.linalg.det) - -```python -paddle.linalg.det(x, name=None) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -result = x.det() - -# Paddle 写法 -result = paddle.linalg.det(x) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.device.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.device.md deleted file mode 100644 index 25569384204..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.device.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.Tensor.device - -### [torch.Tensor.device](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.device.html#torch.Tensor.device) - -```python -torch.Tensor.device -``` - -### [paddle.Tensor.place](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#place) - -```python -paddle.Tensor.place -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -result = src.device - -# Paddle 写法 -result = src.place -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.erf_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.erf_.md deleted file mode 100644 index 11ebf41caae..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.erf_.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.Tensor.erf_ - -### [torch.Tensor.erf\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.erf_.html#torch.Tensor.erf_) - -```python -torch.Tensor.erf_() -``` - -### [paddle.erf\_](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/erf__cn.html#paddle.erf_) - -```python -paddle.erf_(x, name=None) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -a.erf_() - -# Paddle 写法 -paddle.erf_(a) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.expm1_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.expm1_.md deleted file mode 100644 index f46aabfe082..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.expm1_.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.Tensor.expm1_ - -### [torch.Tensor.expm1\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.expm1_.html#torch.Tensor.expm1_) - -```python -torch.Tensor.expm1_() -``` - -### [paddle.expm1\_](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/expm1__cn.html#paddle.expm1_) - -```python -paddle.expm1_(x, name=None) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -a.expm1_() - -# Paddle 写法 -paddle.expm1_(a) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.fix_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.fix_.md deleted file mode 100644 index 763d4f5f986..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.fix_.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.Tensor.fix_ - -### [torch.Tensor.fix\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.fix_.html#torch.Tensor.fix_) - -```python -torch.Tensor.fix_() -``` - -### [paddle.Tensor.trunc_](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor/trunc__cn.html#paddle/Tensor/trunc__cn#cn-api-paddle-Tensor-trunc_) - -```python -paddle.Tensor.trunc_(name=None) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -result = input.fix_() - -# Paddle 写法 -result = input.trunc_() -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.is_sparse.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.is_sparse.md deleted file mode 100644 index f9bddc7558b..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.is_sparse.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.Tensor.is_sparse - -### [torch.Tensor.is\_sparse](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.is_sparse.html#torch.Tensor.is_sparse) - -```python -torch.Tensor.is_sparse -``` - -### [paddle.Tensor.is\_sparse](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#is-sparse) - -```python -paddle.Tensor.is_sparse() -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -result = a.is_sparse - -# Paddle 写法 -result = a.is_sparse() -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.matrix_exp.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.matrix_exp.md deleted file mode 100644 index d62bdbf12a4..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.matrix_exp.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.Tensor.matrix_exp - -### [torch.Tensor.matrix\_exp](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.matrix_exp.html#torch.Tensor.matrix_exp) - -```python -torch.Tensor.matrix_exp() -``` - -### [paddle.linalg.matrix\_exp](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/linalg/matrix_exp_cn.html#paddle.linalg.matrix_exp) - -```python -paddle.linalg.matrix_exp(x, name=None) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -result = x.matrix_exp() - -# Paddle 写法 -result = paddle.linalg.matrix_exp(x) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.movedim.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.movedim.md deleted file mode 100644 index a9283e0e422..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.movedim.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.Tensor.movedim - -### [torch.Tensor.movedim](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.movedim.html#torch.Tensor.movedim) - -```python -torch.Tensor.movedim(source, destination) -``` - -### [paddle.Tensor.moveaxis](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor/moveaxis_cn.html#paddle/Tensor/moveaxis_cn#cn-api-paddle-Tensor-moveaxis) - -```python -paddle.Tensor.moveaxis(source, destination, name=None) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -result = x.movedim(1, 0) - -# Paddle 写法 -result = x.moveaxis(1, 0) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.mvlgamma_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.mvlgamma_.md deleted file mode 100644 index 78de3aa3d0e..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.mvlgamma_.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.Tensor.mvlgamma_ - -### [torch.Tensor.mvlgamma\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.mvlgamma_.html#torch.Tensor.mvlgamma_) - -```python -torch.Tensor.mvlgamma_(p) -``` - -### [paddle.Tensor.multigammaln_](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor/multigammaln__cn.html#paddle/Tensor/multigammaln__cn#cn-api-paddle-Tensor-multigammaln_) - -```python -paddle.Tensor.multigammaln_(p, name=None) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -result = x.mvlgamma_(2) - -# Paddle 写法 -result = x.multigammaln_(2) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.negative_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.negative_.md deleted file mode 100644 index d6db32c6c7b..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.negative_.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.Tensor.negative_ - -### [torch.Tensor.negative\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.negative_.html#torch.Tensor.negative_) - -```python -torch.Tensor.negative_() -``` - -### [paddle.Tensor.neg_](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor/neg__cn.html#paddle/Tensor/neg__cn#cn-api-paddle-Tensor-neg_) - -```python -paddle.Tensor.neg_(name=None) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -a.negative_() - -# Paddle 写法 -a.neg_() -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.nelement.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.nelement.md deleted file mode 100644 index 40d316cd888..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.nelement.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.Tensor.nelement - -### [torch.Tensor.nelement](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.nelement.html#torch.Tensor.nelement) - -```python -torch.Tensor.nelement() -``` - -### [paddle.Tensor.size](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor/size_cn.html#paddle/Tensor/size_cn#cn-api-paddle-Tensor-size) - -```python -paddle.Tensor.size -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -result = a.nelement() - -# Paddle 写法 -result = a.size -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.numel.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.numel.md deleted file mode 100644 index aaa4d781997..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.numel.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.Tensor.numel - -### [torch.Tensor.numel](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.numel.html#torch.Tensor.numel) - -```python -torch.Tensor.numel() -``` - -### [paddle.Tensor.size](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor/size_cn.html#paddle/Tensor/size_cn#cn-api-paddle-Tensor-size) - -```python -paddle.Tensor.size -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -result = a.numel() - -# Paddle 写法 -result = a.size -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.pinverse.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.pinverse.md deleted file mode 100644 index bf966748cef..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.pinverse.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.Tensor.pinverse - -### [torch.Tensor.pinverse](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.pinverse.html#torch.Tensor.pinverse) - -```python -torch.Tensor.pinverse() -``` - -### [paddle.Tensor.pinv](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor/pinv_cn.html#paddle/Tensor/pinv_cn#cn-api-paddle-Tensor-pinv) - -```python -paddle.Tensor.pinv(rcond=1e-15, hermitian=False, name=None) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -result = a.pinverse() - -# Paddle 写法 -result = a.pinv() -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.positive.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.positive.md deleted file mode 100644 index 7dd4aee060b..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.positive.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.Tensor.positive - -### [torch.Tensor.positive](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.positive.html#torch.Tensor.positive) - -```python -torch.Tensor.positive() -``` - -### [paddle.positive](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/positive_cn.html#paddle.positive) - -```python -paddle.positive(x) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -result = x.positive() - -# Paddle 写法 -result = paddle.positive(x) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.retain_grad.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.retain_grad.md deleted file mode 100644 index f90c76907eb..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.retain_grad.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.Tensor.retain_grad - -### [torch.Tensor.retain\_grad](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.retain_grad.html#torch.Tensor.retain_grad) - -```python -torch.Tensor.retain_grad() -``` - -### [paddle.Tensor.retain\_grads](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#retain-grads) - -```python -paddle.Tensor.retain_grads() -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -result.retain_grad() - -# Paddle 写法 -result.retain_grads() -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.sparse_mask.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.sparse_mask.md deleted file mode 100644 index 903c486182b..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.sparse_mask.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.Tensor.sparse_mask - -### [torch.Tensor.sparse\_mask](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.sparse_mask.html#torch.Tensor.sparse_mask) - -```python -torch.Tensor.sparse_mask(mask) -``` - -### [paddle.sparse.mask\_as](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/sparse/mask_as_cn.html#paddle.sparse.mask_as) - -```python -paddle.sparse.mask_as(x, mask, name=None) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -out = x.sparse_mask(coo) - -# Paddle 写法 -out = paddle.sparse.mask_as(x, coo) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.square_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.square_.md deleted file mode 100644 index 03bf3fdb272..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.square_.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.Tensor.square_ - -### [torch.Tensor.square\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.square_.html#torch.Tensor.square_) - -```python -torch.Tensor.square_() -``` - -### [paddle.square\_](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/square__cn.html#paddle.square_) - -```python -paddle.square_(x, name=None) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -x.square_() - -# Paddle 写法 -paddle.square_(x) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.to_sparse.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.to_sparse.md deleted file mode 100644 index b5ffb9fefad..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.Tensor.to_sparse.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.Tensor.to_sparse - -### [torch.Tensor.to\_sparse](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.to_sparse.html#torch.Tensor.to_sparse) - -```python -torch.Tensor.to_sparse(sparse_dim) -``` - -### [paddle.Tensor.to_sparse_coo](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor/to_sparse_coo_cn.html#paddle/Tensor/to_sparse_coo_cn#cn-api-paddle-Tensor-to_sparse_coo) - -```python -paddle.Tensor.to_sparse_coo(sparse_dim) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -b = a.to_sparse(1) - -# Paddle 写法 -b = a.to_sparse_coo(1) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.allclose.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.allclose.md deleted file mode 100644 index b2f58904f60..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.allclose.md +++ /dev/null @@ -1,30 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.allclose -### [torch.allclose](https://docs.pytorch.org/docs/stable/generated/torch.allclose.html#torch.allclose) -```python -torch.allclose(input, - other, - rtol=1e-05, - atol=1e-08, - equal_nan=False) -``` - -### [paddle.compat.allclose](https://github.com/PaddlePaddle/Paddle/blob/304d5c293907f8620ac6e811097a2847514b863c/python/paddle/compat/__init__.py#L71) -```python -paddle.compat.allclose(input, - other, - rtol=1e-05, - atol=1e-08, - equal_nan=False) -``` - -两者功能一致,但调用 API 名称不一致,具体如下: - -### 转写示例 - - -```python -# PyTorch 写法 -is_close = torch.allclose(a, b) -# Paddle 写法 -is_close = paddle.compat.allclose(a, b) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.autograd.enable_grad.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.autograd.enable_grad.md deleted file mode 100644 index e2956628115..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.autograd.enable_grad.md +++ /dev/null @@ -1,36 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.autograd.enable_grad - -### [torch.autograd.enable_grad](https://docs.pytorch.org/docs/stable/generated/torch.enable_grad.html#torch.enable_grad) - -```python -torch.autograd.enable_grad(*args, **kwargs) -``` - -### [paddle.enable\_grad](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/enable_grad_cn.html#paddle.enable_grad) - -```python -paddle.enable_grad(*args, **kwargs) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -@torch.autograd.enable_grad() -def doubler(x): - return x * 2 - -with torch.no_grad(): - result = doubler(x) - -# Paddle 写法 -@paddle.enable_grad() -def doubler(x): - return x * 2 - -with paddle.no_grad(): - result = doubler(x) - -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.autograd.function.FunctionCtx.mark_non_differentiable.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.autograd.function.FunctionCtx.mark_non_differentiable.md deleted file mode 100644 index 51d4ec4261d..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.autograd.function.FunctionCtx.mark_non_differentiable.md +++ /dev/null @@ -1,47 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.autograd.function.FunctionCtx.mark_non_differentiable - -### [torch.autograd.function.FunctionCtx.mark\_non\_differentiable](https://docs.pytorch.org/docs/stable/generated/torch.autograd.function.FunctionCtx.mark_non_differentiable.html#torch.autograd.function.FunctionCtx.mark_non_differentiable) - -```python -torch.autograd.function.FunctionCtx.mark_non_differentiable(*args) -``` - -### [paddle.autograd.PyLayerContext.mark_non_differentiable](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/autograd/PyLayerContext_cn.html#mark-non-differentiable-self-tensors) - -```python -paddle.autograd.PyLayerContext.mark_non_differentiable(*args) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -class cus_func(torch.autograd.Function): - @staticmethod - def forward(ctx, x): - a = x + x - b = x + x + x - ctx.mark_non_differentiable(a) - return a, b - - @staticmethod - def backward(ctx, grad_a, grad_b): - grad_x = 3 * grad_b - return grad_x - -# Paddle 写法 -class cus_func(paddle.autograd.PyLayer): - @staticmethod - def forward(ctx, x): - a = x + x - b = x + x + x - ctx.mark_non_differentiable(a) - return a, b - - @staticmethod - def backward(ctx, grad_a, grad_b): - grad_x = 3 * grad_b - return grad_x -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.autograd.function.FunctionCtx.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.autograd.function.FunctionCtx.md deleted file mode 100644 index 22a00686d96..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.autograd.function.FunctionCtx.md +++ /dev/null @@ -1,45 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.autograd.function.FunctionCtx - -### [torch.autograd.function.FunctionCtx](https://docs.pytorch.org/docs/stable/autograd.html#torch.autograd.function.FunctionCtx) - -```python -torch.autograd.function.FunctionCtx(*args, **kwargs) -``` - -### [paddle.autograd.PyLayerContext](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/autograd/PyLayerContext_cn.html#paddle.autograd.PyLayerContext) - -```python -paddle.autograd.PyLayerContext(*args, **kwargs) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -class MyFunction(torch.autograd.Function): - @staticmethod - def forward(ctx, x): - ctx.x = x - return x * 2 - - @staticmethod - def backward(ctx, grad_output): - x = ctx.x - grad_input = grad_output * 2 - return grad_input - -# Paddle 写法 -class MyFunction(paddle.autograd.PyLayer): - @staticmethod - def forward(ctx, x): - ctx.x = x - return x * 2 - - @staticmethod - def backward(ctx, grad_output): - x = ctx.x - grad_input = grad_output * 2 - return grad_input -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.autograd.function.FunctionCtx.save_for_backward.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.autograd.function.FunctionCtx.save_for_backward.md deleted file mode 100644 index e9e8c2064ea..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.autograd.function.FunctionCtx.save_for_backward.md +++ /dev/null @@ -1,45 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.autograd.function.FunctionCtx.save_for_backward - -### [torch.autograd.function.FunctionCtx.save\_for\_backward](https://docs.pytorch.org/docs/stable/generated/torch.autograd.function.FunctionCtx.save_for_backward.html#torch.autograd.function.FunctionCtx.save_for_backward) - -```python -torch.autograd.function.FunctionCtx.save_for_backward(*tensors) -``` - -### [paddle.autograd.PyLayerContext.save_for_backward](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/autograd/PyLayerContext_cn.html#save-for-backward-tensors) - -```python -paddle.autograd.PyLayerContext.save_for_backward(*tensors) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -class cus_tanh(torch.autograd.Function): - @staticmethod - def forward(ctx, x): - y = torch.nn.functional.tanh(x) - ctx.save_for_backward(y) - return y - - @staticmethod - def backward(ctx, dy): - grad = dy + 1 - return grad - -# Paddle 写法 -class cus_tanh(paddle.autograd.PyLayer): - @staticmethod - def forward(ctx, x): - y = paddle.nn.functional.tanh(x=x) - ctx.save_for_backward(y) - return y - - @staticmethod - def backward(ctx, dy): - grad = dy + 1 - return grad -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.autograd.function.FunctionCtx.set_materialize_grads.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.autograd.function.FunctionCtx.set_materialize_grads.md deleted file mode 100644 index c4deb963e69..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.autograd.function.FunctionCtx.set_materialize_grads.md +++ /dev/null @@ -1,43 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.autograd.function.FunctionCtx.set_materialize_grads - -### [torch.autograd.function.FunctionCtx.set\_materialize\_grads](https://docs.pytorch.org/docs/stable/generated/torch.autograd.function.FunctionCtx.set_materialize_grads.html#torch.autograd.function.FunctionCtx.set_materialize_grads) - -```python -torch.autograd.function.FunctionCtx.set_materialize_grads(value) -``` - -### [paddle.autograd.PyLayerContext.set_materialize_grads](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/autograd/PyLayerContext_cn.html#set-materialize-grads-self-value) - -```python -paddle.autograd.PyLayerContext.set_materialize_grads(value) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -class cus_tanh(torch.autograd.Function): - @staticmethod - def forward(ctx, x): - ctx.set_materialize_grads(False) - return x + x + x, x + x - - @staticmethod - def backward(ctx, grad, grad2): - assert grad2 == None - return grad - -# Paddle 写法 -class cus_tanh(paddle.autograd.PyLayer): - @staticmethod - def forward(ctx, x): - ctx.set_materialize_grads(False) - return x + x + x, x + x - - @staticmethod - def backward(ctx, grad, grad2): - assert grad2 == None - return grad -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.autograd.grad_mode.set_grad_enabled.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.autograd.grad_mode.set_grad_enabled.md deleted file mode 100644 index 7fdd71c350b..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.autograd.grad_mode.set_grad_enabled.md +++ /dev/null @@ -1,27 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.autograd.grad_mode.set_grad_enabled - -### [torch.autograd.grad\_mode.set\_grad\_enabled](https://docs.pytorch.org/docs/stable/generated/torch.autograd.grad_mode.set_grad_enabled.html#torch.autograd.grad_mode.set_grad_enabled) - -```python -torch.autograd.grad_mode.set_grad_enabled(mode) -``` - -### [paddle.set\_grad\_enabled](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/set_grad_enabled_cn.html#paddle.set_grad_enabled) - -```python -paddle.set_grad_enabled(mode) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -with torch.autograd.grad_mode.set_grad_enabled(is_train): - y = x * 2 - -# Paddle 写法 -with paddle.set_grad_enabled(is_train): - y = x * 2 -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.cuda.StreamContext.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.cuda.StreamContext.md deleted file mode 100644 index bf5e2e9da26..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.cuda.StreamContext.md +++ /dev/null @@ -1,27 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.cuda.StreamContext - -### [torch.cuda.StreamContext](https://docs.pytorch.org/docs/stable/generated/torch.cuda.StreamContext.html#torch.cuda.StreamContext) - -```python -torch.cuda.StreamContext(stream) -``` - -### [paddle.device.stream\_guard](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/device/stream_guard_cn.html#paddle.device.stream_guard) - -```python -paddle.device.stream_guard(stream) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -with torch.cuda.StreamContext(stream=s1): - result = a + b - -# Paddle 写法 -with paddle.device.stream_guard(stream=s1): - result = a + b -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.cuda.get_device_name.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.cuda.get_device_name.md deleted file mode 100644 index 0511391cfc6..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.cuda.get_device_name.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.cuda.get_device_name - -### [torch.cuda.get\_device\_name](https://docs.pytorch.org/docs/stable/generated/torch.cuda.get_device_name.html#torch.cuda.get_device_name) - -```python -torch.cuda.get_device_name(device) -``` - -### [paddle.device.cuda.get\_device\_name](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/device/cuda/get_device_name_cn.html#paddle.device.cuda.get_device_name) - -```python -paddle.device.cuda.get_device_name(device) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -result = torch.cuda.get_device_name(current_device) - -# Paddle 写法 -result = paddle.device.cuda.get_device_name(current_device) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.cuda.stream.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.cuda.stream.md deleted file mode 100644 index 274c87a216b..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.cuda.stream.md +++ /dev/null @@ -1,28 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.cuda.stream - -### [torch.cuda.stream](https://docs.pytorch.org/docs/stable/generated/torch.cuda.stream_function.html#torch.cuda.stream) - -```python -torch.cuda.stream(stream) -``` - -### [paddle.device.stream\_guard](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/device/stream_guard_cn.html#paddle.device.stream_guard) - -```python -paddle.device.stream_guard(stream) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -with torch.cuda.stream(stream=s): - result = data1 + data2 - -# Paddle 写法 -with paddle.device.stream_guard(stream=s): - result = data1 + data2 - -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.distributions.distribution.Distribution.log_prob.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.distributions.distribution.Distribution.log_prob.md deleted file mode 100644 index 55e3a1a65e3..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.distributions.distribution.Distribution.log_prob.md +++ /dev/null @@ -1,27 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.distributions.distribution.Distribution.log_prob - -### [torch.distributions.distribution.Distribution.log\_prob](https://docs.pytorch.org/docs/stable/distributions.html#torch.distributions.distribution.Distribution.log_prob) - -```python -torch.distributions.distribution.Distribution.log_prob(value) -``` - -### [paddle.distribution.Distribution.log_prob](https://github.com/PaddlePaddle/Paddle/blob/e6b0ae75d5a7a47100e0e13f34a6ddd61c14b450/python/paddle/distribution/distribution.py#L122-L124) - -```python -paddle.distribution.Distribution.log_prob(value) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -uniform = torch.distributions.Uniform(0.0, 1.0) -result = uniform.log_prob(torch.tensor(0.3)) - -# Paddle 写法 -uniform = paddle.distribution.Uniform(0.0, 1.0) -result = uniform.log_prob(paddle.to_tensor(0.3)) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.equal.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.equal.md deleted file mode 100644 index 2b4abdb153f..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.equal.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.equal - -### [torch.equal](https://docs.pytorch.org/docs/stable/generated/torch.equal.html#torch.equal) - -```python -torch.equal(input, other) -``` - -### [paddle.compat.equal](https://github.com/PaddlePaddle/Paddle/blob/5721d267e434c18fa64ff2b99839c7cb6d4cc04d/python/paddle/compat/__init__.py#L70) - -```python -paddle.compat.equal(input, other) -``` - -两者功能和用法一致,但 API 路径不一致,只需修改 torch 前缀为 paddle.compat,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -result = torch.equal(a, b) - -# Paddle 写法 -result = paddle.compat.equal(a, b) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.max.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.max.md deleted file mode 100644 index af0f83d59f7..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.max.md +++ /dev/null @@ -1,26 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.max - -### [torch.max](https://docs.pytorch.org/docs/stable/generated/torch.max.html#torch.max) - -```python -torch.max(*args, **kwargs) -``` - -### [paddle.compat.max](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/compat/max_cn.html#id3) - -```python -paddle.compat.max(*args, **kwargs) -``` - -两者功能和用法一致,但 API 路径不一致,只需修改 torch 前缀为 paddle.compat,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -result = torch.max(x) - -# Paddle 写法 -result = paddle.compat.max(x) - -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.median.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.median.md deleted file mode 100644 index 5b06acad672..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.median.md +++ /dev/null @@ -1,26 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.median - -### [torch.median](https://docs.pytorch.org/docs/stable/generated/torch.median.html#torch.median) - -```python -torch.median(*args, **kwargs) -``` - -### [paddle.compat.median](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/compat/median_cn.html#paddle.compat.median) - -```python -paddle.compat.median(*args, **kwargs) -``` - -两者功能和用法一致,但 API 路径不一致,只需修改 torch 前缀为 paddle.compat,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -result = torch.median(input) - -# Paddle 写法 -result = paddle.compat.median(input) - -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.min.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.min.md deleted file mode 100644 index 7d66f903d03..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.min.md +++ /dev/null @@ -1,26 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.min - -### [torch.min](https://docs.pytorch.org/docs/stable/generated/torch.min.html#torch.min) - -```python -torch.min(*args, **kwargs) -``` - -### [paddle.compat.min](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/compat/min_cn.html#id3) - -```python -paddle.compat.min(*args, **kwargs) -``` - -两者功能和用法一致,但 API 路径不一致,只需修改 torch 前缀为 paddle.compat,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -result = torch.min(x) - -# Paddle 写法 -result = paddle.compat.min(x) - -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nanmedian.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nanmedian.md deleted file mode 100644 index a33683ba179..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nanmedian.md +++ /dev/null @@ -1,26 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.nanmedian - -### [torch.nanmedian](https://docs.pytorch.org/docs/stable/generated/torch.nanmedian.html#torch.nanmedian) - -```python -torch.nanmedian(*args, **kwargs) -``` - -### [paddle.compat.nanmedian](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/compat/nanmedian_cn.html#paddle.compat.nanmedian) - -```python -paddle.compat.nanmedian(*args, **kwargs) -``` - -两者功能和用法一致,但 API 路径不一致,只需修改 torch 前缀为 paddle.compat,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -result = torch.nanmedian(input) - -# Paddle 写法 -result = paddle.compat.nanmedian(input) - -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.AdaptiveAvgPool1d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.AdaptiveAvgPool1d.md deleted file mode 100644 index e4287799453..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.AdaptiveAvgPool1d.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.nn.AdaptiveAvgPool1d - -### [torch.nn.AdaptiveAvgPool1d](https://docs.pytorch.org/docs/stable/generated/torch.nn.AdaptiveAvgPool1d.html#torch.nn.AdaptiveAvgPool1d) - -```python -torch.nn.AdaptiveAvgPool1d(output_size) -``` - -### [paddle.nn.AdaptiveAvgPool1D](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/AdaptiveAvgPool1D_cn.html#paddle.nn.AdaptiveAvgPool1D) - -```python -paddle.nn.AdaptiveAvgPool1D(output_size, name=None) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -model = torch.nn.AdaptiveAvgPool1d(5) - -# Paddle 写法 -model = paddle.nn.AdaptiveAvgPool1D(5) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.AdaptiveAvgPool2d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.AdaptiveAvgPool2d.md deleted file mode 100644 index d907f603828..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.AdaptiveAvgPool2d.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.nn.AdaptiveAvgPool2d - -### [torch.nn.AdaptiveAvgPool2d](https://docs.pytorch.org/docs/stable/generated/torch.nn.AdaptiveAvgPool2d.html#torch.nn.AdaptiveAvgPool2d) - -```python -torch.nn.AdaptiveAvgPool2d(output_size) -``` - -### [paddle.nn.AdaptiveAvgPool2D](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/AdaptiveAvgPool2D_cn.html#paddle.nn.AdaptiveAvgPool2D) - -```python -paddle.nn.AdaptiveAvgPool2D(output_size, data_format="NCHW", name=None) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -model = torch.nn.AdaptiveAvgPool2d(5) - -# Paddle 写法 -model = paddle.nn.AdaptiveAvgPool2D(5) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.AdaptiveAvgPool3d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.AdaptiveAvgPool3d.md deleted file mode 100644 index b376e4c0cc4..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.AdaptiveAvgPool3d.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.nn.AdaptiveAvgPool3d - -### [torch.nn.AdaptiveAvgPool3d](https://docs.pytorch.org/docs/stable/generated/torch.nn.AdaptiveAvgPool3d.html#torch.nn.AdaptiveAvgPool3d) - -```python -torch.nn.AdaptiveAvgPool3d(output_size) -``` - -### [paddle.nn.AdaptiveAvgPool3D](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/AdaptiveAvgPool3D_cn.html#paddle.nn.AdaptiveAvgPool3D) - -```python -paddle.nn.AdaptiveAvgPool3D(output_size, data_format="NCDHW", name=None) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -model = torch.nn.AdaptiveAvgPool3d(1) - -# Paddle 写法 -model = paddle.nn.AdaptiveAvgPool3D(1) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.AvgPool1d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.AvgPool1d.md deleted file mode 100644 index 769f1d4bfb3..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.AvgPool1d.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.nn.AvgPool1d - -### [torch.nn.AvgPool1d](https://docs.pytorch.org/docs/stable/generated/torch.nn.AvgPool1d.html#torch.nn.AvgPool1d) - -```python -torch.nn.AvgPool1d(kernel_size, stride=None, padding=0, ceil_mode=False, count_include_pad=True) -``` - -### [paddle.compat.nn.AvgPool1d](https://github.com/PaddlePaddle/Paddle/blob/5721d267e434c18fa64ff2b99839c7cb6d4cc04d/python/paddle/compat/nn/__init__.py#L67) - -```python -paddle.compat.nn.AvgPool1d(kernel_size, stride=None, padding=0, ceil_mode=False, count_include_pad=True) -``` - -两者功能和用法一致,但 API 路径不一致,只需修改 torch 前缀为 paddle.compat,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -layer = torch.nn.AvgPool1d(2) - -# Paddle 写法 -layer = paddle.compat.nn.AvgPool1d(2) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.AvgPool2d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.AvgPool2d.md deleted file mode 100644 index e9aace67e10..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.AvgPool2d.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.nn.AvgPool2d - -### [torch.nn.AvgPool2d](https://docs.pytorch.org/docs/stable/generated/torch.nn.AvgPool2d.html#torch.nn.AvgPool2d) - -```python -torch.nn.AvgPool2d(kernel_size, stride=None, padding=0, ceil_mode=False, count_include_pad=True, divisor_override=None) -``` - -### [paddle.compat.nn.AvgPool2d](https://github.com/PaddlePaddle/Paddle/blob/5721d267e434c18fa64ff2b99839c7cb6d4cc04d/python/paddle/compat/nn/__init__.py#L171) - -```python -paddle.compat.nn.AvgPool2d(kernel_size, stride=None, padding=0, ceil_mode=False, count_include_pad=True) -``` - -两者功能和用法一致,但 API 路径不一致,只需修改 torch 前缀为 paddle.compat,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -layer = torch.nn.AvgPool2d(kernel_size=3, stride=2, padding=0) - -# Paddle 写法 -layer = paddle.compat.nn.AvgPool2d(kernel_size=3, stride=2, padding=0) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.AvgPool3d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.AvgPool3d.md deleted file mode 100644 index 4a7fe25c11c..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.AvgPool3d.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.nn.AvgPool3d - -### [torch.nn.AvgPool3d](https://docs.pytorch.org/docs/stable/generated/torch.nn.AvgPool3d.html#torch.nn.AvgPool3d) - -```python -torch.nn.AvgPool3d(kernel_size, stride=None, padding=0, ceil_mode=False, count_include_pad=True, divisor_override=None) -``` - -### [paddle.compat.nn.AvgPool3d](https://github.com/PaddlePaddle/Paddle/blob/5721d267e434c18fa64ff2b99839c7cb6d4cc04d/python/paddle/compat/nn/__init__.py#L291) - -```python -paddle.compat.nn.AvgPool3d(kernel_size, stride=None, padding=0, ceil_mode=False, count_include_pad=True) -``` - -两者功能和用法一致,但 API 路径不一致,只需修改 torch 前缀为 paddle.compat,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -layer = torch.nn.AvgPool3d(4, stride=None, padding=0, ceil_mode=False, count_include_pad=True) - -# Paddle 写法 -layer = paddle.compat.nn.AvgPool3d(4, stride=None, padding=0, ceil_mode=False, count_include_pad=True) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.HuberLoss.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.HuberLoss.md deleted file mode 100644 index 5b346b503c4..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.HuberLoss.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.nn.HuberLoss - -### [torch.nn.HuberLoss](https://docs.pytorch.org/docs/stable/generated/torch.nn.HuberLoss.html#torch.nn.HuberLoss) - -```python -torch.nn.HuberLoss(reduction='mean', delta=1.0) -``` - -### [paddle.nn.SmoothL1Loss](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/SmoothL1Loss_cn.html#paddle.nn.SmoothL1Loss) - -```python -paddle.nn.SmoothL1Loss(reduction='mean', delta=1.0, name=None) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -loss = torch.nn.HuberLoss() - -# Paddle 写法 -loss = paddle.nn.SmoothL1Loss() -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.Linear.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.Linear.md deleted file mode 100644 index 75dd314d121..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.Linear.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.nn.Linear - -### [torch.nn.Linear](https://docs.pytorch.org/docs/stable/generated/torch.nn.Linear.html#torch.nn.Linear) - -```python -torch.nn.Linear(in_features, out_features, bias=True, device=None, dtype=None) -``` - -### [paddle.compat.nn.Linear](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/compat/nn/Linear_cn.html#paddle.compat.nn.Linear) - -```python -paddle.compat.nn.Linear(in_features, out_features, bias=True, device=None, dtype=None) -``` - -两者功能和用法一致,但 API 路径不一致,只需修改 torch 前缀为 paddle.compat,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -layer = torch.nn.Linear(in_features=16, out_features=16) - -# Paddle 写法 -layer = paddle.compat.nn.Linear(in_features=16, out_features=16) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.MaxUnpool1d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.MaxUnpool1d.md deleted file mode 100644 index dfc2fd5be8f..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.MaxUnpool1d.md +++ /dev/null @@ -1,24 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.nn.MaxUnpool1d - -### [torch.nn.MaxUnpool1d](https://docs.pytorch.org/docs/stable/generated/torch.nn.MaxUnpool1d.html#torch.nn.MaxUnpool1d) - -```python -torch.nn.MaxUnpool1d(kernel_size, stride=None, padding=0) -``` - -### [paddle.nn.MaxUnPool1D](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/MaxUnPool1D_cn.html#paddle.nn.MaxUnPool1D) - -```python -paddle.nn.MaxUnPool1D(kernel_size, stride=None, padding=0, data_format='NCL', output_size=None, name=None) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -unpool = torch.nn.MaxUnpool1d(2, 2) -# Paddle 写法) -unpool = paddle.nn.MaxUnPool1D(2, 2) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.MaxUnpool2d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.MaxUnpool2d.md deleted file mode 100644 index 39b3c310c46..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.MaxUnpool2d.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.nn.MaxUnpool2d - -### [torch.nn.MaxUnpool2d](https://docs.pytorch.org/docs/stable/generated/torch.nn.MaxUnpool2d.html#torch.nn.MaxUnpool2d) - -```python -torch.nn.MaxUnpool2d(kernel_size, stride=None, padding=0) -``` - -### [paddle.nn.MaxUnPool2D](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/MaxUnPool2D_cn.html#paddle.nn.MaxUnPool2D) - -```python -paddle.nn.MaxUnPool2D(kernel_size, stride=None, padding=0, data_format='NCHW', output_size=None, name=None) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -unpool = torch.nn.MaxUnpool2d(2, stride=2) - -# Paddle 写法 -unpool = paddle.nn.MaxUnPool2D(2, stride=2) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.MaxUnpool3d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.MaxUnpool3d.md deleted file mode 100644 index 9cf184b533e..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.MaxUnpool3d.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.nn.MaxUnpool3d - -### [torch.nn.MaxUnpool3d](https://docs.pytorch.org/docs/stable/generated/torch.nn.MaxUnpool3d.html#torch.nn.MaxUnpool3d) - -```python -torch.nn.MaxUnpool3d(kernel_size, stride=None, padding=0) -``` - -### [paddle.nn.MaxUnPool3D](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/MaxUnPool3D_cn.html#paddle.nn.MaxUnPool3D) - -```python -paddle.nn.MaxUnPool3D(kernel_size, stride=None, padding=0, data_format='NCDHW', output_size=None, name=None) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -unpool = torch.nn.MaxUnpool3d(3, stride=2) - -# Paddle 写法 -unpool = paddle.nn.MaxUnPool3D(3, stride=2) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.MultiheadAttention.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.MultiheadAttention.md deleted file mode 100644 index 9f023028239..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.MultiheadAttention.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.nn.MultiheadAttention - -### [torch.nn.MultiheadAttention](https://docs.pytorch.org/docs/stable/generated/torch.nn.MultiheadAttention.html#torch.nn.MultiheadAttention) - -```python -torch.nn.MultiheadAttention(embed_dim, num_heads, dropout=0.0, bias=True, add_bias_kv=False, add_zero_attn=False, kdim=None, vdim=None, batch_first=False, device=None, dtype=None) -``` - -### [paddle.compat.nn.MultiheadAttention](https://github.com/PaddlePaddle/Paddle/blob/5721d267e434c18fa64ff2b99839c7cb6d4cc04d/python/paddle/compat/nn/transformer.py#L29) -```python -paddle.compat.nn.MultiheadAttention(embed_dim, num_heads, dropout=0.0, bias=True, add_bias_kv=False, add_zero_attn=False, kdim=None, vdim=None, batch_first=False, device=None, dtype=None) - -``` - -两者功能和用法一致,但 API 路径不一致,只需修改 torch 前缀为 paddle.compat,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -layer = torch.nn.MultiheadAttention(128, 8) - -# Paddle 写法 -layer = paddle.compat.nn.MultiheadAttention(128, 8) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.Softmax.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.Softmax.md deleted file mode 100644 index 0b702f63c33..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.Softmax.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.nn.Softmax - -### [torch.nn.Softmax](https://docs.pytorch.org/docs/stable/generated/torch.nn.Softmax.html#torch.nn.Softmax) - -```python -torch.nn.Softmax(dim=None) -``` - -### [paddle.compat.nn.Softmax](https://github.com/PaddlePaddle/Paddle/blob/5721d267e434c18fa64ff2b99839c7cb6d4cc04d/python/paddle/compat/nn/__init__.py#L613) - -```python -paddle.compat.nn.Softmax(dim=None) -``` - -两者功能和用法一致,但 API 路径不一致,只需修改 torch 前缀为 paddle.compat,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -layer = torch.nn.Softmax() - -# Paddle 写法 -layer = paddle.compat.nn.Softmax() -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.Unfold.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.Unfold.md deleted file mode 100644 index edf8b37569b..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.Unfold.md +++ /dev/null @@ -1,26 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.nn.Unfold - -### [torch.nn.Unfold](https://docs.pytorch.org/docs/stable/generated/torch.nn.Unfold.html#torch.nn.Unfold) - -```python -torch.nn.Unfold(kernel_size, dilation=1, padding=0, stride=1) -``` - -### [paddle.compat.nn.Unfold](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/compat/nn/Unfold_cn.html#paddle.compat.nn.Unfold) - -```python -paddle.compat.nn.Unfold(kernel_size, dilation=1, padding=0, stride=1) -``` - -两者功能和用法一致,但 API 路径不一致,只需修改 torch 前缀为 paddle.compat,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -unfold = torch.nn.Unfold(kernel_size=(2, 2)) - -# Paddle 写法 -unfold = paddle.compat.nn.Unfold(kernel_size=(2, 2)) - -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.UpsamplingBilinear2d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.UpsamplingBilinear2d.md deleted file mode 100644 index 14036cb307f..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.UpsamplingBilinear2d.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.nn.UpsamplingBilinear2d - -### [torch.nn.UpsamplingBilinear2d](https://docs.pytorch.org/docs/stable/generated/torch.nn.UpsamplingBilinear2d.html#torch.nn.UpsamplingBilinear2d) - -```python -torch.nn.UpsamplingBilinear2d(size=None, scale_factor=None) -``` - -### [paddle.nn.UpsamplingBilinear2D](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/UpsamplingBilinear2D_cn.html#paddle.nn.UpsamplingBilinear2D) - -```python -paddle.nn.UpsamplingBilinear2D(size=None, scale_factor=None, data_format='NCHW', name=None) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -model = torch.nn.UpsamplingBilinear2d(scale_factor=2) - -# Paddle 写法 -model = paddle.nn.UpsamplingBilinear2D(scale_factor=2) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.UpsamplingNearest2d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.UpsamplingNearest2d.md deleted file mode 100644 index 3ee6985ab7c..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.UpsamplingNearest2d.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.nn.UpsamplingNearest2d - -### [torch.nn.UpsamplingNearest2d](https://docs.pytorch.org/docs/stable/generated/torch.nn.UpsamplingNearest2d.html#torch.nn.UpsamplingNearest2d) - -```python -torch.nn.UpsamplingNearest2d(size=None, scale_factor=None) -``` - -### [paddle.nn.UpsamplingNearest2D](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/UpsamplingNearest2D_cn.html#paddle.nn.UpsamplingNearest2D) - -```python -paddle.nn.UpsamplingNearest2D(size=None, scale_factor=None, data_format='NCHW', name=None) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -model = torch.nn.UpsamplingNearest2d(scale_factor=2) - -# Paddle 写法 -model = paddle.nn.UpsamplingNearest2D(scale_factor=2) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.ZeroPad2d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.ZeroPad2d.md deleted file mode 100644 index 6bfaeea60f0..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.ZeroPad2d.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.nn.ZeroPad2d - -### [torch.nn.ZeroPad2d](https://docs.pytorch.org/docs/stable/generated/torch.nn.ZeroPad2d.html#torch.nn.ZeroPad2d) - -```python -torch.nn.ZeroPad2d(padding) -``` - -### [paddle.nn.ZeroPad2D](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/ZeroPad2D_cn.html#paddle.nn.ZeroPad2D) - -```python -paddle.nn.ZeroPad2D(padding, data_format='NCHW', name=None) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -model = torch.nn.ZeroPad2d(1) - -# Paddle 写法 -model = paddle.nn.ZeroPad2D(1) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.functional.linear.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.functional.linear.md deleted file mode 100644 index f82d377f2df..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.functional.linear.md +++ /dev/null @@ -1,24 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.nn.functional.linear - -### [torch.nn.functional.linear](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.linear.html#torch.nn.functional.linear) - -```python -torch.nn.functional.linear(input, weight, bias=None) -``` - -### [paddle.compat.nn.functional.linear](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/compat/nn/functional/linear_cn.html#paddle.compat.nn.functional.linear) -```python -paddle.compat.nn.functional.linear(input, weight, bias=None) -``` - -两者功能和用法一致,但 API 路径不一致,只需修改 torch 前缀为 paddle.compat,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -out = torch.nn.functional.linear(input, weight, bias) - -# Paddle 写法 -out = paddle.compat.nn.functional.linear(input, weight, bias) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.functional.pad.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.functional.pad.md deleted file mode 100644 index 2c25e2310c7..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.functional.pad.md +++ /dev/null @@ -1,26 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.nn.functional.pad - -### [torch.nn.functional.pad](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.pad.html#torch.nn.functional.pad) - -```python -torch.nn.functional.pad(input, pad, mode="constant", value=None) -``` - -### [paddle.compat.nn.functional.pad](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/compat/nn/functional/pad_cn.html#paddle.compat.nn.functional.pad) - -```python -paddle.compat.nn.functional.pad(input, pad, mode="constant", value=0.0) -``` - -两者功能和用法一致,但 API 路径不一致,只需修改 torch 前缀为 paddle.compat,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -result = torch.nn.functional.pad(x, [0, 0, 0, 0, 0, 1, 2, 3], value=1) - -# Paddle 写法 -result = paddle.compat.nn.functional.pad(x, [0, 0, 0, 0, 0, 1, 2, 3], value=1) - -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.functional.scaled_dot_product_attention.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.functional.scaled_dot_product_attention.md deleted file mode 100644 index f3f87a67f6c..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.functional.scaled_dot_product_attention.md +++ /dev/null @@ -1,27 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.nn.functional.scaled_dot_product_attention - -### [torch.nn.functional.scaled\_dot\_product\_attention](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.scaled_dot_product_attention.html#torch.nn.functional.scaled_dot_product_attention) -```python -torch.nn.functional.scaled_dot_product_attention( - query, key, value, attn_mask=None, dropout_p=0.0, is_causal=False, scale=None, enable_gqa=False -) -``` - -### [paddle.compat.nn.functional.scaled_dot_product_attention](https://github.com/PaddlePaddle/Paddle/blob/5721d267e434c18fa64ff2b99839c7cb6d4cc04d/python/paddle/compat/nn/functional/sdpa.py#L25) -```python -paddle.compat.nn.functional.scaled_dot_product_attention( - query, key, value, attn_mask=None, dropout_p=0.0, is_causal=False, scale=None, enable_gqa=False -) -``` - -两者功能和用法一致,但 API 路径不一致,只需修改 torch 前缀为 paddle.compat,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -out = torch.nn.functional.scaled_dot_product_attention(query, key, value) - -# Paddle 写法 -out = paddle.compat.nn.functional.scaled_dot_product_attention(query, key, value) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.functional.softmax.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.functional.softmax.md deleted file mode 100644 index f736e122739..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.functional.softmax.md +++ /dev/null @@ -1,26 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.nn.functional.softmax - -### [torch.nn.functional.softmax](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.softmax.html#torch.nn.functional.softmax) - -```python -torch.nn.functional.softmax(input, dim=None, _stacklevel=3, dtype=None) -``` - -### [paddle.compat.nn.functional.softmax](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/compat/nn/functional/softmax_cn.html#paddle.compat.nn.functional.softmax) - -```python -paddle.compat.nn.functional.softmax(input, dim=None, _stacklevel=3, dtype=None, out=None) -``` - -两者功能和用法一致,但 API 路径不一致,只需修改 torch 前缀为 paddle.compat,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -result = torch.nn.functional.softmax(x, -1) - -# Paddle 写法 -result = paddle.compat.nn.functional.softmax(x, -1) - -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.functional.unfold.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.functional.unfold.md deleted file mode 100644 index 89983284217..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.nn.functional.unfold.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.nn.functional.unfold - -### [torch.nn.functional.unfold](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.unfold.html#torch.nn.functional.unfold) - -```python -torch.nn.functional.unfold(input, kernel_size, dilation=1, padding=0, stride=1) -``` - -### [paddle.compat.nn.functional.unfold](https://github.com/PaddlePaddle/Paddle/blob/5721d267e434c18fa64ff2b99839c7cb6d4cc04d/python/paddle/compat/nn/transformer.py#L29) -```python -paddle.compat.nn.functional.unfold(input, kernel_size, dilation=1, padding=0, stride=1) - -``` - -两者功能和用法一致,但 API 路径不一致,只需修改 torch 前缀为 paddle.compat,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -out = torch.nn.functional.unfold(input, kernel_size) - -# Paddle 写法 -out = paddle.compat.nn.functional.unfold(input, kernel_size) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.sort.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.sort.md deleted file mode 100644 index 38ab6ca282c..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.sort.md +++ /dev/null @@ -1,26 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.sort - -### [torch.sort](https://docs.pytorch.org/docs/stable/generated/torch.sort.html#torch.sort) - -```python -torch.sort(input, dim=-1, descending=False, *, stable=False, out=None) -``` - -### [paddle.compat.sort](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/compat/sort_cn.html#paddle.compat.sort) - -```python -paddle.compat.sort(input, dim=-1, descending=False, stable=False, out=None) -``` - -两者功能和用法一致,但 API 路径不一致,只需修改 torch 前缀为 paddle.compat,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -result = torch.sort(a) - -# Paddle 写法 -result = paddle.compat.sort(a) - -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.split.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.split.md deleted file mode 100644 index caa6329d631..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.split.md +++ /dev/null @@ -1,26 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.split - -### [torch.split](https://docs.pytorch.org/docs/stable/generated/torch.split.html#torch.split) - -```python -torch.split(tensor, split_size_or_sections, dim=0) -``` - -### [paddle.compat.split](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/compat/split_cn.html#paddle.compat.split) - -```python -paddle.compat.split(tensor, split_size_or_sections, dim=0) -``` - -两者功能和用法一致,但 API 路径不一致,只需修改 torch 前缀为 paddle.compat,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -result = torch.split(a, 2) - -# Paddle 写法 -result = paddle.compat.split(a, 2) - -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.unique.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.unique.md deleted file mode 100644 index e8cd3ff5243..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.unique.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.unique - -### [torch.unique](https://docs.pytorch.org/docs/stable/generated/torch.unique.html#torch.unique) - -```python -torch.unique(input, sorted=True, return_inverse=False, return_counts=False, dim=None) -``` - -### [paddle.compat.unique](https://docs.pytorch.org/docs/stable/generated/torch.unique.html) - -```python -paddle.compat.unique(input, sorted=True, return_inverse=False, return_counts=False, dim=None) -``` - -两者功能和用法一致,但 API 路径不一致,只需修改 torch 前缀为 paddle.compat,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -result = torch.unique(x) - -# Paddle 写法 -result = paddle.compat.unique(x) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.utils.data.ChainDataset.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.utils.data.ChainDataset.md deleted file mode 100644 index a61bb0d3435..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.utils.data.ChainDataset.md +++ /dev/null @@ -1,29 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.utils.data.ChainDataset - -### [torch.utils.data.ChainDataset](https://docs.pytorch.org/docs/stable/data.html#torch.utils.data.ChainDataset) - -```python -torch.utils.data.ChainDataset(datasets) -``` - -### [paddle.io.ChainDataset](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/io/ChainDataset_cn.html#paddle.io.ChainDataset) - -```python -paddle.io.ChainDataset(datasets) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -dataset = torch.utils.data.ChainDataset( - [MyIterableDataset(start=3, end=7), MyIterableDataset(start=3, end=7)] -) - -# Paddle 写法 -dataset = paddle.io.ChainDataset( - [MyIterableDataset(start=3, end=7), MyIterableDataset(start=3, end=7)] -) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.utils.data.ConcatDataset.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.utils.data.ConcatDataset.md deleted file mode 100644 index e0a65b209e8..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.utils.data.ConcatDataset.md +++ /dev/null @@ -1,26 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.utils.data.ConcatDataset - -### [torch.utils.data.ConcatDataset](https://docs.pytorch.org/docs/stable/data.html#torch.utils.data.ConcatDataset) - -```python -torch.utils.data.ConcatDataset(datasets) -``` - -### [paddle.io.ConcatDataset](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/io/ConcatDataset_cn.html#paddle.io.ConcatDataset) - -```python -paddle.io.ConcatDataset(datasets) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -dataset = torch.utils.data.ConcatDataset([RandomDataset(2), RandomDataset(2)]) - -# Paddle 写法 -dataset = paddle.io.ConcatDataset([RandomDataset(2), RandomDataset(2)]) - -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.utils.data.Dataset.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.utils.data.Dataset.md deleted file mode 100644 index 2fbab83b089..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.utils.data.Dataset.md +++ /dev/null @@ -1,41 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.utils.data.Dataset - -### [torch.utils.data.Dataset](https://docs.pytorch.org/docs/stable/data.html#torch.utils.data.Dataset) - -```python -torch.utils.data.Dataset(*args, **kwargs) -``` - -### [paddle.io.Dataset](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/io/Dataset_cn.html#paddle.io.Dataset) - -```python -paddle.io.Dataset() -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -class Data(torch.utils.data.Dataset): - def __init__(self): - self.x = [1, 2, 3, 4] - - def __getitem__(self, idx): - return self.x[idx] - - def __len__(self): - return len(self.x) - -# Paddle 写法 -class Data(paddle.io.Dataset): - def __init__(self): - self.x = [1, 2, 3, 4] - - def __getitem__(self, idx): - return self.x[idx] - - def __len__(self): - return len(self.x) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.utils.data.IterableDataset.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.utils.data.IterableDataset.md deleted file mode 100644 index 2bcc0926302..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.utils.data.IterableDataset.md +++ /dev/null @@ -1,39 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.utils.data.IterableDataset - -### [torch.utils.data.IterableDataset](https://docs.pytorch.org/docs/stable/data.html#torch.utils.data.IterableDataset) - -```python -torch.utils.data.IterableDataset(*args, **kwargs) -``` - -### [paddle.io.IterableDataset](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/io/IterableDataset_cn.html#paddle.io.IterableDataset) - -```python -paddle.io.IterableDataset() -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -class MyIterableDataset(torch.utils.data.IterableDataset): - def __init__(self, start, end): - super(MyIterableDataset).__init__() - self.start = start - self.end = end - - def __iter__(self): - return iter(range(self.start, self.end)) - -# Paddle 写法 -class MyIterableDataset(paddle.io.IterableDataset): - def __init__(self, start, end): - super(MyIterableDataset).__init__() - self.start = start - self.end = end - - def __iter__(self): - return iter(range(self.start, self.end)) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.utils.data.RandomSampler.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.utils.data.RandomSampler.md deleted file mode 100644 index e8939f8ea15..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.utils.data.RandomSampler.md +++ /dev/null @@ -1,22 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.utils.data.RandomSampler -### [torch.utils.data.RandomSampler](https://docs.pytorch.org/docs/stable/data.html#torch.utils.data.RandomSampler) -```python -torch.utils.data.RandomSampler(data_source, replacement=False, num_samples=None, generator=None) -``` - -### [paddle.io.RandomSampler](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/io/RandomSampler_cn.html#paddle.io.RandomSampler) -```python -paddle.io.RandomSampler(data_source, replacement=False, num_samples=None, generator=None) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -torch.utils.data.RandomSampler(data_source=[1, 2, 3, 4, 5], replacement=False, num_samples=None, generator=None) - -# Paddle 写法 -paddle.io.RandomSampler(data_source=[1, 2, 3, 4, 5], replacement=False, num_samples=None, generator=None) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.utils.data.Sampler.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.utils.data.Sampler.md deleted file mode 100644 index 98e778c8dc0..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.utils.data.Sampler.md +++ /dev/null @@ -1,41 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.utils.data.Sampler - -### [torch.utils.data.Sampler](https://docs.pytorch.org/docs/stable/data.html#torch.utils.data.Sampler) - -```python -torch.utils.data.Sampler(data_source) -``` - -### [paddle.io.Sampler](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/io/Sampler_cn.html#paddle.io.Sampler) - -```python -paddle.io.Sampler(data_source) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -class MySampler(torch.utils.data.Sampler): - def __init__(self, data_source): - self.data_source = data_source - - def __iter__(self): - return iter(range(len(self.data_source))) - - def __len__(self): - return len(self.data_source) - -# Paddle 写法 -class MySampler(paddle.io.Sampler): - def __init__(self, data_source): - super().__init__(data_source) - - def __iter__(self): - return iter(range(len(self.data_source))) - - def __len__(self): - return len(self.data_source) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.utils.data.SequentialSampler.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.utils.data.SequentialSampler.md deleted file mode 100644 index b7a0eb7f76e..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.utils.data.SequentialSampler.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.utils.data.SequentialSampler - -### [torch.utils.data.SequentialSampler](https://docs.pytorch.org/docs/stable/data.html#torch.utils.data.SequentialSampler) - -```python -torch.utils.data.SequentialSampler(data_source) -``` - -### [paddle.io.SequenceSampler](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/io/SequenceSampler_cn.html#paddle.io.SequenceSampler) - -```python -paddle.io.SequenceSampler(data_source) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -s = torch.utils.data.SequentialSampler(MyDataset()) - -# Paddle 写法 -s = paddle.io.SequenceSampler(MyDataset()) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.utils.data.Subset.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.utils.data.Subset.md deleted file mode 100644 index 6cb6ae48327..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.utils.data.Subset.md +++ /dev/null @@ -1,26 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.utils.data.Subset - -### [torch.utils.data.Subset](https://docs.pytorch.org/docs/stable/data.html#torch.utils.data.Subset) - -```python -torch.utils.data.Subset(dataset, indices) -``` - -### [paddle.io.Subset](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/io/Subset_cn.html#paddle.io.Subset) - -```python -paddle.io.Subset(dataset, indices) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -subset = torch.utils.data.Subset(full_dataset, indices) - -# Paddle 写法 -subset = paddle.io.Subset(full_dataset, indices) - -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.utils.data.default_collate.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.utils.data.default_collate.md deleted file mode 100644 index 304424eabd7..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.utils.data.default_collate.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.utils.data.default_collate - -### [torch.utils.data.default\_collate](https://docs.pytorch.org/docs/stable/data.html#torch.utils.data.default_collate) - -```python -torch.utils.data.default_collate(batch) -``` - -### [paddle.io.dataloader.collate.default_collate_fn](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/io/dataloader/collate/default_collate_fn_cn.html#paddle/io/dataloader/collate/default_collate_fn_cn#cn-api-paddle-io-dataloader-collate-default_collate_fn) - -```python -paddle.io.dataloader.collate.default_collate_fn(batch) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -result = torch.tensor(torch.utils.data.default_collate([0, 1, 2, 3])) - -# Paddle 写法 -result = paddle.tensor(paddle.io.dataloader.collate.default_collate_fn([0, 1, 2, 3])) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.utils.data.get_worker_info.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.utils.data.get_worker_info.md deleted file mode 100644 index 8823f260006..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.utils.data.get_worker_info.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.utils.data.get_worker_info - -### [torch.utils.data.get\_worker\_info](https://docs.pytorch.org/docs/stable/data.html#torch.utils.data.get_worker_info) - -```python -torch.utils.data.get_worker_info() -``` - -### [paddle.io.get\_worker\_info](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/io/get_worker_info_cn.html#paddle.io.get_worker_info) - -```python -paddle.io.get_worker_info() -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -result = torch.utils.data.get_worker_info() - -# Paddle 写法 -result = paddle.io.get_worker_info() -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.utils.data.random_split.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.utils.data.random_split.md deleted file mode 100644 index ccde6d8f6cc..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/torch.utils.data.random_split.md +++ /dev/null @@ -1,47 +0,0 @@ -## [ 仅 API 调用方式不一致 ]torch.utils.data.random_split - -### [torch.utils.data.random\_split](https://docs.pytorch.org/docs/stable/data.html#torch.utils.data.random_split) - -```python -torch.utils.data.random_split(dataset, lengths, generator=) -``` - -### [paddle.io.random\_split](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/io/random_split_cn.html#paddle.io.random_split) - -```python -paddle.io.random_split(dataset, lengths, generator=None) -``` - -两者功能一致,但调用方式不一致,具体如下: - -### 转写示例 - -```python -# PyTorch 写法 -class Data(torch.utils.data.Dataset): - def __init__(self): - self.x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] - - def __getitem__(self, idx): - return self.x[idx] - - def __len__(self): - return len(self.x) - -data = Data() -datasets = torch.utils.data.random_split(data, [3, 7]) - -# Paddle 写法 -class Data(paddle.io.Dataset): - def __init__(self): - self.x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] - - def __getitem__(self, idx): - return self.x[idx] - - def __len__(self): - return len(self.x) - -data = Data() -datasets = paddle.io.random_split(data, [3, 7]) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/transformers.PreTrainedTokenizer.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/transformers.PreTrainedTokenizer.md deleted file mode 100644 index 5a0dd459db2..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/invok_only_diff/transformers.PreTrainedTokenizer.md +++ /dev/null @@ -1,12 +0,0 @@ -## [ 仅 API 调用方式不一致 ]transformers.PreTrainedTokenizer -### [transformers.PreTrainedTokenizer](https://huggingface.co/docs/transformers/main_classes/tokenizer#transformers.PythonBackend) -```python -transformers.PreTrainedTokenizer(**kwargs) -``` - -### [paddleformers.transformers.PretrainedTokenizer](https://github.com/PaddlePaddle/PaddleFormers/blob/8a544d93fab8984c223218d2e31328ffefb01f67/paddleformers/generation/configuration_utils.py#L62) -```python -paddleformers.transformers.PretrainedTokenizer(**kwargs) -``` - -两者功能一致,均接受可变参数 kwargs 初始化。 diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/output_args_type_diff/torch.Tensor.allclose.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/output_args_type_diff/torch.Tensor.allclose.md deleted file mode 100644 index 53ce253a38f..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/output_args_type_diff/torch.Tensor.allclose.md +++ /dev/null @@ -1,32 +0,0 @@ -## [ 返回参数类型不一致 ]torch.Tensor.allclose -### [torch.Tensor.allclose](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.allclose.html#torch.Tensor.allclose) -```python -torch.Tensor.allclose(other, rtol=1e-05, atol=1e-08, equal_nan=False) -``` - -### [paddle.Tensor.allclose](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#allclose-y-rtol-1e-05-atol-1e-08-equal-nan-false-name-none) -```python -paddle.Tensor.allclose(y, rtol=1e-05, atol=1e-08, equal_nan=False, name=None) -``` - -其中 PyTorch 和 Paddle 功能一致,返回类型不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| --------- | ------------ | -- | -| other | y | 输入 Tensor,仅参数名不一致。 | -| rtol | rtol | 相对容差。 | -| atol | atol | 绝对容差。 | -| equal_nan | equal_nan | 如果设置为 True,则两个 NaN 数值将被视为相等。 | -| 返回值 | 返回值 | PyTorch 返回值为标量, Paddle 返回值 0D Tensor。需要转写。| - -### 转写示例 -#### 返回值 -```python -# PyTorch 写法 -x.allclose(y) - -# Paddle 写法 -x.allclose(y).item() -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/output_args_type_diff/torch.Tensor.max.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/output_args_type_diff/torch.Tensor.max.md deleted file mode 100644 index 1d34f58467c..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/output_args_type_diff/torch.Tensor.max.md +++ /dev/null @@ -1,54 +0,0 @@ -## [ 返回参数类型不一致 ]torch.Tensor.max -该 api 有两组参数列表重载,因此有两组差异分析。 - -------------------------------------------------------------------------------------------------- - -### [torch.Tensor.max](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.max.html#torch.Tensor.max) -```python -torch.Tensor.max(dim=None, keepdim=False) -``` - -### [paddle.Tensor.max](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#max-axis-none-keepdim-false-name-none) -```python -paddle.Tensor.max(axis=None, keepdim=False, name=None) -``` - -其中 PyTorch 与 Paddle 指定 `dim` 后返回值不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| dim | axis | 求最大值运算的维度, 仅参数名不一致。 | -| keepdim | keepdim | 是否在输出 Tensor 中保留减小的维度。 | -| 返回值 | 返回值 | 表示返回结果,当指定 dim 后,PyTorch 会返回比较结果和元素索引, Paddle 不会返回元素索引,需要转写。 | - -### 转写示例 -#### 指定 dim 后的返回值 -```python -# PyTorch 写法 -result = x.max(dim=1) - -# Paddle 写法 -result = x.max(dim=1), x.argmax(dim=1) -``` - -------------------------------------------------------------------------------------------------- - -### [torch.Tensor.max](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.max.html#torch.Tensor.max) -```python -torch.Tensor.max(other) -``` - -### [paddle.Tensor.maximum](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#maximum-y-axis-1-name-none-out-none) -```python -paddle.Tensor.maximum(y) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ----------------- | ---------------------- | ------------------------------------ | -| other | y | 输⼊ Tensor ,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/output_args_type_diff/torch.Tensor.min.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/output_args_type_diff/torch.Tensor.min.md deleted file mode 100644 index 6ebc2d00e88..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/output_args_type_diff/torch.Tensor.min.md +++ /dev/null @@ -1,54 +0,0 @@ -## [ 返回参数类型不一致 ]torch.Tensor.min -该 api 有两组参数列表重载,因此有两组差异分析。 - -------------------------------------------------------------------------------------------------- - -### [torch.Tensor.min](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.min.html#torch.Tensor.min) -```python -torch.Tensor.min(dim=None, keepdim=False) -``` - -### [paddle.Tensor.min](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#min-axis-none-keepdim-false-name-none) -```python -paddle.Tensor.min(axis=None, keepdim=False, name=None) -``` - -其中 PyTorch 与 Paddle 指定 `dim` 后返回值不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| dim | axis | 求最小值运算的维度, 仅参数名不一致。 | -| keepdim | keepdim | 是否在输出 Tensor 中保留减小的维度。 | -| 返回值 | 返回值 | 表示返回结果,当指定 dim 后,PyTorch 会返回比较结果和元素索引, Paddle 不会返回元素索引,需要转写。 | - -### 转写示例 -#### 指定 dim 后的返回值 -```python -# PyTorch 写法 -result = x.min(dim=1) - -# Paddle 写法 -result = x.min(dim=1), x.argmin(dim=1) -``` - -------------------------------------------------------------------------------------------------- - -### [torch.Tensor.min](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.min.html#torch.Tensor.min) -```python -torch.Tensor.min(other) -``` - -### [paddle.Tensor.minimum](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#minimum-y-axis-1-name-none-out-none) -```python -paddle.Tensor.minimum(y) -``` - -两者功能一致且参数用法一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ----------------- | ---------------------- | ------------------------------------ | -| other | y | 输⼊ Tensor ,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/output_args_type_diff/torch.Tensor.sort.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/output_args_type_diff/torch.Tensor.sort.md deleted file mode 100644 index 38d1d429bc4..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/output_args_type_diff/torch.Tensor.sort.md +++ /dev/null @@ -1,32 +0,0 @@ -## [ 返回参数类型不一致 ]torch.Tensor.sort -### [torch.Tensor.sort](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.sort.html#torch.Tensor.sort) -```python -torch.Tensor.sort(dim=-1, descending=False, *, stable=False) -``` - -### [paddle.Tensor.sort](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#sort-axis-1-descending-false-name-none) -```python -paddle.Tensor.sort(axis=-1, descending=False, stable=False) -``` - -两者功能一致但返回参数类型不同,PyTorch 返回 (Tensor, LongTensor),Paddle 返回 Tensor 。具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| dim | axis | 指定对输入 Tensor 进行运算的轴。默认值为-1, 仅参数名不一致。 | -| descending | descending | 指定算法排序的方向, 参数完全一致。 | -| stable | stable | 是否使用稳定排序。 | -| 返回值 | 返回值 | 表示以(Tensor, LongTensor)输出的元组,含义是排序后的返回值和对应元素索引。Paddle 无此参数,若返回排序后的元素,需要转写;若需要返回元素和元素索引,需要结合 argsort 进行转写。 | - -### 转写示例 -#### 返回值 -```python -# 若要返回排序后的元素和元素索引,需要结合 argsort 进行转写 -# PyTorch 写法 -input.sort(input, -1, True) - -# Paddle 写法 -input.sort(input, -1, True), input.argsort(input, -1, True) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/output_args_type_diff/torch.histc.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/output_args_type_diff/torch.histc.md deleted file mode 100644 index dec4c88be69..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/output_args_type_diff/torch.histc.md +++ /dev/null @@ -1,33 +0,0 @@ -## [ 返回参数类型不一致 ]torch.histc -### [torch.histc](https://docs.pytorch.org/docs/stable/generated/torch.histc.html#torch.histc) -```python -torch.histc(input, bins=100, min=0, max=0, *, out=None) -``` - -### [paddle.histogram](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/histogram_cn.html#paddle.histogram) -```python -paddle.histogram(input, bins=100, min=0, max=0, name=None) -``` - -其中 PyTorch 与 Paddle 的返回值类型不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | --------------------------------------------------- | -| input | input | 表示输入的 Tensor。 | -| bins | bins | 表示直方图直条的个数。 | -| min | min | 表示范围的下边界。 | -| max | max | 表示范围的上边界。 | -| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 | -| 返回值 | 返回值 | 表示返回值,PyTorch 的返回值类型为 float32,Paddle 的返回值类型为 int64 , 需要转写。 | - -### 转写示例 -#### out:指定输出、返回值类型转换 -```python -# PyTorch 写法 -torch.histc(x, out=y) - -# Paddle 写法 -paddle.assign(paddle.histogram(x).astype('float32'), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.Tensor.count_nonzero.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.Tensor.count_nonzero.md deleted file mode 100644 index cc687a73e63..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.Tensor.count_nonzero.md +++ /dev/null @@ -1,19 +0,0 @@ -## [ paddle 参数更多 ]torch.Tensor.count_nonzero -### [torch.Tensor.count\_nonzero](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.count_nonzero.html#torch.Tensor.count_nonzero) -```python -torch.Tensor.count_nonzero(dim=None) -``` - -### [paddle.Tensor.count\_nonzero](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#count-nonzero-axis-none-keepdim-false-name-none) -```python -paddle.Tensor.count_nonzero(axis=None, keepdim=False, name=None) -``` - -其中 Paddle 相比 PyTorch 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| dim | axis | 表示进行运算的轴,仅参数名不一致。 | -| - | keepdim | 是否在输出 Tensor 中保留减小的维度, PyTorch 无此参数, Paddle 保持默认即可。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.Tensor.cummax.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.Tensor.cummax.md deleted file mode 100644 index 310bf7c74f5..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.Tensor.cummax.md +++ /dev/null @@ -1,19 +0,0 @@ -## [ paddle 参数更多 ]torch.Tensor.cummax -### [torch.Tensor.cummax](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.cummax.html#torch.Tensor.cummax) -```python -torch.Tensor.cummax(dim) -``` - -### [paddle.Tensor.cummax](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#cummax-x-axis-none-dtype-int64-name-none) -```python -paddle.Tensor.cummax(axis=None, dtype=None, name=None) -``` - -两者功能一致,其中 Paddle 相比 PyTorch 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ------------------------------ | -| dim | axis | 需要累加的维度,仅参数名不一致。 | -| - | dtype | 输出 Tensor 的数据类型。PyTorch 无此参数, Paddle 保持默认即可。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.Tensor.cummin.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.Tensor.cummin.md deleted file mode 100644 index 2b802f4ad71..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.Tensor.cummin.md +++ /dev/null @@ -1,19 +0,0 @@ -## [ paddle 参数更多 ]torch.Tensor.cummin -### [torch.Tensor.cummin](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.cummin.html#torch.Tensor.cummin) -```python -torch.Tensor.cummin(dim) -``` - -### [paddle.Tensor.cummin](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#cummin-x-axis-none-dtype-int64-name-none) -```python -paddle.Tensor.cummin(axis=None, dtype=None, name=None) -``` - -两者功能一致,其中 Paddle 相比 PyTorch 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ------------------------------ | -| dim | axis | 需要累加的维度,仅参数名不一致。 | -| - | dtype | 输出 Tensor 的数据类型。PyTorch 无此参数, Paddle 保持默认即可。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.Tensor.fill_diagonal_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.Tensor.fill_diagonal_.md deleted file mode 100644 index 5f3025ad181..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.Tensor.fill_diagonal_.md +++ /dev/null @@ -1,20 +0,0 @@ -## [ paddle 参数更多 ]torch.Tensor.fill_diagonal_ -### [torch.Tensor.fill\_diagonal\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.fill_diagonal_.html#torch.Tensor.fill_diagonal_) -```python -torch.Tensor.fill_diagonal_(fill_value, wrap=False) -``` - -### [paddle.Tensor.fill\_diagonal\_](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#fill-diagonal-x-value-offset-0-wrap-false-name-none) -```python -paddle.Tensor.fill_diagonal_(value, offset=0, wrap=False, name=None) -``` - -两者功能一致且参数用法一致,paddle 参数更多,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ---------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------- | -| fill_value | value | 以输入 value 值修改原始 Tensor 对角线元素,仅参数名不一致。 | -| - | offset | 所选取对角线相对原始主对角线位置的偏移量,正向右上方偏移,负向左下方偏移,默认为 0。PyTorch 无此参数, Paddle 保持默认即可。 | -| wrap | wrap | 对于 2 维 Tensor,height>width 时是否循环填充,默认为 False。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.Tensor.logcumsumexp.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.Tensor.logcumsumexp.md deleted file mode 100644 index 5721d7ef790..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.Tensor.logcumsumexp.md +++ /dev/null @@ -1,19 +0,0 @@ -## [ paddle 参数更多 ]torch.Tensor.logcumsumexp -### [torch.Tensor.logcumsumexp](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.logcumsumexp.html#torch.Tensor.logcumsumexp) -```python -torch.Tensor.logcumsumexp(dim) -``` - -### [paddle.Tensor.logcumsumexp](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#logcumsumexp-x-axis-none-dtype-none-name-none) -```python -paddle.Tensor.logcumsumexp(axis=None, dtype=None, name=None) -``` - -两者功能一致,其中 Paddle 相比 PyTorch 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ---------------------------------------------------------------------------------------------------------------------------------------------- | -| dim | axis | 指明需要计算的维,仅参数名不一致。 paddle 中默认 None。 | -| - | dtype | 输出 Tensor 的数据类型,支持 float32、float64。如果指定了,那么在执行操作之前,输入张量将被转换为 dtype,PyTorch 无此参数,Paddle 保持默认即可。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.Tensor.median.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.Tensor.median.md deleted file mode 100644 index 1eeadcd6e69..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.Tensor.median.md +++ /dev/null @@ -1,20 +0,0 @@ -## [ paddle 参数更多 ]torch.Tensor.median -### [torch.Tensor.median](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.median.html#torch.Tensor.median) -```python -torch.Tensor.median(dim=None, keepdim=False) -``` - -### [paddle.Tensor.median](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#median-axis-none-keepdim-false-name-none) -```python -paddle.Tensor.median(axis=None, keepdim=False, mode='avg', name=None) -``` - -Paddle 相比 PyTorch 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | -- | -| dim | axis | 指定对 x 进行计算的轴,仅参数名不一致。 | -| - | mode | 当 x 在所需要计算的轴上有偶数个元素时,选择使用平均值或最小值确定中位数的值, PyTorch 无此参数, Paddle 需设置为 'min'。 | -| keepdim | keepdim | 是否在输出 Tensor 中保留减小的维度。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.Tensor.take.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.Tensor.take.md deleted file mode 100644 index 4a86fa8767c..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.Tensor.take.md +++ /dev/null @@ -1,27 +0,0 @@ -## [ paddle 参数更多 ]torch.Tensor.take -### [torch.Tensor.take](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.take.html#torch.Tensor.take) -```python -torch.Tensor.take(index) -``` - -### [paddle.Tensor.take](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#take-index-mode-raise-name-none) -```python -paddle.Tensor.take(index, mode='raise', name=None) -``` - -两者功能一致,仅参数名不一致,其中 Paddle 相比 PyTorch 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ------------------------------------------------------------ | -| index | index | 表示输入 tensor 的索引,参数完全一致。 | -| - | mode | 指定索引越界的 3 种处理方式,PyTorch 无此参数,Paddle 保持默认即可。 | - -注: - -三种 mode - -- `mode='raise'`,若索引越界,通过最后调用的 `paddle.index_select` 抛出错误 (默认); -- `mode='wrap'`,通过取余约束越界的 indices; -- `mode='clip'`,通过 `paddle.clip` 将两端超出范围的索引约束到 [0, max_index-1]。 diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.Tensor.uniform_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.Tensor.uniform_.md deleted file mode 100644 index f19de2fcce9..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.Tensor.uniform_.md +++ /dev/null @@ -1,20 +0,0 @@ -## [ paddle 参数更多 ]torch.Tensor.uniform_ -### [torch.Tensor.uniform\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.uniform_.html#torch.Tensor.uniform_) -```python -torch.Tensor.uniform_(from=0, to=1) -``` - -### [paddle.Tensor.uniform\_](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#uniform-min-1-0-max-1-0-seed-0-name-none) -```python -paddle.Tensor.uniform_(min=- 1.0, max=1.0, seed=0, name=None) -``` - -Paddle 相比 PyTorch 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ------------------------------------------------------------ | -| from | min | 表示生成元素的起始位置,仅参数名不一致。 | -| to | max | 表示生成元素的结束位置,仅参数名不一致。 | -| - | seed | 表示用于生成随机数的随机种子,PyTorch 无此参数,Paddle 保持默认即可。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.count_nonzero.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.count_nonzero.md deleted file mode 100644 index a189a2b508a..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.count_nonzero.md +++ /dev/null @@ -1,23 +0,0 @@ -## [ paddle 参数更多 ]torch.count_nonzero -### [torch.count\_nonzero](https://docs.pytorch.org/docs/stable/generated/torch.count_nonzero.html#torch.count_nonzero) -```python -torch.count_nonzero(input, dim=None) -``` - -### [paddle.count\_nonzero](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/count_nonzero_cn.html#paddle.count_nonzero) -```python -paddle.count_nonzero(x, - axis=None, - keepdim=False, - name=None) -``` - -其中 Paddle 相比 PyTorch 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| dim | axis | 表示进行运算的轴,仅参数名不一致。 | -| - | keepdim | 是否在输出 Tensor 中保留减小的维度, PyTorch 无此参数, Paddle 保持默认即可。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.nn.LPPool1d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.nn.LPPool1d.md deleted file mode 100644 index 5742efb735c..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.nn.LPPool1d.md +++ /dev/null @@ -1,23 +0,0 @@ -## [ paddle 参数更多 ]torch.nn.LPPool1d -### [torch.nn.LPPool1d](https://docs.pytorch.org/docs/stable/generated/torch.nn.LPPool1d.html#torch.nn.LPPool1d) -```python -torch.nn.LPPool1d(norm_type, kernel_size, stride=None, ceil_mode=False) -``` - -### [paddle.nn.LPPool1D](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/LPPool1D_cn.html#paddle.nn.LPPool1D) -```python -paddle.nn.LPPool1D(norm_type, kernel_size, stride=None, padding=0, ceil_mode=False, data_format='NCL', name=None) -``` - -其中 Paddle 参数更多,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| norm_type | norm_type | 幂平均池化的指数,不可以为 0 。 | -| kernel_size | kernel_size | 池化核的尺寸大小。| -| stride | stride | 池化操作步长。| -| ceil_mode | ceil_mode | 是否用 `ceil` 函数计算输出的 height 和 width,如果设置为 `False`,则使用 `floor` 函数来计算,默认为 `False`。| -| - | padding | 池化补零的方式。PyTorch 无此参数,Paddle 保持默认即可。| -| - | data_format | 输入和输出的数据格式,可以是"NCL"和"NLC"。PyTorch 无此参数,Paddle 保持默认即可。| diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.nn.LPPool2d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.nn.LPPool2d.md deleted file mode 100644 index e872deb3896..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.nn.LPPool2d.md +++ /dev/null @@ -1,23 +0,0 @@ -## [ paddle 参数更多 ]torch.nn.LPPool2d -### [torch.nn.LPPool2d](https://docs.pytorch.org/docs/stable/generated/torch.nn.LPPool2d.html#torch.nn.LPPool2d) -```python -torch.nn.LPPool2d(norm_type, kernel_size, stride=None, ceil_mode=False) -``` - -### [paddle.nn.LPPool2D](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/LPPool2D_cn.html#paddle.nn.LPPool2D) -```python -paddle.nn.LPPool2D(norm_type, kernel_size, stride=None, padding=0, ceil_mode=False, data_format='NCHW', name=None) -``` - -其中 Paddle 参数更多,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| norm_type | norm_type | 幂平均池化的指数,不可以为 0 。 | -| kernel_size | kernel_size | 池化核的尺寸大小。| -| stride | stride | 池化操作步长。| -| ceil_mode | ceil_mode | 是否用 `ceil` 函数计算输出的 height 和 width,如果设置为 `False`,则使用 `floor` 函数来计算,默认为 `False`。| -| - | padding | 池化补零的方式。PyTorch 无此参数,Paddle 保持默认即可。| -| - | data_format | 输入和输出的数据格式,可以是 `NCHW` 和 `NHWC` 。PyTorch 无此参数,Paddle 保持默认即可。| diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.nn.functional.conv_transpose1d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.nn.functional.conv_transpose1d.md deleted file mode 100644 index 1f13eb58e48..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.nn.functional.conv_transpose1d.md +++ /dev/null @@ -1,43 +0,0 @@ -## [ paddle 参数更多 ]torch.nn.functional.conv_transpose1d -### [torch.nn.functional.conv\_transpose1d](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.conv_transpose1d.html#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/develop/api/paddle/nn/functional/conv1d_transpose_cn.html#paddle.nn.functional.conv1d_transpose) -```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 。 | -| weight | weight | 表示权重 Tensor 。 | -| bias | bias | 表示偏置项 。 | -| stride | stride | 表示步长 。 | -| padding | padding | 表示填充大小 。 | -| output_padding | output_padding | 表示输出形状上尾部一侧额外添加的大小 。 | -| groups | groups | 表示分组数 。 | -| dilation | dilation | 表示空洞大小 。 | -| - | output_size | 表示输出 Tensor 的尺寸, PyTorch 无此参数, Paddle 保持默认即可。 | -| - | data_format | 表示输入 Tensor 的数据格式, PyTorch 无此参数, Paddle 保持默认即可。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.nn.functional.conv_transpose2d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.nn.functional.conv_transpose2d.md deleted file mode 100644 index a6a2e976c11..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.nn.functional.conv_transpose2d.md +++ /dev/null @@ -1,43 +0,0 @@ -## [ paddle 参数更多 ]torch.nn.functional.conv_transpose2d -### [torch.nn.functional.conv\_transpose2d](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.conv_transpose2d.html#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/develop/api/paddle/nn/functional/conv2d_transpose_cn.html#paddle.nn.functional.conv2d_transpose) -```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 。 | -| weight | weight | 表示权重 Tensor 。 | -| bias | bias | 表示偏置项 。 | -| stride | stride | 表示步长 。 | -| padding | padding | 表示填充大小 。 | -| output_padding | output_padding | 表示输出形状上尾部一侧额外添加的大小 。 | -| groups | groups | 表示分组数 。 | -| dilation | dilation | 表示空洞大小 。 | -| - | data_format | 表示输入 Tensor 的数据格式, PyTorch 无此参数, Paddle 保持默认即可。 | -| - | output_size | 表示输出 Tensor 的尺寸, PyTorch 无此参数, Paddle 保持默认即可。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.nn.functional.conv_transpose3d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.nn.functional.conv_transpose3d.md deleted file mode 100644 index 0efc6ad26a5..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.nn.functional.conv_transpose3d.md +++ /dev/null @@ -1,43 +0,0 @@ -## [ paddle 参数更多 ]torch.nn.functional.conv_transpose3d -### [torch.nn.functional.conv\_transpose3d](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.conv_transpose3d.html#torch.nn.functional.conv_transpose3d) -```python -torch.nn.functional.conv_transpose3d(input, - weight, - bias=None, - stride=1, - padding=0, - output_padding=0, - groups=1, - dilation=1) -``` - -### [paddle.nn.functional.conv3d\_transpose](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/conv3d_transpose_cn.html#paddle.nn.functional.conv3d_transpose) -```python -paddle.nn.functional.conv3d_transpose(x, - weight, - bias=None, - stride=1, - padding=0, - output_padding=0, - groups=1, - dilation=1, - output_size=None, - data_format='NCDHW', - name=None) -``` - -其中 Paddle 相比 PyTorch 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor 。 | -| weight | weight | 表示权重 Tensor 。 | -| bias | bias | 表示偏置项 。 | -| stride | stride | 表示步长 。 | -| padding | padding | 表示填充大小 。 | -| output_padding | output_padding | 表示输出形状上尾部一侧额外添加的大小 。 | -| groups | groups | 表示分组数 。 | -| dilation | dilation | 表示空洞大小 。 | -| - | output_size | 表示输出 Tensor 的尺寸, PyTorch 无此参数, Paddle 保持默认即可。 | -| - | data_format | 表示输入 Tensor 的数据格式, PyTorch 无此参数, Paddle 保持默认即可。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.nn.functional.group_norm.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.nn.functional.group_norm.md deleted file mode 100644 index 96714172304..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.nn.functional.group_norm.md +++ /dev/null @@ -1,23 +0,0 @@ -## [ paddle 参数更多 ]torch.nn.functional.group_norm -### [torch.nn.functional.group\_norm](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.group_norm.html#torch.nn.functional.group_norm) -```python -torch.nn.functional.group_norm(input, num_groups, weight=None, bias=None, eps=1e-05) -``` - -### [paddle.nn.functional.group\_norm](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/group_norm_cn.html#id0) -```python -paddle.nn.functional.group_norm(x, num_groups, epsilon=1e-05, weight=None, bias=None, data_format='NCHW', name=None) -``` - -Paddle 相比 PyTorch 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| num_groups | num_groups | 输入的通道数。 | -| weight | weight | 权重的 Tensor。 | -| bias | bias | 偏置的 Tensor。 | -| eps | epsilon | 为防止方差除零增加的一个很小的值,仅参数名不一致。 | -| - | data_format | 输入的数据格式, PyTorch 无此参数, Paddle 保持默认即可。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.nn.functional.lp_pool1d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.nn.functional.lp_pool1d.md deleted file mode 100644 index d7a5509cdac..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.nn.functional.lp_pool1d.md +++ /dev/null @@ -1,24 +0,0 @@ -## [ paddle 参数更多 ]torch.nn.functional.lp_pool1d -### [torch.nn.functional.lp\_pool1d](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.lp_pool1d.html#torch.nn.functional.lp_pool1d) -```python -torch.nn.functional.lp_pool1d(input, norm_type, kernel_size, stride=None, ceil_mode=False) -``` - -### [paddle.nn.functional.lp\_pool1d](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/lp_pool1d_cn.html#paddle.nn.functional.lp_pool1d) -```python -paddle.nn.functional.lp_pool1d(x, norm_type, kernel_size, stride=None, padding=0, ceil_mode=False, data_format="NCL", name=None) -``` - -其中 Paddle 参数更多,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| norm_type | norm_type | 幂平均池化的指数,不可以为 0 。 | -| kernel_size | kernel_size | 池化核的尺寸大小。| -| stride | stride | 池化操作步长。| -| ceil_mode | ceil_mode | 是否用 `ceil` 函数计算输出的 height 和 width,如果设置为 `False`,则使用 `floor` 函数来计算,默认为 `False`。| -| - | padding | 池化补零的方式。PyTorch 无此参数,Paddle 保持默认即可。| -| - | data_format | 输入和输出的数据格式,可以是"NCL"和"NLC"。PyTorch 无此参数,Paddle 保持默认即可。| diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.nn.functional.lp_pool2d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.nn.functional.lp_pool2d.md deleted file mode 100644 index 1856d313b68..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.nn.functional.lp_pool2d.md +++ /dev/null @@ -1,24 +0,0 @@ -## [ paddle 参数更多 ]torch.nn.functional.lp_pool2d -### [torch.nn.functional.lp\_pool2d](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.lp_pool2d.html#torch.nn.functional.lp_pool2d) -```python -torch.nn.functional.lp_pool2d(input, norm_type, kernel_size, stride=None, ceil_mode=False) -``` - -### [paddle.nn.functional.lp\_pool2d](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/lp_pool2d_cn.html#paddle.nn.functional.lp_pool2d) -```python -paddle.nn.functional.lp_pool2d(x, norm_type, kernel_size, stride=None, padding=0, ceil_mode=False, data_format="NCWH", name=None) -``` - -其中 Paddle 参数更多,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| norm_type | norm_type | 幂平均池化的指数,不可以为 0 。 | -| kernel_size | kernel_size | 池化核的尺寸大小。| -| stride | stride | 池化操作步长。| -| ceil_mode | ceil_mode | 是否用 `ceil` 函数计算输出的 height 和 width,如果设置为 `False`,则使用 `floor` 函数来计算,默认为 `False`。| -| - | padding | 池化补零的方式。PyTorch 无此参数,Paddle 保持默认即可。| -| - | data_format | 输入和输出的数据格式,可以是 `NCHW` 和 `NHWC` 。PyTorch 无此参数,Paddle 保持默认即可。| diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.nn.functional.pixel_shuffle.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.nn.functional.pixel_shuffle.md deleted file mode 100644 index fdddda31eef..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.nn.functional.pixel_shuffle.md +++ /dev/null @@ -1,19 +0,0 @@ -## [ paddle 参数更多 ]torch.nn.functional.pixel_shuffle -### [torch.nn.functional.pixel\_shuffle](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.pixel_shuffle.html#torch.nn.functional.pixel_shuffle) -```python -torch.nn.functional.pixel_shuffle(input, upscale_factor) -``` - -### [paddle.nn.functional.pixel\_shuffle](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/pixel_shuffle_cn.html#paddle.nn.functional.pixel_shuffle) -```python -paddle.nn.functional.pixel_shuffle(x, upscale_factor, data_format='NCHW', name=None) -``` - -两者功能一致,其中 Paddle 相比 PyTorch 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor,仅参数名不一致。 | -| upscale_factor | upscale_factor | 增加空间分辨率的增加因子。 | -| - | data_format | 指定输入张量格式, PyTorch 无此参数, Paddle 保持默认即可 。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.nn.functional.pixel_unshuffle.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.nn.functional.pixel_unshuffle.md deleted file mode 100644 index ea6fe2cd833..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.nn.functional.pixel_unshuffle.md +++ /dev/null @@ -1,20 +0,0 @@ -## [ paddle 参数更多 ]torch.nn.functional.pixel_unshuffle -### [torch.nn.functional.pixel\_unshuffle](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.pixel_unshuffle.html#torch.nn.functional.pixel_unshuffle) -```python -torch.nn.functional.pixel_unshuffle(input, downscale_factor) -``` - -### [paddle.nn.functional.pixel\_unshuffle](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/pixel_unshuffle_cn.html#paddle.nn.functional.pixel_unshuffle) -```python -paddle.nn.functional.pixel_unshuffle(x, downscale_factor, data_format='NCHW', name=None) -``` - -两者功能一致,其中 Paddle 相比 PyTorch 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor,仅参数名不一致。 | -| downscale_factor | downscale_factor | 减小空间分辨率的减小因子。 | -| - | data_format | 指定输入张量格式,PyTorch 无此参数,Paddle 保持默认即可。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.nn.functional.prelu.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.nn.functional.prelu.md deleted file mode 100644 index e7c012e5d4c..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.nn.functional.prelu.md +++ /dev/null @@ -1,24 +0,0 @@ -## [ paddle 参数更多 ]torch.nn.functional.prelu -### [torch.nn.functional.prelu](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.prelu.html#torch.nn.functional.prelu) -```python -torch.nn.functional.prelu(input, - weight) -``` - -### [paddle.nn.functional.prelu](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/prelu_cn.html#paddle.nn.functional.prelu) -```python -paddle.nn.functional.prelu(x, - weight, - data_format='NCHW', - name=None) -``` - -其中 Paddle 相比 PyTorch 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor 。 | -| weight | weight | 表示激活公式中的可训练权重 。 | -| - | data_format | 表示输入 Tensor 的数据格式, PyTorch 无此参数, Paddle 保持默认即可。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.optim.Optimizer.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.optim.Optimizer.md deleted file mode 100644 index 86d723e5b9f..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.optim.Optimizer.md +++ /dev/null @@ -1,29 +0,0 @@ -## [ paddle 参数更多 ]torch.optim.Optimizer -### [torch.optim.Optimizer](https://docs.pytorch.org/docs/stable/optim.html#torch.optim.Optimizer) -```python -torch.optim.Optimizer(params, - defaults) -``` - -### [paddle.optimizer.Optimizer](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/optimizer/Optimizer_cn.html#paddle.optimizer.Optimizer) -```python -paddle.optimizer.Optimizer(learning_rate=0.001, - epsilon=1e-08, - parameters=None, - weight_decay=None, - grad_clip=None, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,其 `defaults` 可以支持各种参数,但一般只会转写 API 名称,不会转写参数。 - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ----------------------------------- | ------------ | ----------------------------------------------------------------------- | -| params | parameters | 表示指定优化器需要优化的参数,仅参数名不一致。 | -| defaults | - | 表示含有优化选项和其默认值的字典,Paddle 无此参数。 | -| - | learning_rate | 学习率,用于参数更新的计算。PyTorch 无此参数,但 defaults 可含有 lr 与之对应。 | -| - | weight_decay | 表示权重衰减系数。 PyTorch 无此参数,但 defaults 可含有 weight_decay 与之对应。 | -| - | epsilon | 保持数值稳定性的短浮点类型值。PyTorch 无此参数,但 defaults 可含有 eps 与之对应。 | -| - | grad_clip | 梯度裁剪的策略。 PyTorch 无此参数,Paddle 保持默认即可。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.utils.data.BatchSampler.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.utils.data.BatchSampler.md deleted file mode 100644 index 44175609ca1..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/paddle_more_args/torch.utils.data.BatchSampler.md +++ /dev/null @@ -1,27 +0,0 @@ -## [ paddle 参数更多 ]torch.utils.data.BatchSampler -### [torch.utils.data.BatchSampler](https://docs.pytorch.org/docs/stable/data.html#torch.utils.data.BatchSampler) -```python -torch.utils.data.BatchSampler(sampler, - batch_size, - drop_last) -``` - -### [paddle.io.BatchSampler](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/io/BatchSampler_cn.html#paddle.io.BatchSampler) -```python -paddle.io.BatchSampler(dataset=None, - sampler=None, - shuffle=False, - batch_size=1, - drop_last=False) -``` - -其中 Paddle 相比 PyTorch 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| --------- | -------------| ---------- | -| sampler | sampler | 底层取样器,可为 Sampler 或 Iterable 数据类型。 | -| batch_size | batch_size | 每 mini-batch 中包含的样本数。PyTorch 无默认值,Paddle 默认值为 1。 | -| drop_last | drop_last | 是否需要丢弃最后无法凑整一个 mini-batch 的样本。PyTorch 无默认值,Paddle 默认值为 False。 | -| - | dataset | 此参数必须是 paddle.io.Dataset 或 paddle.io.IterableDataset 的一个子类实例或实现了 __len__ 的 Python 对象,用于生成样本下标,PyTorch 无此参数,Paddle 保持默认即可。 | -| - | shuffle | 是否需要在生成样本下标时打乱顺序,PyTorch 无此参数,Paddle 保持默认即可。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.Tensor.backward.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.Tensor.backward.md deleted file mode 100644 index 9c6969c2ffe..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.Tensor.backward.md +++ /dev/null @@ -1,21 +0,0 @@ -## [ torch 参数更多 ]torch.Tensor.backward -### [torch.Tensor.backward](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.backward.html#torch.Tensor.backward) -```python -torch.Tensor.backward(gradient=None, retain_graph=None, create_graph=False, inputs=None) -``` - -### [paddle.Tensor.backward](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#backward-grad-tensor-none-retain-graph-false) -```python -paddle.Tensor.backward(grad_tensor=None, retain_graph=False) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ----------------------------------------------------------------------------------- | -| gradient | grad_tensor | 当前 Tensor 的初始梯度值。仅参数名不一致。 | -| retain_graph | retain_graph | 是否保留计算图。 | -| create_graph | - | 是否创建梯度图,Paddle 无此参数,暂无转写方式。 | -| inputs | - | 计算的起始输入 tensor,Paddle 无此参数,暂无转写方式。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.Tensor.bernoulli_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.Tensor.bernoulli_.md deleted file mode 100644 index c197b00217f..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.Tensor.bernoulli_.md +++ /dev/null @@ -1,20 +0,0 @@ -## [ torch 参数更多 ]torch.Tensor.bernoulli_ -### [torch.Tensor.bernoulli\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.bernoulli_.html#torch.Tensor.bernoulli_) -```python -torch.Tensor.bernoulli_(p=0.5, *, generator=None) -``` - -### [paddle.Tensor.bernoulli\_](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#bernoulli-p-0-5-name-none) -```python -paddle.Tensor.bernoulli_(p=0.5, name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ----------------------------------------------------------------------------- | -| p | p | 可选,伯努利参数 p。 | -| generator | - | 用于采样的伪随机数生成器, Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.Tensor.exponential_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.Tensor.exponential_.md deleted file mode 100644 index 929959d1320..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.Tensor.exponential_.md +++ /dev/null @@ -1,19 +0,0 @@ -## [ torch 参数更多 ]torch.Tensor.exponential\_ -### [torch.Tensor.exponential\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.exponential_.html#torch.Tensor.exponential_) -```python -torch.Tensor.exponential_(lambd=1, *, generator=None) -``` - -### [paddle.Tensor.exponential\_](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#exponential-lam-1-0-name-none) -```python -paddle.Tensor.exponential_(lam=1.0, name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| --------- | ------------ | ----------------------------------------------------------------------------------- | -| lambd | lam | 指数分布的 λ 参数,仅参数名不一致。 | -| generator | - | 用于采样的伪随机数生成器,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.Tensor.geometric_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.Tensor.geometric_.md deleted file mode 100644 index 25f729c7992..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.Tensor.geometric_.md +++ /dev/null @@ -1,19 +0,0 @@ -## [ torch 参数更多 ]torch.Tensor.geometric_ -### [torch.Tensor.geometric\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.geometric_.html#torch.Tensor.geometric_) -```python -torch.Tensor.geometric_(p, *, generator=None) -``` - -### [paddle.Tensor.geometric_](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor_cn.html) -```python -paddle.Tensor.geometric_(probs, name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ----------------------------- | -| p | probs | 每次伯努利试验中成功的概率,仅参数名不一致。 | -| generator | - | 用于采样的伪随机数生成器, Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.Tensor.index_add.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.Tensor.index_add.md deleted file mode 100644 index df83ffacab4..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.Tensor.index_add.md +++ /dev/null @@ -1,31 +0,0 @@ -## [ torch 参数更多 ]torch.Tensor.index_add -### [torch.Tensor.index\_add](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.index_add.html#torch.Tensor.index_add) -```python -torch.Tensor.index_add(dim, index, source, *, alpha=1) -``` - -### [paddle.Tensor.index\_add](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#index-add-index-axis-value-name-none) -```python -paddle.Tensor.index_add(index, axis, value, name=None) -``` - -其中 PyTorch 与 Paddle 参数有差异,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| dim | axis | 表示进行运算的轴,仅参数名不一致。 | -| index | index | 包含索引下标的 1-D Tensor。 | -| source | value | 被加的 Tensor,仅参数名不一致。 | -| alpha | - | source 的 缩放倍数, Paddle 无此参数,需要转写。Paddle 应将 alpha 和 source 的乘积作为 value。 | - - -### 转写示例 -#### alpha:source 的缩放倍数 -```python -# PyTorch 写法 -x.index_add(dim=1, index=index, source=source, alpha=alpha) - -# Paddle 写法 -x.index_add(index=index, axis=1, value=alpha*source) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.Tensor.index_add_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.Tensor.index_add_.md deleted file mode 100644 index 6d9cca8f14f..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.Tensor.index_add_.md +++ /dev/null @@ -1,32 +0,0 @@ -## [ torch 参数更多 ]torch.Tensor.index_add_ -### [torch.Tensor.index\_add\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.index_add_.html#torch.Tensor.index_add_) -```python -torch.Tensor.index_add_(dim, index, source, *, alpha=1) -``` - -### [paddle.Tensor.index_add_]() -```python -paddle.Tensor.index_add_(index, axis, value) -``` - -其中 PyTorch 与 Paddle 参数有差异,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| dim | axis | 表示进行运算的轴,仅参数名不一致。 | -| index | index | 包含索引下标的 1-D Tensor。 | -| source | value | 被加的 Tensor,仅参数名不一致。 | -| alpha | - | source 的 缩放倍数, Paddle 无此参数,需要转写。Paddle 应将 alpha 和 source 的乘积作为 value。 | - - -### 转写示例 -#### alpha:source 的缩放倍数 -```python -# PyTorch 写法 -x.index_add_(dim=1, index=index, source=source, alpha=alpha) - -# Paddle 写法 -x.index_add_(index=index, axis=1, value=alpha*source) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.Tensor.nanmean.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.Tensor.nanmean.md deleted file mode 100644 index efc294077cb..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.Tensor.nanmean.md +++ /dev/null @@ -1,36 +0,0 @@ -## [ torch 参数更多 ]torch.Tensor.nanmean -### [torch.Tensor.nanmean](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.nanmean.html#torch.Tensor.nanmean) -```python -torch.Tensor.nanmean(dim=None, - keepdim=False, - *, - dtype=None) -``` - -### [paddle.Tensor.nanmean](暂无对应文档) -```python -paddle.Tensor.nanmean(axis=None, - keepdim=False, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| dim | axis | 表示进行运算的轴,可选项,仅参数名不一致。 | -| keepdim | keepdim | 表示是否保留计算后的维度,可选项。 | -| dtype | - | 指定输出数据类型,可选项,PyTorch 默认值为 None,Paddle 无此参数,需要转写。 | - -### 转写示例 -#### dtype:指定数据类型 -```python -# PyTorch 写法 -x.nanmean(dim=-1, dtype=torch.float32) - -# Paddle 写法 -x.astype('float32') -paddle.assign(x.nanmean(dim=-1),y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.Tensor.new_tensor.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.Tensor.new_tensor.md deleted file mode 100644 index 8b422954e5a..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.Tensor.new_tensor.md +++ /dev/null @@ -1,40 +0,0 @@ -## [ torch 参数更多 ]torch.Tensor.new_tensor -### [torch.Tensor.new\_tensor](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.new_tensor.html#torch.Tensor.new_tensor) -```python -torch.Tensor.new_tensor(data, *, dtype=None, device=None, requires_grad=False) -``` - -### [paddle.to\_tensor](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/to_tensor_cn.html#paddle.to_tensor) -```python -paddle.to_tensor(data, dtype=None, place=None, stop_gradient=True) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------------ | -| data | data | 数据内容。 | -| dtype | dtype | 表示输出 Tensor 类型,如果没有指定,默认使用当前对象的 dtype,需要转写。 | -| device | place | 创建 tensor 的设备位置,仅参数名不一致。 | -| requires_grad | stop_gradient | 表示是否计算梯度,两者参数功能相反,需要转写。 | - -### 转写示例 -#### dtype:数据类型 -```python -# PyTorch 写法 -y = x.new_tensor(data) - -# Paddle 写法 -y = paddle.to_tensor(data, dtype=x.dtype) -``` - -#### requires_grad:是否求梯度 -```python -# PyTorch 写法 -y = x.new_tensor(data, requires_grad=True) - -# Paddle 写法 -y = paddle.to_tensor(data, stop_gradient=False) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.Tensor.numpy.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.Tensor.numpy.md deleted file mode 100644 index 6336d655e21..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.Tensor.numpy.md +++ /dev/null @@ -1,20 +0,0 @@ -## [ torch 参数更多 ]torch.Tensor.numpy -### [torch.Tensor.numpy](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.numpy.html#torch.Tensor.numpy) -```python -torch.Tensor.numpy(*, force=False) -``` - -### [paddle.Tensor.numpy](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#numpy) -```python -paddle.Tensor.numpy() -``` - -两者功能一致,用于将当前 Tensor 转化为 numpy.ndarray。 - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ---------------------------------------------------------------- | -| force | - | 若 force 为默认,则返回的 ndarray 和 tensor 将共享它们的存储空间。Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。| diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.Tensor.resize_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.Tensor.resize_.md deleted file mode 100644 index 4b622a044a7..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.Tensor.resize_.md +++ /dev/null @@ -1,33 +0,0 @@ -## [ torch 参数更多 ]torch.Tensor.resize\_ - -### [torch.Tensor.resize\_](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.resize_.html#torch.Tensor.resize_) -```python -torch.Tensor.resize_(*sizes, memory_format=torch.contiguous_format) -``` - -### [paddle.Tensor.resize\_](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#resize-shape-fill-zero-false-name-none) -```python -paddle.Tensor.resize_(shape, fill_zero=False, name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| *sizes | shape | 设置的目标形状,torch 支持可变参数或 list/tuple,paddle 仅支持 list/tuple。对于可变参数的用法,需要转写。 | -| memory_format | - | 设置后的内存形式,Paddle 无此参数,暂无转写方式。 | -| - | fill_zero | 当目标形状的元素个数大于``self`` 的元素个数时,是否用 0 填充新元素,若 False 则新元素的值不确定,PyTorch 无此参数,Paddle 保持默认即可。 | - -### 转写示例 -#### *sizes: 目标形状,可变参数用法 -```python -# pytorch -x = torch.randn(2, 3) -x.resize_(4, 4) - -# paddle -x = paddle.randn([2, 3]) -x.resize_((4, 4)) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.Tensor.type.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.Tensor.type.md deleted file mode 100644 index eff92e58d73..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.Tensor.type.md +++ /dev/null @@ -1,19 +0,0 @@ -## [ torch 参数更多 ]torch.Tensor.type -### [torch.Tensor.type](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.type.html#torch.Tensor.type) -```python -torch.Tensor.type(dtype=None, non_blocking=False, **kwargs) -``` - -### [paddle.Tensor.astype](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#astype-dtype) -```python -paddle.Tensor.astype(dtype) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------ | ------------ | ------------------------------------------------------------ | -| dtype | dtype | 转换后的 dtype。 | -| non_blocking | - | 控制 cpu 和 gpu 数据的异步复制,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.Tensor.unique.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.Tensor.unique.md deleted file mode 100644 index e1ad0bf5d6f..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.Tensor.unique.md +++ /dev/null @@ -1,21 +0,0 @@ -## [ torch 参数更多 ]torch.Tensor.unique -### [torch.Tensor.unique](https://docs.pytorch.org/docs/stable/generated/torch.Tensor.unique.html#torch.Tensor.unique) -```python -torch.Tensor.unique(sorted=True, return_inverse=False, return_counts=False, dim=None) -``` - -### [paddle.Tensor.unique](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor__upper_cn.html#unique-return-index-false-return-inverse-false-return-counts-false-axis-none-dtype-int64-name-none) -```python -paddle.Tensor.unique(return_index=False, return_inverse=False, return_counts=False, axis=None, dtype='int64', name=None) -``` - -两者功能一致,torch 参数更多,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| sorted | - | 是否返回前进行排序,Paddle 无此参数。可直接删除,PyTorch 目前忽略了此参数。 | -| return_inverse| return_inverse | 是否返回输入 Tensor 的元素对应在独有元素中的索引。 | -| return_counts | return_counts | 是否返回每个独有元素在输入 Tensor 中的个数。 | -| dim | axis | 选取的轴,仅参数名不一致。 | -| - | return_index| 是否返回独有元素在输入 Tensor 中的索引,PyTorch 无此参数, Paddle 保持默认即可。| diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.acos.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.acos.md deleted file mode 100644 index 2532118570d..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.acos.md +++ /dev/null @@ -1,32 +0,0 @@ -## [ torch 参数更多 ]torch.acos -### [torch.acos](https://docs.pytorch.org/docs/stable/generated/torch.acos.html#torch.acos) -```python -torch.acos(input, - *, - out=None) -``` - -### [paddle.acos](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/acos_cn.html#paddle.acos) -```python -paddle.acos(x, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | -------------------------------------------------------- | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.acos(torch.tensor([0.3348, -0.5889]), out=y) - -# Paddle 写法 -paddle.assign(paddle.acos(paddle.to_tensor([0.3348, -0.5889])), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.acosh.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.acosh.md deleted file mode 100644 index 2ce93feea03..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.acosh.md +++ /dev/null @@ -1,33 +0,0 @@ -## [ torch 参数更多 ]torch.acosh -### [torch.acosh](https://docs.pytorch.org/docs/stable/generated/torch.acosh.html#torch.acosh) -```python -torch.acosh(input, - *, - out=None) -``` - -### [paddle.acosh](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/acosh_cn.html#paddle.acosh) -```python -paddle.acosh(x, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | --------------------------------------------------------- | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| out | - | 表示输出的 Tensor ,Paddle 无此参数,需要转写。 | - - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.acosh(torch.tensor([1.3192, 1.9915]), out=y) - -# Paddle 写法 -paddle.assign(paddle.acosh(paddle.to_tensor([1.3192, 1.9915])), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.amp.autocast.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.amp.autocast.md deleted file mode 100644 index 6f94dea76fb..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.amp.autocast.md +++ /dev/null @@ -1,33 +0,0 @@ -## [ torch 参数更多 ]torch.amp.autocast -### [torch.amp.autocast](https://pytorch.org/docs/stable/amp.html#torch.cuda.amp.autocast) -```python -torch.amp.autocast(device_type, - dtype=None, - enabled=True, - cache_enabled=None) -``` - -### [paddle.amp.auto\_cast](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/amp/auto_cast_cn.html#paddle.amp.auto_cast) -```python -paddle.amp.auto_cast(enable=True, - custom_white_list=None, - custom_black_list=None, - level='O1', - dtype='float16', - use_promote=True) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------ | ------------------------------------------------------------ | -| device_type | - | 指定设备类型,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| dtype | dtype | 指定自动混合精度的计算类型。 | -| enabled | enable | 是否启用自动混合精度。 | -| cache_enabled | - | 启用或禁用 CUDA 图形缓存 Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| - | custom_white_list | 白名单,通常不需要设置。PyTorch 无此参数,Paddle 保持默认即可。 | -| - | custom_black_list | 黑名单,通常不需要设置。PyTorch 无此参数,Paddle 保持默认即可。 | -| - | level | 混合精度训练的优化级别,可为 O1 、O2 或者 OD 模式。PyTorch 无此参数,Paddle 保持默认即可。 | -| - | use_promote | 当一个算子存在 float32 类型的输入时,按照 Promote to the Widest 原则,选择 float32 数据类型进行计算。PyTorch 无此参数,Paddle 保持默认即可。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.asin.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.asin.md deleted file mode 100644 index 4319c956d04..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.asin.md +++ /dev/null @@ -1,32 +0,0 @@ -## [ torch 参数更多 ]torch.asin -### [torch.asin](https://docs.pytorch.org/docs/stable/generated/torch.asin.html#torch.asin) -```python -torch.asin(input, - *, - out=None) -``` - -### [paddle.asin](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/asin_cn.html#paddle.asin) -```python -paddle.asin(x, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| out | - | 表示输出的 Tensor , Paddle 无此参数,需要转写。 | - - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.asin(torch.tensor([-0.5962, 0.4985]), out=y) - -# Paddle 写法 -paddle.assign(paddle.asin(paddle.to_tensor([-0.5962, 0.4985])), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.atan2.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.atan2.md deleted file mode 100644 index d6df1927510..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.atan2.md +++ /dev/null @@ -1,36 +0,0 @@ -## [ torch 参数更多 ]torch.atan2 -### [torch.atan2](https://docs.pytorch.org/docs/stable/generated/torch.atan2.html#torch.atan2) -```python -torch.atan2(input, - other, - *, - out=None) -``` - -### [paddle.atan2](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/atan2_cn.html#paddle.atan2) -```python -paddle.atan2(x, - y, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| other | y | 表示输入的 Tensor ,仅参数名不一致。 | -| out | - | 表示输出的 Tensor , Paddle 无此参数,需要转写。 | - - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.atan2(torch.tensor([0.2,0.3]),torch.tensor([0.4,0.5]),out=y) - -# Paddle 写法 -paddle.assign(paddle.atan2(paddle.to_tensor([0.2,0.3]),paddle.to_tensor([0.4,0.5])),y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.atanh.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.atanh.md deleted file mode 100644 index 876d9d5576d..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.atanh.md +++ /dev/null @@ -1,33 +0,0 @@ -## [ torch 参数更多 ]torch.atanh -### [torch.atanh](https://docs.pytorch.org/docs/stable/generated/torch.atanh.html#torch.atanh) -```python -torch.atanh(input, - *, - out=None) -``` - -### [paddle.atanh](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/atanh_cn.html#paddle.atanh) -```python -paddle.atanh(x, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| out | - | 表示输出的 Tensor , Paddle 无此参数,需要转写。 | - - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.atanh(torch.tensor([ 0.2341, 0.2539]), out=y) - -# Paddle 写法 -paddle.assign(paddle.atanh(paddle.to_tensor([ 0.2341, 0.2539])), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.autocast.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.autocast.md deleted file mode 100644 index 3c2c05ad2e6..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.autocast.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ torch 参数更多 ]torch.autocast -### [torch.autocast](https://docs.pytorch.org/docs/stable/amp.html#torch.autocast) -```python -torch.autocast(device_type, dtype=None, enabled=True, cache_enabled=None) -``` - -### [paddle.amp.auto\_cast](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/amp/auto_cast_cn.html#paddle.amp.auto_cast) -```python -paddle.amp.auto_cast(enable=True, custom_white_list=None, custom_black_list=None, level='O1', dtype='float16', use_promote=True) -``` - -其中 PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ----------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| device_type | - | 设备类型,Paddle 不区分设备,可直接删除。 | -| dtype | dtype | 使用的数据类型。 | -| enabled | enable | 是否开启自动混合精度。 | -| cache_enabled | - | 是否启用权重缓存,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| - | custom_white_list | 自定义算子白名单,PyTorch 无此参数,Paddle 保持默认即可。 | -| - | custom_black_list | 自定义算子黑名单,PyTorch 无此参数,Paddle 保持默认即可。 | -| - | level | 混合精度训练模式,PyTorch 无此参数,Paddle 保持默认即可。 | -| - | use_promote | 当一个算子存在 float32 类型的输入时,按照 Promote to the Widest 原则,选择 float32 数据类型进行计算。仅在 AMP-O2 训练时可配置。默认为 True。PyTorch 无此参数,Paddle 保持默认即可。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.bernoulli.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.bernoulli.md deleted file mode 100644 index dbabc436639..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.bernoulli.md +++ /dev/null @@ -1,38 +0,0 @@ -## [ torch 参数更多 ]torch.bernoulli -### [torch.bernoulli](https://docs.pytorch.org/docs/stable/generated/torch.bernoulli.html#torch.bernoulli) -```python -torch.bernoulli(input, - p=None, - *, - generator=None, - out=None) -``` - -### [paddle.bernoulli](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/bernoulli_cn.html#paddle.bernoulli) -```python -paddle.bernoulli(x, - p=None, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 伯努利参数 Tensor,仅参数名不一致。 | -| p | p | 可选,伯努利参数 p。 | -| generator | - | 用于采样的伪随机数生成器, Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 | - - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.bernoulli(x, out=y) - -# Paddle 写法 -paddle.assign(paddle.bernoulli(x), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.blackman_window.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.blackman_window.md deleted file mode 100644 index 3596d1bfbfd..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.blackman_window.md +++ /dev/null @@ -1,62 +0,0 @@ -## [ torch 参数更多 ]torch.blackman_window -### [torch.blackman\_window](https://docs.pytorch.org/docs/stable/generated/torch.blackman_window.html#torch.blackman_window) -```python -torch.blackman_window(window_length, periodic=True, *, dtype=None, layout=torch.strided, device=None, requires_grad=False) -``` - -### [paddle.audio.functional.get\_window](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/audio/functional/get_window_cn.html#paddle.audio.functional.get_window) -```python -paddle.audio.functional.get_window(window, win_length, fftbins=True, dtype='float64') -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| - | window | 窗函数类型,Pytorch 无此参数,Paddle 需设置为 `blackman`。 | -| window_length | win_length | 输入窗口的长度,仅参数名不同。 | -| periodic | fftbins | 判断是否返回适用于过滤器设计的对称窗口,仅参数名不同。 | -| dtype | dtype | 返回 Tensor 的数据类型,支持 float32、float64。PyTorch 若参数为空,返回数据类型默认为 `float32`。 Paddle 若参数为空,返回数据类型默认为 `float64` ,需要转写。| -| layout | -| 表示布局方式, Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| device | - | 表示 Tensor 存放设备位置,Paddle 无此参数,需要转写。 | -| requires_grad | - | 表示是否计算梯度, Paddle 无此参数,需要转写。 | - -### 转写示例 -#### window:窗函数类型 -```python -# PyTorch 写法 -torch.blackman_window(5) - -# Paddle 写法 -paddle.audio.functional.get_window('blackman', 5) -``` - -#### dtype:返回 Tensor 的数据类型 -```python -# PyTorch 写法 -torch.blackman_window(5) - -# Paddle 写法 -paddle.audio.functional.get_window('blackman', 5, dtype='float32') -``` - -#### requires_grad:是否需要求反向梯度,需要修改该 Tensor 的 stop_gradient 属性 -```python -# PyTorch 写法 -torch.blackman_window(5, requires_grad = True) - -# Paddle 写法 -x = paddle.audio.functional.get_window('blackman', 5) -x.stop_gradient = False -``` - -#### device: Tensor 的设备 -```python -# PyTorch 写法 -torch.blackman_window(5, device = torch.device('cpu')) - -# Paddle 写法 -y = paddle.audio.functional.get_window('blackman', 5) -y.cpu() -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.bucketize.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.bucketize.md deleted file mode 100644 index b5c0391f75f..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.bucketize.md +++ /dev/null @@ -1,32 +0,0 @@ -## [ torch 参数更多 ]torch.bucketize -### [torch.bucketize](https://docs.pytorch.org/docs/stable/generated/torch.bucketize.html#torch.bucketize) -```python -torch.bucketize(input, boundaries, *, out_int32=False, right=False, out=None) -``` - -### [paddle.bucketize](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/bucketize_cn.html#paddle.bucketize) -```python -paddle.bucketize(x, sorted_sequence, out_int32=False, right=False, name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input| x | 表示输入的 Tensor ,仅参数名不一致。 | -| boundaries| sorted_sequence | 数据的边界,仅参数名不一致。 | -| out_int32| out_int32 | 输出的数据类型是否为 int32。 | -| right| right | 根据给定输入在 sorted_sequence 查找对应的上边界或下边界。 | -| out | - | 表示输出的 Tensor, Paddle 无此参数,需要转写。 | - - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.bucketize(x, boundaries, out=y) - -# Paddle 写法 -paddle.assign(paddle.bucketize(x, boundaries), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.clamp_max.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.clamp_max.md deleted file mode 100644 index fbd64e23ec6..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.clamp_max.md +++ /dev/null @@ -1,38 +0,0 @@ -## [ torch 参数更多 ]torch.clamp_max - -### [torch.clamp_max]() -```python -torch.clamp_max(input, - max=None, - *, - out=None) -``` - -### [paddle.clip](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/clip_cn.html#paddle.clip) -```python -paddle.clip(x, - min=None, - max=None, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| - | min | 表示裁剪的最小值。PyTorch 无此参数, Paddle 保持默认即可。 | -| max | max | 表示裁剪的最大值。 | -| out | - | 表示输出的 Tensor , Paddle 无此参数,需要转写。 | - - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.clamp_max(input, max=0.5, out=y) - -# Paddle 写法 -paddle.assign(paddle.clip(input, max=0.5), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.clone.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.clone.md deleted file mode 100644 index 76ebad24834..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.clone.md +++ /dev/null @@ -1,22 +0,0 @@ -## [ torch 参数更多 ]torch.clone -### [torch.clone](https://docs.pytorch.org/docs/stable/generated/torch.clone.html#torch.clone) -```python -torch.clone(input, - *, - memory_format=torch.preserve_format) -``` - -### [paddle.clone](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/clone_cn.html#paddle.clone) -```python -paddle.clone(x, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 输入的 Tensor ,仅参数名不一致。 | -| memory_format | - | 返回张量的所需内存格式,默认为 torch.preserve_format 。Paddle 无此参数,一般对训练结果影响不大,可直接删除。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.copysign.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.copysign.md deleted file mode 100644 index f9d095b8169..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.copysign.md +++ /dev/null @@ -1,34 +0,0 @@ -## [ torch 参数更多 ]torch.copysign - -### [torch.copysign](https://docs.pytorch.org/docs/stable/generated/torch.copysign.html#torch.copysign) -```python -torch.copysign(input, - other, - *, - out=None) -``` - -### [paddle.copysign](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/copysign_cn.html#paddle.copysign) -```python -paddle.copysign(x, y) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 输入的第一个张量,表示输出的大小,仅参数名不一致。 | -| other | y | 输入的第二个张量,表示输出的符号,仅参数名不一致。 | -| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.copysign(input, other, out=t) - -# Paddle 写法 -paddle.assign(paddle.copysign(input, other), t) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.cosh.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.cosh.md deleted file mode 100644 index 3aea0fd5498..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.cosh.md +++ /dev/null @@ -1,33 +0,0 @@ -## [ torch 参数更多 ]torch.cosh - -### [torch.cosh](https://docs.pytorch.org/docs/stable/generated/torch.cosh.html#torch.cosh) -```python -torch.cosh(input, - *, - out=None) -``` - -### [paddle.cosh](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/cosh_cn.html#paddle.cosh) -```python -paddle.cosh(x, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor,仅参数名不一致。 | -| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 | - - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.cosh(torch.tensor([0.1632, 1.1835]), out=y) - -# Paddle 写法 -paddle.assign(paddle.cosh(paddle.to_tensor([0.1632, 1.1835])), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.cross.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.cross.md deleted file mode 100644 index 07179edcc3f..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.cross.md +++ /dev/null @@ -1,39 +0,0 @@ -## [ torch 参数更多 ]torch.cross -### [torch.cross](https://docs.pytorch.org/docs/stable/generated/torch.cross.html#torch.cross) -```python -torch.cross(input, - other, - dim=None, - *, - out=None) -``` - -### [paddle.cross](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/cross_cn.html#paddle.cross) -```python -paddle.cross(x, - y, - axis=None, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 输入的 Tensor ,仅参数名不一致。 | -| other | y | 输入的 Tensor ,仅参数名不一致。 | -| dim | axis | 沿着此维进行向量积操作,仅参数名不一致。 | -| out | - | 表示输出的 Tensor ,Paddle 无此参数,需要转写。 | - - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.cross(input, other, dim=1, out=y) - -# Paddle 写法 -paddle.assign(paddle.cross(input, other, axis=1), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.cuda.is_bf16_supported.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.cuda.is_bf16_supported.md deleted file mode 100644 index d16461ea783..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.cuda.is_bf16_supported.md +++ /dev/null @@ -1,22 +0,0 @@ -## [ torch 参数更多 ]torch.cuda.is_bf16_supported - -### [torch.cuda.is\_bf16\_supported](https://docs.pytorch.org/docs/stable/generated/torch.cuda.is_bf16_supported.html#torch.cuda.is_bf16_supported) - -```python -torch.cuda.is_bf16_supported(including_emulation=True) -``` - -### [paddle.amp.is\_bfloat16\_supported](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/amp/is_bfloat16_supported_cn.html#paddle.amp.is_bfloat16_supported) - -```python -paddle.amp.is_bfloat16_supported(device=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ---------- | ------------ | -- | -| including_emulation | - | 是否包含软件模拟支持,暂无转写方式。 | -| - | device | 查询的设备类型, PyTorch 无此参数,Paddle 保持默认即可。| diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.cummax.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.cummax.md deleted file mode 100644 index 93f12eff759..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.cummax.md +++ /dev/null @@ -1,37 +0,0 @@ -## [ torch 参数更多 ]torch.cummax -### [torch.cummax](https://docs.pytorch.org/docs/stable/generated/torch.cummax.html#torch.cummax) -```python -torch.cummax(input, - dim, - *, - out=None) -``` - -### [paddle.cummax](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/cummax_cn.html#paddle.cummax) -```python -paddle.cummax(x, - axis=None, - dtype='int64', - name=None) -``` - -两者功能一致,torch 参数更多,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor,仅参数名不一致。 | -| dim | axis | 用于指定 index 获取输入的维度,仅参数名不一致。 | -| - | dtype | 指定输出索引的数据格式,PyTorch 无此参数,Paddle 保持默认即可。 | -| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.cummax(x,1, out=(values, indices)) - -# Paddle 写法 -paddle.assign(paddle.cummax(x,1), (values, indices)) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.cummin.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.cummin.md deleted file mode 100644 index 61793b30d8a..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.cummin.md +++ /dev/null @@ -1,37 +0,0 @@ -## [ torch 参数更多 ]torch.cummin -### [torch.cummin](https://docs.pytorch.org/docs/stable/generated/torch.cummin.html#torch.cummin) -```python -torch.cummin(input, - dim, - *, - out=None) -``` - -### [paddle.cummin](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/cummin_cn.html#paddle.cummin) -```python -paddle.cummin(x, - axis=None, - dtype='int64', - name=None) -``` - -两者功能一致,torch 参数更多,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor,仅参数名不一致。 | -| dim | axis | 用于指定 index 获取输入的维度,仅参数名不一致。 | -| - | dtype | 指定输出索引的数据格式,PyTorch 无此参数,Paddle 保持默认即可。 | -| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.cummin(x,1, out=(values, indices)) - -# Paddle 写法 -paddle.assign(paddle.cummin(x,1), (values, indices)) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.cumprod.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.cumprod.md deleted file mode 100644 index e9f7385db4a..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.cumprod.md +++ /dev/null @@ -1,39 +0,0 @@ -## [ torch 参数更多 ]torch.cumprod -### [torch.cumprod](https://docs.pytorch.org/docs/stable/generated/torch.cumprod.html#torch.cumprod) -```python -torch.cumprod(input, - dim, - *, - dtype=None, - out=None) -``` - -### [paddle.cumprod](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/cumprod_cn.html#paddle.cumprod) -```python -paddle.cumprod(x, - dim=None, - dtype=None, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------| -| input | x | 输入的 Tensor ,仅参数名不一致。 | -| dim | dim | 指明需要累乘的维度,参数名相同。 | -| dtype | dtype | 输出 Tensor 的数据类型,如果指定了,那么在执行操作之前,输入的 Tensor 将被转换为 dtype 类型,这对防止数据类型溢出非常有用,默认为 None,参数名相同。 | -| out | - | 表示输出的 Tensor ,Paddle 无此参数,需要转写。 | - - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.cumprod(input, dim=1, dtype='float64', out=y) - -# Paddle 写法 -paddle.assign(paddle.cumprod(input, dim=1, dtype='float64'), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.distributed.init_process_group.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.distributed.init_process_group.md deleted file mode 100644 index c7ae2582f5a..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.distributed.init_process_group.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ torch 参数更多 ]torch.distributed.init_process_group -### [torch.distributed.init\_process\_group](https://docs.pytorch.org/docs/stable/distributed.html#torch.distributed.init_process_group) -```python -torch.distributed.init_process_group(backend='nccl', init_method=None, timeout=datetime.timedelta(seconds=1800), world_size=-1, rank=-1, store=None, group_name='', pg_options=None) -``` - -### [paddle.distributed.init\_parallel\_env](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/distributed/init_parallel_env_cn.html#paddle.distributed.init_parallel_env) -```python -paddle.distributed.init_parallel_env() -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| backend | - | backend 配置,paddle 无此参数,暂无转写方式。 | -| init_method | - | 初始化方法,paddle 无此参数,暂无转写方式。 | -| timeout | - | 超时配置,paddle 无此参数,暂无转写方式。 | -| world_size | - | 进程数量,paddle 无此参数,暂无转写方式。 | -| rank | - | 当前进程所在的 gpu,paddle 无此参数,暂无转写方式。 | -| store | - | 信息交换的配置,paddle 无此参数,暂无转写方式。 | -| group_name | - | 组名,paddle 无此参数,暂无转写方式。 | -| pg_options | - | 进程组配置,paddle 无此参数,暂无转写方式。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.distributions.categorical.Categorical.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.distributions.categorical.Categorical.md deleted file mode 100644 index c566bc96d4d..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.distributions.categorical.Categorical.md +++ /dev/null @@ -1,20 +0,0 @@ -## [ torch 参数更多 ]torch.distributions.categorical.Categorical -### [torch.distributions.categorical.Categorical](https://docs.pytorch.org/docs/stable/distributions.html#torch.distributions.categorical.Categorical) -```python -torch.distributions.categorical.Categorical(probs=None, logits=None, validate_args=None) -``` - -### [paddle.distribution.Categorical](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/distribution/Categorical_cn.html#paddle.distribution.Categorical) -```python -paddle.distribution.Categorical(logits, name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | --------------------------------------------- | -| probs | - | 事件概率,Paddle 无此参数,暂无转写方式。 | -| logits | logits | 类别分布对应的 logits。 | -| validate_args | - | 是否添加验证环节。Paddle 无此参数,一般对训练结果影响不大,可直接删除。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.distributions.distribution.Distribution.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.distributions.distribution.Distribution.md deleted file mode 100644 index af1bac231e3..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.distributions.distribution.Distribution.md +++ /dev/null @@ -1,20 +0,0 @@ -## [ torch 参数更多 ]torch.distributions.distribution.Distribution -### [torch.distributions.distribution.Distribution](https://docs.pytorch.org/docs/stable/distributions.html#torch.distributions.distribution.Distribution) -```python -torch.distributions.distribution.Distribution(batch_shape=torch.Size([]), event_shape=torch.Size([]), validate_args=None) -``` - -### [paddle.distribution.Distribution](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/distribution/Distribution_cn.html#paddle.distribution.Distribution) -```python -paddle.distribution.Distribution(batch_shape, event_shape) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | --------------------------------------------- | -| batch_shape | batch_shape | 概率分布参数批量形状。 | -| event_shape | event_shape | 多元概率分布维数形状。 | -| validate_args | - | 是否添加验证环节。Paddle 无此参数,一般对训练结果影响不大,可直接删除。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.distributions.multivariate_normal.MultivariateNormal.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.distributions.multivariate_normal.MultivariateNormal.md deleted file mode 100644 index aaa397d6c8a..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.distributions.multivariate_normal.MultivariateNormal.md +++ /dev/null @@ -1,29 +0,0 @@ -## [ torch 参数更多 ]torch.distributions.multivariate_normal.MultivariateNormal -### [torch.distributions.multivariate\_normal.MultivariateNormal](https://docs.pytorch.org/docs/stable/distributions.html#torch.distributions.multivariate_normal.MultivariateNormal) -```python -torch.distributions.multivariate_normal.MultivariateNormal(loc, - covariance_matrix=None, - precision_matrix=None, - scale_tril=None, - validate_args=None) -``` - -### [paddle.distribution.MultivariateNormal](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/distribution/MultivariateNormal_cn.html#paddle.distribution.MultivariateNormal) -```python -paddle.distribution.MultivariateNormal(loc, - covariance_matrix=None, - precision_matrix=None, - scale_tril=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------ | ------------------------------------------------------------ | -| loc | loc | MultivariateNormal 的均值向量。 | -| covariance_matrix | covariance_matrix | MultivariateNormal 的协方差矩阵。 | -| precision_matrix | precision_matrix | MultivariateNormal 协方差矩阵的逆矩阵。 | -| scale_tril | scale_tril | MultivariateNormal 协方差矩阵的柯列斯基分解的下三角矩阵。 | -| validate_args | - | 是否添加验证环节。Paddle 无此参数,一般对训练结果影响不大,可直接删除。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.distributions.normal.Normal.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.distributions.normal.Normal.md deleted file mode 100644 index 7ee8e5ed937..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.distributions.normal.Normal.md +++ /dev/null @@ -1,20 +0,0 @@ -## [ torch 参数更多 ]torch.distributions.normal.Normal -### [torch.distributions.normal.Normal](https://docs.pytorch.org/docs/stable/distributions.html#torch.distributions.normal.Normal) -```python -torch.distributions.normal.Normal(loc, scale, validate_args=None) -``` - -### [paddle.distribution.Normal](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/distribution/Normal_cn.html#paddle.distribution.Normal) -```python -paddle.distribution.Normal(loc, scale, name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | --------------------------------------------- | -| loc | loc | 正态分布平均值。 | -| scale | scale | 正态分布标准差。 | -| validate_args | - | 是否添加验证环节。Paddle 无此参数,一般对训练结果影响不大,可直接删除。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.exp.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.exp.md deleted file mode 100644 index 44748c2cb11..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.exp.md +++ /dev/null @@ -1,32 +0,0 @@ -## [ torch 参数更多 ]torch.exp -### [torch.exp](https://docs.pytorch.org/docs/stable/generated/torch.exp.html#torch.exp) -```python -torch.exp(input, - *, - out=None) -``` - -### [paddle.exp](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/exp_cn.html#paddle.exp) -```python -paddle.exp(x, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| out | - | 表示输出的 Tensor , Paddle 无此参数,需要转写。 | - - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.exp(torch.tensor([-0.4, -0.2, 0.1, 0.3]), out=y) - -# Paddle 写法 -paddle.assign(paddle.exp(paddle.to_tensor([-0.4, -0.2, 0.1, 0.3])), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.fft.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.fft.md deleted file mode 100644 index 726b8f81d9b..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.fft.md +++ /dev/null @@ -1,31 +0,0 @@ -## [ torch 参数更多 ]torch.fft.fft -### [torch.fft.fft](https://docs.pytorch.org/docs/stable/generated/torch.fft.fft.html#torch.fft.fft) -```python -torch.fft.fft(input, n=None, dim=- 1, norm='backward', *, out=None) -``` - -### [paddle.fft.fft](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/fft/fft_cn.html#paddle.fft.fft) -```python -paddle.fft.fft(x, n=None, axis=- 1, norm='backward', name=None) -``` - -其中,PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 输入 Tensor,仅参数名不一致。 | -| n | n | 输出 Tensor 在傅里叶变换轴的长度。 | -| dim | axis | 傅里叶变换的轴,如果没有指定,默认是使用最后一维,仅参数名不一致。| -| norm |norm |傅里叶变换的缩放模式,缩放系数由变换的方向和缩放模式同时决定,完全一致。| -| out | - |输出 Tensor,Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.fft.fft(x, s, dim, norm, out=y) - -# Paddle 写法 -paddle.assign(paddle.fft.fft(x, s, axes, norm), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.fft2.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.fft2.md deleted file mode 100644 index dba32e5f367..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.fft2.md +++ /dev/null @@ -1,31 +0,0 @@ -## [ torch 参数更多 ]torch.fft.fft2 -### [torch.fft.fft2](https://docs.pytorch.org/docs/stable/generated/torch.fft.fft2.html#torch.fft.fft2) -```python -torch.fft.fft2(input, s=None, dim=None, norm='backward', *, out=None) -``` - -### [paddle.fft.fft2](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/fft/fft2_cn.html#paddle.fft.fft2) -```python -paddle.fft.fft2(x, s=None, axes=None, norm='backward', name=None) -``` - -其中,PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 输入 Tensor,仅参数名不一致。 | -| s | s | 输出 Tensor 在傅里叶变换轴的长度。 | -| dim | axes | 傅里叶变换的轴,如果没有指定,默认是使用最后一维,仅参数名不一致。| -| norm |norm |傅里叶变换的缩放模式,缩放系数由变换的方向和缩放模式同时决定,完全一致。| -| out | - |输出 Tensor,Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.fft.fft2(x, s, dim, norm, out=y) - -# Paddle 写法 -paddle.assign(paddle.fft.fft2(x, s, axes, norm), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.fftfreq.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.fftfreq.md deleted file mode 100644 index e7d0e83b087..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.fftfreq.md +++ /dev/null @@ -1,62 +0,0 @@ -## [ torch 参数更多 ]torch.fft.fftfreq -### [torch.fft.fftfreq](https://docs.pytorch.org/docs/stable/generated/torch.fft.fftfreq.html#torch.fft.fftfreq) -```python -torch.fft.fftfreq(n, - d=1.0, - *, - out=None, - dtype=None, - layout=torch.strided, - device=None, - requires_grad=False) -``` - -### [paddle.fft.fftfreq](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/fft/fftfreq_cn.html#paddle.fft.fftfreq) -```python -paddle.fft.fftfreq(n, - d=1.0, - dtype=None, - name=None) -``` - -其中,PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| n | n | 窗长度(傅里叶变换点数)。 | -| d | d | 采样间隔,采样率的倒数,默认值为 1。 | -| out | - |输出的 Tensor,Paddle 无此参数,需要转写。 | -| dtype | dtype |返回 Tensor 的数据类型。 | -| layout |- |表示布局方式,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。| -| device |- |表示 Tensor 存放设备位置,Paddle 无此参数,需要转写。 | -| requires_grad |- |表示是否不阻断梯度传导,Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.fft.fftfreq(x, out=y) - -# Paddle 写法 -paddle.assign(paddle.fft.fftfreq(x),y) -``` - -#### requires_grad:是否需要求反向梯度,需要修改该 Tensor 的 stop_gradient 属性 -```python -# PyTorch 写法 -x = torch.fft.fftfreq(x, requires_grad=True) - -# Paddle 写法 -x = paddle.fft.fftfreq(x) -x.stop_gradient = False -``` - -#### device: Tensor 的设备 -```python -# PyTorch 写法 -torch.fft.fftfreq(x, device=torch.device('cpu')) - -# Paddle 写法 -y = paddle.fft.fftfreq(x) -y.cpu() diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.fftn.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.fftn.md deleted file mode 100644 index 512d6907d0a..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.fftn.md +++ /dev/null @@ -1,31 +0,0 @@ -## [ torch 参数更多 ]torch.fft.fftn -### [torch.fft.fftn](https://docs.pytorch.org/docs/stable/generated/torch.fft.fftn.html#torch.fft.fftn) -```python -torch.fft.fftn(input, s=None, dim=None, norm='backward', *, out=None) -``` - -### [paddle.fft.fftn](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/fft/fftn_cn.html#paddle.fft.fftn) -```python -paddle.fft.fftn(x, s=None, axes=None, norm='backward', name=None) -``` - -其中,PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 输入 Tensor,仅参数名不一致。 | -| s | s | 输出 Tensor 在傅里叶变换轴的长度。 | -| dim | axes | 傅里叶变换的轴,如果没有指定,默认是使用最后一维,仅参数名不一致。| -| norm |norm |傅里叶变换的缩放模式,缩放系数由变换的方向和缩放模式同时决定,完全一致。| -| out | - |输出 Tensor,Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.fft.fftn(x, s, dim, norm, out=y) - -# Paddle 写法 -paddle.assign(paddle.fft.fftn(x, s, axes, norm), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.hfft.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.hfft.md deleted file mode 100644 index c3425b6e524..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.hfft.md +++ /dev/null @@ -1,40 +0,0 @@ -## [ torch 参数更多 ]torch.fft.hfft -### [torch.fft.hfft](https://docs.pytorch.org/docs/stable/generated/torch.fft.hfft.html#torch.fft.hfft) -```python -torch.fft.hfft(input, - n=None, - dim=- 1, - norm='backward', - *, - out=None) -``` - -### [paddle.fft.hfft](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/fft/hfft_cn.html#paddle.fft.hfft) -```python -paddle.fft.hfft(x, - n=None, - axis=- 1, - norm='backward', - name=None) -``` - -其中,PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 输入 Tensor,仅参数名不一致。 | -| n | n | 输出 Tensor 在傅里叶变换轴的长度。 | -| dim | axis | 傅里叶变换的轴,如果没有指定,默认是使用最后一维,仅参数名不一致。| -| norm |norm |傅里叶变换的缩放模式,缩放系数由变换的方向和缩放模式同时决定,完全一致。| -| out | - |输出 Tensor,Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.fft.hfft(x, n=5, out=y) - -# Paddle 写法 -paddle.assign(paddle.fft.hfft(x), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.hfft2.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.hfft2.md deleted file mode 100644 index 47c628c532e..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.hfft2.md +++ /dev/null @@ -1,32 +0,0 @@ -## [ torch 参数更多 ]torch.fft.hfft2 -### [torch.fft.hfft2](https://docs.pytorch.org/docs/stable/generated/torch.fft.hfft2.html#torch.fft.hfft2) -```python -torch.fft.hfft2(input, s=None, dim=(- 2, - 1), norm='backward', *, out=None) -``` - -### [paddle.fft.hfft2](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/fft/hfft2_cn.html#paddle.fft.hfft2) -```python -paddle.fft.hfft2(x, s=None, axes=(- 2, - 1), norm='backward', name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ----------------------------------- | ------------ | ----------------------------------------------------------------------- | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| s | s | 表示在傅里叶变换轴的长度 。 | -| dim | axes | 表示进行运算的轴,仅参数名不一致。 | -| norm | norm | 表示傅里叶变换的缩放模式。 | -| out | - | 表示输出的 Tensor , Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.fft.hfft2(x, s, dim, norm, out=y) - -# Paddle 写法 -paddle.assign(paddle.fft.hfft2(x, s, dim, norm) , y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.hfftn.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.hfftn.md deleted file mode 100644 index 85295187b06..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.hfftn.md +++ /dev/null @@ -1,32 +0,0 @@ -## [ torch 参数更多 ]torch.fft.hfftn -### [torch.fft.hfftn](https://docs.pytorch.org/docs/stable/generated/torch.fft.hfftn.html#torch.fft.hfftn) -```python -torch.fft.hfftn(input, s=None, dim=None, norm='backward', *, out=None) -``` - -### [paddle.fft.hfftn](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/fft/hfftn_cn.html#paddle.fft.hfftn) -```python -paddle.fft.hfftn(x, s=None, axes=None, norm='backward', name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ----------------------------------- | ------------ | ----------------------------------------------------------------------- | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| s | s | 表示在傅里叶变换轴的长度 。 | -| dim | axes | 表示进行运算的轴,仅参数名不一致。 | -| norm | norm | 表示傅里叶变换的缩放模式。 | -| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.fft.hfftn(x, s, dim, norm, out=y) - -# Paddle 写法 -paddle.assign(paddle.fft.hfftn(x, s, dim, norm) , y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.ifft.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.ifft.md deleted file mode 100644 index 8e4cb5c0628..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.ifft.md +++ /dev/null @@ -1,31 +0,0 @@ -## [ torch 参数更多 ]torch.fft.ifft -### [torch.fft.ifft](https://docs.pytorch.org/docs/stable/generated/torch.fft.ifft.html#torch.fft.ifft) -```python -torch.fft.ifft(input, n=None, dim=- 1, norm='backward', *, out=None) -``` - -### [paddle.fft.ifft](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/fft/ifft_cn.html#paddle.fft.ifft) -```python -paddle.fft.ifft(x, n=None, axis=- 1, norm='backward', name=None) -``` - -其中,PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x |输入 Tensor,仅参数名不一致。 | -| n | n |输出 Tensor 在每一个傅里叶变换轴上的长度。 | -| dim | axis |计算快速傅里叶变换的轴。仅参数名不一致。 | -| norm |norm |傅里叶变换的缩放模式,缩放系数由变换的方向和缩放模式同时决定,完全一致。| -| out | - |输出的 Tensor,Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.fft.ifft(x, out=y) - -# Paddle 写法 -paddle.assign(paddle.fft.ifft(x), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.ifft2.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.ifft2.md deleted file mode 100644 index 3b4f850f51a..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.ifft2.md +++ /dev/null @@ -1,40 +0,0 @@ -## [ torch 参数更多 ]torch.fft.ifft2 -### [torch.fft.ifft2](https://docs.pytorch.org/docs/stable/generated/torch.fft.ifft2.html#torch.fft.ifft2) -```python -torch.fft.ifft2(input, - s=None, - dim=None, - norm='backward', - *, - out=None) -``` - -### [paddle.fft.ifft2](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/fft/ifft2_cn.html#paddle.fft.ifft2) -```python -paddle.fft.ifft2(x, - s=None, - axes=None, - norm='backward', - name=None) -``` - -其中,PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x |输入 Tensor,仅参数名不一致。 | -| s | s |输出 Tensor 在每一个傅里叶变换轴上的长度。 | -| dim | axes |计算快速傅里叶变换的轴。仅参数名不一致。 | -| norm |norm |傅里叶变换的缩放模式,缩放系数由变换的方向和缩放模式同时决定,完全一致。| -| out | - |输出的 Tensor,Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.fft.ifft2(x, out=y) - -# Paddle 写法 -paddle.assign(paddle.fft.ifft2(x), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.ifftn.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.ifftn.md deleted file mode 100644 index 1f23058fb08..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.ifftn.md +++ /dev/null @@ -1,40 +0,0 @@ -## [ torch 参数更多 ]torch.fft.ifftn -### [torch.fft.ifftn](https://docs.pytorch.org/docs/stable/generated/torch.fft.ifftn.html#torch.fft.ifftn) -```python -torch.fft.ifftn(input, - s=None, - dim=None, - norm='backward', - *, - out=None) -``` - -### [paddle.fft.ifftn](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/fft/ifftn_cn.html#paddle.fft.ifftn) -```python -paddle.fft.ifftn(x, - s=None, - axes=None, - norm='backward', - name=None) -``` - -其中,PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x |输入 Tensor,仅参数名不一致。 | -| s | s |输出 Tensor 在每一个傅里叶变换轴上的长度。 | -| dim | axes |计算快速傅里叶变换的轴。仅参数名不一致。 | -| norm |norm |傅里叶变换的缩放模式,缩放系数由变换的方向和缩放模式同时决定,完全一致。| -| out | - |输出的 Tensor,Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.fft.ifftn(x, out=y) - -# Paddle 写法 -paddle.assign(paddle.fft.ifftn(x), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.ihfft.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.ihfft.md deleted file mode 100644 index c60ca411f64..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.ihfft.md +++ /dev/null @@ -1,40 +0,0 @@ -## [ torch 参数更多 ]torch.fft.ihfft -### [torch.fft.ihfft](https://docs.pytorch.org/docs/stable/generated/torch.fft.ihfft.html#torch.fft.ihfft) -```python -torch.fft.ihfft(input, - n=None, - dim=- 1, - norm='backward', - *, - out=None) -``` - -### [paddle.fft.ihfft](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/fft/ihfft_cn.html#paddle.fft.ihfft) -```python -paddle.fft.ihfft(x, - n=None, - axis=- 1, - norm='backward', - name=None) -``` - -其中,PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x |输入 Tensor,仅参数名不一致。 | -| n | n |傅里叶变换点数。 | -| dim | axis |傅里叶变换的轴,如果没有指定,默认使用最后一维,仅参数名不一致。| -| norm |norm |傅里叶变换的缩放模式,缩放系数由变换的方向和缩放模式同时决定,完全一致。| -| out | - |输出的 Tensor,Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.fft.ihfft(x, out=y) - -# Paddle 写法 -paddle.assign(paddle.fft.ihfft(x), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.ihfft2.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.ihfft2.md deleted file mode 100644 index 53a70d18c37..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.ihfft2.md +++ /dev/null @@ -1,32 +0,0 @@ -## [ torch 参数更多 ]torch.fft.ihfft2 -### [torch.fft.ihfft2](https://docs.pytorch.org/docs/stable/generated/torch.fft.ihfft2.html#torch.fft.ihfft2) -```python -torch.fft.ihfft2(input, s=None, dim=(- 2, - 1), norm='backward', *, out=None) -``` - -### [paddle.fft.ihfft2](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/fft/ihfft2_cn.html#paddle.fft.ihfft2) -```python -paddle.fft.ihfft2(x, s=None, axes=(- 2, - 1), norm='backward', name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ----------------------------------- | ------------ | ----------------------------------------------------------------------- | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| s | s | 表示在傅里叶变换轴的长度 。 | -| dim | axes | 表示进行运算的轴,仅参数名不一致。 | -| norm | norm | 表示傅里叶变换的缩放模式。 | -| out | - | 表示输出的 Tensor , Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.fft.ihfft2(x, s, dim, norm, out=y) - -# Paddle 写法 -paddle.assign(paddle.fft.ihfft2(x, s, dim, norm) , y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.ihfftn.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.ihfftn.md deleted file mode 100644 index f4b2a0e0c28..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.ihfftn.md +++ /dev/null @@ -1,32 +0,0 @@ -## [ torch 参数更多 ]torch.fft.ihfftn -### [torch.fft.ihfftn](https://docs.pytorch.org/docs/stable/generated/torch.fft.ihfftn.html#torch.fft.ihfftn) -```python -torch.fft.ihfftn(input, s=None, dim=None, norm='backward', *, out=None) -``` - -### [paddle.fft.ihfftn](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/fft/ihfftn_cn.html#paddle.fft.ihfftn) -```python -paddle.fft.ihfftn(x, s=None, axes=None, norm='backward', name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ----------------------------------- | ------------ | ----------------------------------------------------------------------- | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| s | s | 表示在傅里叶变换轴的长度 。 | -| dim | axes | 表示进行运算的轴,仅参数名不一致。 | -| norm | norm | 表示傅里叶变换的缩放模式。 | -| out | - | 表示输出的 Tensor , Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.fft.ihfftn(x, s, dim, norm, out=y) - -# Paddle 写法 -paddle.assign(paddle.fft.ihfftn(x, s, dim, norm) , y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.irfft.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.irfft.md deleted file mode 100644 index 92c0310532b..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.irfft.md +++ /dev/null @@ -1,32 +0,0 @@ -## [ torch 参数更多 ]torch.fft.irfft -### [torch.fft.irfft](https://docs.pytorch.org/docs/stable/generated/torch.fft.irfft.html#torch.fft.irfft) -```python -torch.fft.irfft(input, n=None, dim=- 1, norm='backward', *, out=None) -``` - -### [paddle.fft.irfft](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/fft/irfft_cn.html#paddle.fft.irfft) -```python -paddle.fft.irfft(x, n=None, axis=- 1, norm='backward', name=None) -``` - -其中,PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ----------------------------------- | ------------ | ----------------------------------------------------------------------- | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| n | n | 表示在傅里叶变换轴的长度 。 | -| dim | axis | 表示进行运算的轴,仅参数名不一致。 | -| norm | norm | 表示傅里叶变换的缩放模式。 | -| out | - | 表示输出的 Tensor , Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.fft.irfft(x, s, dim, norm, out=y) - -# Paddle 写法 -paddle.assign(paddle.fft.irfft(x, s, dim, norm) , y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.irfft2.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.irfft2.md deleted file mode 100644 index 4ec3881a2be..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.irfft2.md +++ /dev/null @@ -1,32 +0,0 @@ -## [ torch 参数更多 ]torch.fft.irfft2 -### [torch.fft.irfft2](https://docs.pytorch.org/docs/stable/generated/torch.fft.irfft2.html#torch.fft.irfft2) -```python -torch.fft.irfft2(input, s=None, dim=(- 2, - 1), norm='backward', *, out=None) -``` - -### [paddle.fft.irfft2](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/fft/irfft2_cn.html#paddle.fft.irfft2) -```python -paddle.fft.irfft2(x, s=None, axes=(- 2, - 1), norm='backward', name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ----------------------------------- | ------------ | ----------------------------------------------------------------------- | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| s | s | 表示在傅里叶变换轴的长度 。 | -| dim | axes | 表示进行运算的轴,仅参数名不一致。 | -| norm | norm | 表示傅里叶变换的缩放模式。 | -| out | - | 表示输出的 Tensor , Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.fft.irfft2(x, s, dim, norm, out=y) - -# Paddle 写法 -paddle.assign(paddle.fft.irfft2(x, s, dim, norm) , y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.irfftn.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.irfftn.md deleted file mode 100644 index 5f626916662..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.irfftn.md +++ /dev/null @@ -1,40 +0,0 @@ -## [ torch 参数更多 ]torch.fft.irfftn -### [torch.fft.irfftn](https://docs.pytorch.org/docs/stable/generated/torch.fft.irfftn.html#torch.fft.irfftn) -```python -torch.fft.irfftn(input, - s=None, - dim=None, - norm='backward', - *, - out=None) -``` - -### [paddle.fft.irfftn](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/fft/irfftn_cn.html#paddle.fft.irfftn) -```python -paddle.fft.irfftn(x, - s=None, - axes=None, - norm='backward', - name=None) -``` - -其中,PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x |输入 Tensor,仅参数名不一致。 | -| s | s |输出 Tensor 在每一个傅里叶变换轴上的长度。 | -| dim | axes |计算快速傅里叶变换的轴。仅参数名不一致。 | -| norm |norm |傅里叶变换的缩放模式,缩放系数由变换的方向和缩放模式同时决定,完全一致。| -| out | - |输出的 Tensor,Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.fft.irfftn(x, out=y) - -# Paddle 写法 -paddle.assign(paddle.fft.irfftn(x), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.rfft.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.rfft.md deleted file mode 100644 index bc8e382cdfe..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.rfft.md +++ /dev/null @@ -1,32 +0,0 @@ -## [ torch 参数更多 ]torch.fft.rfft -### [torch.fft.rfft](https://docs.pytorch.org/docs/stable/generated/torch.fft.rfft.html#torch.fft.rfft) -```python -torch.fft.rfft(input, n=None, dim=(- 2, - 1), norm='backward', *, out=None) -``` - -### [paddle.fft.rfft](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/fft/rfft_cn.html#paddle.fft.rfft) -```python -paddle.fft.rfft(x, n=None, axis=(- 2, - 1), norm='backward', name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ----------------------------------- | ------------ | ----------------------------------------------------------------------- | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| n | n | 表示在傅里叶变换轴的长度 。 | -| dim | axis | 表示进行运算的轴,仅参数名不一致。 | -| norm | norm | 表示傅里叶变换的缩放模式。 | -| out | - | 表示输出的 Tensor , Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.fft.rfft(x, n, dim, norm, out=y) - -# Paddle 写法 -paddle.assign(paddle.fft.rfft(x, n, dim, norm) , y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.rfft2.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.rfft2.md deleted file mode 100644 index f652776d01a..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.rfft2.md +++ /dev/null @@ -1,32 +0,0 @@ -## [ torch 参数更多 ]torch.fft.rfft2 -### [torch.fft.rfft2](https://docs.pytorch.org/docs/stable/generated/torch.fft.rfft2.html#torch.fft.rfft2) -```python -torch.fft.rfft2(input, s=None, dim=(-2, -1), norm=None, *, out=None) -``` - -### [paddle.fft.rfft2](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/fft/rfft2_cn.html#paddle.fft.rfft2) -```python -paddle.fft.rfft2(x, s=None, axes=(- 2, - 1), norm='backward', name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ----- | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| s | s | 表示在傅里叶变换轴的长度 。 | -| dim | axes | 表示进行运算的轴,仅参数名不一致。 | -| norm | norm | 表示傅里叶变换的缩放模式。 | -| out | - | 表示输出的 Tensor , Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.fft.rfft2(x, s, dim, norm, out=y) - -# Paddle 写法 -paddle.assign(paddle.fft.rfft2(x, s, dim, norm), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.rfftfreq.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.rfftfreq.md deleted file mode 100644 index e61563de312..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.rfftfreq.md +++ /dev/null @@ -1,63 +0,0 @@ -## [ torch 参数更多 ]torch.fft.rfftfreq -### [torch.fft.rfftfreq](https://docs.pytorch.org/docs/stable/generated/torch.fft.rfftfreq.html#torch.fft.rfftfreq) -```python -torch.fft.rfftfreq(n, - d=1.0, - *, - out=None, - dtype=None, - layout=torch.strided, - device=None, - requires_grad=False) -``` - -### [paddle.fft.rfftfreq](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/fft/rfftfreq_cn.html#paddle.fft.rfftfreq) -```python -paddle.fft.rfftfreq(n, - d=1.0, - dtype=None, - name=None) -``` - -其中,PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| n |n | 窗长度(傅里叶变换点数)。 | -| d |d | 采样间隔,采样率的倒数,默认值为 1。 | -| out |- |输出的 Tensor,Paddle 无此参数,需要转写。 | -| dtype |dtype | 返回 Tensor 的数据类型。 | -| layout |- |表示布局方式,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。| -| device |- |表示 Tensor 存放设备位置,Paddle 无此参数,需要转写。 | -| requires_grad |- |表示是否不阻断梯度传导,Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.fft.rfftfreq(x, out=y) - -# Paddle 写法 -paddle.assign(paddle.fft.rfftfreq(x), y) -``` - -#### requires_grad:是否需要求反向梯度,需要修改该 Tensor 的 stop_gradient 属性 -```python -# PyTorch 写法 -x = torch.fft.rfftfreq(x, requires_grad=True) - -# Paddle 写法 -x = paddle.fft.rfftfreq(x) -x.stop_gradient = False -``` - -#### device: Tensor 的设备 -```python -# PyTorch 写法 -torch.fft.rfftfreq(x, device=torch.device('cpu')) - -# Paddle 写法 -y = paddle.fft.rfftfreq(x) -y.cpu() -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.rfftn.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.rfftn.md deleted file mode 100644 index 0f9d467ff25..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fft.rfftn.md +++ /dev/null @@ -1,32 +0,0 @@ -## [ torch 参数更多 ]torch.fft.rfftn -### [torch.fft.rfftn](https://docs.pytorch.org/docs/stable/generated/torch.fft.rfftn.html#torch.fft.rfftn) -```python -torch.fft.rfftn(input, s=None, dim=None, norm='backward', *, out=None) -``` - -### [paddle.fft.rfftn](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/fft/rfftn_cn.html#paddle.fft.rfftn) -```python -paddle.fft.rfftn(x, s=None, axes=None, norm='backward', name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ----------------------------------- | ------------ | ----------------------------------------------------------------------- | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| s | s | 表示在傅里叶变换轴的长度 。 | -| dim | axes | 表示进行运算的轴,仅参数名不一致。 | -| norm | norm | 表示傅里叶变换的缩放模式。 | -| out | - | 表示输出的 Tensor , Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.fft.rfftn(x, s, dim, norm, out=y) - -# Paddle 写法 -paddle.assign(paddle.fft.rfftn(x, s, dim, norm) , y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fix.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fix.md deleted file mode 100644 index 22d0ed2e01d..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.fix.md +++ /dev/null @@ -1,31 +0,0 @@ -## [ torch 参数更多 ]torch.fix -### [torch.fix](https://docs.pytorch.org/docs/stable/generated/torch.fix.html#torch.fix) -```python -torch.fix(input, - *, - out=None) -``` - -### [paddle.trunc](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/trunc_cn.html#paddle.trunc) -```python -paddle.trunc(input, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | input | 表示输入的 Tensor。 | -| out | - | 表示输出的 Tensor , Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.fix(input, out=y) - -# Paddle 写法 -paddle.assign(paddle.trunc(input), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.frac.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.frac.md deleted file mode 100644 index 735ea5010b5..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.frac.md +++ /dev/null @@ -1,33 +0,0 @@ -## [ torch 参数更多 ]torch.frac -### [torch.frac](https://docs.pytorch.org/docs/stable/generated/torch.frac.html#torch.frac) -```python -torch.frac(input, - *, - out=None) -``` - -### [paddle.frac](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/frac_cn.html#paddle.frac) -```python -paddle.frac(x, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| out | - | 表示输出的 Tensor , Paddle 无此参数,需要转写。 | - - - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.frac(input, out=y) - -# Paddle 写法 -paddle.assign(paddle.frac(input), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.frexp.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.frexp.md deleted file mode 100644 index d01dff9efc1..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.frexp.md +++ /dev/null @@ -1,32 +0,0 @@ -## [ torch 参数更多 ]torch.frexp -### [torch.frexp](https://docs.pytorch.org/docs/stable/generated/torch.frexp.html#torch.frexp) -```python -torch.frexp(input, - *, - out=None) -``` - -### [paddle.frexp](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/frexp_cn.html#paddle.frexp) -```python -paddle.frexp(x, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor,仅参数名不一致。 | -| out | - | 表示输出的 Tensor,可选项,Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.frexp(x,out=y) - -# Paddle 写法 -out1, out2 = paddle.frexp(x) -paddle.assign(out1, y[0]), paddle.assign(out2, y[1]) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.gcd.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.gcd.md deleted file mode 100644 index a85a026e691..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.gcd.md +++ /dev/null @@ -1,30 +0,0 @@ -## [ torch 参数更多 ]torch.gcd -### [torch.gcd](https://docs.pytorch.org/docs/stable/generated/torch.gcd.html#torch.gcd) -```python -torch.gcd(input, other, *, out=None) -``` - -### [paddle.gcd](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/gcd_cn.html#paddle.gcd) -```python -paddle.gcd(x, y, name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | --------------------------------------------------- | -| input | x | 表示输入的第一个 Tensor ,仅参数名不一致。 | -| other | y | 表示输入的第二个 Tensor ,仅参数名不一致。 | -| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.gcd(x,y, out=output) - -# Paddle 写法 -paddle.assign(paddle.gcd(x,y), output) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.hamming_window.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.hamming_window.md deleted file mode 100644 index c522ec9b41a..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.hamming_window.md +++ /dev/null @@ -1,64 +0,0 @@ -## [ torch 参数更多 ]torch.hamming_window -### [torch.hamming\_window](https://docs.pytorch.org/docs/stable/generated/torch.hamming_window.html#torch.hamming_window) -```python -torch.hamming_window(window_length, periodic=True, alpha=0.54, beta=0.46, *, dtype=None, layout=torch.strided, device=None, requires_grad=False) -``` - -### [paddle.audio.functional.get\_window](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/audio/functional/get_window_cn.html#paddle.audio.functional.get_window) -```python -paddle.audio.functional.get_window(window, win_length, fftbins=True, dtype='float64') -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| - | window | 窗函数类型,Pytorch 无此参数,Paddle 需设置为 `hamming`。 | -| window_length | win_length | 输入窗口的长度,仅参数名不同。 | -| periodic | fftbins | 判断是否返回适用于过滤器设计的对称窗口,仅参数名不同。 | -| alpha | - | 窗函数中非线性部分的衰减速度,Paddle 无此参数,暂无转写方式。 | -| beta | - | 窗函数中线性部分的衰减速度,Paddle 无此参数,暂无转写方式。 | -| dtype | dtype | 返回 Tensor 的数据类型,支持 float32、float64。PyTorch 若参数为空,返回数据类型默认为 `float32`。 Paddle 若参数为空,返回数据类型默认为 `float64` ,需要转写。| -| layout | - | 表示布局方式, Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| device | - | 表示 Tensor 存放设备位置,Paddle 无此参数,需要转写。 | -| requires_grad | - | 表示是否计算梯度, Paddle 无此参数,需要转写。 | - -### 转写示例 -#### window:窗函数类型 -```python -# PyTorch 写法 -torch.hamming_window(10) - -# Paddle 写法 -paddle.audio.functional.get_window('hamming', 10) -``` - -#### dtype:返回 Tensor 的数据类型 -```python -# PyTorch 写法 -torch.hamming_window(10) - -# Paddle 写法 -paddle.audio.functional.get_window('hamming', 10, dtype='float32') -``` - -#### requires_grad:是否需要求反向梯度,需要修改该 Tensor 的 stop_gradient 属性 -```python -# PyTorch 写法 -torch.hamming_window(10, requires_grad=True) - -# Paddle 写法 -x = paddle.audio.functional.get_window('hamming', 10) -x.stop_gradient = False -``` - -#### device: Tensor 的设备 -```python -# PyTorch 写法 -torch.hamming_window(10, device=torch.device('cpu')) - -# Paddle 写法 -y = paddle.audio.functional.get_window('hamming', 10) -y.cpu() -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.hann_window.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.hann_window.md deleted file mode 100644 index 4dc556b0685..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.hann_window.md +++ /dev/null @@ -1,62 +0,0 @@ -## [ torch 参数更多 ]torch.hann_window -### [torch.hann\_window](https://docs.pytorch.org/docs/stable/generated/torch.hann_window.html#torch.hann_window) -```python -torch.hann_window(window_length, periodic=True, *, dtype=None, layout=torch.strided, device=None, requires_grad=False) -``` - -### [paddle.audio.functional.get\_window](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/audio/functional/get_window_cn.html#paddle.audio.functional.get_window) -```python -paddle.audio.functional.get_window(window, win_length, fftbins=True, dtype='float64') -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| - | window | 窗函数类型,Pytorch 无此参数,Paddle 需设置为 `hann`。 | -| window_length | win_length | 输入窗口的长度,仅参数名不同。 | -| periodic | fftbins | 判断是否返回适用于过滤器设计的对称窗口,仅参数名不同。 | -| dtype | dtype | 返回 Tensor 的数据类型,支持 float32、float64。PyTorch 若参数为空,返回数据类型默认为 `float32`。 Paddle 若参数为空,返回数据类型默认为 `float64` ,需要转写。| -| layout | - | 表示布局方式, Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| device | - | 表示 Tensor 存放设备位置,Paddle 无此参数,需要转写。 | -| requires_grad | - | 表示是否计算梯度, Paddle 无此参数,需要转写。 | - -### 转写示例 -#### window:窗函数类型 -```python -# PyTorch 写法 -torch.hann_window(5) - -# Paddle 写法 -paddle.audio.functional.get_window('hann', 5) -``` - -#### dtype:返回 Tensor 的数据类型 -```python -# PyTorch 写法 -torch.hann_window(10) - -# Paddle 写法 -paddle.audio.functional.get_window('hann', 10, dtype='float32') -``` - -#### requires_grad:是否需要求反向梯度,需要修改该 Tensor 的 stop_gradient 属性 -```python -# PyTorch 写法 -torch.hann_window(10, requires_grad=True) - -# Paddle 写法 -x = paddle.audio.functional.get_window('hann', 10) -x.stop_gradient = False -``` - -#### device: Tensor 的设备 -```python -# PyTorch 写法 -torch.hann_window(10, device=torch.device('cpu')) - -# Paddle 写法 -y = paddle.audio.functional.get_window('hann', 10) -y.cpu() -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.hypot.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.hypot.md deleted file mode 100644 index fae771b9897..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.hypot.md +++ /dev/null @@ -1,30 +0,0 @@ -## [ torch 参数更多 ]torch.hypot -### [torch.hypot](https://docs.pytorch.org/docs/stable/generated/torch.hypot.html#torch.hypot) -```python -torch.hypot(input, other, *, out=None) -``` - -### [paddle.hypot](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/hypot_cn.html#paddle.hypot) -```python -paddle.hypot(x, y, name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ---------------------------------------------- | -| input | x | 输入 Tensor,仅参数名不一致。 | -| other | y | 输入 Tensor,仅参数名不一致。 | -| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.hypot(x, y, out=out) - -# Paddle 写法 -paddle.assign(paddle.hypot(x, y), out) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.index_add.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.index_add.md deleted file mode 100644 index 64a918c9206..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.index_add.md +++ /dev/null @@ -1,42 +0,0 @@ -## [ torch 参数更多 ]torch.index_add -### [torch.index\_add](https://docs.pytorch.org/docs/stable/generated/torch.index_add.html#torch.index_add) -```python -torch.index_add(input, dim, index, source, *, alpha=1, out=None) -``` - -### [paddle.index\_add](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/index_add_cn.html#paddle.index_add) -```python -paddle.index_add(x, index, axis, value, name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| dim | axis | 表示进行运算的轴,仅参数名不一致。 | -| index | index | 包含索引下标的 1-D Tensor。 | -| source | value | 被加的 Tensor,仅参数名不一致。 | -| alpha | - | source 的 缩放倍数, Paddle 无此参数,需要转写。 Paddle 应将 alpha 和 source 的乘积作为 value。| -| out | - | 表示输出的 Tensor , Paddle 无此参数,需要转写。 | - - -### 转写示例 -#### alpha:source 的缩放倍数 -```python -# PyTorch 写法 -torch.index_add(x, dim=1, index=index, source=source, alpha=alpha) - -# Paddle 写法 -paddle.index_add(x, index=index, axis=1, value=alpha*source) -``` - -#### out:指定输出 -```python -# PyTorch 写法 -torch.index_add(x, dim=1, index=index, source=source, alpha=alpha, out=y) - -# Paddle 写法 -paddle.assign(paddle.index_add(x, index=index, axis=1, value=alpha*source), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.inner.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.inner.md deleted file mode 100644 index 8a1dda4e531..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.inner.md +++ /dev/null @@ -1,31 +0,0 @@ -## [ torch 参数更多 ]torch.inner -### [torch.inner](https://docs.pytorch.org/docs/stable/generated/torch.inner.html#torch.inner) -```python -torch.inner(input, other, *, out=None) -``` - -### [paddle.inner](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/inner_cn.html#paddle.inner) -```python -paddle.inner(x, y, name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 输入的 Tensor ,仅参数名不一致。 | -| other | y | 输入的 Tensor ,仅参数名不一致。 | -| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 | - - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.inner([[1., 2. , 3.], [4. ,5. ,6.]], [[1., 2. , 3.], [4. ,5. ,6.], [7., 8., 9.]], out=y) - -# Paddle 写法 -paddle.assign(paddle.inner([[1., 2. , 3.], [4. ,5. ,6.]], [[1., 2. , 3.], [4. ,5. ,6.], [7., 8., 9.]]), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.inverse.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.inverse.md deleted file mode 100644 index 2d03f627a1c..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.inverse.md +++ /dev/null @@ -1,30 +0,0 @@ -## [ torch 参数更多 ]torch.inverse -### [torch.inverse](https://docs.pytorch.org/docs/stable/generated/torch.inverse.html#torch.inverse) -```python -torch.inverse(input, *, out=None) -``` - -### [paddle.inverse](https://github.com/PaddlePaddle/Paddle/blob/5721d267e434c18fa64ff2b99839c7cb6d4cc04d/python/paddle/tensor/math.py#L2900) -```python -paddle.inverse(x, name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 输入的 Tensor ,仅参数名不一致。 | -| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 | - - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.inverse(torch.tensor([[2., 0.], [0., 2.]]), out=y) - -# Paddle 写法 -paddle.assign(paddle.inverse(paddle.to_tensor([[2., 0], [0, 2.]])), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.isneginf.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.isneginf.md deleted file mode 100644 index fc87c1d64f5..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.isneginf.md +++ /dev/null @@ -1,29 +0,0 @@ -## [ torch 参数更多 ]torch.isneginf -### [torch.isneginf](https://docs.pytorch.org/docs/stable/generated/torch.isneginf.html#torch.isneginf) -```python -torch.isneginf(input, *, out=None) -``` - -### [paddle.isneginf](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/isneginf_cn.html#paddle.isneginf) -```python -paddle.isneginf(x, name=None) -``` - -Pytorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------ | ----------- | ------------------------------------------------ | -| input | x | 输入的 Tensor,仅参数名不一致。 | -| out | - | 表示输出的 Tensor , Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# Pytorch 写法 -torch.isneginf(x, out=y) - -# Paddle 写法 -paddle.assign(paddle.isneginf(x), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.isposinf.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.isposinf.md deleted file mode 100644 index 5150658b8b6..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.isposinf.md +++ /dev/null @@ -1,29 +0,0 @@ -## [ torch 参数更多 ]torch.isposinf -### [torch.isposinf](https://docs.pytorch.org/docs/stable/generated/torch.isposinf.html#torch.isposinf) -```python -torch.isposinf(input, *, out=None) -``` - -### [paddle.isposinf](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/isposinf_cn.html#paddle.isposinf) -```python -paddle.isposinf(x, name=None) -``` - -Pytorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------ | ----------- | ------------------------------------------------ | -| input | x | 输入的 Tensor,仅参数名不一致。 | -| out | - | 表示输出的 Tensor , Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out 参数:指定输出 -```python -# Pytorch 写法 -torch.isposinf(x, out=y) - -# Paddle 写法 -paddle.assign(paddle.isposinf(x), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.lcm.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.lcm.md deleted file mode 100644 index 7340a80935a..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.lcm.md +++ /dev/null @@ -1,30 +0,0 @@ -## [ torch 参数更多 ]torch.lcm -### [torch.lcm](https://docs.pytorch.org/docs/stable/generated/torch.lcm.html#torch.lcm) -```python -torch.lcm(input, other, *, out=None) -``` - -### [paddle.lcm](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/lcm_cn.html#paddle.lcm) -```python -paddle.lcm(x, y, name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | --------------------------------------------------- | -| input | x | 表示输入的第一个 Tensor ,仅参数名不一致。 | -| other | y | 表示输入的第二个 Tensor ,仅参数名不一致。 | -| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.lcm(x,y, out=output) - -# Paddle 写法 -paddle.assign(paddle.lcm(x,y), output) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.ldexp.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.ldexp.md deleted file mode 100644 index b79df217636..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.ldexp.md +++ /dev/null @@ -1,29 +0,0 @@ -## [ torch 参数更多 ]torch.ldexp -### [torch.ldexp](https://docs.pytorch.org/docs/stable/generated/torch.ldexp.html#torch.ldexp) -```python -torch.ldexp(input, other, *, out=None) -``` - -### [paddle.ldexp](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/ldexp_cn.html#paddle.ldexp) -```python -paddle.ldexp(x, y, name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| other | y | 表示输入的 Tensor ,仅参数名不一致。 | -| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:输出的 Tensor -```python -# PyTorch 写法 -torch.ldexp(a, b, out=output) - -# Paddle 写法 -paddle.assign(paddle.ldexp(a,b), output=output) diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.lerp.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.lerp.md deleted file mode 100644 index 440c32b84ca..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.lerp.md +++ /dev/null @@ -1,39 +0,0 @@ -## [ torch 参数更多 ]torch.lerp -### [torch.lerp](https://docs.pytorch.org/docs/stable/generated/torch.lerp.html#torch.lerp) -```python -torch.lerp(input, - end, - weight, - *, - out=None) -``` - -### [paddle.lerp](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/lerp_cn.html#paddle.lerp) -```python -paddle.lerp(x, - y, - weight, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| end | y | 表示输入的 Tensor ,仅参数名不一致。 | -| weight | weight | 表示输入的 Tensor 。 | -| out | - | 表示输出的 Tensor , Paddle 无此参数,需要转写。 | - - - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.lerp(input1,input2,0.5, out=y) - -# Paddle 写法 -paddle.assign(paddle.lerp(input1,input2, 0.5), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.linalg.cholesky.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.linalg.cholesky.md deleted file mode 100644 index f31da904b59..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.linalg.cholesky.md +++ /dev/null @@ -1,31 +0,0 @@ -## [ torch 参数更多 ]torch.linalg.cholesky -### [torch.linalg.cholesky](https://docs.pytorch.org/docs/stable/generated/torch.linalg.cholesky.html#torch.linalg.cholesky) -```python -torch.linalg.cholesky(input, *, upper=False, out=None) -``` - -### [paddle.linalg.cholesky](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/linalg/cholesky_cn.html#paddle.linalg.cholesky) -```python -paddle.linalg.cholesky(x, upper=False, name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------- | ------- | -| input | x | 表示输入参数为多维 Tensor,它的维度应该为 [*, M, N],其中*为零或更大的批次尺寸,并且最里面的两个维度上的矩阵都应为对称的正定矩阵,仅参数名不一致。 | -| upper | upper | 表示是否返回上三角矩阵或下三角矩阵。 | -| out | - | 表示输出的 Tensor ,Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out: 输出的 Tensor -```python -# PyTorch 写法 -torch.linalg.cholesky(x, upper=False, out=output) - - -# Paddle 写法 -paddle.assign(paddle.linalg.cholesky(x, upper=False),output) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.linalg.cross.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.linalg.cross.md deleted file mode 100644 index 1951b76f63f..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.linalg.cross.md +++ /dev/null @@ -1,31 +0,0 @@ -## [ torch 参数更多 ]torch.linalg.cross -### [torch.linalg.cross](https://docs.pytorch.org/docs/stable/generated/torch.linalg.cross.html#torch.linalg.cross) -```python -torch.linalg.cross(input, other, *, dim=- 1, out=None) -``` - -### [paddle.cross](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/cross_cn.html#paddle.cross) -```python -paddle.cross(x, y, axis=None, name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ----------------------------------- | ------------ | ----------------------------------------------------------------------- | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| other | y | 表示输入的 Tensor ,仅参数名不一致。 | -| dim | axis | 表示进行运算的维度,参数默认值不一致。PyTorch 默认为`-1`,Paddle 默认为 `None`。 | -| out | - | 表示输出的 Tensor , Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.linalg.cross(input, other, dim=1, out=y) - -# Paddle 写法 -paddle.assign(paddle.cross(input, other, axis=1) , y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.linalg.det.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.linalg.det.md deleted file mode 100644 index 05f4c370da0..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.linalg.det.md +++ /dev/null @@ -1,28 +0,0 @@ -## [ torch 参数更多 ]torch.linalg.det -### [torch.linalg.det](https://docs.pytorch.org/docs/stable/generated/torch.linalg.det.html#torch.linalg.det) -```python -torch.linalg.det(A, *, out=None) -``` - -### [paddle.linalg.det](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/linalg/det_cn.html#paddle.linalg.det) -```python -paddle.linalg.det(x) -``` - -torch 参数更多,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| A | x | 表示输入的 Tensor ,仅参数名不一致。 | -| out | - | 表示输出 Tensor, Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.linalg.det(x, out=y) - -# Paddle 写法 -paddle.assign(paddle.linalg.det(x), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.linalg.eigh.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.linalg.eigh.md deleted file mode 100644 index ba6b567831e..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.linalg.eigh.md +++ /dev/null @@ -1,30 +0,0 @@ -## [ torch 参数更多 ]torch.linalg.eigh -### [torch.linalg.eigh](https://docs.pytorch.org/docs/stable/generated/torch.linalg.eigh.html#torch.linalg.eigh) -```python -torch.linalg.eigh(input, UPLO='L', *, out=None) -``` - -### [paddle.linalg.eigh](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/linalg/eigh_cn.html#paddle.linalg.eigh) -```python -paddle.linalg.eigh(x, UPLO='L', name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ------------------------------------------------ | -| input | x | 输入 Tensor,仅参数名不一致。 | -| UPLO | UPLO | 表示计算上三角或者下三角矩阵。 | -| out | - | 表示输出的 Tensor , Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out 参数:输出的 Tensor -```python -# PyTorch 写法: -torch.linalg.eigh(x, out=y) - -# Paddle 写法: -paddle.assign(paddle.linalg.eigh(x), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.linalg.inv.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.linalg.inv.md deleted file mode 100644 index 4461b812d99..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.linalg.inv.md +++ /dev/null @@ -1,29 +0,0 @@ -## [ torch 参数更多 ]torch.linalg.inv -### [torch.linalg.inv](https://docs.pytorch.org/docs/stable/generated/torch.linalg.inv.html#torch.linalg.inv) -```python -torch.linalg.inv(A, *, out=None) -``` - -### [paddle.linalg.inv](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/linalg/inv_cn.html#paddle.linalg.inv) -```python -paddle.linalg.inv(x, name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ---------------------------------------------------- | -| A | x | 输入 Tensor,仅参数名不一致。 | -| out | - | 表示输出的 Tensor , Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out 参数:输出的 Tensor -```python -# PyTorch 写法: -torch.linalg.inv(x, out=y) - -# Paddle 写法: -paddle.assign(paddle.linalg.inv(x), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.linalg.pinv.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.linalg.pinv.md deleted file mode 100644 index eff79b625a1..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.linalg.pinv.md +++ /dev/null @@ -1,32 +0,0 @@ -## [ torch 参数更多 ]torch.linalg.pinv -### [torch.linalg.pinv](https://docs.pytorch.org/docs/stable/generated/torch.linalg.pinv.html#torch.linalg.pinv) -```python -torch.linalg.pinv(input, *, atol=None, rtol=None, hermitian=False, out=None) -``` - -### [paddle.linalg.pinv](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/linalg/pinv_cn.html#paddle.linalg.pinv) -```python -paddle.linalg.pinv(x, rcond=1e-15, hermitian=False, name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| --------- | ------------ | ------------------------------------------------------------------- | -| input | x | 输入 Tensor,仅参数名不一致。 | -| atol | - | 绝对阈值,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| rtol | rcond | 奇异值(特征值)被截断的阈值,仅参数名不一致。 | -| hermitian | hermitian | 是否为 hermitian 矩阵或者实对称矩阵。 | -| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out 参数:输出的 Tensor -```python -# PyTorch 写法: -torch.linalg.pinv(x, out=y) - -# Paddle 写法: -paddle.assign(paddle.linalg.pinv(x), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.linalg.qr.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.linalg.qr.md deleted file mode 100644 index 33f52bec59e..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.linalg.qr.md +++ /dev/null @@ -1,30 +0,0 @@ -## [ torch 参数更多 ]torch.linalg.qr -### [torch.linalg.qr](https://docs.pytorch.org/docs/stable/generated/torch.linalg.qr.html#torch.linalg.qr) -```python -torch.linalg.qr(A, mode='reduced', *, out=None) -``` - -### [paddle.linalg.qr](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/linalg/qr_cn.html#paddle.linalg.qr) -```python -paddle.linalg.qr(x, mode='reduced', name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | -------------------------------------------------- | -| A | x | 输入 Tensor,仅参数名不一致。 | -| mode | mode | 控制正交三角分解的行为。 | -| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out 参数:输出的 Tensor -```python -# PyTorch 写法: -torch.linalg.qr(x, out=y) - -# Paddle 写法: -paddle.assign(paddle.linalg.qr(x), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.linalg.solve.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.linalg.solve.md deleted file mode 100644 index 8bc262431cf..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.linalg.solve.md +++ /dev/null @@ -1,31 +0,0 @@ -## [ torch 参数更多 ]torch.linalg.solve -### [torch.linalg.solve](https://docs.pytorch.org/docs/stable/generated/torch.linalg.solve.html#torch.linalg.solve) -```python -torch.linalg.solve(A, B, *, left=True, out=None) -``` - -### [paddle.linalg.solve](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/linalg/solve_cn.html#paddle.linalg.solve) -```python -paddle.linalg.solve(x, y, left=True, name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ------------------------------------------------------------ | -| A | x | 输入线性方程组求解的一个或一批方阵,仅参数名不一致。 | -| B | y | 输入线性方程组求解的右值,仅参数名不一致。 | -| left | left | 是否求解 AX = B 或 XA = B。 | -| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out 参数:输出的 Tensor -```python -# PyTorch 写法: -torch.linalg.solve(x1, x2, out=y) - -# Paddle 写法: -paddle.assign(paddle.linalg.solve(x1, x2), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.linspace.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.linspace.md deleted file mode 100644 index 6ca56263b0b..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.linspace.md +++ /dev/null @@ -1,67 +0,0 @@ -## [ torch 参数更多 ]torch.linspace -### [torch.linspace](https://docs.pytorch.org/docs/stable/generated/torch.linspace.html#torch.linspace) -```python -torch.linspace(start, - end, - steps, - *, - out=None, - dtype=None, - layout=torch.strided, - device=None, - requires_grad=False) -``` - -### [paddle.linspace](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/linspace_cn.html#paddle.linspace) -```python -paddle.linspace(start, - stop, - num, - dtype=None, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------------ | -| start | start | 表示区间开始的变量。 | -| end | stop | 表示区间结束的变量,仅参数名不一致。 | -| steps | num | 表示给定区间内需要划分的区间数,仅参数名不一致。 | -| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 | -| dtype | dtype | 表示输出 Tensor 类型。 | -| layout | - | 表示布局方式,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| device | - | 表示 Tensor 存放设备位置,Paddle 无此参数,需要转写。 | -| requires_grad | - | 表示是否计算梯度,Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.linspace(0, 10, 5, out=y) - -# Paddle 写法 -paddle.assign(paddle.linspace(0, 10, 5), y) -``` - -#### device: Tensor 的设备 -```python -# PyTorch 写法 -y = torch.linspace(0, 10, 5, device=torch.device('cpu')) - -# Paddle 写法 -y = paddle.linspace(0, 10, 5) -y.cpu() -``` - -#### requires_grad:是否求梯度 -```python -# PyTorch 写法 -y = torch.linspace(0, 10, 5, requires_grad=True) - -# Paddle 写法 -y = paddle.linspace(0, 10, 5) -y.stop_gradient = False -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.logaddexp.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.logaddexp.md deleted file mode 100644 index d4beda3cb61..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.logaddexp.md +++ /dev/null @@ -1,31 +0,0 @@ -## [ torch 参数更多 ]torch.logaddexp -### [torch.logaddexp](https://docs.pytorch.org/docs/stable/generated/torch.logaddexp.html#torch.logaddexp) -```python -torch.logaddexp(input, other, *, out=None) -``` - -### [paddle.logaddexp](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/logaddexp_cn.html#paddle.logaddexp) -```python -paddle.logaddexp(x, y, name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| other | y | 表示输入的 Tensor ,仅参数名不一致。 | -| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 | - - -### 转写示例 -#### out: 输出的 Tensor -```python -# PyTorch 写法 -torch.logaddexp(a, b, out=output) - -# Paddle 写法 -paddle.assign(paddle.logaddexp(a,b), output=output) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.logcumsumexp.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.logcumsumexp.md deleted file mode 100644 index d98f962841f..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.logcumsumexp.md +++ /dev/null @@ -1,31 +0,0 @@ -## [ torch 参数更多 ]torch.logcumsumexp -### [torch.logcumsumexp](https://docs.pytorch.org/docs/stable/generated/torch.logcumsumexp.html#torch.logcumsumexp) -```python -torch.logcumsumexp(input, dim, *, out=None) -``` - -### [paddle.logcumsumexp](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/logcumsumexp_cn.html#paddle.logcumsumexp) -```python -paddle.logcumsumexp(x, axis=None, dtype=None, name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ------------------------------------------------------------------- | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| dim | axis | 表示需要计算的维度,仅参数名不一致。 | -| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 | -| - | dtype | 表示输出 Tensor 的数据类型,PyTorch 无此参数,Paddle 保持默认即可。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.logcumsumexp(x,dim=0, out=output) - -# Paddle 写法 -paddle.assign(paddle.logcumsumexp(x,axis=0), output) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.logspace.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.logspace.md deleted file mode 100644 index 00205893fcb..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.logspace.md +++ /dev/null @@ -1,70 +0,0 @@ -## [ torch 参数更多 ]torch.logspace -### [torch.logspace](https://docs.pytorch.org/docs/stable/generated/torch.logspace.html#torch.logspace) -```python -torch.logspace(start, - end, - steps, - base=10.0, - *, - out=None, - dtype=None, - layout=torch.strided, - device=None, - requires_grad=False) -``` - -### [paddle.logspace](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/logspace_cn.html#paddle.logspace) -```python -paddle.logspace(start, - stop, - num, - base=10.0, - dtype=None, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------------ | -| start | start | 表示区间开始值以 base 为底的指数。 | -| end | stop | 表示区间结束值以 base 为底的指数,仅参数名不一致。 | -| steps | num | 表示给定区间内需要划分的区间数,仅参数名不一致。 | -| base | base | 表示对数函数的底数。 | -| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 | -| dtype | dtype | 表示输出 Tensor 类型。 | -| layout | - | 表示布局方式,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| device | - | 表示 Tensor 存放设备位置,Paddle 无此参数,需要转写。 | -| requires_grad | - | 表示是否计算梯度,Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.logspace(0, 10, 5, 2, out=y) - -# Paddle 写法 -paddle.assign(paddle.logspace(0, 10, 5, 2), y) -``` - -#### device: Tensor 的设备 -```python -# PyTorch 写法 -y = torch.logspace(0, 10, 5, 2, device=torch.device('cpu')) - -# Paddle 写法 -y = paddle.logspace(0, 10, 5, 2) -y.cpu() -``` - -#### requires_grad:是否求梯度 -```python -# PyTorch 写法 -y = torch.logspace(0, 10, 5, 2, requires_grad=True) - -# Paddle 写法 -y = paddle.logspace(0, 10, 5, 2) -y.stop_gradient = False -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.meshgrid.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.meshgrid.md deleted file mode 100644 index 023862c15e6..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.meshgrid.md +++ /dev/null @@ -1,34 +0,0 @@ -## [ torch 参数更多 ]torch.meshgrid -### [torch.meshgrid](https://docs.pytorch.org/docs/stable/generated/torch.meshgrid.html#torch.meshgrid) -```python -torch.meshgrid(*tensors, indexing=None) -``` - -### [paddle.meshgrid](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/meshgrid_cn.html#paddle.meshgrid) -```python -paddle.meshgrid(*args, **kargs) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| *tensors | *args | 输入的 Tensor 列表,仅参数名不一致。 | -| indexing | - | tensor 的组合模式。Paddle 无此参数,需要转写。 | - -### 转写示例 -#### indexing:tensor 的组合模式 -```python -# PyTorch 写法 (indexing 为‘ij’时) -torch.meshgrid(x, y, indexing='ij') - -# Paddle 写法 -paddle.meshgrid(x, y) - -# PyTorch 写法 (indexing 为‘xy’时) -torch.meshgrid(x, y, indexing='xy') - -# Paddle 写法 -list([i.T for i in paddle.meshgrid(x, y)]) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.mm.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.mm.md deleted file mode 100644 index 0eb94a6e154..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.mm.md +++ /dev/null @@ -1,34 +0,0 @@ -## [ torch 参数更多 ]torch.mm -### [torch.mm](https://docs.pytorch.org/docs/stable/generated/torch.mm.html#torch.mm) -```python -torch.mm(input, - mat2, - *, - out=None) -``` - -### [paddle.mm](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/mm_cn.html#paddle.mm) -```python -paddle.mm(input, mat2, name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,Paddle 多余参数保持默认即可,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | input | 表示输入的第一个 Tensor。 | -| mat2 | mat2 | 表示输入的第二个 Tensor。 | -| out | - | 表示输出的 Tensor , Paddle 无此参数,需要转写。 | - - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.mm(a, b, out=y) - -# Paddle 写法 -paddle.assign(paddle.mm(a, b), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.mode.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.mode.md deleted file mode 100644 index c08e050c8ab..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.mode.md +++ /dev/null @@ -1,32 +0,0 @@ -## [ torch 参数更多 ]torch.mode -### [torch.mode](https://docs.pytorch.org/docs/stable/generated/torch.mode.html#torch.mode) -```python -torch.mode(input, dim=-1, keepdim=False, *, out=None) -``` - -### [paddle.mode](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/mode_cn.html#paddle.mode) -```python -paddle.mode(x, axis=-1, keepdim=False, name=None) -``` - -其中 PyTorch 和 Paddle 功能一致,仅参数名不一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | -- | -| input | x | 输入的多维 Tensor,仅参数名不一致。 | -| dim | axis | 指定对输入 Tensor 进行运算的轴,仅参数名不一致。 | -| keepdim | keepdim | 是否保留指定的轴。 | -| out | - | 表示输出的 Tensor , Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.mode(x, dim, False, out=(a, b)) - -# Paddle 写法 -out1, out2 = paddle.mode(x, dim, False) -paddle.assign(out1, a), paddle.assign(out2, b) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.mv.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.mv.md deleted file mode 100644 index f764259e409..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.mv.md +++ /dev/null @@ -1,30 +0,0 @@ -## [ torch 参数更多 ]torch.mv -### [torch.mv](https://docs.pytorch.org/docs/stable/generated/torch.mv.html#torch.mv) -```python -torch.mv(input, vec, *, out=None) -``` - -### [paddle.mv](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/mv_cn.html#paddle.mv) -```python -paddle.mv(x, vec, name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| vec | vec | 表示输入的 Tensor 。 | -| out | - | 表示输出的 Tensor , Paddle 无此参数,需要转写 。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.mv(x, vec, out=y) - -# Paddle 写法 -paddle.assign(paddle.mv(x, vec), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nan_to_num.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nan_to_num.md deleted file mode 100644 index 64362639449..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nan_to_num.md +++ /dev/null @@ -1,32 +0,0 @@ -## [ torch 参数更多 ]torch.nan_to_num -### [torch.nan\_to\_num](https://docs.pytorch.org/docs/stable/generated/torch.nan_to_num.html#torch.nan_to_num) -```python -torch.nan_to_num(input, nan=0.0, posinf=None, neginf=None, *, out=None) -``` - -### [paddle.nan\_to\_num](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nan_to_num_cn.html#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/torch_more_args/torch.nanmean.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nanmean.md deleted file mode 100644 index ea9d14c417c..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nanmean.md +++ /dev/null @@ -1,48 +0,0 @@ -## [ torch 参数更多 ]torch.nanmean -### [torch.nanmean](https://docs.pytorch.org/docs/stable/generated/torch.nanmean.html#torch.nanmean) -```python -torch.nanmean(input, - dim=None, - keepdim=False, - *, - dtype=None, - out=None) -``` - -### [paddle.nanmean](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nanmean_cn.html#paddle.nanmean) -```python -paddle.nanmean(x, - axis=None, - keepdim=False, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor,仅参数名不一致。 | -| dim | axis | 表示进行运算的轴,可选项,仅参数名不一致。 | -| keepdim | keepdim | 表示是否保留计算后的维度,可选项。 | -| dtype | - | 指定输出数据类型,可选项,PyTorch 默认值为 None,Paddle 无此参数,需要转写。 | -| out | - | 表示输出的 Tensor,可选项,Paddle 无此参数,需要转写。 | - -### 转写示例 -#### dtype:指定数据类型 -```python -# PyTorch 写法 -torch.nanmean(x, dim=-1, dtype=torch.float32,out=y) - -# Paddle 写法 -paddle.assign(paddle.nanmean(x.astype('float32'),dim=-1),y) -``` - -#### out:指定输出 -```python -# PyTorch 写法 -torch.nanmean(t, dim=1,out=y) - -# Paddle 写法 -paddle.assign(paddle.nanmean(t, dim=1), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nanquantile.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nanquantile.md deleted file mode 100644 index aee0f237e52..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nanquantile.md +++ /dev/null @@ -1,45 +0,0 @@ -## [ torch 参数更多 ]torch.nanquantile -### [torch.nanquantile](https://docs.pytorch.org/docs/stable/generated/torch.nanquantile.html#torch.nanquantile) -```python -torch.nanquantile(input, - q, - dim=None, - keepdim=False, - *, - interpolation='linear', - out=None) -``` - -### [paddle.nanquantile](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nanquantile_cn.html#paddle.nanquantile) -```python -paddle.nanquantile(x, - q, - axis=None, - keepdim=False, - interpolation='linear', - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor,仅参数名不一致。 | -| q | q | 待计算的分位数。 | -| dim | axis | 指定对 x 进行计算的轴,仅参数名不一致。 | -| keepdim | keepdim | 是否在输出 Tensor 中保留减小的维度。| -| interpolation | interpolation | 当所需分位数位于两个数据点之间时使用的插值方法。 | -| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 | - - -### 转写示例 -#### out:指定输出 -```python -# Pytorch 写法 -torch.nanquantile(torch.tensor([float('nan'), 1., 2., 3.]), 0.6, interpolation='linear', out=y) - -# Paddle 写法 -paddle.assign(paddle.nanquantile(paddle.to_tensor([float('nan'), 1., 2., 3.]), 0.6, interpolation='linear'), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nansum.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nansum.md deleted file mode 100644 index a9104a1dde0..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nansum.md +++ /dev/null @@ -1,33 +0,0 @@ -## [ torch 参数更多 ]torch.nansum -### [torch.nansum](https://docs.pytorch.org/docs/stable/generated/torch.nansum.html#torch.nansum) -```python -torch.nansum(input, dim=None, keepdim=False, *, dtype=None, out=None) -``` - -### [paddle.nansum](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nansum_cn.html#paddle.nansum) -```python -paddle.nansum(x, axis=None, dtype=None, keepdim=False, name=None) -``` - -Paddle 比 PyTorch 支持更多参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ----------- | ------------ | ----------------------------------------------------------------------------------------- | -| input | x | 输入的 Tensor,数据类型为:float16、float32、float64、int32 或 int64。仅参数名不一致。 | -| dim | axis | 求和运算的维度。仅参数名不一致。 | -| keepdim | keepdim | 是否在输出 Tensor 中保留减小的维度。| -| dtype | dtype | 输出变量的数据类型。若参数为空,则输出变量的数据类型和输入变量相同,默认值为 None。 | -| out | - | 表示输出的 Tensor,可选项,Paddle 无此参数,需要转写。| - - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.nansum(t, dim=1,out=y) - -# Paddle 写法 -paddle.assign(paddle.nansum(t, dim=1), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.neg.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.neg.md deleted file mode 100644 index 1a622b37568..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.neg.md +++ /dev/null @@ -1,29 +0,0 @@ -## [ torch 参数更多 ]torch.neg -### [torch.neg](https://docs.pytorch.org/docs/stable/generated/torch.neg.html#torch.neg) -```python -torch.neg(input, *, out=None) -``` - -### [paddle.neg](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/neg_cn.html#paddle.neg) -```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/torch_more_args/torch.nn.BCELoss.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.BCELoss.md deleted file mode 100644 index b2e35f04932..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.BCELoss.md +++ /dev/null @@ -1,59 +0,0 @@ -## [ torch 参数更多 ]torch.nn.BCELoss -### [torch.nn.BCELoss](https://docs.pytorch.org/docs/stable/generated/torch.nn.BCELoss.html#torch.nn.BCELoss) -```python -torch.nn.BCELoss(weight=None, - size_average=None, - reduce=None, - reduction='mean') -``` - -### [paddle.nn.BCELoss](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/BCELoss_cn.html#paddle.nn.BCELoss) -```python -paddle.nn.BCELoss(weight=None, - reduction='mean', - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| weight | weight | 表示每个 batch 二值交叉熵的权重。 | -| size_average | - | PyTorch 已弃用,paddle 需要转写。 | -| reduce | - | PyTorch 已弃用,paddle 需要转写。 | -| reduction | reduction | 表示应用于输出结果的计算方式。 | - -### 转写示例 -#### size_average/reduce:对应到 reduction 为 sum -```python -# PyTorch 写法 -torch.nn.BCELoss(weight=w, size_average=False, reduce=True) -torch.nn.BCELoss(weight=w, size_average=False) - -# Paddle 写法 -paddle.nn.BCELoss(weight=w, reduction='sum') -``` - -#### size_average/reduce:对应到 reduction 为 mean -```python -# PyTorch 写法 -torch.nn.BCELoss(weight=w, size_average=True, reduce=True) -torch.nn.BCELoss(weight=w, reduce=True) -torch.nn.BCELoss(weight=w, size_average=True) -torch.nn.BCELoss(weight=w) - -# Paddle 写法 -paddle.nn.BCELoss(weight=w, reduction='mean') -``` - -#### size_average/reduce:对应到 reduction 为 none -```python -# PyTorch 写法 -torch.nn.BCELoss(weight=w, size_average=True, reduce=False) -torch.nn.BCELoss(weight=w, size_average=False, reduce=False) -torch.nn.BCELoss(weight=w, reduce=False) - -# Paddle 写法 -paddle.nn.BCELoss(weight=w, reduction='none') -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.BCEWithLogitsLoss.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.BCEWithLogitsLoss.md deleted file mode 100644 index 4df741c7c18..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.BCEWithLogitsLoss.md +++ /dev/null @@ -1,62 +0,0 @@ -## [ torch 参数更多 ]torch.nn.BCEWithLogitsLoss -### [torch.nn.BCEWithLogitsLoss](https://docs.pytorch.org/docs/stable/generated/torch.nn.BCEWithLogitsLoss.html#torch.nn.BCEWithLogitsLoss) -```python -torch.nn.BCEWithLogitsLoss(weight=None, - size_average=None, - reduce=None, - reduction='mean', - pos_weight=None) -``` - -### [paddle.nn.BCEWithLogitsLoss](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/BCEWithLogitsLoss_cn.html#paddle.nn.BCEWithLogitsLoss) -```python -paddle.nn.BCEWithLogitsLoss(weight=None, - reduction='mean', - pos_weight=None, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| weight | weight | 表示每个 batch 二值交叉熵的权重。 | -| size_average | - | PyTorch 已弃用,paddle 需要转写。 | -| reduce | - | PyTorch 已弃用,paddle 需要转写。 | -| reduction | reduction | 表示应用于输出结果的计算方式。 | -| pos_weight | pos_weight | 表示正类的权重。 | - -### 转写示例 -#### size_average/reduce:对应到 reduction 为 sum -```python -# PyTorch 写法 -torch.nn.BCEWithLogitsLoss(weight=w, size_average=False, reduce=True) -torch.nn.BCEWithLogitsLoss(weight=w, size_average=False) - -# Paddle 写法 -paddle.nn.BCEWithLogitsLoss(weight=w, reduction='sum') -``` - -#### size_average/reduce:对应到 reduction 为 mean -```python -# PyTorch 写法 -torch.nn.BCEWithLogitsLoss(weight=w, size_average=True, reduce=True) -torch.nn.BCEWithLogitsLoss(weight=w, reduce=True) -torch.nn.BCEWithLogitsLoss(weight=w, size_average=True) -torch.nn.BCEWithLogitsLoss(weight=w) - -# Paddle 写法 -paddle.nn.BCEWithLogitsLoss(weight=w, reduction='mean') -``` - -#### size_average/reduce:对应到 reduction 为 none -```python -# PyTorch 写法 -torch.nn.BCEWithLogitsLoss(weight=w, size_average=True, reduce=False) -torch.nn.BCEWithLogitsLoss(weight=w, size_average=False, reduce=False) -torch.nn.BCEWithLogitsLoss(weight=w, reduce=False) - -# Paddle 写法 -paddle.nn.BCEWithLogitsLoss(weight=w, reduction='none') -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.CosineEmbeddingLoss.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.CosineEmbeddingLoss.md deleted file mode 100644 index d7296856c22..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.CosineEmbeddingLoss.md +++ /dev/null @@ -1,55 +0,0 @@ -## [ torch 参数更多 ]torch.nn.CosineEmbeddingLoss -### [torch.nn.CosineEmbeddingLoss](https://docs.pytorch.org/docs/stable/generated/torch.nn.CosineEmbeddingLoss.html#torch.nn.CosineEmbeddingLoss) -```python -torch.nn.CosineEmbeddingLoss(margin=0.0, size_average=None, reduce=None, reduction='mean') -``` - -### [paddle.nn.CosineEmbeddingLoss](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/CosineEmbeddingLoss_cn.html#paddle.nn.CosineEmbeddingLoss) -```python -paddle.nn.CosineEmbeddingLoss(margin=0, reduction='mean', name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------ | ------------ | ---------------------------------------------- | -| margin | margin | 可以设置的范围为[-1, 1]。 | -| size_average | - | 已废弃,和 reduce 组合决定损失计算方式。 需要转写。 | -| reduce | - | 已废弃,和 size_average 组合决定损失计算方式。需要转写。 | -| reduction | reduction | 指定应用于输出结果的计算方式。 | - -### 转写示例 -#### size_average/reduce:对应到 reduction 为 sum -```python -# PyTorch 写法 -torch.nn.CosineEmbeddingLoss(margin=m, size_average=False, reduce=True) -torch.nn.CosineEmbeddingLoss(margin=m, size_average=False) - -# Paddle 写法 -paddle.nn.CosineEmbeddingLoss(margin=m, reduction='sum') -``` - -#### size_average/reduce:对应到 reduction 为 mean -```python -# PyTorch 写法 -torch.nn.CosineEmbeddingLoss(margin=m, size_average=True, reduce=True) -torch.nn.CosineEmbeddingLoss(margin=m, reduce=True) -torch.nn.CosineEmbeddingLoss(margin=m, size_average=True) -torch.nn.CosineEmbeddingLoss(margin=m) - -# Paddle 写法 -paddle.nn.CosineEmbeddingLoss(margin=m, reduction='mean') -``` - -#### size_average/reduce:对应到 reduction 为 none -```python -# PyTorch 写法 -torch.nn.CosineEmbeddingLoss(margin=m, size_average=True, reduce=False) -torch.nn.CosineEmbeddingLoss(margin=m, size_average=False, reduce=False) -torch.nn.CosineEmbeddingLoss(margin=m, reduce=False) - -# Paddle 写法 -paddle.nn.CosineEmbeddingLoss(margin=m, reduction='none') -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.CrossEntropyLoss.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.CrossEntropyLoss.md deleted file mode 100644 index d03ec516375..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.CrossEntropyLoss.md +++ /dev/null @@ -1,70 +0,0 @@ -## [ torch 参数更多 ]torch.nn.CrossEntropyLoss -### [torch.nn.CrossEntropyLoss](https://docs.pytorch.org/docs/stable/generated/torch.nn.CrossEntropyLoss.html#torch.nn.CrossEntropyLoss) -```python -torch.nn.CrossEntropyLoss(weight=None, - size_average=None, - ignore_index=-100, - reduce=None, - reduction='mean', - label_smoothing=0.0) -``` - -### [paddle.nn.CrossEntropyLoss](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/CrossEntropyLoss_cn.html#paddle.nn.CrossEntropyLoss) -```python -paddle.nn.CrossEntropyLoss(weight=None, - ignore_index=-100, - reduction='mean', - soft_label=False, - label_smoothing=0.0, - axis=-1, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| weight | weight | 表示每个类别的权重。 | -| size_average | - | PyTorch 已弃用,Paddle 无此参数,需要转写。| -| ignore_index | ignore_index | 表示忽略的一个标签值。 | -| reduce | - | PyTorch 已弃用, Paddle 无此参数,需要转写。 | -| reduction | reduction | 表示应用于输出结果的计算方式。 | -| label_smoothing | label_smoothing | 指定计算损失时的平滑量,参数完全一致。 | -| - | soft_label | 指明 label 是否为软标签,PyTorch 无此参数,Paddle 保持默认即可。 | -| - | axis | 进行 softmax 计算的维度索引,PyTorch 无此参数,Paddle 保持默认即可。 | - -### 转写示例 -#### size_average/reduce:对应到 reduction 为 sum -```python -# PyTorch 写法 -torch.nn.CrossEntropyLoss(weight=w, size_average=False, reduce=True) -torch.nn.CrossEntropyLoss(weight=w, size_average=False) - -# Paddle 写法 -paddle.nn.CrossEntropyLoss(weight=w, reduction='sum') -``` - -#### size_average/reduce:对应到 reduction 为 mean -```python -# PyTorch 写法 -torch.nn.CrossEntropyLoss(weight=w, size_average=True, reduce=True) -torch.nn.CrossEntropyLoss(weight=w, reduce=True) -torch.nn.CrossEntropyLoss(weight=w, size_average=True) -torch.nn.CrossEntropyLoss(weight=w) - -# Paddle 写法 -paddle.nn.CrossEntropyLoss(weight=w, reduction='mean') -``` - -#### size_average/reduce:对应到 reduction 为 none -```python -# PyTorch 写法 -torch.nn.CrossEntropyLoss(weight=w, size_average=True, reduce=False) -torch.nn.CrossEntropyLoss(weight=w, size_average=False, reduce=False) -torch.nn.CrossEntropyLoss(weight=w, reduce=False) - -# Paddle 写法 -paddle.nn.CrossEntropyLoss(weight=w, reduction='none') -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.Dropout.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.Dropout.md deleted file mode 100644 index 8c5b3061299..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.Dropout.md +++ /dev/null @@ -1,24 +0,0 @@ -## [ torch 参数更多 ]torch.nn.Dropout -### [torch.nn.Dropout](https://docs.pytorch.org/docs/stable/generated/torch.nn.Dropout.html#torch.nn.Dropout) -```python -torch.nn.Dropout(p=0.5, - inplace=False) -``` - -### [paddle.nn.Dropout](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/Dropout_cn.html#paddle.nn.Dropout) -```python -paddle.nn.Dropout(p=0.5, - axis=None, - mode="upscale_in_train”, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| p | p | 表示丢弃概率。 | -| inplace | - | 表示在不更改变量的内存地址的情况下,直接修改变量的值,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| - | axis | 指定对输入 Tensor 进行 Dropout 操作的轴,PyTorch 无此参数,Paddle 保持默认即可。 | -| - | mode | 表示丢弃单元的方式,PyTorch 无此参数,Paddle 保持默认即可。| diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.ELU.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.ELU.md deleted file mode 100644 index 6b2cbe52706..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.ELU.md +++ /dev/null @@ -1,20 +0,0 @@ -## [ torch 参数更多 ]torch.nn.ELU -### [torch.nn.ELU](https://docs.pytorch.org/docs/stable/generated/torch.nn.ELU.html#torch.nn.ELU) -```python -torch.nn.ELU(alpha=1.0, - inplace=False) -``` - -### [paddle.nn.ELU](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/ELU_cn.html#paddle.nn.ELU) -```python -paddle.nn.ELU(alpha=1.0, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| alpha | alpha | 表示公式中的超参数。 | -| inplace | - | 在不更改变量的内存地址的情况下,直接修改变量的值,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.GroupNorm.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.GroupNorm.md deleted file mode 100644 index e5ac166ac82..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.GroupNorm.md +++ /dev/null @@ -1,51 +0,0 @@ -## [ torch 参数更多 ]torch.nn.GroupNorm -### [torch.nn.GroupNorm](https://docs.pytorch.org/docs/stable/generated/torch.nn.GroupNorm.html#torch.nn.GroupNorm) -```python -torch.nn.GroupNorm(num_groups, - num_channels, - eps=1e-05, - affine=True, - device=True, - dtype=None) -``` - -### [paddle.nn.GroupNorm](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/GroupNorm_cn.html#paddle.nn.GroupNorm) -```python -paddle.nn.GroupNorm(num_groups, - num_channels, - epsilon=1e-05, - weight_attr=None, - bias_attr=None, - data_format='NCHW', - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| eps | epsilon | 为了数值稳定加在分母上的值。 | -| affine | - | 是否进行仿射变换,Paddle 无此参数,需要转写。 | -| device | - | 设备类型,Paddle 无此参数。暂无转写方式。 | -| dtype | - | 参数类型,Paddle 无此参数。暂无转写方式。 | -| - | weight_attr | 指定权重参数属性的对象。如果为 False, 则表示每个通道的伸缩固定为 1,不可改变。默认值为 None,表示使用默认的权重参数属性。 | -| - | bias_attr | 指定偏置参数属性的对象。如果为 False, 则表示每一个通道的偏移固定为 0,不可改变。默认值为 None,表示使用默认的偏置参数属性。 | -| - | data_format | 指定输入数据格式,PyTorch 无此参数,Paddle 保持默认即可。 | - -### 转写示例 -#### affine:是否进行仿射变换 -```python -# 当 PyTorch 的 affine 为`False`,表示 weight 和 bias 不进行更新,torch 写法 -torch.nn.GroupNorm(num_groups=5, num_channels=50, eps=1e-05, affine=False) - -# paddle 写法 -paddle.nn.GroupNorm(num_groups=5, num_channels=50, epsilon=1e-05, weight_attr=False, bias_attr=False) - -# 当 PyTorch 的 affine 为`True`,torch 写法 -torch.nn.GroupNorm(num_groups=5, num_channels=50, eps=1e-05, affine=True) - -# paddle 写法 -paddle.nn.GroupNorm(num_groups=5, num_channels=50, epsilon=1e-05) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.Hardswish.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.Hardswish.md deleted file mode 100644 index 8c84269edd7..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.Hardswish.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ torch 参数更多 ]torch.nn.Hardswish -### [torch.nn.Hardswish](https://docs.pytorch.org/docs/stable/generated/torch.nn.Hardswish.html#torch.nn.Hardswish) -```python -torch.nn.Hardswish(inplace=False) -``` - -### [paddle.nn.Hardswish](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/Hardswish_cn.html#paddle.nn.Hardswish) -```python -paddle.nn.Hardswish(name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ----------------------------------------------------------------------------------------------------------- | -| inplace | - | 在不更改变量的内存地址的情况下,直接修改变量的值,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.HingeEmbeddingLoss.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.HingeEmbeddingLoss.md deleted file mode 100644 index 1c01e165ed7..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.HingeEmbeddingLoss.md +++ /dev/null @@ -1,60 +0,0 @@ -## [ torch 参数更多 ]torch.nn.HingeEmbeddingLoss -### [torch.nn.HingeEmbeddingLoss](https://docs.pytorch.org/docs/stable/generated/torch.nn.HingeEmbeddingLoss.html#torch.nn.HingeEmbeddingLoss) -```python -torch.nn.HingeEmbeddingLoss(margin=1.0, - size_average=None, - reduce=None, - reduction='mean') -``` - -### [paddle.nn.HingeEmbeddingLoss](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/HingeEmbeddingLoss_cn.html#paddle.nn.HingeEmbeddingLoss) -```python -paddle.nn.HingeEmbeddingLoss(margin=1.0, - reduction='mean', - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------ | ------------ | ------------------------------------------------------------ | -| margin | margin | 当 label 为-1 时,该值决定了小于 margin 的 input 才需要纳入 hinge embedding loss 的计算。 | -| size_average | - | PyTorch 已弃用, Paddle 无此参数,需要转写。 | -| reduce | - | PyTorch 已弃用, Paddle 无此参数,需要转写。 | -| reduction | reduction | 表示应用于输出结果的计算方式。 | - -### 转写示例 -#### size_average/reduce:对应到 reduction 为 sum -```python -# PyTorch 写法 -torch.nn.HingeEmbeddingLoss(margin=m, size_average=False, reduce=True) -torch.nn.HingeEmbeddingLoss(margin=m, size_average=False) - -# Paddle 写法 -paddle.nn.HingeEmbeddingLoss(margin=m, reduction='sum') -``` - -#### size_average/reduce:对应到 reduction 为 mean -```python -# PyTorch 写法 -torch.nn.HingeEmbeddingLoss(margin=m, size_average=True, reduce=True) -torch.nn.HingeEmbeddingLoss(margin=m, reduce=True) -torch.nn.HingeEmbeddingLoss(margin=m, size_average=True) -torch.nn.HingeEmbeddingLoss(margin=m) - -# Paddle 写法 -paddle.nn.HingeEmbeddingLoss(margin=m, reduction='mean') -``` - -#### size_average/reduce:对应到 reduction 为 none -```python -# PyTorch 写法 -torch.nn.HingeEmbeddingLoss(margin=m, size_average=True, reduce=False) -torch.nn.HingeEmbeddingLoss(margin=m, size_average=False, reduce=False) -torch.nn.HingeEmbeddingLoss(margin=m, reduce=False) - -# Paddle 写法 -paddle.nn.HingeEmbeddingLoss(margin=m, reduction='none') -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.KLDivLoss.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.KLDivLoss.md deleted file mode 100644 index e9ba29b9d29..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.KLDivLoss.md +++ /dev/null @@ -1,58 +0,0 @@ -## [ torch 参数更多 ]torch.nn.KLDivLoss -### [torch.nn.KLDivLoss](https://docs.pytorch.org/docs/stable/generated/torch.nn.KLDivLoss.html#torch.nn.KLDivLoss) -```python -torch.nn.KLDivLoss(size_average=None, - reduce=None, - reduction='mean', - log_target=False) -``` - -### [paddle.nn.KLDivLoss](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/KLDivLoss_cn.html#paddle.nn.KLDivLoss) -```python -paddle.nn.KLDivLoss(reduction='mean', - log_target=False) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| size_average | - | PyTorch 已弃用, Paddle 无此参数,需要转写。 | -| reduce | - | PyTorch 已弃用, Paddle 无此参数,需要转写。 | -| reduction | reduction | 表示对输出结果的计算方式。 | -| log_target | log_target | 指定目标是否属于 log 空间。 | - -### 转写示例 -#### size_average/reduce:对应到 reduction 为 sum -```python -# PyTorch 写法 -torch.nn.KLDivLoss(size_average=False, reduce=True) -torch.nn.KLDivLoss(size_average=False) - -# Paddle 写法 -paddle.nn.KLDivLoss(reduction='sum') -``` - -#### size_average/reduce:对应到 reduction 为 mean -```python -# PyTorch 写法 -torch.nn.KLDivLoss(size_average=True, reduce=True) -torch.nn.KLDivLoss(reduce=True) -torch.nn.KLDivLoss(size_average=True) -torch.nn.KLDivLoss() - -# Paddle 写法 -paddle.nn.KLDivLoss(reduction='mean') -``` - -#### size_average/reduce:对应到 reduction 为 none -```python -# PyTorch 写法 -torch.nn.KLDivLoss(size_average=True, reduce=False) -torch.nn.KLDivLoss(size_average=False, reduce=False) -torch.nn.KLDivLoss(reduce=False) - -# Paddle 写法 -paddle.nn.KLDivLoss(reduction='none') -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.L1Loss.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.L1Loss.md deleted file mode 100644 index 1b4bf2c095a..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.L1Loss.md +++ /dev/null @@ -1,56 +0,0 @@ -## [ torch 参数更多 ]torch.nn.L1Loss -### [torch.nn.L1Loss](https://docs.pytorch.org/docs/stable/generated/torch.nn.L1Loss.html#torch.nn.L1Loss) -```python -torch.nn.L1Loss(size_average=None, - reduce=None, - reduction='mean') -``` - -### [paddle.nn.L1Loss](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/L1Loss_cn.html#paddle.nn.L1Loss) -```python -paddle.nn.L1Loss(reduction='mean', - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| size_average | - | 已弃用。需要转写。 | -| reduce | - | 已弃用。需要转写。 | -| reduction | reduction | 表示对输出结果的计算方式。 | - -### 转写示例 -#### size_average/reduce:对应到 reduction 为 sum -```python -# PyTorch 写法 -torch.nn.L1Loss(size_average=False, reduce=True) -torch.nn.L1Loss(size_average=False) - -# Paddle 写法 -paddle.nn.L1Loss(reduction='sum') -``` - -#### size_average/reduce:对应到 reduction 为 mean -```python -# PyTorch 写法 -torch.nn.L1Loss(size_average=True, reduce=True) -torch.nn.L1Loss(reduce=True) -torch.nn.L1Loss(size_average=True) -torch.nn.L1Loss() - -# Paddle 写法 -paddle.nn.L1Loss(reduction='mean') -``` - -#### size_average/reduce:对应到 reduction 为 none -```python -# PyTorch 写法 -torch.nn.L1Loss(size_average=True, reduce=False) -torch.nn.L1Loss(size_average=False, reduce=False) -torch.nn.L1Loss(reduce=False) - -# Paddle 写法 -paddle.nn.L1Loss(reduction='none') -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.LayerNorm.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.LayerNorm.md deleted file mode 100644 index 0faeb93df5d..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.LayerNorm.md +++ /dev/null @@ -1,47 +0,0 @@ -## [ torch 参数更多 ]torch.nn.LayerNorm -### [torch.nn.LayerNorm](https://docs.pytorch.org/docs/stable/generated/torch.nn.LayerNorm.html#torch.nn.LayerNorm) -```python -torch.nn.LayerNorm(normalized_shape, - eps=1e-05, - elementwise_affine=True, - device=None, - dtype=None) -``` - -### [paddle.nn.LayerNorm](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/LayerNorm_cn.html#paddle.nn.LayerNorm) -```python -paddle.nn.LayerNorm(normalized_shape, - epsilon=1e-05, - weight_attr=None, - bias_attr=None, - name=None) -``` - -两者功能一致但参数不一致,torch 参数更多,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| eps | epsilon | 为了数值稳定加在分母上的值。 | -| elementwise_affine | - | 是否进行仿射变换,Paddle 无此参数,需要转写。 | -| device | - | 设备类型,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| dtype | - | 参数类型,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| - | weight_attr | 指定权重参数属性的对象。如果为 False, 则表示每个通道的伸缩固定为 1,不可改变。默认值为 None,表示使用默认的权重参数属性。 | -| - | bias_attr | 指定偏置参数属性的对象。如果为 False, 则表示每一个通道的偏移固定为 0,不可改变。默认值为 None,表示使用默认的偏置参数属性。 | - - -### 转写示例 -#### elementwise_affine:是否进行仿射变换 -```python -# 当 PyTorch 的 elementwise_affine 为`False`,表示 weight 和 bias 不进行更新,torch 写法 -torch.nn.LayerNorm(normalized_shape=(256, 256), eps=1e-05, elementwise_affine=False) - -# paddle 写法 -paddle.nn.LayerNorm(normalized_shape=(256, 256), epsilon=1e-05, weight_attr=False, bias_attr=False) - -# 当 PyTorch 的 elementwise_affine 为`True`,torch 写法 -torch.nn.LayerNorm(normalized_shape=(256, 256), eps=1e-05, elementwise_affine=True) - -# paddle 写法 -paddle.nn.LayerNorm(normalized_shape=(256, 256), epsilon=1e-05) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.LeakyReLU.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.LeakyReLU.md deleted file mode 100644 index c59b4a4a369..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.LeakyReLU.md +++ /dev/null @@ -1,20 +0,0 @@ -## [ torch 参数更多 ]torch.nn.LeakyReLU -### [torch.nn.LeakyReLU](https://docs.pytorch.org/docs/stable/generated/torch.nn.LeakyReLU.html#torch.nn.LeakyReLU) -```python -torch.nn.LeakyReLU(negative_slope=0.01, - inplace=False) -``` - -### [paddle.nn.LeakyReLU](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/LeakyReLU_cn.html#paddle.nn.LeakyReLU) -```python -paddle.nn.LeakyReLU(negative_slope=0.01, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| negative_slope | negative_slope | 表示 x<0 时的斜率。 | -| inplace | - | 在不更改变量的内存地址的情况下,直接修改变量的值,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.MSELoss.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.MSELoss.md deleted file mode 100644 index 6b092ac0427..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.MSELoss.md +++ /dev/null @@ -1,55 +0,0 @@ -## [ torch 参数更多 ]torch.nn.MSELoss -### [torch.nn.MSELoss](https://docs.pytorch.org/docs/stable/generated/torch.nn.MSELoss.html#torch.nn.MSELoss) -```python -torch.nn.MSELoss(size_average=None, - reduce=None, - reduction='mean') -``` - -### [paddle.nn.MSELoss](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/MSELoss_cn.html#paddle.nn.MSELoss) -```python -paddle.nn.MSELoss(reduction='mean') -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| size_average | - | 已弃用。需要转写。 | -| reduce | - | 已弃用。需要转写。 | -| reduction | reduction | 表示对输出结果的计算方式。 | - -### 转写示例 -#### size_average/reduce:对应到 reduction 为 sum -```python -# PyTorch 写法 -torch.nn.MSELoss(size_average=False, reduce=True) -torch.nn.MSELoss(size_average=False) - -# Paddle 写法 -paddle.nn.MSELoss(reduction='sum') -``` - -#### size_average/reduce:对应到 reduction 为 mean -```python -# PyTorch 写法 -torch.nn.MSELoss(size_average=True, reduce=True) -torch.nn.MSELoss(reduce=True) -torch.nn.MSELoss(size_average=True) -torch.nn.MSELoss() - -# Paddle 写法 -paddle.nn.MSELoss(reduction='mean') -``` - -#### size_average/reduce:对应到 reduction 为 none -```python -# PyTorch 写法 -torch.nn.MSELoss(size_average=True, reduce=False) -torch.nn.MSELoss(size_average=False, reduce=False) -torch.nn.MSELoss(reduce=False) - -# Paddle 写法 -paddle.nn.MSELoss(reduction='none') -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.MarginRankingLoss.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.MarginRankingLoss.md deleted file mode 100644 index 3e0410e0c7a..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.MarginRankingLoss.md +++ /dev/null @@ -1,60 +0,0 @@ -## [ torch 参数更多 ]torch.nn.MarginRankingLoss -### [torch.nn.MarginRankingLoss](https://docs.pytorch.org/docs/stable/generated/torch.nn.MarginRankingLoss.html#torch.nn.MarginRankingLoss) -```python -torch.nn.MarginRankingLoss(margin=0.0, - size_average=None, - reduce=None, - reduction='mean') -``` - -### [paddle.nn.MarginRankingLoss](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/MarginRankingLoss_cn.html#paddle.nn.MarginRankingLoss) -```python -paddle.nn.MarginRankingLoss(margin=0.0, - reduction='mean', - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------ | ------------ | -------------------------------------------- | -| margin | margin | 用于加和的 margin 值。 | -| size_average | - | PyTorch 已弃用, Paddle 无此参数,需要转写。 | -| reduce | - | PyTorch 已弃用, Paddle 无此参数,需要转写。 | -| reduction | reduction | 表示应用于输出结果的计算方式。 | - -### 转写示例 -#### size_average/reduce:对应到 reduction 为 sum -```python -# PyTorch 写法 -torch.nn.MarginRankingLoss(margin=m, size_average=False, reduce=True) -torch.nn.MarginRankingLoss(margin=m, size_average=False) - -# Paddle 写法 -paddle.nn.MarginRankingLoss(margin=m, reduction='sum') -``` - -#### size_average/reduce:对应到 reduction 为 mean -```python -# PyTorch 写法 -torch.nn.MarginRankingLoss(margin=m, size_average=True, reduce=True) -torch.nn.MarginRankingLoss(margin=m, reduce=True) -torch.nn.MarginRankingLoss(margin=m, size_average=True) -torch.nn.MarginRankingLoss(margin=m) - -# Paddle 写法 -paddle.nn.MarginRankingLoss(margin=m, reduction='mean') -``` - -#### size_average/reduce:对应到 reduction 为 none -```python -# PyTorch 写法 -torch.nn.MarginRankingLoss(margin=m, size_average=True, reduce=False) -torch.nn.MarginRankingLoss(margin=m, size_average=False, reduce=False) -torch.nn.MarginRankingLoss(margin=m, reduce=False) - -# Paddle 写法 -paddle.nn.MarginRankingLoss(margin=m, reduction='none') -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.MaxPool1d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.MaxPool1d.md deleted file mode 100644 index c8852d599bf..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.MaxPool1d.md +++ /dev/null @@ -1,32 +0,0 @@ -## [ torch 参数更多 ]torch.nn.MaxPool1d -### [torch.nn.MaxPool1d](https://docs.pytorch.org/docs/stable/generated/torch.nn.MaxPool1d.html#torch.nn.MaxPool1d) -```python -torch.nn.MaxPool1d(kernel_size, - stride=None, - padding=0, - dilation=1, - return_indices=False, - ceil_mode=False) -``` - -### [paddle.nn.MaxPool1D](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/MaxPool1D_cn.html#paddle.nn.MaxPool1D) -```python -paddle.nn.MaxPool1D(kernel_size, - stride=None, - padding=0, - return_mask=False, - ceil_mode=False, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| kernel_size | kernel_size | 表示池化核大小。 | -| stride | stride | 表示池化核步长。 | -| padding | padding | 表示填充大小。 | -| dilation | - | 设置空洞池化的大小,Paddle 无此参数,暂无转写方式。 | -| return_indices | return_mask | 是否返回最大值的索引,仅参数名不一致。 | -| ceil_mode | ceil_mode | 表示是否用 ceil 函数计算输出的 height 和 width 。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.MaxPool2d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.MaxPool2d.md deleted file mode 100644 index ded2e9848ae..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.MaxPool2d.md +++ /dev/null @@ -1,32 +0,0 @@ -## [ torch 参数更多 ]torch.nn.MaxPool2d -### [torch.nn.MaxPool2d](https://docs.pytorch.org/docs/stable/generated/torch.nn.MaxPool2d.html#torch.nn.MaxPool2d) -```python -torch.nn.MaxPool2d(kernel_size, - stride=None, - padding=0, - dilation=1, - return_indices=False, - ceil_mode=False) -``` - -### [paddle.nn.MaxPool2D](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/MaxPool2D_cn.html#paddle.nn.MaxPool2D) -```python -paddle.nn.MaxPool2D(kernel_size, - stride=None, - padding=0, - return_mask=False, - ceil_mode=False, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| kernel_size | kernel_size | 表示池化核大小。 | -| stride | stride | 表示池化核步长。 | -| padding | padding | 表示填充大小。 | -| dilation | - | 设置空洞池化的大小,Paddle 无此参数,暂无转写方式。 | -| return_indices | return_mask | 是否返回最大值的索引,仅参数名不一致。 | -| ceil_mode | ceil_mode | 表示是否用 ceil 函数计算输出的 height 和 width 。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.MaxPool3d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.MaxPool3d.md deleted file mode 100644 index f4d239ca357..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.MaxPool3d.md +++ /dev/null @@ -1,34 +0,0 @@ -## [ torch 参数更多 ]torch.nn.MaxPool3d -### [torch.nn.MaxPool3d](https://docs.pytorch.org/docs/stable/generated/torch.nn.MaxPool3d.html#torch.nn.MaxPool3d) -```python -torch.nn.MaxPool3d(kernel_size, - stride=None, - padding=0, - dilation=1, - return_indices=False, - ceil_mode=False) -``` - -### [paddle.nn.MaxPool3D](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/MaxPool3D_cn.html#paddle.nn.MaxPool3D) -```python -paddle.nn.MaxPool3D(kernel_size, - stride=None, - padding=0, - ceil_mode=False, - return_mask=False, - data_format='NCDHW', - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| kernel_size | kernel_size | 表示池化核大小。 | -| stride | stride | 表示池化核步长。 | -| padding | padding | 表示填充大小。 | -| dilation | - | 设置空洞池化的大小,Paddle 无此参数,暂无转写方式。 | -| return_indices | return_mask | 是否返回最大值的索引,仅参数名不一致。 | -| ceil_mode | ceil_mode | 表示是否用 ceil 函数计算输出的 height 和 width 。 | -| - | data_format | 输入和输出的数据格式,PyTorch 无此参数,Paddle 保持默认即可。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.Module.register_forward_hook.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.Module.register_forward_hook.md deleted file mode 100644 index e684cebead2..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.Module.register_forward_hook.md +++ /dev/null @@ -1,20 +0,0 @@ -## [ torch 参数更多 ]torch.nn.Module.register_forward_hook -### [torch.nn.Module.register\_forward\_hook](https://docs.pytorch.org/docs/stable/generated/torch.nn.Module.html#torch.nn.Module.register_forward_hook) -```python -torch.nn.Module.register_forward_hook(hook, *, prepend=False, with_kwargs=False, always_call=False) -``` - -### [paddle.nn.Module.register_forward_post_hook](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/Layer_cn.html#register-forward-post-hook-hook) -```python -paddle.nn.Module.register_forward_post_hook(hook) -``` -PyTorch 参数更多,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| hook | hook | 被注册的 hook。 | -| prepend | - | 是否在其他 hook 执行前执行,Paddle 无此参数, 暂无转写方式。 | -| with_kwargs | - | 是否传入 forward 函数的参数,paddle 无此参数, 暂无转写方式。 | -| always_call | - | 是否无论成功运行都调用 hook,Paddle 无此参数,暂无转写方式。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.Module.register_forward_pre_hook.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.Module.register_forward_pre_hook.md deleted file mode 100644 index 4f71538b2fc..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.Module.register_forward_pre_hook.md +++ /dev/null @@ -1,19 +0,0 @@ -## [ torch 参数更多 ]torch.nn.Module.register_forward_pre_hook -### [torch.nn.Module.register\_forward\_pre\_hook](https://docs.pytorch.org/docs/stable/generated/torch.nn.Module.html#torch.nn.Module.register_forward_pre_hook) -```python -torch.nn.Module.register_forward_pre_hook(hook, *, prepend=False, with_kwargs=False) -``` - -### [paddle.nn.Module.register_forward_pre_hook](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/Layer_cn.html#register-forward-pre-hook-hook) -```python -paddle.nn.Module.register_forward_pre_hook(hook) -``` -PyTorch 参数更多,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| hook | hook | 被注册的 hook。 | -| prepend | - | 是否在其他 hook 执行前执行,Paddle 无此参数,暂无转写方式。 | -| with_kwargs| - | 是否传入 forward 函数的参数,Paddle 无此参数,暂无转写方式。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.MultiLabelMarginLoss.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.MultiLabelMarginLoss.md deleted file mode 100644 index e282ee561fe..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.MultiLabelMarginLoss.md +++ /dev/null @@ -1,54 +0,0 @@ -## [ torch 参数更多 ]torch.nn.MultiLabelMarginLoss -### [torch.nn.MultiLabelMarginLoss](https://docs.pytorch.org/docs/stable/generated/torch.nn.MultiLabelMarginLoss.html#torch.nn.MultiLabelMarginLoss) -```python -torch.nn.MultiLabelMarginLoss(size_average=None, reduce=None, reduction='mean') -``` - -### [paddle.nn.MultiLabelMarginLoss](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/MultiLabelMarginLoss_cn.html#paddle.nn.MultiLabelMarginLoss) -```python -paddle.nn.MultiLabelMarginLoss(reduction='mean', name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------ | ------------ | ---------------------------------------------- | -| size_average | - | 已废弃,和 reduce 组合决定损失计算方式,需要转写。 | -| reduce | - | 已废弃,和 size_average 组合决定损失计算方式,需要转写。 | -| reduction | reduction | 指定应用于输出结果的计算方式。 | - -### 转写示例 -#### size_average/reduce:对应到 reduction 为 sum -```python -# PyTorch 写法 -torch.nn.MultiLabelMarginLoss(size_average=False, reduce=True) -torch.nn.MultiLabelMarginLoss(size_average=False) - -# Paddle 写法 -paddle.nn.MultiLabelMarginLoss(reduction='sum') -``` - -#### size_average/reduce:对应到 reduction 为 mean -```python -# PyTorch 写法 -torch.nn.MultiLabelMarginLoss(size_average=True, reduce=True) -torch.nn.MultiLabelMarginLoss(reduce=True) -torch.nn.MultiLabelMarginLoss(size_average=True) -torch.nn.MultiLabelMarginLoss() - -# Paddle 写法 -paddle.nn.MultiLabelMarginLoss(reduction='mean') -``` - -#### size_average/reduce:对应到 reduction 为 none -```python -# PyTorch 写法 -torch.nn.MultiLabelMarginLoss(size_average=True, reduce=False) -torch.nn.MultiLabelMarginLoss(size_average=False, reduce=False) -torch.nn.MultiLabelMarginLoss(reduce=False) - -# Paddle 写法 -paddle.nn.MultiLabelMarginLoss(reduction='none') -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.MultiLabelSoftMarginLoss.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.MultiLabelSoftMarginLoss.md deleted file mode 100644 index 966c8917121..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.MultiLabelSoftMarginLoss.md +++ /dev/null @@ -1,55 +0,0 @@ -## [ torch 参数更多 ]torch.nn.MultiLabelSoftMarginLoss -### [torch.nn.MultiLabelSoftMarginLoss](https://docs.pytorch.org/docs/stable/generated/torch.nn.MultiLabelSoftMarginLoss.html#torch.nn.MultiLabelSoftMarginLoss) -```python -torch.nn.MultiLabelSoftMarginLoss(weight=None, size_average=None, reduce=None, reduction='mean') -``` - -### [paddle.nn.MultiLabelSoftMarginLoss](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/MultiLabelSoftMarginLoss_cn.html#paddle.nn.MultiLabelSoftMarginLoss) -```python -paddle.nn.MultiLabelSoftMarginLoss(weight=None, reduction='mean', name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------ | ------------ | ---------------------------------------------- | -| weight | weight | 手动设定权重。 | -| size_average | - | 已废弃,和 reduce 组合决定损失计算方式。需要转写。 | -| reduce | - | 已废弃,和 size_average 组合决定损失计算方式。需要转写。 | -| reduction | reduction | 指定应用于输出结果的计算方式。 | - -### 转写示例 -#### size_average/reduce:对应到 reduction 为 sum -```python -# PyTorch 写法 -torch.nn.MultiLabelSoftMarginLoss(weight=w, size_average=False, reduce=True) -torch.nn.MultiLabelSoftMarginLoss(weight=w, size_average=False) - -# Paddle 写法 -paddle.nn.MultiLabelSoftMarginLoss(weight=w, reduction='sum') -``` - -#### size_average/reduce:对应到 reduction 为 mean -```python -# PyTorch 写法 -torch.nn.MultiLabelSoftMarginLoss(weight=w, size_average=True, reduce=True) -torch.nn.MultiLabelSoftMarginLoss(weight=w, reduce=True) -torch.nn.MultiLabelSoftMarginLoss(weight=w, size_average=True) -torch.nn.MultiLabelSoftMarginLoss(weight=w) - -# Paddle 写法 -paddle.nn.MultiLabelSoftMarginLoss(weight=w, reduction='mean') -``` - -#### size_average/reduce:对应到 reduction 为 none -```python -# PyTorch 写法 -torch.nn.MultiLabelSoftMarginLoss(weight=w, size_average=True, reduce=False) -torch.nn.MultiLabelSoftMarginLoss(weight=w, size_average=False, reduce=False) -torch.nn.MultiLabelSoftMarginLoss(weight=w, reduce=False) - -# Paddle 写法 -paddle.nn.MultiLabelSoftMarginLoss(weight=w, reduction='none') -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.MultiMarginLoss.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.MultiMarginLoss.md deleted file mode 100644 index fcbbf594bb3..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.MultiMarginLoss.md +++ /dev/null @@ -1,57 +0,0 @@ -## [ torch 参数更多 ]torch.nn.MultiMarginLoss -### [torch.nn.MultiMarginLoss](https://docs.pytorch.org/docs/stable/generated/torch.nn.MultiMarginLoss.html#torch.nn.MultiMarginLoss) -```python -torch.nn.MultiMarginLoss(p=1, margin=1.0, weight=None, size_average=None, reduce=None, reduction='mean') -``` - -### [paddle.nn.MultiMarginLoss](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/MultiMarginLoss_cn.html#paddle.nn.MultiMarginLoss) -```python -paddle.nn.MultiMarginLoss(p: int = 1, margin: float = 1.0, weight=None, reduction: str = 'mean', name: str = None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------------ | ------------------ | ---------------------------------------------------------------------------------- | -| p | p | 手动指定幂次方指数大小,默认为 1。 | -| margin | margin | 手动指定间距,默认为 1。 | -| weight | weight | 权重值,默认为 None。 如果给定权重则形状为 `[C,]`。 | -| size_average | - | 已废弃(可用 `reduction` 代替)。表示是否采用 batch 中各样本 loss 平均值作为最终的 loss。如果置 False,则采用加和作为 loss。默认为 True,paddle 需要转写。 | -| reduce | - | 已废弃(可用 `reduction` 代替)。表示是否采用输出单个值作为 loss。如果置 False,则每个元素输出一个 loss 并忽略 `size_average`。默认为 True,paddle 需要转写。 | -| reduction | reduction | 指定应用于输出结果的计算方式,可选值有 `none`、`mean` 和 `sum`。默认为 `mean`,计算 mini-batch loss 均值。设置为 `sum` 时,计算 mini-batch loss 的总和。设置为 `none` 时,则返回 loss Tensor。默认值下为 `mean`。 | - -### 转写示例 -#### size_average/reduce:对应到 reduction 为 sum -```python -# PyTorch 写法 -torch.nn.MultiMarginLoss(p=1, margin=1.0, weight=w, size_average=False, reduce=True) -torch.nn.MultiMarginLoss(p=1, margin=1.0, weight=w, size_average=False) - -# Paddle 写法 -paddle.nn.MultiMarginLoss(p=1, margin=1.0, weight=w, reduction='sum') -``` - -#### size_average/reduce:对应到 reduction 为 mean -```python -# PyTorch 写法 -torch.nn.MultiMarginLoss(p=1, margin=1.0, weight=w, size_average=True, reduce=True) -torch.nn.MultiMarginLoss(p=1, margin=1.0, weight=w, reduce=True) -torch.nn.MultiMarginLoss(p=1, margin=1.0, weight=w, size_average=True) -torch.nn.MultiMarginLoss(p=1, margin=1.0, weight=w) - -# Paddle 写法 -paddle.nn.MultiMarginLoss(p=1, margin=1.0, weight=w, reduction='mean') -``` - -#### size_average/reduce:对应到 reduction 为 none -```python -# PyTorch 写法 -torch.nn.MultiMarginLoss(p=1, margin=1.0, weight=w, size_average=True, reduce=False) -torch.nn.MultiMarginLoss(p=1, margin=1.0, weight=w, size_average=False, reduce=False) -torch.nn.MultiMarginLoss(p=1, margin=1.0, weight=w, reduce=False) - -# Paddle 写法 -paddle.nn.MultiMarginLoss(p=1, margin=1.0, weight=w, reduction='none') -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.NLLLoss.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.NLLLoss.md deleted file mode 100644 index d93b4c83e13..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.NLLLoss.md +++ /dev/null @@ -1,63 +0,0 @@ -## [ torch 参数更多 ]torch.nn.NLLLoss -### [torch.nn.NLLLoss](https://docs.pytorch.org/docs/stable/generated/torch.nn.NLLLoss.html#torch.nn.NLLLoss) -```python -torch.nn.NLLLoss(weight=None, - size_average=None, - ignore_index=- 100, - reduce=None, - reduction='mean') -``` - -### [paddle.nn.NLLLoss](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/NLLLoss_cn.html#paddle.nn.NLLLoss) -```python -paddle.nn.NLLLoss(weight=None, - ignore_index=- 100, - reduction='mean', - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------ | ------------ | -------------------------------------------- | -| weight | weight | 表示每个类别的权重。 | -| size_average | - | PyTorch 已弃用, Paddle 无此参数,需要转写。 | -| ignore_index | ignore_index | 表示忽略的一个标签值。 | -| reduce | - | PyTorch 已弃用, Paddle 无此参数,需要转写。 | -| reduction | reduction | 表示应用于输出结果的计算方式。 | - -### 转写示例 -#### size_average/reduce:对应到 reduction 为 sum -```python -# PyTorch 写法 -torch.nn.NLLLoss(weight=w, ignore_index=-100, size_average=False, reduce=True) -torch.nn.NLLLoss(weight=w, ignore_index=-100, size_average=False) - -# Paddle 写法 -paddle.nn.NLLLoss(weight=w, ignore_index=-100, reduction='sum') -``` - -#### size_average/reduce:对应到 reduction 为 mean -```python -# PyTorch 写法 -torch.nn.NLLLoss(weight=w, ignore_index=-100, size_average=True, reduce=True) -torch.nn.NLLLoss(weight=w, ignore_index=-100, reduce=True) -torch.nn.NLLLoss(weight=w, ignore_index=-100, size_average=True) -torch.nn.NLLLoss(weight=w, ignore_index=-100) - -# Paddle 写法 -paddle.nn.NLLLoss(weight=w, ignore_index=-100, reduction='mean') -``` - -#### size_average/reduce:对应到 reduction 为 none -```python -# PyTorch 写法 -torch.nn.NLLLoss(weight=w, ignore_index=-100, size_average=True, reduce=False) -torch.nn.NLLLoss(weight=w, ignore_index=-100, size_average=False, reduce=False) -torch.nn.NLLLoss(weight=w, ignore_index=-100, reduce=False) - -# Paddle 写法 -paddle.nn.NLLLoss(weight=w, ignore_index=-100, reduction='none') -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.PReLU.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.PReLU.md deleted file mode 100644 index f8ae535d8a4..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.PReLU.md +++ /dev/null @@ -1,29 +0,0 @@ -## [ torch 参数更多 ]torch.nn.PReLU -### [torch.nn.PReLU](https://docs.pytorch.org/docs/stable/generated/torch.nn.PReLU.html#torch.nn.PReLU) -```python -torch.nn.PReLU(num_parameters=1, - init=0.25, - device=None, - dtype=None) -``` - -### [paddle.nn.PReLU](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/PReLU_cn.html#paddle.nn.PReLU) -```python -paddle.nn.PReLU(num_parameters=1, - init=0.25, - weight_attr=None, - data_format='NCHW', - name=None) -``` - -其中 PyTorch 与 Paddle 均支持更多其它参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| num_parameters | num_parameters | 表示可训练 `weight` 的数量。 | -| init | init | 表示 `weight` 的初始值。 | -| device | - | 指定设备,PaddlePaddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| dtype | - | 指定数据类型,PaddlePaddle 无此功能。暂无转写方式。 | -| - | weight_attr | 指定权重参数属性的对象,PyTorch 无此参数,Paddle 保持默认即可。 | -| - | data_format | 指定输入的数据格式,PyTorch 无此参数,Paddle 保持默认即可。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.PoissonNLLLoss.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.PoissonNLLLoss.md deleted file mode 100644 index f4ddeaf80ae..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.PoissonNLLLoss.md +++ /dev/null @@ -1,57 +0,0 @@ -## [ torch 参数更多 ]torch.nn.PoissonNLLLoss -### [torch.nn.PoissonNLLLoss](https://docs.pytorch.org/docs/stable/generated/torch.nn.PoissonNLLLoss.html#torch.nn.PoissonNLLLoss) -```python -torch.nn.PoissonNLLLoss(log_input=True, full=False, size_average=None, eps=1e-08, reduce=None, reduction='mean') -``` - -### [paddle.nn.PoissonNLLLoss](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/PoissonNLLLoss_cn.html#paddle.nn.PoissonNLLLoss) -```python -paddle.nn.PoissonNLLLoss(log_input=True, full=False, epsilon=1e-8, reduction='mean', name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------------ | ------------------ | ---------------------------------------------------------------------------------- | -| log_input | log_input | 输入是否为对数函数映射后结果。 | -| full | full | 是否在损失计算中包括 Stirling 近似项。 | -| size_average | - | 已废弃(可用 `reduction` 代替)。表示是否采用 batch 中各样本 loss 平均值作为最终的 loss。如果置 False,则采用加和作为 loss。默认为 True,paddle 需要转写。 | -| eps | epsilon | 在 `log_input` 为 True 时使用的常数小量。默认值为 1e-8,仅参数名不一致。 | -| reduce | - | 已废弃(可用 `reduction` 代替)。表示是否采用输出单个值作为 loss。如果置 False,则每个元素输出一个 loss 并忽略 `size_average`。默认为 True,paddle 需要转写。 | -| reduction | reduction | 指定应用于输出结果的计算方式,可选值有 `none`、`mean` 和 `sum`。默认为 `mean`,计算 mini-batch loss 均值。设置为 `sum` 时,计算 mini-batch loss 的总和。设置为 `none` 时,则返回 loss Tensor。默认值下为 `mean`。两者完全一致。 | - -### 转写示例 -#### size_average/reduce:对应到 reduction 为 sum -```python -# PyTorch 写法 -torch.nn.PoissonNLLLoss(log_input=True, full=False, eps=1e-8, size_average=False, reduce=True) -torch.nn.PoissonNLLLoss(log_input=True, full=False, eps=1e-8, size_average=False) - -# Paddle 写法 -paddle.nn.PoissonNLLLoss(log_input=True, full=False, epsilon=1e-8, reduction='sum') -``` - -#### size_average/reduce:对应到 reduction 为 mean -```python -# PyTorch 写法 -torch.nn.PoissonNLLLoss(log_input=True, full=False, eps=1e-8, size_average=True, reduce=True) -torch.nn.PoissonNLLLoss(log_input=True, full=False, eps=1e-8, reduce=True) -torch.nn.PoissonNLLLoss(log_input=True, full=False, eps=1e-8, size_average=True) -torch.nn.PoissonNLLLoss(log_input=True, full=False, eps=1e-8) - -# Paddle 写法 -paddle.nn.PoissonNLLLoss(log_input=True, full=False, epsilon=1e-8, reduction='mean') -``` - -#### size_average/reduce:对应到 reduction 为 none -```python -# PyTorch 写法 -torch.nn.PoissonNLLLoss(log_input=True, full=False, eps=1e-8, size_average=True, reduce=False) -torch.nn.PoissonNLLLoss(log_input=True, full=False, eps=1e-8, size_average=False, reduce=False) -torch.nn.PoissonNLLLoss(log_input=True, full=False, eps=1e-8, reduce=False) - -# Paddle 写法 -paddle.nn.PoissonNLLLoss(log_input=True, full=False, epsilon=1e-8, reduction='none') -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.ReLU.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.ReLU.md deleted file mode 100644 index bb564fa87a6..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.ReLU.md +++ /dev/null @@ -1,17 +0,0 @@ -## [ torch 参数更多 ]torch.nn.ReLU -### [torch.nn.ReLU](https://docs.pytorch.org/docs/stable/generated/torch.nn.ReLU.html#torch.nn.ReLU) -```python -torch.nn.ReLU(inplace=False) -``` - -### [paddle.nn.ReLU](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/ReLU_cn.html#paddle.nn.ReLU) -```python -paddle.nn.ReLU(name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| inplace | - | 在不更改变量的内存地址的情况下,直接修改变量的值,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.ReLU6.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.ReLU6.md deleted file mode 100644 index 662fa4ff7de..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.ReLU6.md +++ /dev/null @@ -1,18 +0,0 @@ -## [ torch 参数更多 ]torch.nn.ReLU6 -### [torch.nn.ReLU6](https://docs.pytorch.org/docs/stable/generated/torch.nn.ReLU6.html#torch.nn.ReLU6) -```python -torch.nn.ReLU6(inplace=False) -``` - -### [paddle.nn.ReLU6](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/ReLU6_cn.html#paddle.nn.ReLU6) -```python -paddle.nn.ReLU6(name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | --------------------------------------------------------------------------------------------------------------- | -| inplace | - | 表示在不更改变量的内存地址的情况下,直接修改变量的值,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.SoftMarginLoss.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.SoftMarginLoss.md deleted file mode 100644 index df154e890d4..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.SoftMarginLoss.md +++ /dev/null @@ -1,57 +0,0 @@ -## [ torch 参数更多 ]torch.nn.SoftMarginLoss -### [torch.nn.SoftMarginLoss](https://docs.pytorch.org/docs/stable/generated/torch.nn.SoftMarginLoss.html#torch.nn.SoftMarginLoss) -```python -torch.nn.SoftMarginLoss(size_average=None, - reduce=None, - reduction='mean') -``` - -### [paddle.nn.SoftMarginLoss](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/SoftMarginLoss_cn.html#paddle.nn.SoftMarginLoss) -```python -paddle.nn.SoftMarginLoss(reduction='mean', - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------ | ------------ | -------------------------------------------- | -| size_average | - | PyTorch 已弃用, Paddle 无此参数,需要转写。 | -| reduce | - | PyTorch 已弃用, Paddle 无此参数,需要转写。 | -| reduction | reduction | 表示应用于输出结果的计算方式。 | - -### 转写示例 -#### size_average/reduce:对应到 reduction 为 sum -```python -# PyTorch 写法 -torch.nn.SoftMarginLoss(size_average=False, reduce=True) -torch.nn.SoftMarginLoss(size_average=False) - -# Paddle 写法 -paddle.nn.SoftMarginLoss(reduction='sum') -``` - -#### size_average/reduce:对应到 reduction 为 mean -```python -# PyTorch 写法 -torch.nn.SoftMarginLoss(size_average=True, reduce=True) -torch.nn.SoftMarginLoss(reduce=True) -torch.nn.SoftMarginLoss(size_average=True) -torch.nn.SoftMarginLoss() - -# Paddle 写法 -paddle.nn.SoftMarginLoss(reduction='mean') -``` - -#### size_average/reduce:对应到 reduction 为 none -```python -# PyTorch 写法 -torch.nn.SoftMarginLoss(size_average=True, reduce=False) -torch.nn.SoftMarginLoss(size_average=False, reduce=False) -torch.nn.SoftMarginLoss(reduce=False) - -# Paddle 写法 -paddle.nn.SoftMarginLoss(reduction='none') -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.TripletMarginLoss.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.TripletMarginLoss.md deleted file mode 100644 index 5337fe156c3..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.TripletMarginLoss.md +++ /dev/null @@ -1,61 +0,0 @@ -## [ torch 参数更多 ]torch.nn.TripletMarginLoss -### [torch.nn.TripletMarginLoss](https://docs.pytorch.org/docs/stable/generated/torch.nn.TripletMarginLoss.html#torch.nn.TripletMarginLoss) -```python -torch.nn.TripletMarginLoss(margin=1.0, p=2.0, eps=1e-06, swap=False, size_average=None, reduce=None, reduction='mean') -``` - -### [paddle.nn.TripletMarginLoss](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/TripletMarginLoss_cn.html#paddle.nn.TripletMarginLoss) -```python -paddle.nn.TripletMarginLoss(margin=1.0, p=2., epsilon=1e-6, swap=False, reduction='mean', name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------ | ------------ | ---------------------------------------------- | -| margin | margin | 手动指定间距。 | -| p | p | 手动指定范数。 | -| eps | epsilon | 防止除数为 0,仅参数名不一致。 | -| swap | swap | 默认为 False。 | -| size_average | - | 已废弃,和 reduce 组合决定损失计算方式。需要转写。 | -| reduce | - | 已废弃,和 size_average 组合决定损失计算方式。需要转写。 | -| reduction | reduction | 指定应用于输出结果的计算方式。 | - -### 转写示例 -#### size_average/reduce:对应到 reduction 为 sum -```python -# PyTorch 写法 -torch.nn.TripletMarginLoss(margin=m, size_average=False, reduce=True) -torch.nn.TripletMarginLoss(margin=m, size_average=False) - -# Paddle 写法 -## 以上写法都统一对应到如下写法 -paddle.nn.TripletMarginLoss(margin=m, reduction='sum') -``` - -#### size_average/reduce:对应到 reduction 为 mean -```python -# PyTorch 写法 -torch.nn.TripletMarginLoss(margin=m, size_average=True, reduce=True) -torch.nn.TripletMarginLoss(margin=m, reduce=True) -torch.nn.TripletMarginLoss(margin=m, size_average=True) -torch.nn.TripletMarginLoss(margin=m) - -# Paddle 写法 -## 以上写法都统一对应到如下写法 -paddle.nn.TripletMarginLoss(margin=m, reduction='mean') -``` - -#### size_average/reduce:对应到 reduction 为 none -```python -# PyTorch 写法 -torch.nn.TripletMarginLoss(margin=m, size_average=True, reduce=False) -torch.nn.TripletMarginLoss(margin=m, size_average=False, reduce=False) -torch.nn.TripletMarginLoss(margin=m, reduce=False) - -# Paddle 写法 -## 以上写法都统一对应到如下写法 -paddle.nn.TripletMarginLoss(margin=m, reduction='none') -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.binary_cross_entropy.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.binary_cross_entropy.md deleted file mode 100644 index 2bfac892eeb..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.binary_cross_entropy.md +++ /dev/null @@ -1,87 +0,0 @@ -## [ torch 参数更多 ]torch.nn.functional.binary_cross_entropy -### [torch.nn.functional.binary\_cross\_entropy](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.binary_cross_entropy.html#torch.nn.functional.binary_cross_entropy) -```python -torch.nn.functional.binary_cross_entropy(input, target, weight=None, size_average=None, reduce=None, reduction='mean') -``` - -### [paddle.nn.functional.binary\_cross\_entropy](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/binary_cross_entropy_cn.html#paddle.nn.functional.binary_cross_entropy) -```python -paddle.nn.functional.binary_cross_entropy(input, label, weight=None, reduction='mean', name=None) -``` - -其中 PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------ | ------------ | -- | -| input | input | 输入 Tensor。 | -| target | label | 标签 Tensor。 | -| weight | weight | 手动指定每个 batch 二值交叉熵的权重。 | -| size_average | - | PyTorch 已弃用, Paddle 无此参数,需要转写。 | -| reduce | - | PyTorch 已弃用, Paddle 无此参数,需要转写。 | -| reduction | reduction | 指定应用于输出结果的计算方式。 | - -### 转写示例 - - -#### size_average -size_average 为 True -```python -# PyTorch 写法 -torch.nn.functional.binary_cross_entropy(size_average=True) - -# Paddle 写法 -paddle.nn.functional.binary\_cross\_entropy(reduction='mean') -``` - -size_average 为 False -```python -# PyTorch 写法 -torch.nn.functional.binary_cross_entropy(size_average=False) - -# Paddle 写法 -paddle.nn.functional.binary\_cross\_entropy(reduction='sum') -``` -#### reduce -reduce 为 True -```python -# PyTorch 写法 -torch.nn.functional.binary_cross_entropy(reduce=True) - -# Paddle 写法 -paddle.nn.functional.binary\_cross\_entropy(reduction='sum') -``` -reduce 为 False -```python -# PyTorch 写法 -torch.nn.functional.binary_cross_entropy(reduce=False) - -# Paddle 写法 -paddle.nn.functional.binary\_cross\_entropy(reduction='none') -``` -#### reduction -reduction 为'none' -```python -# PyTorch 写法 -torch.nn.functional.binary_cross_entropy(reduction='none') - -# Paddle 写法 -paddle.nn.functional.binary\_cross\_entropy(reduction='none') -``` -reduction 为'mean' -```python -# PyTorch 写法 -torch.nn.functional.binary_cross_entropy(reduction='mean') - -# Paddle 写法 -paddle.nn.functional.binary\_cross\_entropy(reduction='mean') -``` -reduction 为'sum' -```python -# PyTorch 写法 -torch.nn.functional.binary_cross_entropy(reduction='sum') - -# Paddle 写法 -paddle.nn.functional.binary\_cross\_entropy(reduction='sum') -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.binary_cross_entropy_with_logits.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.binary_cross_entropy_with_logits.md deleted file mode 100644 index bffe47ed2c8..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.binary_cross_entropy_with_logits.md +++ /dev/null @@ -1,90 +0,0 @@ -## [ torch 参数更多 ]torch.nn.functional.binary_cross_entropy_with_logits -### [torch.nn.functional.binary\_cross\_entropy\_with\_logits](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.binary_cross_entropy_with_logits.html#torch.nn.functional.binary_cross_entropy_with_logits) -```python -torch.nn.functional.binary_cross_entropy_with_logits(input, target, weight=None, size_average=None, reduce=None, reduction='mean', pos_weight=None) -``` - -### [paddle.nn.functional.binary\_cross\_entropy\_with\_logits](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/binary_cross_entropy_with_logits_cn.html#paddle.nn.functional.binary_cross_entropy_with_logits) -```python -paddle.nn.functional.binary_cross_entropy_with_logits(logit, label, weight=None, reduction='mean', pos_weight=None, name=None) -``` - -其中 `input` 是 Paddle 参数 `logit` 的别名,`target` 是 Paddle 参数 `label` 的别名。 - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | logit | 表示输入的 Tensor。Paddle 兼容 `input` 别名,无需改写。 | -| target | label | 标签,和 input 具有相同的维度。Paddle 兼容 `target` 别名,无需改写。 | -| weight | weight | 类别权重。 | -| size_average | - | 已废弃,和 reduce 组合决定损失计算方式。 Paddle 无此参数,需要转写。 | -| reduce | - | 已废弃,和 size_average 组合决定损失计算方式。 Paddle 无此参数,需要转写。 | -| reduction | reduction | 输出结果的计算方式。 | -| pos_weight | pos_weight | 正类的权重。 | - -### 转写示例 - - -#### size_average -size_average 为 True -```python -# PyTorch 写法 -torch.nn.functional.binary_cross_entropy_with_logits(size_average=True) - -# Paddle 写法 -paddle.nn.functional.binary_cross_entropy_with_logits(reduction='mean') -``` - -size_average 为 False -```python -# PyTorch 写法 -torch.nn.functional.binary_cross_entropy_with_logits(size_average=False) - -# Paddle 写法 -paddle.nn.functional.binary_cross_entropy_with_logits(reduction='sum') -``` -#### reduce -reduce 为 True -```python -# PyTorch 写法 -torch.nn.functional.binary_cross_entropy_with_logits(reduce=True) - -# Paddle 写法 -paddle.nn.functional.binary_cross_entropy_with_logits(reduction='sum') -``` -reduce 为 False -```python -# PyTorch 写法 -torch.nn.functional.binary_cross_entropy_with_logits(reduce=False) - -# Paddle 写法 -paddle.nn.functional.binary_cross_entropy_with_logits(reduction='none') -``` -#### reduction -reduction 为'none' -```python -# PyTorch 写法 -torch.nn.functional.binary_cross_entropy_with_logits(reduction='none') - -# Paddle 写法 -paddle.nn.functional.binary_cross_entropy_with_logits(reduction='none') -``` -reduction 为'mean' -```python -# PyTorch 写法 -torch.nn.functional.binary_cross_entropy_with_logits(reduction='mean') - -# Paddle 写法 -paddle.nn.functional.binary_cross_entropy_with_logits(reduction='mean') -``` -reduction 为'sum' -```python -# PyTorch 写法 -torch.nn.functional.binary_cross_entropy_with_logits(reduction='sum') - -# Paddle 写法 -paddle.nn.functional.binary_cross_entropy_with_logits(reduction='sum') -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.cosine_embedding_loss.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.cosine_embedding_loss.md deleted file mode 100644 index 331a8d8a37d..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.cosine_embedding_loss.md +++ /dev/null @@ -1,88 +0,0 @@ -## [ torch 参数更多 ]torch.nn.functional.cosine_embedding_loss -### [torch.nn.functional.cosine\_embedding\_loss](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.cosine_embedding_loss.html#torch.nn.functional.cosine_embedding_loss) -```python -torch.nn.functional.cosine_embedding_loss(input1, input2, target, margin=0, size_average=None, reduce=None, reduction='mean') -``` - -### [paddle.nn.functional.cosine\_embedding\_loss](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/cosine_embedding_loss_cn.html#paddle.nn.functional.cosine_embedding_loss) -```python -paddle.nn.functional.cosine_embedding_loss(input1, input2, label, margin=0, reduction='mean', name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------ | ------------ | ---------------------------------------------- | -| input1 | input1 | 输入的 Tensor。 | -| input2 | input2 | 输入的 Tensor。 | -| target | label | 标签,仅参数名不一致。 | -| margin | margin | 可以设置的范围为[-1, 1]。 | -| size_average | - | 已废弃,和 reduce 组合决定损失计算方式。 需要转写。 | -| reduce | - | 已废弃,和 size_average 组合决定损失计算方式。需要转写。 | -| reduction | reduction | 指定应用于输出结果的计算方式。 | - -### 转写示例 - - -#### size_average -size_average 为 True -```python -# PyTorch 写法 -torch.nn.functional.cosine_embedding_loss(size_average=True) - -# Paddle 写法 -paddle.nn.functional.cosine_embedding_loss(reduction='mean') -``` - -size_average 为 False -```python -# PyTorch 写法 -torch.nn.functional.cosine_embedding_loss(size_average=False) - -# Paddle 写法 -paddle.nn.functional.cosine_embedding_loss(reduction='sum') -``` -#### reduce -reduce 为 True -```python -# PyTorch 写法 -torch.nn.functional.cosine_embedding_loss(reduce=True) - -# Paddle 写法 -paddle.nn.functional.cosine_embedding_loss(reduction='sum') -``` -reduce 为 False -```python -# PyTorch 写法 -torch.nn.functional.cosine_embedding_loss(reduce=False) - -# Paddle 写法 -paddle.nn.functional.cosine_embedding_loss(reduction='none') -``` -#### reduction -reduction 为'none' -```python -# PyTorch 写法 -torch.nn.functional.cosine_embedding_loss(reduction='none') - -# Paddle 写法 -paddle.nn.functional.cosine_embedding_loss(reduction='none') -``` -reduction 为'mean' -```python -# PyTorch 写法 -torch.nn.functional.cosine_embedding_loss(reduction='mean') - -# Paddle 写法 -paddle.nn.functional.cosine_embedding_loss(reduction='mean') -``` -reduction 为'sum' -```python -# PyTorch 写法 -torch.nn.functional.cosine_embedding_loss(reduction='sum') - -# Paddle 写法 -paddle.nn.functional.cosine_embedding_loss(reduction='sum') -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.cross_entropy.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.cross_entropy.md deleted file mode 100644 index 4c6bfc913f8..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.cross_entropy.md +++ /dev/null @@ -1,107 +0,0 @@ -## [ torch 参数更多 ]torch.nn.functional.cross_entropy -### [torch.nn.functional.cross\_entropy](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.cross_entropy.html#torch.nn.functional.cross_entropy) -```python -torch.nn.functional.cross_entropy(input, - target, - weight=None, - size_average=None, - ignore_index=-100, - reduce=None, - reduction='mean', - label_smoothing=0.0) -``` - -### [paddle.nn.functional.cross\_entropy](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/cross_entropy_cn.html#paddle.nn.functional.cross_entropy) -```python -paddle.nn.functional.cross_entropy(input, - label, - weight=None, - ignore_index=-100, - reduction='mean', - soft_label=False, - label_smoothing=0.0, - axis=-1, - use_softmax=True) -``` - -两者功能一致,torch 参数更多,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | input | 表示预测的 Tensor 。 | -| target | label | 表示真实的 Tensor,仅参数名不同。 | -| weight | weight | 表示权重。 | -| size_average | - | 已弃用 。 需要转写。 | -| ignore_index | ignore_index | 表示忽略的标签值 。 | -| reduce | - | 已弃用 。 需要转写。 | -| reduction | reduction | 表示应用于输出结果的计算方式 。 | -| label_smoothing | label_smoothing | 指定计算损失时的平滑量,参数完全一致。| -| - | soft_label | 指明 label 是否为软标签, PyTorch 无此参数, Paddle 保持默认即可。| -| - | axis | 进行 softmax 计算的维度索引, PyTorch 无此参数, Paddle 保持默认即可。| -| - | use_softmax | 指定是否对 input 进行 softmax 归一化, PyTorch 无此参数, Paddle 保持默认即可。| - -### 转写示例 - - -#### size_average -size_average 为 True -```python -# PyTorch 写法 -torch.nn.functional.cross_entropy(size_average=True) - -# Paddle 写法 -paddle.nn.functional.cross_entropy(reduction='mean') -``` - -size_average 为 False -```python -# PyTorch 写法 -torch.nn.functional.cross_entropy(size_average=False) - -# Paddle 写法 -paddle.nn.functional.cross_entropy(reduction='sum') -``` -#### reduce -reduce 为 True -```python -# PyTorch 写法 -torch.nn.functional.cross_entropy(reduce=True) - -# Paddle 写法 -paddle.nn.functional.cross_entropy(reduction='sum') -``` -reduce 为 False -```python -# PyTorch 写法 -torch.nn.functional.cross_entropy(reduce=False) - -# Paddle 写法 -paddle.nn.functional.cross_entropy(reduction='none') -``` -#### reduction -reduction 为'none' -```python -# PyTorch 写法 -torch.nn.functional.cross_entropy(reduction='none') - -# Paddle 写法 -paddle.nn.functional.cross_entropy(reduction='none') -``` -reduction 为'mean' -```python -# PyTorch 写法 -torch.nn.functional.cross_entropy(reduction='mean') - -# Paddle 写法 -paddle.nn.functional.cross_entropy(reduction='mean') -``` -reduction 为'sum' -```python -# PyTorch 写法 -torch.nn.functional.cross_entropy(reduction='sum') - -# Paddle 写法 -paddle.nn.functional.cross_entropy(reduction='sum') -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.dropout.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.dropout.md deleted file mode 100644 index b17df879ccc..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.dropout.md +++ /dev/null @@ -1,23 +0,0 @@ -## [ torch 参数更多 ]torch.nn.functional.dropout -### [torch.nn.functional.dropout](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.dropout.html#torch.nn.functional.dropout) -```python -torch.nn.functional.dropout(input, p=0.5, training=True, inplace=False) -``` - -### [paddle.nn.functional.dropout](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/dropout_cn.html#paddle.nn.functional.dropout) -```python -paddle.nn.functional.dropout(x, p=0.5, axis=None, training=True, mode='upscale_in_train', name=None) -``` - -其中 PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| -------- | ------------ | -- | -| input | x | 输入 Tensor,仅参数名不一致。 | -| p | p | 将输入节点置 0 的概率。 | -| - | axis | 指定对输入 Tensor 进行 dropout 操作的轴,PyTorch 无此参数,Paddle 保持默认即可。 | -| training | training | 标记是否为训练阶段。 | -| - | mode | 丢弃单元的方式,PyTorch 无此参数,Paddle 保持默认即可。 | -| inplace | - | 表示在不更改变量的内存地址的情况下,直接修改变量的值,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.gumbel_softmax.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.gumbel_softmax.md deleted file mode 100644 index c56e86f5e71..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.gumbel_softmax.md +++ /dev/null @@ -1,22 +0,0 @@ -## [ torch 参数更多 ]torch.nn.functional.gumbel_softmax -### [torch.nn.functional.gumbel\_softmax](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.gumbel_softmax.html#torch.nn.functional.gumbel_softmax) -```python -torch.nn.functional.gumbel_softmax(logits, tau=1, hard=False, eps=1e-10, dim=- 1) -``` - -### [paddle.nn.functional.gumbel\_softmax](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/gumbel_softmax_cn.html#paddle.nn.functional.gumbel_softmax) -```python -paddle.nn.functional.gumbel_softmax(x, temperature=1.0, hard=False, axis=- 1, name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ------------------------------------------------------------------------------------------------- | -| logits | x | 一个 N-D Tensor,前 N-1 维用于独立分布 batch 的索引,最后一维表示每个类别的概率,仅参数名不一致。 | -| tau | temperature | 大于 0 的标量,仅参数名不一致。 | -| hard | hard | 如果是 True,返回离散的 one-hot 向量。如果是 False,返回软样本。 | -| eps | - | eps 参数,PyTorch 已废弃不会生效,Paddle 无此参数,对网络无影响,可直接删除。 | -| dim | axis | 按照维度 axis 计算 softmax,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.hardswish.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.hardswish.md deleted file mode 100644 index 5a6af6b18fd..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.hardswish.md +++ /dev/null @@ -1,19 +0,0 @@ -## [ torch 参数更多 ]torch.nn.functional.hardswish -### [torch.nn.functional.hardswish](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.hardswish.html#torch.nn.functional.hardswish) -```python -torch.nn.functional.hardswish(input, inplace=False) -``` - -### [paddle.nn.functional.hardswish](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/hardswish_cn.html#paddle.nn.functional.hardswish) -```python -paddle.nn.functional.hardswish(x, name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | --------------------------------------------------------------------------------------------------------------- | -| input | x | 输入的 Tensor,仅参数名不一致。 | -| inplace | - | 表示在不更改变量的内存地址的情况下,直接修改变量的值,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.hinge_embedding_loss.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.hinge_embedding_loss.md deleted file mode 100644 index 73fe7368d0e..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.hinge_embedding_loss.md +++ /dev/null @@ -1,87 +0,0 @@ -## [ torch 参数更多 ]torch.nn.functional.hinge_embedding_loss -### [torch.nn.functional.hinge\_embedding\_loss](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.hinge_embedding_loss.html#torch.nn.functional.hinge_embedding_loss) -```python -torch.nn.functional.hinge_embedding_loss(input, target, margin=1.0, size_average=None, reduce=None, reduction='mean') -``` - -### [paddle.nn.functional.hinge\_embedding\_loss](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/hinge_embedding_loss_cn.html#paddle.nn.functional.hinge_embedding_loss) -```python -paddle.nn.functional.hinge_embedding_loss(input, label, margin=1.0, reduction='mean', name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------ | ------------ | ------------------------------------------------------------------------------------------ | -| input | input | 输入的 Tensor。 | -| target | label | 标签,仅参数名不一致。 | -| margin | margin | 当 label 为 -1 时,该值决定了小于 margin 的 input 才需要纳入 hinge embedding loss 的计算。 | -| size_average | - | 已废弃,和 reduce 组合决定损失计算方式。需要转写。 | -| reduce | - | 已废弃,和 size_average 组合决定损失计算方式。 需要转写。 | -| reduction | reduction | 指定应用于输出结果的计算方式。 | - -### 转写示例 - - -#### size_average -size_average 为 True -```python -# PyTorch 写法 -torch.nn.functional.hinge_embedding_loss(size_average=True) - -# Paddle 写法 -paddle.nn.functional.hinge_embedding_loss(reduction='mean') -``` - -size_average 为 False -```python -# PyTorch 写法 -torch.nn.functional.hinge_embedding_loss(size_average=False) - -# Paddle 写法 -paddle.nn.functional.hinge_embedding_loss(reduction='sum') -``` -#### reduce -reduce 为 True -```python -# PyTorch 写法 -torch.nn.functional.hinge_embedding_loss(reduce=True) - -# Paddle 写法 -paddle.nn.functional.hinge_embedding_loss(reduction='sum') -``` -reduce 为 False -```python -# PyTorch 写法 -torch.nn.functional.hinge_embedding_loss(reduce=False) - -# Paddle 写法 -paddle.nn.functional.hinge_embedding_loss(reduction='none') -``` -#### reduction -reduction 为'none' -```python -# PyTorch 写法 -torch.nn.functional.hinge_embedding_loss(reduction='none') - -# Paddle 写法 -paddle.nn.functional.hinge_embedding_loss(reduction='none') -``` -reduction 为'mean' -```python -# PyTorch 写法 -torch.nn.functional.hinge_embedding_loss(reduction='mean') - -# Paddle 写法 -paddle.nn.functional.hinge_embedding_loss(reduction='mean') -``` -reduction 为'sum' -```python -# PyTorch 写法 -torch.nn.functional.hinge_embedding_loss(reduction='sum') - -# Paddle 写法 -paddle.nn.functional.hinge_embedding_loss(reduction='sum') -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.interpolate.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.interpolate.md deleted file mode 100644 index 81bdd4f62c1..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.interpolate.md +++ /dev/null @@ -1,26 +0,0 @@ -## [ torch 参数更多 ]torch.nn.functional.interpolate -### [torch.nn.functional.interpolate](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.interpolate.html#torch.nn.functional.interpolate) -```python -torch.nn.functional.interpolate(input, size=None, scale_factor=None, mode='nearest', align_corners=None, recompute_scale_factor=None, antialias=False) -``` - -### [paddle.nn.functional.interpolate](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/interpolate_cn.html#paddle.nn.functional.interpolate) -```python -paddle.nn.functional.interpolate(x, size=None, scale_factor=None, mode='nearest', align_corners=False, align_mode=0, data_format=None, recompute_scale_factor=None, name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ---------------------- | ------------- | ------------------------------------------------------------------------------------------------------ | -| input | x | 输入的 Tensor,仅参数名不一致。 | -| size | size | 输出 Tensor 形状。 | -| scale_factor | scale_factor | 输入的高度或宽度的乘数因子。 | -| mode | mode | 插值方法。 | -| align_corners | align_corners | 一个可选的 bool 型参数,如果为 True,则将输入和输出张量的 4 个角落像素的中心对齐,并保留角点像素的值。 | -| recompute_scale_factor | recompute_scale_factor | 是否重新计算乘数因子。 | -| antialias | - | 是否使用 anti-aliasing,Paddle 无此参数,暂无转写方式。 | -| - | align_mode | 双线性插值的可选项,PyTorch 无此参数,Paddle 保持默认即可。 | -| - | data_format | 指定输入的数据格式,PyTorch 无此参数,Paddle 保持默认即可。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.kl_div.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.kl_div.md deleted file mode 100644 index 193a69d12b8..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.kl_div.md +++ /dev/null @@ -1,94 +0,0 @@ -## [ torch 参数更多 ]torch.nn.functional.kl_div -### [torch.nn.functional.kl\_div](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.kl_div.html#torch.nn.functional.kl_div) -```python -torch.nn.functional.kl_div(input, - target, - size_average=None, - reduce=None, - reduction='mean', - log_target=False) -``` - -### [paddle.nn.functional.kl\_div](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/kl_div_cn.html#paddle.nn.functional.kl_div) -```python -paddle.nn.functional.kl_div(input, - label, - reduction='mean', - log_target=False) -``` - -其中 PyTorch 相比 Paddle 支持更多的参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------ | ------------ | ------------------------------------------------------ | -| target | label | 与 input 对应的标签值,仅参数名不一致。 | -| size_average | - | PyTorch 已弃用, Paddle 无此参数,需要转写。 | -| reduce | - | PyTorch 已弃用, Paddle 无此参数,需要转写。 | -| reduction | reduction | 表示对输出结果的计算方式。 | -| log_target | log_target | 指定目标是否属于 log 空间。 | - -### 转写示例 - - -#### size_average -size_average 为 True -```python -# PyTorch 写法 -torch.nn.functional.kl_div(size_average=True) - -# Paddle 写法 -paddle.nn.functional.kl_div(reduction='mean') -``` - -size_average 为 False -```python -# PyTorch 写法 -torch.nn.functional.kl_div(size_average=False) - -# Paddle 写法 -paddle.nn.functional.kl_div(reduction='sum') -``` -#### reduce -reduce 为 True -```python -# PyTorch 写法 -torch.nn.functional.kl_div(reduce=True) - -# Paddle 写法 -paddle.nn.functional.kl_div(reduction='sum') -``` -reduce 为 False -```python -# PyTorch 写法 -torch.nn.functional.kl_div(reduce=False) - -# Paddle 写法 -paddle.nn.functional.kl_div(reduction='none') -``` -#### reduction -reduction 为'none' -```python -# PyTorch 写法 -torch.nn.functional.kl_div(reduction='none') - -# Paddle 写法 -paddle.nn.functional.kl_div(reduction='none') -``` -reduction 为'mean' -```python -# PyTorch 写法 -torch.nn.functional.kl_div(reduction='mean') - -# Paddle 写法 -paddle.nn.functional.kl_div(reduction='mean') -``` -reduction 为'sum' -```python -# PyTorch 写法 -torch.nn.functional.kl_div(reduction='sum') - -# Paddle 写法 -paddle.nn.functional.kl_div(reduction='sum') -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.l1_loss.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.l1_loss.md deleted file mode 100644 index f15a8138456..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.l1_loss.md +++ /dev/null @@ -1,86 +0,0 @@ -## [ torch 参数更多 ]torch.nn.functional.l1_loss -### [torch.nn.functional.l1\_loss](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.l1_loss.html#torch.nn.functional.l1_loss) -```python -torch.nn.functional.l1_loss(input, target, size_average=None, reduce=None, reduction='mean') -``` - -### [paddle.nn.functional.l1\_loss](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/l1_loss_cn.html#paddle.nn.functional.l1_loss) -```python -paddle.nn.functional.l1_loss(input, label, reduction='mean', name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | input | 表示输入的 Tensor。 | -| target | label | 标签,和 input 具有相同的维度,仅参数名不一致。 | -| size_average | - | 已废弃,和 reduce 组合决定损失计算方式。Paddle 无此参数,需要转写。 | -| reduce | - | 已废弃,和 size_average 组合决定损失计算方式。Paddle 无此参数,需要转写。 | -| reduction | reduction | 输出结果的计算方式。 | - -### 转写示例 - - -#### size_average -size_average 为 True -```python -# PyTorch 写法 -torch.nn.functional.l1_loss(size_average=True) - -# Paddle 写法 -paddle.nn.functional.l1_loss(reduction='mean') -``` - -size_average 为 False -```python -# PyTorch 写法 -torch.nn.functional.l1_loss(size_average=False) - -# Paddle 写法 -paddle.nn.functional.l1_loss(reduction='sum') -``` -#### reduce -reduce 为 True -```python -# PyTorch 写法 -torch.nn.functional.l1_loss(reduce=True) - -# Paddle 写法 -paddle.nn.functional.l1_loss(reduction='sum') -``` -reduce 为 False -```python -# PyTorch 写法 -torch.nn.functional.l1_loss(reduce=False) - -# Paddle 写法 -paddle.nn.functional.l1_loss(reduction='none') -``` -#### reduction -reduction 为'none' -```python -# PyTorch 写法 -torch.nn.functional.l1_loss(reduction='none') - -# Paddle 写法 -paddle.nn.functional.l1_loss(reduction='none') -``` -reduction 为'mean' -```python -# PyTorch 写法 -torch.nn.functional.l1_loss(reduction='mean') - -# Paddle 写法 -paddle.nn.functional.l1_loss(reduction='mean') -``` -reduction 为'sum' -```python -# PyTorch 写法 -torch.nn.functional.l1_loss(reduction='sum') - -# Paddle 写法 -paddle.nn.functional.l1_loss(reduction='sum') -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.leaky_relu.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.leaky_relu.md deleted file mode 100644 index da1d519df38..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.leaky_relu.md +++ /dev/null @@ -1,20 +0,0 @@ -## [ torch 参数更多 ]torch.nn.functional.leaky_relu -### [torch.nn.functional.leaky\_relu](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.leaky_relu.html#torch.nn.functional.leaky_relu) -```python -torch.nn.functional.leaky_relu(input, negative_slope=0.01, inplace=False) -``` - -### [paddle.nn.functional.leaky\_relu](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/leaky_relu_cn.html#paddle.nn.functional.leaky_relu) -```python -paddle.nn.functional.leaky_relu(x, negative_slope=0.01, name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| -------------- | -------------- | --------------------------------------------------------------------------------------------------------------- | -| input | x | 输入的 Tensor,仅参数名不一致。 | -| negative_slope | negative_slope | x<0 时的斜率。 | -| inplace | - | 表示在不更改变量的内存地址的情况下,直接修改变量的值,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.log_softmax.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.log_softmax.md deleted file mode 100644 index dcded092f7f..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.log_softmax.md +++ /dev/null @@ -1,21 +0,0 @@ -## [ torch 参数更多 ]torch.nn.functional.log_softmax -### [torch.nn.functional.log\_softmax](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.log_softmax.html#torch.nn.functional.log_softmax) -```python -torch.nn.functional.log_softmax(input, dim=None, _stacklevel=3, dtype=None) -``` - -### [paddle.nn.functional.log\_softmax](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/log_softmax_cn.html#paddle.nn.functional.log_softmax) -```python -paddle.nn.functional.log_softmax(x, axis=- 1, dtype=None, name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------ | ------------ | -------------------------------------------------- | -| input | x | 输入的 Tensor,仅参数名不一致。 | -| dim | axis | 指定对输入 x 进行运算的轴,仅参数名不一致。 | -| \_stacklevel | - | \_stacklevel 参数,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| dtype | dtype | 输入 Tensor 的数据类型。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.margin_ranking_loss.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.margin_ranking_loss.md deleted file mode 100644 index e0996931238..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.margin_ranking_loss.md +++ /dev/null @@ -1,98 +0,0 @@ -## [ torch 参数更多 ]torch.nn.functional.margin_ranking_loss -### [torch.nn.functional.margin\_ranking\_loss](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.margin_ranking_loss.html#torch.nn.functional.margin_ranking_loss) -```python -torch.nn.functional.margin_ranking_loss(input1, - input2, - target, - margin=0, - size_average=None, - reduce=None, - reduction='mean') -``` - -### [paddle.nn.functional.margin\_ranking\_loss](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/margin_ranking_loss_cn.html#paddle.nn.functional.margin_ranking_loss) -```python -paddle.nn.functional.margin_ranking_loss(input, - other, - label, - margin=0.0, - reduction='mean', - name=None) -``` - -其中 PyTorch 相⽐ Paddle ⽀持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input1 | input | 表示第一个输入的 Tensor ,仅参数名不一致。 | -| input2 | other | 表示第二个输入的 Tensor ,仅参数名不一致。 | -| target | label | 表示训练数据的标签 Tensor ,仅参数名不一致。 | -| margin | margin | 表示用于加和的 margin 值 。 | -| size_average | - | 已弃用 。需要转写。 | -| reduce | - | 已弃用 。需要转写。 | -| reduction | reduction | 表示应用于输出结果的计算方式 。 | - -### 转写示例 - - -#### size_average -size_average 为 True -```python -# PyTorch 写法 -torch.nn.functional.margin_ranking_loss(size_average=True) - -# Paddle 写法 -paddle.nn.functional.margin_ranking_loss(reduction='mean') -``` - -size_average 为 False -```python -# PyTorch 写法 -torch.nn.functional.margin_ranking_loss(size_average=False) - -# Paddle 写法 -paddle.nn.functional.margin_ranking_loss(reduction='sum') -``` -#### reduce -reduce 为 True -```python -# PyTorch 写法 -torch.nn.functional.margin_ranking_loss(reduce=True) - -# Paddle 写法 -paddle.nn.functional.margin_ranking_loss(reduction='sum') -``` -reduce 为 False -```python -# PyTorch 写法 -torch.nn.functional.margin_ranking_loss(reduce=False) - -# Paddle 写法 -paddle.nn.functional.margin_ranking_loss(reduction='none') -``` -#### reduction -reduction 为'none' -```python -# PyTorch 写法 -torch.nn.functional.margin_ranking_loss(reduction='none') - -# Paddle 写法 -paddle.nn.functional.margin_ranking_loss(reduction='none') -``` -reduction 为'mean' -```python -# PyTorch 写法 -torch.nn.functional.margin_ranking_loss(reduction='mean') - -# Paddle 写法 -paddle.nn.functional.margin_ranking_loss(reduction='mean') -``` -reduction 为'sum' -```python -# PyTorch 写法 -torch.nn.functional.margin_ranking_loss(reduction='sum') - -# Paddle 写法 -paddle.nn.functional.margin_ranking_loss(reduction='sum') -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.max_pool1d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.max_pool1d.md deleted file mode 100644 index 5969959cfae..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.max_pool1d.md +++ /dev/null @@ -1,24 +0,0 @@ -## [ torch 参数更多 ]torch.nn.functional.max_pool1d -### [torch.nn.functional.max\_pool1d](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.max_pool1d.html#torch.nn.functional.max_pool1d) -```python -torch.nn.functional.max_pool1d(input, kernel_size, stride=None, padding=0, dilation=1, ceil_mode=False, return_indices=False) -``` - -### [paddle.nn.functional.max\_pool1d](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/max_pool1d_cn.html#paddle.nn.functional.max_pool1d) -```python -paddle.nn.functional.max_pool1d(x, kernel_size, stride=None, padding=0, return_mask=False, ceil_mode=False, name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| -------------- | ------------ | ------------------------------------------------------------ | -| input | x | 输入的 Tensor,仅参数名不一致。 | -| kernel_size | kernel_size | 池化核的尺寸大小。 | -| stride | stride | 池化操作步长。 | -| padding | padding | 池化补零的方式。 | -| dilation | - | 带有滑动窗口元素间的 stride,Paddle 无此参数,暂无转写方式。 | -| ceil_mode | ceil_mode | 是否用 ceil 函数计算输出的 height 和 width。 | -| return_indices | return_mask | 是否返回最大值的索引,仅参数名不一致。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.max_pool2d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.max_pool2d.md deleted file mode 100644 index 70e4c90e203..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.max_pool2d.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ torch 参数更多 ]torch.nn.functional.max_pool2d -### [torch.nn.functional.max\_pool2d](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.max_pool2d.html#torch.nn.functional.max_pool2d) -```python -torch.nn.functional.max_pool2d(input, kernel_size, stride=None, padding=0, dilation=1, ceil_mode=False, return_indices=False) -``` - -### [paddle.nn.functional.max\_pool2d](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/max_pool2d_cn.html#paddle.nn.functional.max_pool2d) -```python -paddle.nn.functional.max_pool2d(x, kernel_size, stride=None, padding=0, ceil_mode=False, return_mask=False, data_format='NCHW', name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| -------------- | ------------ | ------------------------------------------------------------- | -| input | x | 输入的 Tensor,仅参数名不一致。 | -| kernel_size | kernel_size | 池化核的尺寸大小。 | -| stride | stride | 池化操作步长。 | -| padding | padding | 池化补零的方式。 | -| dilation | - | 带有滑动窗口元素间的 stride,Paddle 无此参数,暂无转写方式。 | -| ceil_mode | ceil_mode | 是否用 ceil 函数计算输出的 height 和 width。 | -| return_indices | return_mask | 是否返回最大值的索引,仅参数名不一致。 | -| - | data_format | 输入和输出的数据格式,PyTorch 无此参数,Paddle 保持默认即可。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.max_pool3d.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.max_pool3d.md deleted file mode 100644 index 6dd9573477d..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.max_pool3d.md +++ /dev/null @@ -1,25 +0,0 @@ -## [ torch 参数更多 ]torch.nn.functional.max_pool3d -### [torch.nn.functional.max\_pool3d](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.max_pool3d.html#torch.nn.functional.max_pool3d) -```python -torch.nn.functional.max_pool3d(input, kernel_size, stride=None, padding=0, dilation=1, ceil_mode=False, return_indices=False) -``` - -### [paddle.nn.functional.max\_pool3d](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/max_pool3d_cn.html#paddle.nn.functional.max_pool3d) -```python -paddle.nn.functional.max_pool3d(x, kernel_size, stride=None, padding=0, ceil_mode=False, return_mask=False, data_format="NCDHW", name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| -------------- | ------------ | ------------------------------------------------------------- | -| input | x | 输入的 Tensor,仅参数名不一致。 | -| kernel_size | kernel_size | 池化核的尺寸大小。 | -| stride | stride | 池化操作步长。 | -| padding | padding | 池化补零的方式。 | -| dilation | - | 带有滑动窗口元素间的 stride,Paddle 无此参数,暂无转写方式。 | -| ceil_mode | ceil_mode | 是否用 ceil 函数计算输出的 height 和 width。 | -| return_indices | return_mask | 是否返回最大值的索引,仅参数名不一致。 | -| - | data_format | 输入和输出的数据格式,PyTorch 无此参数,Paddle 保持默认即可。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.mse_loss.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.mse_loss.md deleted file mode 100644 index 7ed48025da5..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.mse_loss.md +++ /dev/null @@ -1,92 +0,0 @@ -## [ torch 参数更多 ]torch.nn.functional.mse_loss -### [torch.nn.functional.mse\_loss](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.mse_loss.html#torch.nn.functional.mse_loss) -```python -torch.nn.functional.mse_loss(input, - target, - size_average=None, - reduce=None, - reduction='mean') -``` - -### [paddle.nn.functional.mse\_loss](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/mse_loss_cn.html#paddle.nn.functional.mse_loss) -```python -paddle.nn.functional.mse_loss(input, - label, - reduction='mean', - name=None) -``` - -其中 PyTorch 相⽐ Paddle ⽀持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | input | 表示预测的 Tensor 。 | -| target | label | 表示真实的 Tensor 。 | -| size_average | - | 已弃用 。 需要转写。 | -| reduce | - | 已弃用 。需要转写。 | -| reduction | reduction | 表示应用于输出结果的计算方式 。 | - -### 转写示例 - - -#### size_average -size_average 为 True -```python -# PyTorch 写法 -torch.nn.functional.mse_loss(size_average=True) - -# Paddle 写法 -paddle.nn.functional.mse_loss(reduction='mean') -``` - -size_average 为 False -```python -# PyTorch 写法 -torch.nn.functional.mse_loss(size_average=False) - -# Paddle 写法 -paddle.nn.functional.mse_loss(reduction='sum') -``` -#### reduce -reduce 为 True -```python -# PyTorch 写法 -torch.nn.functional.mse_loss(reduce=True) - -# Paddle 写法 -paddle.nn.functional.mse_loss(reduction='sum') -``` -reduce 为 False -```python -# PyTorch 写法 -torch.nn.functional.mse_loss(reduce=False) - -# Paddle 写法 -paddle.nn.functional.mse_loss(reduction='none') -``` -#### reduction -reduction 为'none' -```python -# PyTorch 写法 -torch.nn.functional.mse_loss(reduction='none') - -# Paddle 写法 -paddle.nn.functional.mse_loss(reduction='none') -``` -reduction 为'mean' -```python -# PyTorch 写法 -torch.nn.functional.mse_loss(reduction='mean') - -# Paddle 写法 -paddle.nn.functional.mse_loss(reduction='mean') -``` -reduction 为'sum' -```python -# PyTorch 写法 -torch.nn.functional.mse_loss(reduction='sum') - -# Paddle 写法 -paddle.nn.functional.mse_loss(reduction='sum') -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.multi_margin_loss.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.multi_margin_loss.md deleted file mode 100644 index fd4af42c0eb..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.multi_margin_loss.md +++ /dev/null @@ -1,89 +0,0 @@ -## [ torch 参数更多 ]torch.nn.functional.multi_margin_loss -### [torch.nn.functional.multi\_margin\_loss](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.multi_margin_loss.html#torch.nn.functional.multi_margin_loss) -```python -torch.nn.functional.multi_margin_loss(input, target, p=1, margin=1, weight=None, size_average=None, reduce=None, reduction='mean') -``` - -### [paddle.nn.functional.multi\_margin\_loss](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/multi_margin_loss_cn.html#paddle.nn.functional.multi_margin_loss) -```python -paddle.nn.functional.multi_margin_loss(input, label, p=1, margin=1.0, weight=None, reduction='mean', name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------ | ------------ | -- | -| input | input | 输入 Tensor。 | -| target | label | 标签 Tensor,仅参数名不一致。 | -| p | p | 手动指定范数。| -| margin | margin | 手动指定间距。 | -| weight | weight | 手动指定每个 batch 二值交叉熵的权重。 | -| size_average | - | PyTorch 已弃用, Paddle 无此参数,需要转写。 | -| reduce | - | PyTorch 已弃用, Paddle 无此参数,需要转写。 | -| reduction | reduction | 指定应用于输出结果的计算方式。 | - -### 转写示例 - - -#### size_average -size_average 为 True -```python -# PyTorch 写法 -torch.nn.functional.multi_margin_loss(size_average=True) - -# Paddle 写法 -paddle.nn.functional.multi\_margin\_loss(reduction='mean') -``` - -size_average 为 False -```python -# PyTorch 写法 -torch.nn.functional.multi_margin_loss(size_average=False) - -# Paddle 写法 -paddle.nn.functional.multi\_margin\_loss(reduction='sum') -``` -#### reduce -reduce 为 True -```python -# PyTorch 写法 -torch.nn.functional.multi_margin_loss(reduce=True) - -# Paddle 写法 -paddle.nn.functional.multi\_margin\_loss(reduction='sum') -``` -reduce 为 False -```python -# PyTorch 写法 -torch.nn.functional.multi_margin_loss(reduce=False) - -# Paddle 写法 -paddle.nn.functional.multi\_margin\_loss(reduction='none') -``` -#### reduction -reduction 为'none' -```python -# PyTorch 写法 -torch.nn.functional.multi_margin_loss(reduction='none') - -# Paddle 写法 -paddle.nn.functional.multi\_margin\_loss(reduction='none') -``` -reduction 为'mean' -```python -# PyTorch 写法 -torch.nn.functional.multi_margin_loss(reduction='mean') - -# Paddle 写法 -paddle.nn.functional.multi\_margin\_loss(reduction='mean') -``` -reduction 为'sum' -```python -# PyTorch 写法 -torch.nn.functional.multi_margin_loss(reduction='sum') - -# Paddle 写法 -paddle.nn.functional.multi\_margin\_loss(reduction='sum') -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.multilabel_margin_loss.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.multilabel_margin_loss.md deleted file mode 100644 index f2d8d63a3e9..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.multilabel_margin_loss.md +++ /dev/null @@ -1,86 +0,0 @@ -## [ torch 参数更多 ]torch.nn.functional.multilabel_margin_loss -### [torch.nn.functional.multilabel\_margin\_loss](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.multilabel_margin_loss.html#torch.nn.functional.multilabel_margin_loss) -```python -torch.nn.functional.multilabel_margin_loss(input, target, size_average=None, reduce=None, reduction='mean') -``` - -### [paddle.nn.functional.multi\_label\_margin\_loss](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/multi_label_margin_loss_cn.html#paddle.nn.functional.multi_label_margin_loss) -```python -paddle.nn.functional.multi_label_margin_loss(input, label, reduction='mean', name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------ | ------------ | -- | -| input | input | 输入 Tensor。 | -| target | label | 标签 Tensor,仅参数名不一致。 | -| size_average | - | PyTorch 已弃用, Paddle 无此参数,需要转写。 | -| reduce | - | PyTorch 已弃用, Paddle 无此参数,需要转写。 | -| reduction | reduction | 指定应用于输出结果的计算方式。 | - -### 转写示例 - - -#### size_average -size_average 为 True -```python -# PyTorch 写法 -torch.nn.functional.multilabel_margin_loss(size_average=True) - -# Paddle 写法 -paddle.nn.functional.multi\_label\_margin\_loss(reduction='mean') -``` - -size_average 为 False -```python -# PyTorch 写法 -torch.nn.functional.multilabel_margin_loss(size_average=False) - -# Paddle 写法 -paddle.nn.functional.multi\_label\_margin\_loss(reduction='sum') -``` -#### reduce -reduce 为 True -```python -# PyTorch 写法 -torch.nn.functional.multilabel_margin_loss(reduce=True) - -# Paddle 写法 -paddle.nn.functional.multi\_label\_margin\_loss(reduction='sum') -``` -reduce 为 False -```python -# PyTorch 写法 -torch.nn.functional.multilabel_margin_loss(reduce=False) - -# Paddle 写法 -paddle.nn.functional.multi\_label\_margin\_loss(reduction='none') -``` -#### reduction -reduction 为'none' -```python -# PyTorch 写法 -torch.nn.functional.multilabel_margin_loss(reduction='none') - -# Paddle 写法 -paddle.nn.functional.multi\_label\_margin\_loss(reduction='none') -``` -reduction 为'mean' -```python -# PyTorch 写法 -torch.nn.functional.multilabel_margin_loss(reduction='mean') - -# Paddle 写法 -paddle.nn.functional.multi\_label\_margin\_loss(reduction='mean') -``` -reduction 为'sum' -```python -# PyTorch 写法 -torch.nn.functional.multilabel_margin_loss(reduction='sum') - -# Paddle 写法 -paddle.nn.functional.multi\_label\_margin\_loss(reduction='sum') -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.multilabel_soft_margin_loss.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.multilabel_soft_margin_loss.md deleted file mode 100644 index 3eebdd116d9..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.multilabel_soft_margin_loss.md +++ /dev/null @@ -1,87 +0,0 @@ -## [ torch 参数更多 ]torch.nn.functional.multilabel_soft_margin_loss -### [torch.nn.functional.multilabel\_soft\_margin\_loss](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.multilabel_soft_margin_loss.html#torch.nn.functional.multilabel_soft_margin_loss) -```python -torch.nn.functional.multilabel_soft_margin_loss(input, target, weight=None, size_average=None, reduce=None, reduction='mean') -``` - -### [paddle.nn.functional.multi\_label\_soft\_margin\_loss](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/multi_label_soft_margin_loss_cn.html#paddle.nn.functional.multi_label_soft_margin_loss) -```python -paddle.nn.functional.multi_label_soft_margin_loss(input, label, weight=None, reduction='mean', name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------ | ------------ | -- | -| input | input | 输入 Tensor。 | -| target | label | 标签 Tensor,仅参数名不一致。 | -| weight | weight | 手动指定每个 batch 二值交叉熵的权重。 | -| size_average | - | PyTorch 已弃用, Paddle 无此参数,需要转写。 | -| reduce | - | PyTorch 已弃用, Paddle 无此参数,需要转写。 | -| reduction | reduction | 指定应用于输出结果的计算方式。 | - -### 转写示例 - - -#### size_average -size_average 为 True -```python -# PyTorch 写法 -torch.nn.functional.multilabel_soft_margin_loss(size_average=True) - -# Paddle 写法 -paddle.nn.functional.multi\_label\_soft\_margin\_loss(reduction='mean') -``` - -size_average 为 False -```python -# PyTorch 写法 -torch.nn.functional.multilabel_soft_margin_loss(size_average=False) - -# Paddle 写法 -paddle.nn.functional.multi\_label\_soft\_margin\_loss(reduction='sum') -``` -#### reduce -reduce 为 True -```python -# PyTorch 写法 -torch.nn.functional.multilabel_soft_margin_loss(reduce=True) - -# Paddle 写法 -paddle.nn.functional.multi\_label\_soft\_margin\_loss(reduction='sum') -``` -reduce 为 False -```python -# PyTorch 写法 -torch.nn.functional.multilabel_soft_margin_loss(reduce=False) - -# Paddle 写法 -paddle.nn.functional.multi\_label\_soft\_margin\_loss(reduction='none') -``` -#### reduction -reduction 为'none' -```python -# PyTorch 写法 -torch.nn.functional.multilabel_soft_margin_loss(reduction='none') - -# Paddle 写法 -paddle.nn.functional.multi\_label\_soft\_margin\_loss(reduction='none') -``` -reduction 为'mean' -```python -# PyTorch 写法 -torch.nn.functional.multilabel_soft_margin_loss(reduction='mean') - -# Paddle 写法 -paddle.nn.functional.multi\_label\_soft\_margin\_loss(reduction='mean') -``` -reduction 为'sum' -```python -# PyTorch 写法 -torch.nn.functional.multilabel_soft_margin_loss(reduction='sum') - -# Paddle 写法 -paddle.nn.functional.multi\_label\_soft\_margin\_loss(reduction='sum') -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.nll_loss.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.nll_loss.md deleted file mode 100644 index 5d286474390..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.nll_loss.md +++ /dev/null @@ -1,98 +0,0 @@ -## [ torch 参数更多 ]torch.nn.functional.nll_loss -### [torch.nn.functional.nll\_loss](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.nll_loss.html#torch.nn.functional.nll_loss) -```python -torch.nn.functional.nll_loss(input, - target, - weight=None, - size_average=None, - ignore_index=- 100, - reduce=None, - reduction='mean') -``` - -### [paddle.nn.functional.nll\_loss](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/nll_loss_cn.html#paddle.nn.functional.nll_loss) -```python -paddle.nn.functional.nll_loss(input, - label, - weight=None, - ignore_index=-100, - reduction='mean', - name=None) -``` - -其中 PyTorch 相⽐ Paddle ⽀持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | input | 输入 Tensor。 | -| target | label | 输入 Tensor 对应的标签值,仅参数名不一致。 | -| weight | weight | 手动指定每个类别的权重。 | -| size_average | - | 已弃用,需要转写。 | -| ignore_index | ignore_index | 指定一个忽略的标签值,此标签值不参与计算。 | -| reduce | - | 已弃用,需要转写。 | -| reduction | reduction | 表示应用于输出结果的规约方式,可选值有:'none', 'mean', 'sum'。 | - -### 转写示例 - - -#### size_average -size_average 为 True -```python -# PyTorch 写法 -torch.nn.functional.nll_loss(size_average=True) - -# Paddle 写法 -paddle.nn.functional.nll_loss(reduction='mean') -``` - -size_average 为 False -```python -# PyTorch 写法 -torch.nn.functional.nll_loss(size_average=False) - -# Paddle 写法 -paddle.nn.functional.nll_loss(reduction='sum') -``` -#### reduce -reduce 为 True -```python -# PyTorch 写法 -torch.nn.functional.nll_loss(reduce=True) - -# Paddle 写法 -paddle.nn.functional.nll_loss(reduction='sum') -``` -reduce 为 False -```python -# PyTorch 写法 -torch.nn.functional.nll_loss(reduce=False) - -# Paddle 写法 -paddle.nn.functional.nll_loss(reduction='none') -``` -#### reduction -reduction 为'none' -```python -# PyTorch 写法 -torch.nn.functional.nll_loss(reduction='none') - -# Paddle 写法 -paddle.nn.functional.nll_loss(reduction='none') -``` -reduction 为'mean' -```python -# PyTorch 写法 -torch.nn.functional.nll_loss(reduction='mean') - -# Paddle 写法 -paddle.nn.functional.nll_loss(reduction='mean') -``` -reduction 为'sum' -```python -# PyTorch 写法 -torch.nn.functional.nll_loss(reduction='sum') - -# Paddle 写法 -paddle.nn.functional.nll_loss(reduction='sum') -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.normalize.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.normalize.md deleted file mode 100644 index 9fba0faf1f0..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.normalize.md +++ /dev/null @@ -1,39 +0,0 @@ -## [ torch 参数更多 ]torch.nn.functional.normalize -### [torch.nn.functional.normalize](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.normalize.html#torch.nn.functional.normalize) -```python -torch.nn.functional.normalize(input, - p=2.0, - dim=1, - eps=1e-12, - out=None) -``` - -### [paddle.nn.functional.normalize](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/normalize_cn.html#paddle.nn.functional.normalize) -```python -paddle.nn.functional.normalize(x, - p=2, - axis=1, - epsilon=1e-12, - name=None) -``` - -其中 PyTorch 相⽐ Paddle ⽀持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输出 Tensor 的 size 。 | -| p | p | 表示范数公式中的指数值 。 | -| dim | axis | 表示要进行归一化的轴 。 | -| eps | epsilon | 表示添加到分母上的值 。 | -| out | - | 表示输出 Tensor,需要转写。 | - -### 转写示例 -#### out: 指定输出 -```python -# PyTorch 写法 -torch.nn.functional.normalize(x, out=y) - -# Paddle 写法 -y = paddle.nn.functional.normalize(x) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.poisson_nll_loss.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.poisson_nll_loss.md deleted file mode 100644 index dd1965aabb5..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.poisson_nll_loss.md +++ /dev/null @@ -1,89 +0,0 @@ -## [ torch 参数更多 ]torch.nn.functional.poisson_nll_loss -### [torch.nn.functional.poisson\_nll\_loss](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.poisson_nll_loss.html#torch.nn.functional.poisson_nll_loss) -```python -torch.nn.functional.poisson_nll_loss(input, target, log_input=True, full=False, size_average=None, eps=1e-08, reduce=None, reduction='mean') -``` - -### [paddle.nn.functional.poisson\_nll\_loss](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/poisson_nll_loss_cn.html#paddle.nn.functional.poisson_nll_loss) -```python -paddle.nn.functional.poisson_nll_loss(input, label, log_input=True, full=False, epsilon=1e-8, reduction='mean', name=None) -``` - -其中 PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------ | ------------ | ----------------------------------------------------------------------- | -| input | input | 输入 Tensor。 | -| target | label | 标签 Tensor,仅参数名不一致,Paddle 同时支持 `target`。 | -| log_input | log_input | 输入是否为对数函数映射后结果。 | -| full | full | 是否在损失计算中包括 Stirling 近似项。 | -| size_average | - | PyTorch 已弃用, Paddle 无此参数,需要转写。 | -| eps | epsilon | 在 log_input 为 True 时使用的常数小量,仅参数名不一致,Paddle 同时支持 `eps`。 | -| reduce | - | PyTorch 已弃用, Paddle 无此参数,需要转写。 | -| reduction | reduction | 指定应用于输出结果的计算方式。 | - -### 转写示例 - - -#### size_average -size_average 为 True -```python -# PyTorch 写法 -torch.nn.functional.poisson_nll_loss(size_average=True) - -# Paddle 写法 -paddle.nn.functional.poisson\_nll\_loss(reduction='mean') -``` - -size_average 为 False -```python -# PyTorch 写法 -torch.nn.functional.poisson_nll_loss(size_average=False) - -# Paddle 写法 -paddle.nn.functional.poisson\_nll\_loss(reduction='sum') -``` -#### reduce -reduce 为 True -```python -# PyTorch 写法 -torch.nn.functional.poisson_nll_loss(reduce=True) - -# Paddle 写法 -paddle.nn.functional.poisson\_nll\_loss(reduction='sum') -``` -reduce 为 False -```python -# PyTorch 写法 -torch.nn.functional.poisson_nll_loss(reduce=False) - -# Paddle 写法 -paddle.nn.functional.poisson\_nll\_loss(reduction='none') -``` -#### reduction -reduction 为'none' -```python -# PyTorch 写法 -torch.nn.functional.poisson_nll_loss(reduction='none') - -# Paddle 写法 -paddle.nn.functional.poisson\_nll\_loss(reduction='none') -``` -reduction 为'mean' -```python -# PyTorch 写法 -torch.nn.functional.poisson_nll_loss(reduction='mean') - -# Paddle 写法 -paddle.nn.functional.poisson\_nll\_loss(reduction='mean') -``` -reduction 为'sum' -```python -# PyTorch 写法 -torch.nn.functional.poisson_nll_loss(reduction='sum') - -# Paddle 写法 -paddle.nn.functional.poisson\_nll\_loss(reduction='sum') -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.relu.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.relu.md deleted file mode 100644 index 3bdd1308373..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.relu.md +++ /dev/null @@ -1,19 +0,0 @@ -## [ torch 参数更多 ]torch.nn.functional.relu -### [torch.nn.functional.relu](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.relu.html#torch.nn.functional.relu) -```python -torch.nn.functional.relu(input, inplace=False) -``` - -### [paddle.nn.functional.relu](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/relu_cn.html#paddle.nn.functional.relu) -```python -paddle.nn.functional.relu(x, name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | --------------------------------------------------------------------------------------------------------------- | -| input | x | 输入的 Tensor,仅参数名不一致。 | -| inplace | - | 表示在不更改变量的内存地址的情况下,直接修改变量的值,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.soft_margin_loss.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.soft_margin_loss.md deleted file mode 100644 index 3a4d1ff52db..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.soft_margin_loss.md +++ /dev/null @@ -1,92 +0,0 @@ -## [ torch 参数更多 ]torch.nn.functional.soft_margin_loss -### [torch.nn.functional.soft\_margin\_loss](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.soft_margin_loss.html#torch.nn.functional.soft_margin_loss) -```python -torch.nn.functional.soft_margin_loss(input, - target, - size_average=None, - reduce=None, - reduction='mean') -``` - -### [paddle.nn.functional.soft\_margin\_loss](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/soft_margin_loss_cn.html#paddle.nn.functional.soft_margin_loss) -```python -paddle.nn.functional.soft_margin_loss(input, - label, - reduction='mean', - name=None) -``` - -其中 PyTorch 相⽐ Paddle ⽀持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | input | 输入 Tensor 。 | -| target | label | 输入 Tensor 对应的标签值,仅参数名不一致。 | -| size_average | - | 已弃用。需要转写。 | -| reduce | - | 已弃用。需要转写。 | -| reduction | reduction | 表示应用于输出结果的规约方式,可选值有:'none', 'mean', 'sum'。 | - -### 转写示例 - - -#### size_average -size_average 为 True -```python -# PyTorch 写法 -torch.nn.functional.soft_margin_loss(size_average=True) - -# Paddle 写法 -paddle.nn.functional.soft_margin_loss(reduction='mean') -``` - -size_average 为 False -```python -# PyTorch 写法 -torch.nn.functional.soft_margin_loss(size_average=False) - -# Paddle 写法 -paddle.nn.functional.soft_margin_loss(reduction='sum') -``` -#### reduce -reduce 为 True -```python -# PyTorch 写法 -torch.nn.functional.soft_margin_loss(reduce=True) - -# Paddle 写法 -paddle.nn.functional.soft_margin_loss(reduction='sum') -``` -reduce 为 False -```python -# PyTorch 写法 -torch.nn.functional.soft_margin_loss(reduce=False) - -# Paddle 写法 -paddle.nn.functional.soft_margin_loss(reduction='none') -``` -#### reduction -reduction 为'none' -```python -# PyTorch 写法 -torch.nn.functional.soft_margin_loss(reduction='none') - -# Paddle 写法 -paddle.nn.functional.soft_margin_loss(reduction='none') -``` -reduction 为'mean' -```python -# PyTorch 写法 -torch.nn.functional.soft_margin_loss(reduction='mean') - -# Paddle 写法 -paddle.nn.functional.soft_margin_loss(reduction='mean') -``` -reduction 为'sum' -```python -# PyTorch 写法 -torch.nn.functional.soft_margin_loss(reduction='sum') - -# Paddle 写法 -paddle.nn.functional.soft_margin_loss(reduction='sum') -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.triplet_margin_loss.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.triplet_margin_loss.md deleted file mode 100644 index 6499c92a82f..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.triplet_margin_loss.md +++ /dev/null @@ -1,107 +0,0 @@ -## [ torch 参数更多 ]torch.nn.functional.triplet_margin_loss -### [torch.nn.functional.triplet\_margin\_loss](https://docs.pytorch.org/docs/stable/generated/torch.nn.functional.triplet_margin_loss.html#torch.nn.functional.triplet_margin_loss) -```python -torch.nn.functional.triplet_margin_loss(anchor, - positive, - negative, - margin=1.0, - p=2, - eps=1e-06, - swap=False, - size_average=None, - reduce=None, - reduction='mean') -``` - -### [paddle.nn.functional.triplet\_margin\_loss](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/triplet_margin_loss_cn.html#paddle.nn.functional.triplet_margin_loss) -```python -paddle.nn.functional.triplet_margin_loss(input, - positive, - negative, - margin: float = 1.0, - p: float = 2.0, - epsilon: float = 1e-6, - swap: bool = False, - reduction: str = 'mean', - name: str = None) -``` - -其中 PyTorch 相⽐ Paddle ⽀持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| anchor | input | 输入 Tensor,仅参数名不一致。 | -| positive | positive | 输入正样本。 | -| negative | negative | 输入负样本。 | -| margin | margin | 手动指定间距。 | -| p | p | 指定范数。 | -| eps | epsilon | 防止除数为零的常数。 | -| swap | swap | 是否进行交换。 | -| size_average | - | 已弃用。 需要转写。 | -| reduce | - | 已弃用。需要转写。 | -| reduction | reduction | 表示应用于输出结果的规约方式,可选值有:'none', 'mean', 'sum'。 | - -### 转写示例 - - -#### size_average -size_average 为 True -```python -# PyTorch 写法 -torch.nn.functional.triplet_margin_loss(size_average=True) - -# Paddle 写法 -paddle.nn.functional.triplet_margin_loss(reduction='mean') -``` - -size_average 为 False -```python -# PyTorch 写法 -torch.nn.functional.triplet_margin_loss(size_average=False) - -# Paddle 写法 -paddle.nn.functional.triplet_margin_loss(reduction='sum') -``` -#### reduce -reduce 为 True -```python -# PyTorch 写法 -torch.nn.functional.triplet_margin_loss(reduce=True) - -# Paddle 写法 -paddle.nn.functional.triplet_margin_loss(reduction='sum') -``` -reduce 为 False -```python -# PyTorch 写法 -torch.nn.functional.triplet_margin_loss(reduce=False) - -# Paddle 写法 -paddle.nn.functional.triplet_margin_loss(reduction='none') -``` -#### reduction -reduction 为'none' -```python -# PyTorch 写法 -torch.nn.functional.triplet_margin_loss(reduction='none') - -# Paddle 写法 -paddle.nn.functional.triplet_margin_loss(reduction='none') -``` -reduction 为'mean' -```python -# PyTorch 写法 -torch.nn.functional.triplet_margin_loss(reduction='mean') - -# Paddle 写法 -paddle.nn.functional.triplet_margin_loss(reduction='mean') -``` -reduction 为'sum' -```python -# PyTorch 写法 -torch.nn.functional.triplet_margin_loss(reduction='sum') - -# Paddle 写法 -paddle.nn.functional.triplet_margin_loss(reduction='sum') -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.utils.clip_grad_norm_.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.utils.clip_grad_norm_.md deleted file mode 100644 index 7e816aa7531..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.utils.clip_grad_norm_.md +++ /dev/null @@ -1,29 +0,0 @@ -## [ torch 参数更多 ]torch.nn.utils.clip_grad_norm_ -### [torch.nn.utils.clip\_grad\_norm\_](https://docs.pytorch.org/docs/stable/generated/torch.nn.utils.clip_grad_norm_.html#torch.nn.utils.clip_grad_norm_) -```python -torch.nn.utils.clip_grad_norm_(parameters, - max_norm, - norm_type=2.0, - error_if_nonfinite=False, - foreach=None) -``` - -### [paddle.nn.utils.clip\_grad\_norm\_](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/utils/clip_grad_norm__cn.html#paddle.nn.utils.clip_grad_norm_) -```python -paddle.nn.utils.clip_grad_norm_(parameters, - max_norm, - norm_type=2.0, - error_if_nonfinite=False) -``` - -paddle 参数和 torch 参数完全一致,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ----------- | ------------ | -------------------------------------- | -| parameters | parameters | 需要参与梯度裁剪的一个 Tensor 或者多个 Tensor。 | -| max_norm | max_norm | 梯度的最大范数。 | -| norm_type | norm_type | 所用 p-范数类型。可以是无穷范数的`inf`。 | -| error_if_nonfinite | error_if_nonfinite | 如果为 True,且如果来自:attr:parameters`的梯度的总范数为`nan、inf`或-inf`,则抛出错误。 | -| foreach | - | 是否使用优化器的 foreach 实现。Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.normal.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.normal.md deleted file mode 100644 index d38f6e8871b..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.normal.md +++ /dev/null @@ -1,38 +0,0 @@ -## [ torch 参数更多 ]torch.normal -### [torch.normal](https://docs.pytorch.org/docs/stable/generated/torch.normal.html#torch.normal) -```python -torch.normal(mean, - std, - *, - generator=None, - out=None) -``` -### [paddle.normal](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/normal_cn.html#paddle.normal) -```python -paddle.normal(mean=0.0, - std=1.0, - shape=None, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| mean | mean | 表示正态分布的均值。 | -| std | std | 表示正态分布的方差。 | -| - | shape | 表示输出 Tensor 的形状,PyTorch 无此参数, Paddle 保持默认即可。 | -| generator | - | 用于采样的伪随机数生成器,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| out | - | 表示输出的 Tensor, Paddle 无此参数,需要转写。 | - - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.normal(torch.tensor([0, 0, 0]), torch.tensor([1.0, 2.0, 3.0]), out=y) - -# Paddle 写法 -paddle.assign(paddle.normal(paddle.to_tensor([0, 0, 0]), paddle.to_tensor([1.0, 2.0, 3.0])), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.optim.Adagrad.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.optim.Adagrad.md deleted file mode 100644 index b2fdad04f11..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.optim.Adagrad.md +++ /dev/null @@ -1,44 +0,0 @@ -## [ torch 参数更多 ]torch.optim.Adagrad -### [torch.optim.Adagrad](https://docs.pytorch.org/docs/stable/generated/torch.optim.Adagrad.html#torch.optim.Adagrad) -```python -torch.optim.Adagrad(params, - lr=1e-2, - lr_decay=0, - weight_decay=0, - initial_accumulator_value=0, - eps=1e-10, - foreach=None, - *, - maximize=False, - differentiable=False, - fused=None) -``` - -### [paddle.optimizer.Adagrad](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/optimizer/Adagrad_cn.html#paddle.optimizer.Adagrad) -```python -paddle.optimizer.Adagrad(learning_rate, - epsilon=1e-06, - parameters=None, - weight_decay=None, - grad_clip=None, - name=None, - initial_accumulator_value=0.0) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ----------------------------------- | ------------ | ----------------------------------------------------------------------- | -| params | parameters | 表示指定优化器需要优化的参数,仅参数名不一致。 | -| lr | learning_rate | 学习率,用于参数更新的计算。参数默认值不一致, PyTorch 默认为`1e-2`, Paddle 为必选参数,Paddle 需保持与 PyTorch 一致。 | -| lr_decay | - | 学习率衰减系数。Paddle 无此参数,暂无转写方式。 | -| weight_decay | weight_decay | 表示权重衰减系数,参数默认值不一致, PyTorch 默认为`0`, Paddle 默认为`None`,Paddle 需保持与 PyTorch 一致。 | -| initial_accumulator_value | initial_accumulator_value | 表示 moment 累加器的初始值,参数完全一致。 | -| eps | epsilon | 保持数值稳定性的短浮点类型值,参数默认值不一致, PyTorch 默认为`1e-10`, Paddle 为`1e-6`,Paddle 需保持与 PyTorch 一致。 | -| foreach | - | 是否使用优化器的 foreach 实现。Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| maximize | - | 根据目标最大化参数,而不是最小化。Paddle 无此参数,暂无转写方式。 | -| differentiable | - | 是否应通过训练中的优化器步骤进行自动微分。Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| fused | - | 表示是否使用 fused 的实现方式。Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| - | grad_clip | 梯度裁剪的策略。 PyTorch 无此参数,Paddle 保持默认即可。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.optim.AdamW.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.optim.AdamW.md deleted file mode 100644 index 9c668607d30..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.optim.AdamW.md +++ /dev/null @@ -1,56 +0,0 @@ -## [ torch 参数更多 ]torch.optim.AdamW -### [torch.optim.AdamW](https://docs.pytorch.org/docs/stable/generated/torch.optim.AdamW.html#torch.optim.AdamW) -```python -torch.optim.AdamW(params, - lr=0.001, - betas=(0.9, 0.999), - eps=1e-08, - weight_decay=0.01, - amsgrad=False, - *, - maximize=False, - foreach=None, - capturable=False, - differentiable=False, - fused=None) -``` - -### [paddle.optimizer.AdamW](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/optimizer/AdamW_cn.html#paddle.optimizer.AdamW) -```python -paddle.optimizer.AdamW(learning_rate=0.001, - beta1=0.9, - beta2=0.999, - epsilon=1e-08, - parameters=None, - weight_decay=0.01, - lr_ratio=None, - apply_decay_param_fun=None, - grad_clip=None, - name=None, - lazy_mode=False, - multi_precision=False, - amsgrad=False,) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ----------------------------------- | ------------ | ----------------------------------------------------------------------- | -| params | parameters | 表示指定优化器需要优化的参数,仅参数名不一致。 | -| lr | learning_rate | 学习率,用于参数更新的计算。仅参数名不一致。 | -| betas | beta1, beta2 | 一阶矩估计的指数衰减率。PyTorch 为元祖形式,Paddle 为分开的两个参数。默认值分别一致。 | -| eps | epsilon | 保持数值稳定性的短浮点类型值。仅参数名不一致。 | -| weight_decay | weight_decay | 表示权重衰减系数。参数名和默认值均一致。 | -| amsgrad | amsgrad | 是否使用该算法的 AMSGrad 变体。参数一致。 | -| maximize | - | 根据目标最大化参数,而不是最小化。Paddle 无此参数,暂无转写方式。 | -| foreach | - | 是否使用优化器的 foreach 实现。Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| capturable | - | 在 CUDA 图中捕获此实例是否安全。Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| differentiable | - | 是否应通过训练中的优化器步骤进行自动微分。Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| fused | - | 是否使用融合实现(仅限 CUDA)。Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| - | lr_ratio | 传入函数时,会为每个参数计算一个权重衰减系数,并使用该系数与学习率的乘积作为新的学习率。PyTorch 无此参数,Paddle 保持默认即可。 | -| - | apply_decay_param_fun | 传入函数时,只有可以使 apply_decay_param_fun(Tensor.name)==True 的 Tensor 会进行 weight decay 更新。PyTorch 无此参数,Paddle 保持默认即可。 | -| - | grad_clip | 梯度裁剪的策略。 PyTorch 无此参数,Paddle 保持默认即可。 | -| - | lazy_mode | 设为 True 时,仅更新当前具有梯度的元素。PyTorch 无此参数,Paddle 保持默认即可。 | -| - | multi_precision | 在基于 GPU 设备的混合精度训练场景中,该参数主要用于保证梯度更新的数值稳定性。PyTorch 无此参数,Paddle 保持默认即可。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.optim.Optimizer.step.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.optim.Optimizer.step.md deleted file mode 100644 index 6eb6301e55b..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.optim.Optimizer.step.md +++ /dev/null @@ -1,21 +0,0 @@ -## [ torch 参数更多 ]torch.optim.Optimizer.step - -### [torch.optim.Optimizer.step](https://docs.pytorch.org/docs/stable/generated/torch.optim.Optimizer.step.html#torch.optim.Optimizer.step) - -```python -torch.optim.Optimizer.step(closure=None) -``` - -### [paddle.optimizer.Optimizer.step](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/optimizer/Optimizer/step_cn.html#paddle/optimizer/Optimizer/step_cn#cn-api-paddle-optimizer-Optimizer-step) - -```python -paddle.optimizer.Optimizer.step() -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ---------- | ------------ | -- | -| closure | - | 传入一个闭包函数,在优化器更新参数前执行。Paddle 无此参数,暂无转写方式。| diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.optim.SGD.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.optim.SGD.md deleted file mode 100644 index 75cffe53949..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.optim.SGD.md +++ /dev/null @@ -1,42 +0,0 @@ -## [ torch 参数更多 ]torch.optim.SGD -### [torch.optim.SGD](https://docs.pytorch.org/docs/stable/generated/torch.optim.SGD.html#torch.optim.SGD) -```python -torch.optim.SGD(params, - lr=1e-3, - momentum=0, - dampening=0, - weight_decay=0, - nesterov=False, - *, - maximize=False, - foreach=None, - differentiable=False, - fused=None) -``` - -### [paddle.optimizer.SGD](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/optimizer/SGD_cn.html#paddle.optimizer.SGD) -```python -paddle.optimizer.SGD(learning_rate=0.001, - parameters=None, - weight_decay=None, - grad_clip=None, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ----------------------------------- | ------------ | ----------------------------------------------------------------------- | -| params | parameters | 表示指定优化器需要优化的参数,仅参数名不一致。 | -| lr | learning_rate | 学习率,用于参数更新的计算。PyTorch 无默认值,Paddle 默认为`0.001`,Paddle 需保持与 PyTorch 一致。 | -| momentum | - | 动量因子。Paddle 无此参数,暂无转写方式。 | -| dampening | - | 抑制动量。Paddle 无此参数,暂无转写方式。 | -| weight_decay | weight_decay | 表示权重衰减系数。参数默认值不一致, PyTorch 默认为`0`, Paddle 默认为`None`,Paddle 需保持与 PyTorch 一致。 | -| nesterov | - | 打开 nesterov 动量。Paddle 无此参数,暂无转写方式。 | -| maximize | - | 根据目标最大化参数,而不是最小化。Paddle 无此参数,暂无转写方式。 | -| foreach | - | 是否使用优化器的 foreach 实现。Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| differentiable | - | 是否应通过训练中的优化器步骤进行自动微分。Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| fused | - | 是否使用融合内核。Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。| -| - | grad_clip | 梯度裁剪的策略。 PyTorch 无此参数,Paddle 保持默认即可。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.poisson.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.poisson.md deleted file mode 100644 index 755d17c9b58..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.poisson.md +++ /dev/null @@ -1,19 +0,0 @@ -## [ torch 参数更多 ]torch.poisson -### [torch.poisson](https://docs.pytorch.org/docs/stable/generated/torch.poisson.html#torch.poisson) -```python -torch.poisson(input, - generator=None) -``` -### [paddle.poisson](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/poisson_cn.html#paddle.poisson) -```python -paddle.poisson(x, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,Paddle 中参数名为 ``x``,同时支持别名 ``input``。 | -| generator | - | 用于采样的伪随机数生成器,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.quantile.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.quantile.md deleted file mode 100644 index 0bcb7526896..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.quantile.md +++ /dev/null @@ -1,45 +0,0 @@ -## [ torch 参数更多 ]torch.quantile -### [torch.quantile](https://docs.pytorch.org/docs/stable/generated/torch.quantile.html#torch.quantile) -```python -torch.quantile(input, - q, - dim=None, - keepdim=False, - *, - interpolation='linear', - out=None) -``` - -### [paddle.quantile](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/quantile_cn.html#paddle.quantile) -```python -paddle.quantile(x, - q, - axis=None, - keepdim=False, - interpolation='linear', - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor,仅参数名不一致。 | -| q | q | 待计算的分位数。 | -| dim | axis | 指定对 x 进行计算的轴,仅参数名不一致。 | -| keepdim | keepdim | 是否在输出 Tensor 中保留减小的维度。 | -| interpolation | interpolation | 当所需分位数位于两个数据点之间时使用的插值方法。| -| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 | - - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.quantile(torch.tensor([0., 1., 2., 3.]), 0.6, interpolation='linear', out=y) - -# Paddle 写法 -paddle.assign(paddle.quantile(paddle.to_tensor([0., 1., 2., 3.]), 0.6, interpolation='linear'), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.rad2deg.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.rad2deg.md deleted file mode 100644 index 0be8469ee03..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.rad2deg.md +++ /dev/null @@ -1,29 +0,0 @@ -## [ torch 参数更多 ]torch.rad2deg -### [torch.rad2deg](https://docs.pytorch.org/docs/stable/generated/torch.rad2deg.html#torch.rad2deg) -```python -torch.rad2deg(input, *, out=None) -``` - -### [paddle.rad2deg](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/rad2deg_cn.html#paddle.rad2deg) -```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/torch_more_args/torch.randint.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.randint.md deleted file mode 100644 index 468e79507b6..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.randint.md +++ /dev/null @@ -1,81 +0,0 @@ -## [ torch 参数更多 ]torch.randint -### [torch.randint](https://docs.pytorch.org/docs/stable/generated/torch.randint.html#torch.randint) -```python -torch.randint(low=0, - high, - size, - *, - generator=None, - out=None, - dtype=None, - layout=torch.strided, - device=None, - pin_memory=False, - requires_grad=False) -``` - -### [paddle.randint](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/randint_cn.html#paddle.randint) -```python -paddle.randint(low=0, - high=None, - shape=[1], - dtype=None, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| low | low | 表示生成的随机值范围的下限(区间一般包含)。 | -| high | high | 表示生成的随机值范围的上限(区间一般不包含)。 | -| size | shape | 表示输出形状大小。 | -| generator | - | 用于采样的伪随机数生成器,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| out | - | 表示输出的 Tensor , Paddle 无此参数,需要转写。 | -| dtype | dtype | 表示数据类型。 | -| layout | - | 表示布局方式, Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| device | - | 表示 Tensor 存放设备位置,Paddle 无此参数,需要转写。 | -| pin_memory | - | 表示是否使用锁页内存, Paddle 无此参数,需要转写。 | -| requires_grad | - | 表示是否计算梯度, Paddle 无此参数,需要转写。 | - - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.randint(10, (2, 2), out=y) - -# Paddle 写法 -paddle.assign(paddle.randint(10, shape=[2, 2]), y) -``` - - -#### requires_grad:是否求梯度 -```python -# PyTorch 写法 -x = torch.randint(10, (2, 2), requires_grad=True) - -# Paddle 写法 -x = paddle.randint(10, shape=[2, 2]) -x.stop_gradient = False -``` - -#### device: Tensor 的设备 -```python -# PyTorch 写法 -torch.randint(10, (2, 2), device=torch.device('cpu')) - -# Paddle 写法 -y = paddle.randint(10, shape=[2, 2]) -y.cpu() -``` - -#### pin_memory:是否分配到固定内存上 -```python -# PyTorch 写法 -torch.randint(10, (2, 2), pin_memory=True) - -# Paddle 写法 -paddle.randint(10, shape=[2, 2]).pin_memory() -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.randint_like.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.randint_like.md deleted file mode 100644 index dbb94898128..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.randint_like.md +++ /dev/null @@ -1,72 +0,0 @@ -## [ torch 参数更多 ]torch.randint_like -### [torch.randint\_like](https://docs.pytorch.org/docs/stable/generated/torch.randint_like.html#torch.randint_like) -```python -torch.randint_like(input, - low=0, - high, - *, - memory_format=torch.preserve_format, - dtype=None, - layout=torch.strided, - device=None, - pin_memory=False, - requires_grad=False - ) -``` - -### [paddle.randint\_like](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/randint_like_cn.html#paddle.randint_like) -```python -paddle.randint_like(x, - low=0, - high=None, - dtype=None, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| low | low | 表示生成的随机值范围的下限(区间一般包含)。 | -| high | high | 表示生成的随机值范围的上限(区间一般不包含)。 | -| memory_format | - | 表示内存格式, Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| dtype | dtype | 表示数据类型。 | -| layout | - | 表示布局方式, Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| device | - | 表示 Tensor 存放设备位置,Paddle 无此参数,需要转写。 | -| pin_memory | - | 表示是否使用锁页内存, Paddle 无此参数,需要转写。 | -| requires_grad | - | 表示是否计算梯度, Paddle 无此参数,需要转写。 | - - - -### 转写示例 -#### device: Tensor 的设备 -```python -# PyTorch 写法 -torch.randint_like(x, 10, device=torch.device('cpu')) - -# Paddle 写法 -y = paddle.randint_like(x, 10) -y.cpu() -``` - -#### requires_grad:是否求梯度 -```python -# PyTorch 写法 -x = torch.randint_like(x, 10, requires_grad=True) - -# Paddle 写法 -x = paddle.randint_like(x, 10) -x.stop_gradient = False -``` - -#### pin_memory:是否分配到固定内存上 -```python -# PyTorch 写法 -x = torch.randint_like(x, 10, pin_memory=True) - -# Paddle 写法 -x = paddle.randint_like(x, 10).pin_memory() -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.renorm.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.renorm.md deleted file mode 100644 index 1af1719daa3..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.renorm.md +++ /dev/null @@ -1,31 +0,0 @@ -## [ torch 参数更多 ]torch.renorm -### [torch.renorm](https://docs.pytorch.org/docs/stable/generated/torch.renorm.html#torch.renorm) -```python -torch.renorm(input, p, dim, maxnorm, *, out=None) -``` - -### [paddle.renorm](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/renorm_cn.html#paddle.renorm) -```python -paddle.renorm(x, p, axis, max_norm) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | --------------------------------------------------- | -| input | x | 表示输入的 Tensor,仅参数名不一致。 | -| p | p | 表示 p-范数计算的 p 值。| -| dim | axis | 表示切分的维度,仅参数名不一致。 | -| maxnorm | max_norm | 表示子张量的 p-范数最大值,仅参数名不一致。 | -| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 | -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.renorm(x, 1, 0, 5, out=output) - -# Paddle 写法 -paddle.assign(paddle.renorm(x, 1, 0, 5), output) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.round.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.round.md deleted file mode 100644 index 58598f62b54..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.round.md +++ /dev/null @@ -1,36 +0,0 @@ -## [ torch 参数更多 ]torch.round -### [torch.round](https://docs.pytorch.org/docs/stable/generated/torch.round.html#torch.round) -```python -torch.round(input, - *, - decimals=0, - out=None) -``` - -### [paddle.round](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/round_cn.html#paddle.round) -```python -paddle.round(x, - decimals=0, - name=None) -``` -PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 输入的 Tensor ,仅参数名不一致。 | -| decimals | decimals | 要舍入到的小数位数。 | -| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 | - - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -x = torch.tensor([3, 5]) -torch.round(x, out=y) - -# Paddle 写法 -x = paddle.to_tensor([3, 5]) -paddle.assign(paddle.round(x), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.searchsorted.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.searchsorted.md deleted file mode 100644 index 707b1b97ff4..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.searchsorted.md +++ /dev/null @@ -1,63 +0,0 @@ -## [ torch 参数更多 ]torch.searchsorted -### [torch.searchsorted](https://docs.pytorch.org/docs/stable/generated/torch.searchsorted.html#torch.searchsorted) -```python -torch.searchsorted(sorted_sequence, - values, - *, - out_int32=False, - right=False, - side='left', - out=None, - sorter=None) -``` - -### [paddle.searchsorted](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/searchsorted_cn.html#paddle.searchsorted) -```python -paddle.searchsorted(sorted_sequence, - values, - out_int32=False, - right=False, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | --------------------------------------------------- | -| sorted_sequence | sorted_sequence | 表示待查找的 Tensor 。 | -| values | values | 表示用于查找的 Tensor。 | -| out_int32 | out_int32 | 表示输出的数据类型。 | -| right | right | 表示查找对应的上边界或下边界。 | -| side | - | 表示查找对应的上边界或下边界,Paddle 无此参数,需要转写。 | -| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 | -| sorter | - | 表示 sorted_sequence 元素无序时对应的升序索引,Paddle 无此参数,一般对网络训练结果影响不大。需要转写。 | - -### 转写示例 -#### side:指定查找对应的上边界或下边界 -```python -# PyTorch 写法 -torch.searchsorted(x,y, side='right') - -# Paddle 写法 -paddle.searchsorted(x,y,right=True) -``` - -#### out:指定输出 -```python -# PyTorch 写法 -torch.searchsorted(x,y, out=output) - -# Paddle 写法 -paddle.assign(paddle.searchsorted(x,y), output) -``` - -#### sorter: 提供 sorted_sequence 为无序 Tensor 时,相对应的升序索引 -```python -# PyTorch 写法 -torch.searchsorted(x,y, sorter=sorter) - -# Paddle 写法 -paddle.searchsorted(x.take_along_axis(axis = -1, indices = sorter), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.sgn.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.sgn.md deleted file mode 100644 index a446ce60afc..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.sgn.md +++ /dev/null @@ -1,32 +0,0 @@ -## [ torch 参数更多 ]torch.sgn -### [torch.sgn](https://docs.pytorch.org/docs/stable/generated/torch.sgn.html#torch.sgn) -```python -torch.sgn(input, - *, - out=None) -``` - -### [paddle.sgn](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/sgn_cn.html#paddle.sgn) -```python -paddle.sgn(x, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 输入的 Tensor ,仅参数名不一致。 | -| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 | - - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.sgn([3, 5], out=y) - -# Paddle 写法 -paddle.assign(paddle.sgn([3, 5]), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.signbit.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.signbit.md deleted file mode 100644 index 830ded1b4cb..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.signbit.md +++ /dev/null @@ -1,29 +0,0 @@ -## [ torch 参数更多 ]torch.signbit -### [torch.signbit](https://docs.pytorch.org/docs/stable/generated/torch.signbit.html#torch.signbit) -```python -torch.signbit(input, *, out=None) -``` - -### [paddle.signbit](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/signbit_cn.html#paddle.signbit) -```python -paddle.signbit(x, name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | ---------------------------------------------- | -| input | x | 输入 Tensor,仅参数名不一致。 | -| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.signbit([1., 2., 3., -1.], out=y) - -# Paddle 写法 -paddle.assign(paddle.signbit([1., 2., 3., -1.]), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.sinh.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.sinh.md deleted file mode 100644 index 9453aeac6a0..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.sinh.md +++ /dev/null @@ -1,32 +0,0 @@ -## [ torch 参数更多 ]torch.sinh -### [torch.sinh](https://docs.pytorch.org/docs/stable/generated/torch.sinh.html#torch.sinh) -```python -torch.sinh(input, - *, - out=None) -``` - -### [paddle.sinh](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/sinh_cn.html#paddle.sinh) -```python -paddle.sinh(x, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| out | - | 表示输出的 Tensor , Paddle 无此参数,需要转写。 | - - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.sinh([3, 5], out=y) - -# Paddle 写法 -paddle.assign(paddle.sinh([3, 5]), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.special.erf.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.special.erf.md deleted file mode 100644 index badd1eb3da1..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.special.erf.md +++ /dev/null @@ -1,31 +0,0 @@ -## [ torch 参数更多 ]torch.special.erf -### [torch.special.erf](https://docs.pytorch.org/docs/stable/special.html#torch.special.erf) -```python -torch.special.erf(input, - *, - out=None) -``` - -### [paddle.erf](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/erf_cn.html#paddle.erf) -```python -paddle.erf(x, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 表示输入的 Tensor ,仅参数名不一致。 | -| out | - | 表示输出的 Tensor , Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.special.erf(t, out=y) - -# Paddle 写法 -paddle.assign(paddle.erf(t), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.special.expm1.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.special.expm1.md deleted file mode 100644 index 41ab0d11680..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.special.expm1.md +++ /dev/null @@ -1,31 +0,0 @@ -## [ torch 参数更多 ]torch.special.expm1 -### [torch.special.expm1](https://docs.pytorch.org/docs/stable/special.html#torch.special.expm1) -```python -torch.special.expm1(input, - *, - out=None) -``` - -### [paddle.expm1](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/expm1_cn.html#paddle.expm1) -```python -paddle.expm1(x, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | x | 该 OP 的输入为多维 Tensor。数据类型为:float16、float32、float64,仅参数名不一致。 | -| out | - | 表示输出的 Tensor , Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.special.expm1([2, 3, 8, 7], [1, 5, 3, 3], out=y) - -# Paddle 写法 -paddle.assign(paddle.expm1([2, 3, 8, 7], [1, 5, 3, 3]), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.special.i0.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.special.i0.md deleted file mode 100644 index a14c43a2cae..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.special.i0.md +++ /dev/null @@ -1,31 +0,0 @@ -## [ torch 参数更多 ]torch.special.i0 -### [torch.special.i0](https://docs.pytorch.org/docs/stable/special.html#torch.special.i0) -```python -torch.special.i0(input, *, out=None) -``` - -### [paddle.i0](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/i0_cn.html#paddle.i0) -```python -paddle.i0(x, name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | -------------------------------------------------- | -| input | x | 表示输入的 Tensor,仅参数名不一致。 | -| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -x = torch.tensor([1, 2, 3, 4, 5], dtype=torch.float32) -torch.special.i0(x, out=y) - -# Paddle 写法 -x = paddle.to_tensor([1, 2, 3, 4, 5], dtype="float32") -paddle.assign(paddle.i0(x), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.special.i0e.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.special.i0e.md deleted file mode 100644 index ef36cba39fd..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.special.i0e.md +++ /dev/null @@ -1,31 +0,0 @@ -## [ torch 参数更多 ]torch.special.i0e -### [torch.special.i0e](https://docs.pytorch.org/docs/stable/special.html#torch.special.i0e) -```python -torch.special.i0e(input, *, out=None) -``` - -### [paddle.i0e](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/i0e_cn.html#paddle.i0e) -```python -paddle.i0e(x, name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | -------------------------------------------------- | -| input | x | 表示输入的 Tensor,仅参数名不一致。 | -| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -x = torch.tensor([1, 2, 3, 4, 5], dtype=torch.float32) -torch.special.i0e(x, out=y) - -# Paddle 写法 -x = paddle.to_tensor([1, 2, 3, 4, 5], dtype="float32") -paddle.assign(paddle.i0e(x), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.special.i1.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.special.i1.md deleted file mode 100644 index 5e0f8ff3bbd..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.special.i1.md +++ /dev/null @@ -1,31 +0,0 @@ -## [ torch 参数更多 ]torch.special.i1 -### [torch.special.i1](https://docs.pytorch.org/docs/stable/special.html#torch.special.i1) -```python -torch.special.i1(input, *, out=None) -``` - -### [paddle.i1](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/i1_cn.html#paddle.i1) -```python -paddle.i1(x, name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | -------------------------------------------------- | -| input | x | 表示输入的 Tensor,仅参数名不一致。 | -| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -x = torch.tensor([1, 2, 3, 4, 5], dtype=torch.float32) -torch.special.i1(x, out=y) - -# Paddle 写法 -x = paddle.to_tensor([1, 2, 3, 4, 5], dtype="float32") -paddle.assign(paddle.i1(x), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.special.i1e.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.special.i1e.md deleted file mode 100644 index cd71032bc08..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.special.i1e.md +++ /dev/null @@ -1,31 +0,0 @@ -## [ torch 参数更多 ]torch.special.i1e -### [torch.special.i1e](https://docs.pytorch.org/docs/stable/special.html#torch.special.i1e) -```python -torch.special.i1e(input, *, out=None) -``` - -### [paddle.i1e](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/i1e_cn.html#paddle.i1e) -```python -paddle.i1e(x, name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | -------------------------------------------------- | -| input | x | 表示输入的 Tensor,仅参数名不一致。 | -| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -x = torch.tensor([1, 2, 3, 4, 5], dtype=torch.float32) -torch.special.i1e(x, out=y) - -# Paddle 写法 -x = paddle.to_tensor([1, 2, 3, 4, 5], dtype="float32") -paddle.assign(paddle.i1e(x), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.special.logit.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.special.logit.md deleted file mode 100644 index f677bc79df6..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.special.logit.md +++ /dev/null @@ -1,30 +0,0 @@ -## [ torch 参数更多 ]torch.special.logit -### [torch.special.logit](https://docs.pytorch.org/docs/stable/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#paddle.logit) -```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) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.special.round.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.special.round.md deleted file mode 100644 index 7b4472fa557..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.special.round.md +++ /dev/null @@ -1,42 +0,0 @@ -## [ torch 参数更多 ]torch.special.round -### [torch.special.round](https://docs.pytorch.org/docs/stable/special.html#torch.special.round) -```python -# torch.special.round 为 torch.round 别名,参数和 torch.round 相同 -torch.special.round(input, *, decimals=0, out=None) -``` - -### [paddle.round](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/round_cn.html#paddle.round) -```python -paddle.round(x, name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------------ | -------------------------------------------------- | -| input | x | 输入的 Tensor,仅参数名不一致。 | -| decimals | - | 舍入到的小数位数,PaddlePaddle 无此参数,需要转写。 | -| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 | - -### 转写示例 -#### decimals:要舍入到的小数位数 -```python -# PyTorch 写法 -torch.special.round(x, decimals=2) - -# Paddle 写法 -paddle.round(1e2 * x) / 1e2 - -# 注:Paddle 可使用 10 的 decimals 次方来实现 -``` - -#### out 参数:输出的 Tensor -```python -# PyTorch 写法: -torch.special.round(x, out=y) - -# Paddle 写法: -paddle.assign(paddle.round(x), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.special.sinc.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.special.sinc.md deleted file mode 100644 index bb4ae887106..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.special.sinc.md +++ /dev/null @@ -1,27 +0,0 @@ -## [ torch 参数更多 ]torch.special.sinc -### [torch.special.sinc](https://docs.pytorch.org/docs/stable/special.html#torch.special.sinc) -```python -torch.special.sinc(input, *, out=None) -``` - -### [paddle.sinc](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/sinc_cn.html#paddle.sinc) -```python -paddle.sinc(x, name=None) -``` - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ----------------------------------------------------------------------------- | -| input | x | 表示输出的 Tensor, 仅参数名不一致。 | -| out | - | 表示输出的 Tensor,Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.special.sinc(input, out) - -# Paddle 写法 -paddle.assign(paddle.sinc(input), output=out) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.tensordot.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.tensordot.md deleted file mode 100644 index 4549a667fef..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.tensordot.md +++ /dev/null @@ -1,31 +0,0 @@ -## [ torch 参数更多 ]torch.tensordot -### [torch.tensordot](https://docs.pytorch.org/docs/stable/generated/torch.tensordot.html#torch.tensordot) -```python -torch.tensordot(a,b,dims=2,out=None) -``` - -### [paddle.tensordot](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/tensordot_cn.html#paddle.tensordot) -```python -paddle.tensordot(x,y,axes=2,name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------- | ------- | -| a | x | 表示缩并运算的左张量,仅参数名不一致。 | -| b | y | 表示缩并运算的右张量,仅参数名不一致。 | -| dims | axes | 表示对张量做缩并运算的轴,默认值为 2 ,仅参数名不一致。 | -| out | - | 表示输出的 Tensor , Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out: 输出的 Tensor -```python -# PyTorch 写法 -torch.tensordot(x,y,axes,out=output) - -# Paddle 写法 -paddle.assign(paddle.tensordot(x,y,axes),output) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.tril_indices.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.tril_indices.md deleted file mode 100644 index d99a8d0c031..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.tril_indices.md +++ /dev/null @@ -1,34 +0,0 @@ -## [ torch 参数更多 ]torch.tril_indices -### [torch.tril\_indices](https://docs.pytorch.org/docs/stable/generated/torch.tril_indices.html#torch.tril_indices) -```python -torch.tril_indices(row,col,offset=0,*,dtype=torch.long,device='cpu',layout=torch.strided) -``` - -### [paddle.tril\_indices](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/tril_indices_cn.html#paddle.tril_indices) -```python -paddle.tril_indices(row,col,offset=0,dtype='int64') -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------- | ------- | -| row | row | 表示输入 Tensor 的行数。 | -| col | col | 表示输入 Tensor 的列数。 | -| offset | offset | 表示从指定二维平面中获取对角线的位置。如果 offset = 0 ,取主对角线;如果 offset > 0 ,取主对角线右上的对角线;如果 offset < 0 ,取主对角线左下的对角线。 | -| dtype | dtype | 表示输出张量的数据类型。 | -| device | - | 表示 Tensor 存放设备位置,Paddle 无此参数,需要转写。 | -| layout | - | 表示布局方式, Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | - -### 转写示例 -#### device: Tensor 的设备 -```python -# PyTorch 写法 -torch.tril_indices(row,col,offset,dtype,device=torch.device('cpu')) - -# Paddle 写法 -y = paddle.tril_indices(row,col,offset,dtype) -y.cpu() -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.triu_indices.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.triu_indices.md deleted file mode 100644 index 40f824a18ad..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.triu_indices.md +++ /dev/null @@ -1,34 +0,0 @@ -## [ torch 参数更多 ]torch.triu_indices -### [torch.triu\_indices](https://docs.pytorch.org/docs/stable/generated/torch.triu_indices.html#torch.triu_indices) -```python -torch.triu_indices(row,col,offset=0,*,dtype=torch.long,device='cpu',layout=torch.strided) -``` - -### [paddle.triu\_indices](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/triu_indices_cn.html#paddle.triu_indices) -```python -paddle.triu_indices(row,col=None,offset=0,dtype='int64') -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------- | ------- | ------- | -| row | row | 表示输入 Tensor 的行数。 | -| col | col | 表示输入 Tensor 的列数。 | -| offset | offset | 表示从指定二维平面中获取对角线的位置。如果 offset = 0 ,取主对角线;如果 offset > 0 ,取主对角线右上的对角线;如果 offset < 0 ,取主对角线左下的对角线。 | -| dtype | dtype | 表示数据类型。 | -| device | - | 表示 Tensor 存放设备位置,Paddle 无此参数,需要转写。 | -| layout | - | 表示布局方式, Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | - -### 转写示例 -#### device: Tensor 的设备 -```python -# PyTorch 写法 -y = torch.triu_indices(row,col,offset,dtype,device=torch.device('cpu')) - -# Paddle 写法 -y = paddle.triu_indices(row,col,offset,dtype) -y.cpu() -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.trunc.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.trunc.md deleted file mode 100644 index 5027d556050..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.trunc.md +++ /dev/null @@ -1,31 +0,0 @@ -## [ torch 参数更多 ]torch.trunc -### [torch.trunc](https://docs.pytorch.org/docs/stable/generated/torch.trunc.html#torch.trunc) -```python -torch.trunc(input, - *, - out=None) -``` - -### [paddle.trunc](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/trunc_cn.html#paddle.trunc) -```python -paddle.trunc(input, - name=None) -``` - -PyTorch 相比 Paddle 支持更多其他参数,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| input | input | 表示输入的 Tensor。 | -| out | - | 表示输出的 Tensor , Paddle 无此参数,需要转写。 | - -### 转写示例 -#### out:指定输出 -```python -# PyTorch 写法 -torch.trunc(input, out=y) - -# Paddle 写法 -paddle.assign(paddle.trunc(input), y) -``` diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.utils.data.DataLoader.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.utils.data.DataLoader.md deleted file mode 100644 index b88b0c6a88f..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.utils.data.DataLoader.md +++ /dev/null @@ -1,66 +0,0 @@ -## [ torch 参数更多 ]torch.utils.data.DataLoader -### [torch.utils.data.DataLoader](https://docs.pytorch.org/docs/stable/data.html#torch.utils.data.DataLoader) -```python -torch.utils.data.DataLoader(dataset, - batch_size=1, - shuffle=False, - sampler=None, - batch_sampler=None, - num_workers=0, - collate_fn=None, - pin_memory=False, - drop_last=False, - timeout=0, - worker_init_fn=None, - multiprocessing_context=None, - generator=None, - *, - prefetch_factor=2, - persistent_workers=False, - pin_memory_device='') -``` - -### [paddle.io.DataLoader](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/io/DataLoader_cn.html#paddle.io.DataLoader) -```python -paddle.io.DataLoader(dataset, - feed_list=None, - places=None, - return_list=False, - batch_sampler=None, - batch_size=1, - shuffle=False, - drop_last=False, - collate_fn=None, - num_workers=0, - use_buffer_reader=True, - use_shared_memory=False, - timeout=0, - worker_init_fn=None) -``` - - -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ------------- | ------------ | ------------------------------------------------------ | -| dataset | dataset | 表示数据集。 | -| batch_size | batch_size | 每 mini-batch 中样本个数。 | -| shuffle | shuffle | 生成 mini-batch 索引列表时是否对索引打乱顺序。 | -| sampler | - | 表示数据集采集器,Paddle 无此参数,暂无转写方式。 | -| batch_sampler | batch_sampler | mini-batch 索引列表。 | -| num_workers | num_workers | 用于加载数据的子进程个数。 | -| collate_fn | collate_fn | 用于指定如何将样本列表组合为 mini-batch 数据。 | -| pin_memory | - | 表示数据最开始是属于锁页内存,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| drop_last | drop_last | 是否丢弃因数据集样本数不能被 batch_size 整除而产生的最后一个不完整的 mini-batch。 | -| timeout | timeout | 从子进程输出队列获取 mini-batch 数据的超时时间。 | -| worker_init_fn | worker_init_fn | 子进程初始化函数。 | -| multiprocessing_context | - | 用于设置多进程的上下文,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| generator | - | 用于采样的伪随机数生成器,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| prefetch_factor | - | 表示每个 worker 预先加载的数据数量,Paddle 无此参数,暂无转写方式。 | -| persistent_workers | - | 表示数据集使用一次后,数据加载器将会不会关闭工作进程,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| pin_memory_device | - | 数据加载器是否在返回 Tensor 之前将 Tensor 复制到设备固定存储器中,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| - | feed_list | 表示 feed 变量列表,PyTorch 无此参数,Paddle 保持默认即可。 | -| - | places | 数据需要放置到的 Place 列表,PyTorch 无此参数,Paddle 保持默认即可。 | -| - | return_list | 每个设备上的数据是否以 list 形式返回,PyTorch 无此参数,Paddle 保持默认即可。 | -| - | use_buffer_reader | 表示是否使用缓存读取器,PyTorch 无此参数,Paddle 保持默认即可。 | -| - | use_shared_memory | 表示是否使用共享内存来提升子进程将数据放入进程间队列的速度,PyTorch 无此参数,Paddle 保持默认即可。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.utils.data.distributed.DistributedSampler.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.utils.data.distributed.DistributedSampler.md deleted file mode 100644 index 52f0cabee40..00000000000 --- a/docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.utils.data.distributed.DistributedSampler.md +++ /dev/null @@ -1,33 +0,0 @@ -## [ torch 参数更多 ]torch.utils.data.distributed.DistributedSampler -### [torch.utils.data.distributed.DistributedSampler](https://docs.pytorch.org/docs/stable/data.html#torch.utils.data.distributed.DistributedSampler) -```python -torch.utils.data.distributed.DistributedSampler(dataset, - num_replicas=None, - rank=None, - shuffle=True, - seed=0, - drop_last=False) -``` - -### [paddle.io.DistributedBatchSampler](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/io/DistributedBatchSampler_cn.html#paddle.io.DistributedBatchSampler) -```python -paddle.io.DistributedBatchSampler(dataset=None, - batch_size, - num_replicas=None, - rank=None, - shuffle=False, - drop_last=False) -``` - -PyTorch 参数更多,具体如下: -### 参数映射 - -| PyTorch | PaddlePaddle | 备注 | -| ----- | ---------- | ---------- | -| dataset | dataset | 被采样的数据集。 | -| - | batch_size | 每 mini-batch 中包含的样本数,PyTorch 无此参数,Paddle 需设置为 1。 | -| num_replicas | num_replicas | 分布式训练时的进程个数。 | -| rank | rank | num_replicas 个进程中的进程序号。 | -| shuffle | shuffle | 是否需要在生成样本下标时打乱顺序。Paddle 与 PyTorch 默认值不同,Paddle 应设置为 `True`。 | -| seed | - | 如果 shuffle=True,则使用随机种子对采样器进行随机排序,此数字在分布式组中的所有进程中应相同,Paddle 无此参数,一般对网络训练结果影响不大,可直接删除。 | -| drop_last | drop_last | 是否需要丢弃最后无法凑整一个 mini-batch 的样本。 |