Skip to content

【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

Merged
merged 25 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
74ef784
add api mapping
longranger2 Sep 30, 2023
1502c9d
Update pytorch_api_mapping_cn.md
longranger2 Sep 30, 2023
588098e
Update pytorch_api_mapping_cn.md
longranger2 Sep 30, 2023
72f868c
Update pytorch_api_mapping_cn.md
longranger2 Oct 3, 2023
3bdc8d5
Update pytorch_api_mapping_cn.md
longranger2 Oct 21, 2023
9d7d3ab
add torch.float_power.md
longranger2 Oct 21, 2023
9ffa404
Merge branch 'hackthon_45' of https://github.com/longranger2/docs int…
longranger2 Oct 21, 2023
02a18f8
add torch.cuda.seed.md and torch.cuda.seed_all.md
longranger2 Oct 21, 2023
859c253
update torch.cuda.float_power.md
longranger2 Oct 21, 2023
828fcce
Merge branch 'PaddlePaddle:develop' into hackthon_45
longranger2 Oct 25, 2023
8a5aec7
Merge branch 'develop' into hackthon_45
longranger2 Nov 9, 2023
5d5111f
fix bug
longranger2 Nov 9, 2023
a6369bb
fix bug
longranger2 Nov 13, 2023
d2f1de4
fix bug
longranger2 Nov 21, 2023
fbef3ba
Merge branch 'PaddlePaddle:develop' into hackthon_45
longranger2 Nov 22, 2023
f7ace43
fix bug
longranger2 Dec 9, 2023
0c4bd06
fix bug
longranger2 Dec 9, 2023
98f2a72
Delete docs/guides/model_convert/convert_from_pytorch/api_difference/…
longranger2 Jan 19, 2024
84b5b7a
Delete docs/guides/model_convert/convert_from_pytorch/api_difference/…
longranger2 Jan 19, 2024
641a8d1
Update pytorch_api_mapping_cn.md
longranger2 Jan 19, 2024
a1da7da
fix bug
longranger2 Jan 22, 2024
687b3ab
fix bug
longranger2 Jan 22, 2024
5c9a317
Merge branch 'PaddlePaddle:develop' into hackthon_45
longranger2 Jan 23, 2024
4532a7b
fix bug
longranger2 Jan 24, 2024
24906c4
Merge branch 'PaddlePaddle:develop' into hackthon_45
longranger2 Jan 24, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
### [ 无参数 ] torch.cuda.seed
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这两个错误的映射,你删掉吧


### [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()
Copy link
Collaborator

Choose a reason for hiding this comment

The 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()
Copy link
Collaborator

Choose a reason for hiding this comment

The 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
Copy link
Collaborator

Choose a reason for hiding this comment

The 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
Expand Up @@ -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)|
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

你这个路径对吗


***持续更新...***

Expand Down Expand Up @@ -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)| | 功能缺失|

***持续更新...***

Expand Down