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

apply(fn) my_layer #6316

Merged
merged 8 commits into from
Dec 1, 2023
Merged

apply(fn) my_layer #6316

merged 8 commits into from
Dec 1, 2023

Conversation

rhmaaa
Copy link
Contributor

@rhmaaa rhmaaa commented Nov 16, 2023

PR types

bug fix

PR changes

docs

Description

apply(fn) 中文没有。
中英文源代码链接有误,如果前缀为“mylayer”少下划线。

关联问题:
PaddlePaddle/Paddle#59227 (comment)

Copy link

paddle-bot bot commented Nov 16, 2023

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

@CLAassistant
Copy link

CLAassistant commented Nov 16, 2023

CLA assistant check
All committers have signed the CLA.

@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Nov 17, 2023
@rhmaaa
Copy link
Contributor Author

rhmaaa commented Nov 17, 2023

这是哪里错了?有点没明白

@rhmaaa
Copy link
Contributor Author

rhmaaa commented Nov 21, 2023

@sunzhongkai588 孙哥看下?

Comment on lines +19 to +20
**返回**
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
**返回**

这段可以删掉


COPY-FROM: paddle.nn.Layer


Copy link
Collaborator

Choose a reason for hiding this comment

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

下面还是加上“方法”,因为以下都是方法而不是参数

Suggested change
方法
::::::::::::

@@ -10,14 +10,20 @@ Layer

基于 OOD 实现的动态图 Layer,包含该 Layer 的参数、前序运行的结构等信息。

参数
**参数**
Copy link
Collaborator

Choose a reason for hiding this comment

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

不用加粗,因为下面的 :::::::::::: 已经能让“参数”显示成一个标题


**参数**

**fn** (function) - 该函数被应用带每一个子层中
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
**fn** (function) - 该函数被应用带每一个子层中
- **fn** (function) - 应用到每一个子层的函数

@@ -421,6 +442,7 @@ astype(dtype=None)
返回类型:Layer
Copy link
Collaborator

Choose a reason for hiding this comment

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

上面的typo也顺手修改一下,把

astype(dtype=None)
:::::::::

修改成

astype(dtype=None)
'''''''''

Copy link
Collaborator

@sunzhongkai588 sunzhongkai588 left a comment

Choose a reason for hiding this comment

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

一些细节修改一下~


**参数**

-**fn** (function) - 应用到每一个子层的函数
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
-**fn** (function) - 应用到每一个子层的函数
- **fn** (function) - 应用到每一个子层的函数

Comment on lines 52 to 53
'''''''''
将一个函数 fn 递归地应用到网络的每一个子层(即在函数的 ``.sublayers()`` 中返回的子层)以及模块自身。该方法通常用来初始化一个模型中的参数。
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
'''''''''
将一个函数 fn 递归地应用到网络的每一个子层(即在函数的 ``.sublayers()`` 中返回的子层)以及模块自身。该方法通常用来初始化一个模型中的参数。
'''''''''
将一个函数 fn 递归地应用到网络的每一个子层(即在函数的 ``.sublayers()`` 中返回的子层)以及模块自身。该方法通常用来初始化一个模型中的参数。

Copy link
Collaborator

@sunzhongkai588 sunzhongkai588 left a comment

Choose a reason for hiding this comment

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

LGTM

@luotao1 luotao1 merged commit db911ab into PaddlePaddle:develop Dec 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contributor HappyOpenSource 快乐开源活动issue与PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants