Skip to content
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

映射文档 No. 299/305/316/317/319 #6021

Merged
merged 1 commit into from
Jul 20, 2023
Merged

Conversation

co63oc
Copy link
Contributor

@co63oc co63oc commented Jul 13, 2023

PaddlePaddle/PaConvert#112

299 torch.cumulative_trapezoid
305 torch.special.i1
316 torch.special.i1e
317 torch.special.i0
319 torch.histogram

@paddle-bot
Copy link

paddle-bot bot commented Jul 13, 2023

感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-6021.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html
预览工具的更多说明,请参考:飞桨文档预览工具

@@ -0,0 +1,24 @@
## [仅参数名不一致]torch.cumulative_trapezoid

### [torch.cumulative_trapezoid](https://pytorch.org/docs/1.13/generated/torch.cumulative_trapezoid.html#torch.cumulative_trapezoid)
Copy link
Contributor

Choose a reason for hiding this comment

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

这个不要用1.13版本torch的API,要用最新版本torch的API

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改

@@ -0,0 +1,39 @@
## [torch 参数更多]torch.histogram

### [torch.histogram](https://pytorch.org/docs/1.13/generated/torch.histogram.html#torch.histogram)
Copy link
Contributor

Choose a reason for hiding this comment

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

这个不要用1.13版本torch的API,要用最新版本torch的API

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改

@@ -0,0 +1,36 @@
## [torch 参数更多]torch.special.i0

### [torch.special.i0](https://pytorch.org/docs/1.13/special.html#torch.special.i0)
Copy link
Contributor

Choose a reason for hiding this comment

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

这个不要用1.13版本torch的API,要用最新版本torch的API

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改

| bins | bins | 直方图 bins(直条)的个数。 |
| range | min, max | PyTorch 为 bins 的范围,类型为 float,Paddle 为 range 的下边界,上边界,类型为 int,需要进行转写。 |
| weight | - | 权重,Paddle 无此参数,暂无转写方式。 |
| density | - | 结果中每个 bin 是否包含权重数,Paddle 无此参数,暂无转写方式。 |
Copy link
Collaborator

Choose a reason for hiding this comment

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

加一个返回值的对比

这两个API返回的Tensor数量不同对不上

分类为 参数不一致

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改

| range | min, max | PyTorch 为 bins 的范围,类型为 float,Paddle 为 range 的下边界,上边界,类型为 int,需要进行转写。 |
| weight | - | 权重,Paddle 无此参数,暂无转写方式。 |
| density | - | 结果中每个 bin 是否包含权重数,Paddle 无此参数,暂无转写方式。 |
| 返回值 | 返回值 | PyTorch 返回 hist 和 bin_edges,Paddle 返回 hist,需要进行转写。 |
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个如果没办法计算出bin_edges,那应该是暂无转写方式,这个转写是指Pytorch代码如何转为paddle代码,也就是paddle怎么去适配pytorch的一个API调用,不能去改pytorch来适配paddle的

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改暂无转写方式

y = paddle.histogram(x, bins=5, min=0, max=3)
```

#### 返回值
Copy link
Collaborator

@zhwesky2010 zhwesky2010 Jul 19, 2023

Choose a reason for hiding this comment

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

这个转写是指Pytorch的一次API调用如何转为paddle代码,也就是torch.histogram(x, bins=5, range=(0., 3.)) 如何转写,不能去改动 待转写的Pytorch代码形式
这个如果没办法实现出bin_edges,就只能按功能缺失来了

Copy link
Contributor Author

Choose a reason for hiding this comment

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

已修改取消

Copy link
Collaborator

@zhwesky2010 zhwesky2010 left a comment

Choose a reason for hiding this comment

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

LGTM

@zhwesky2010 zhwesky2010 merged commit b15f01a into PaddlePaddle:develop Jul 20, 2023
1 check passed
@co63oc co63oc deleted the cum branch August 30, 2023 23:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants