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

【映射文档】新增部分映射文档 #6512

Merged
merged 5 commits into from
Mar 8, 2024

Conversation

RedContritio
Copy link
Contributor

@RedContritio RedContritio commented Mar 5, 2024

  • 新增部分映射文档
  • 合并检查逻辑,减少检查出现问题的可能性,并参考 此前意见 ,当类型不符合预设类型时,中断生成。

Copy link

paddle-bot bot commented Mar 5, 2024

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

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.

  1. 后面按这个格式来统一,包括 分类情况、别名API(无需维护新的.md,直接引用主API的md),同时更新下 pytorch_api_mapping_format_cn.md 吧
infoflow 2024-03-05 16-12-32
  1. 文档的细节较多,注意把握,写完后可以自己通读一遍

@@ -0,0 +1,24 @@
## [ 仅参数名不一致 ]torch.nn.functional.dropout
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个 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.

按照 torch 角度来看,inplace 可删除所以应该算是 torch 参数更多

### [paddle.nn.functional.rrelu](https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/api/paddle/nn/functional/rrelu_cn.html)

```python
paddle.nn.functional.rrelu(x, lower=1./8., upper=1./3., training=True, name=None)
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个有没有inplace的版本对应

Copy link
Contributor Author

Choose a reason for hiding this comment

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

没有,目前实现上是直接用的 GenericMatcher


# Paddle 写法
out1, out2 = paddle.mode(x, dim, False)
paddle.assign(out1, (a, b)[0]), paddle.assign(out2, (a, b)[1])
Copy link
Collaborator

Choose a reason for hiding this comment

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

这个写两行吧,看得清楚点:

paddle.assign(out1, a)
paddle.assign(out2, b)

Copy link
Collaborator

Choose a reason for hiding this comment

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

paddle.assign(out1, a), paddle.assign(out2, b)

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.

写完文档后自查一遍:包括 映射分类、参数映射 的细节

paddle.nn.functional.rrelu(x, lower=1./8., upper=1./3., training=True, name=None)
```

其中 PyTorch 和 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的inplace区别吧,参考上面的inplace参数描述

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.

下个PR修改一下,先合入了

@@ -0,0 +1,27 @@
## [torch 参数]torch.nn.functional.embedding
Copy link
Collaborator

Choose a reason for hiding this comment

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

torch参数更多

Copy link
Contributor Author

Choose a reason for hiding this comment

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

追加,该文件因为没有出现在主目录中,所以未作映射类别检查,后续考虑继续完善

@zhwesky2010 zhwesky2010 merged commit 301efe0 into PaddlePaddle:develop Mar 8, 2024
2 checks passed
@RedContritio RedContritio deleted the update_check branch March 9, 2024 07:44
RedContritio added a commit to RedContritio/PaddleDocs that referenced this pull request Mar 9, 2024
zhwesky2010 pushed a commit that referenced this pull request Mar 13, 2024
* fix incorrect mapping type from docs/#6512

* update 2 doc

* fix paddle api url in torch.mean

* update some docs

* fix some bugs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants