diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/Tensor/torch.Tensor.nan_to_num.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/Tensor/torch.Tensor.nan_to_num.md new file mode 100644 index 00000000000..fbeca6d2a84 --- /dev/null +++ b/docs/guides/model_convert/convert_from_pytorch/api_difference/Tensor/torch.Tensor.nan_to_num.md @@ -0,0 +1,23 @@ +## [参数完全一致]torch.Tensor.nan_to_num + +### [torch.Tensor.nan_to_num](https://pytorch.org/docs/1.13/generated/torch.Tensor.nan_to_num.html#torch.Tensor.nan_to_num) + +```python +torch.Tensor.nan_to_num(nan=0.0, posinf=None, neginf=None) +``` + +### [paddle.Tensor.nan_to_num](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/Tensor_cn.html#nan-to-num) + +```python +paddle.Tensor.nan_to_num(nan=0.0, posinf=None, neginf=None) +``` + +两者功能一致,且参数用法一致,具体如下: + +### 参数映射 + +| PyTorch | PaddlePaddle | 备注 | +| ------- | ------------ | --------------- | +| nan | nan | NaN 的替换值。 | +| posinf | posinf | +inf 的替换值。 | +| neginf | neginf | -inf 的替换值。 | diff --git a/docs/guides/model_convert/convert_from_pytorch/api_difference/Tensor/torch.Tensor.nextafter.md b/docs/guides/model_convert/convert_from_pytorch/api_difference/Tensor/torch.Tensor.nextafter.md new file mode 100644 index 00000000000..112edf665c7 --- /dev/null +++ b/docs/guides/model_convert/convert_from_pytorch/api_difference/Tensor/torch.Tensor.nextafter.md @@ -0,0 +1,23 @@ +## [仅参数名不一致]torch.Tensor.nextafter + +### [torch.Tensor.nextafter](https://pytorch.org/docs/1.13/generated/torch.Tensor.nextafter.html#torch.Tensor.nextafter) + +```python +torch.Tensor.nextafter(other) +``` + +### [paddle.Tensor.nextafter](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nextafter_cn.html) + +```python +paddle.Tensor.nextafter(y) +``` + +其中 xxx 相比 xxx 支持更多其他参数,具体如下: + +### 参数映射 + +两者功能一致,且参数用法一致,仅参数名不同,具体如下: + +| PyTorch | PaddlePaddle | 备注 | +| ------- | ------------ | ---------------------------------- | +| other | y | 输⼊第二个 Tensor,仅参数名不同。 |