-
Notifications
You must be signed in to change notification settings - Fork 826
【Hackathon 5th No.45】映射文档69-70 -part #6217
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 10 commits
74ef784
1502c9d
588098e
72f868c
3bdc8d5
9d7d3ab
9ffa404
02a18f8
859c253
828fcce
8a5aec7
5d5111f
a6369bb
d2f1de4
fbef3ba
f7ace43
0c4bd06
98f2a72
84b5b7a
641a8d1
a1da7da
687b3ab
5c9a317
4532a7b
24906c4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
### [ 无参数 ] torch.cuda.seed | ||
|
||
### [torch.cuda.seed](https://pytorch.org/docs/stable/generated/torch.cuda.seed.html#torch.cuda.seed) | ||
|
||
```python | ||
torch.cuda.seed() | ||
``` | ||
|
||
### [paddle.seed](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/seed_cn.html#seed) | ||
|
||
```python | ||
paddle.seed() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 你这个API签名就不对,也不是无参数 |
||
``` | ||
|
||
两者功能一致,无参数。 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
### [ 无参数 ] torch.cuda.seed | ||
|
||
### [torch.cuda.seed_all](https://pytorch.org/docs/stable/generated/torch.cuda.seed.html#torch.cuda.seed) | ||
|
||
```python | ||
torch.cuda.seed() | ||
``` | ||
|
||
### [paddle.seed](https://www.paddlepaddle.org.cn/documentation/docs/zh/api/paddle/seed_cn.html#seed) | ||
|
||
```python | ||
paddle.seed() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这些签名不对 |
||
``` | ||
|
||
两者功能一致,无参数。 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
## [ 组合替代实现 ]torch.float_power | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 这个文档已经有开发的了 |
||
|
||
### [torch.float_power](https://pytorch.org/docs/stable/generated/torch.float_power.html#torch-float-power) | ||
```python | ||
torch.float_power(input, exponent) | ||
``` | ||
|
||
以双倍精度将输入以元素为单位提升到指数的幂级数。如果两个输入都不是复数,则返回 torch.float64 张量; | ||
如果一个或多个输入是复数,则返回 torch.complex128 张量。 | ||
|
||
PaddlePaddle 目前无对应 API,可使用如下代码组合实现该 API,不过 paddle.cast 不支持复数类型的转换。 | ||
|
||
### 转写示例 | ||
|
||
```python | ||
# Pytorch 写法 | ||
import paddle | ||
|
||
y = torch.float_power(input, exponent) | ||
|
||
# Paddle 写法 | ||
y = paddle.cast(paddle.pow(input, exponent), 'float64') | ||
``` |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -366,6 +366,7 @@ | |
| 328 | [torch.get_default_dtype](https://pytorch.org/docs/stable/generated/torch.get_default_dtype.html#torch-get-default-dtype) |[paddle.get_default_dtype](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/get_default_dtype_cn.html#get-default-dtype)| 无参数 , [差异对比](https://github.com/PaddlePaddle/docs/tree/develop/docs/guides/model_convert/convert_from_pytorch/api_difference/others/torch.get_default_dtype.md)| | ||
| 329 | [torch.is_grad_enabled](https://pytorch.org/docs/stable/generated/torch.is_grad_enabled.html?highlight=torch+is_grad_enabled#torch.is_grad_enabled) |[paddle.is_grad_enabled](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/is_grad_enabled_cn.html#is-grad-enabled)|无参数, [差异对比](https://github.com/PaddlePaddle/docs/tree/develop/docs/guides/model_convert/convert_from_pytorch/api_difference/others/torch.is_grad_enabled.md)| | ||
| 330 | [torch.manual_seed](https://pytorch.org/docs/stable/generated/torch.manual_seed.html#torch-manual-seed) |[paddle.seed](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/seed_cn.html)| 参数完全一致 , [差异对比](https://github.com/PaddlePaddle/docs/tree/develop/docs/guides/model_convert/convert_from_pytorch/api_difference/others/torch.manual_seed.md)| | ||
| 331 | [torch.float_power](https://pytorch.org/docs/stable/generated/torch.float_power.html#torch-float-power)| | 组合替代实现 , [差异对比](https://github.com/PaddlePaddle/docs/tree/develop/docs/guides/model_convert/convert_from_pytorch/api_difference/ops/torch.copysign.md)| | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 你这个路径对吗 |
||
|
||
***持续更新...*** | ||
|
||
|
@@ -1074,6 +1075,10 @@ | |
| 38 |[torch.cuda.ShortTensor](https://pytorch.org/docs/stable/tensors.html)|[paddle.to_tensor](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/to_tensor_cn.html#to-tensor)| 仅 paddle 参数更多 , [差异对比](https://github.com/PaddlePaddle/docs/tree/develop/docs/guides/model_convert/convert_from_pytorch/api_difference/cuda/torch.cuda.ShortTensor.md)| | ||
| 39 |[torch.cuda.stream](https://pytorch.org/docs/stable/generated/torch.cuda.stream.html)|[paddle.device.cuda.stream_guard](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/device/cuda/stream_guard_cn.html)|参数完全一致, [差异对比](https://github.com/PaddlePaddle/docs/tree/develop/docs/guides/model_convert/convert_from_pytorch/api_difference/cuda/torch.cuda.stream.md)| | ||
| 40 |[torch.cuda.Stream](https://pytorch.org/docs/stable/generated/torch.cuda.Stream.html#torch.cuda.Stream)|[paddle.device.cuda.Stream](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/device/cuda/Stream_cn.html)|参数不一致, [差异对比](https://github.com/PaddlePaddle/docs/tree/develop/docs/guides/model_convert/convert_from_pytorch/api_difference/cuda/torch.cuda.Stream__upper.md)| | ||
| 42 | [torch.cuda.seed](https://pytorch.org/docs/stable/generated/torch.cuda.seed.html)| | 功能一致,无参数,[差异对比](https://github.com/PaddlePaddle/docs/tree/develop/docs/guides/model_convert/convert_from_pytorch/api_difference/cuda/torch.cuda.seed.md)| | ||
| 43 | [torch.cuda.seed_all](https://pytorch.org/docs/stable/generated/torch.cuda.seed_all.html)| | 功能一致,无参数,[差异对比](https://github.com/PaddlePaddle/docs/tree/develop/docs/guides/model_convert/convert_from_pytorch/api_difference/cuda/torch.cuda.seed_all.md)| | ||
| 44 | [torch.cuda.comm.scatter](https://pytorch.org/docs/stable/generated/torch.cuda.comm.scatterw.html)| | 功能缺失 | | ||
| 45 | [torch.cuda.comm.gather](https://pytorch.org/docs/stable/generated/torch.cuda.comm.gather.html)| | 功能缺失| | ||
|
||
***持续更新...*** | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这两个错误的映射,你删掉吧