-
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.
【Hackathon 5th No.7】为 Paddle 新增 apply API (#6429)
* add docs apply_ * fix
- Loading branch information
1 parent
23cceca
commit e8b395f
Showing
3 changed files
with
37 additions
and
1 deletion.
There are no files selected for viewing
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
20 changes: 20 additions & 0 deletions
20
...model_convert/convert_from_pytorch/api_difference/Tensor/torch.Tensor.apply_.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,20 @@ | ||
## [ 参数完全一致 ]torch.Tensor.apply_ | ||
### [torch.Tensor.apply_](https://pytorch.org/docs/stable/generated/torch.Tensor.apply_.html) | ||
|
||
```python | ||
torch.Tensor.apply_(callable) | ||
``` | ||
|
||
### [paddle.Tensor.apply_]() | ||
|
||
```python | ||
paddle.Tensor.apply_(callable) | ||
``` | ||
|
||
|
||
两者功能不同,pytorch 只支持 Inplace 操作,且只对 CPU tensor 才能使用。Paddle 版本可以在 GPU 下运行同时也有 outplace 版本。两者参数一致,具体如下: | ||
|
||
### 参数映射 | ||
| PyTorch | PaddlePaddle | 备注 | | ||
|----------|--------------|-----------| | ||
| callable | callable | 一个被调用的函数。 | |
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