-
Notifications
You must be signed in to change notification settings - Fork 766
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
19 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
...ides/model_convert/convert_from_pytorch/api_difference/ops/torch.from_dlpack.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
## [ 仅参数名不一致 ]torch.from_dlpack | ||
|
||
### [torch.from_dlpack](https://pytorch.org/docs/2.0/generated/torch.from_dlpack.html?highlight=from_dlpack#torch.from_dlpack) | ||
|
||
```python | ||
torch.from_dlpack(ext_tensor) | ||
``` | ||
|
||
### [paddle.utils.dlpack.from_dlpack](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/utils/dlpack/from_dlpack_cn.html) | ||
|
||
```python | ||
paddle.utils.dlpack.from_dlpack(dlpack) | ||
``` | ||
|
||
两者功能一致且参数用法一致,仅参数名不同,具体如下: | ||
### 参数映射 | ||
| PyTorch | PaddlePaddle | 备注 | | ||
| ------------- | ------------ | ------------------------------------------------------ | | ||
| ext_tensor | dlpack | 表示输入的带有 dltensor 的 PyCapsule 对象,仅参数名不一致。 | |