-
Notifications
You must be signed in to change notification settings - Fork 874
Refine dy2stat docs #4103
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
Refine dy2stat docs #4103
Conversation
|
Thanks for your contribution! |
| net = SimpleNet() | ||
| x = paddle.rand([2, 10]) | ||
| y = paddle.rand([2, 3]) | ||
| out = net(x, y) |
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.
这里也加一下jit.save的导出代码吧,下面方式的case也加一下
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.
Done
| @@ -0,0 +1,440 @@ | |||
| # 转换原理 | |||
|
|
|||
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.
这里可以加几句概括性的话,简单介绍或引入下面的几个模块内容,比如类似,动转静模块在转换上,主要包括对XXX,XXX的处理.....
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.
Done
| # 案例解析 | ||
|
|
||
|
|
||
| 在[【基础接口用法】](./basic_usage_cn.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.
| 在[【基础接口用法】](./basic_usage_cn.html)章节我们介绍了动转静的用法和机制,下面会结合一些具体的模型代码,解答动转静中比较常见的问题。 | |
| 在[【使用样例】](./basic_usage_cn.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.
Done
| x_spec = InputSpec(shape=[None, 3], dtype='float32', name='x') | ||
|
|
||
| # step 3: @to_static 装饰 | ||
| static_func = to_static(net.another_func, input_spec=[x_spec]) |
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.
这里最好把 simplenet的class定义也放进来,用户可能不知道anotherfunc怎么定义的
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.
Done
|
|
||
| 在框架内部,动转静模块在转换上主要包括对InputSpec的处理,对函数调用的递归转写,对IfElse、For、While控制语句的转写,以及Layer的Parameters和Buffers变量的转换。下面将从这四个方面介绍动转静模块的转换原理。 | ||
|
|
||
| ## 一、 输入层 InputSpec |
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.
这里换一个标题吧,比如设置 Placeholder? 要描述操作的目的,而不是我们提供的API
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.
已修改为设置 Placeholder 信息
* Move @to_static pnd into parent dir (#4045) * Refactor @to_static tutorial doc (#4044) * Refactor @to_static turial doc * polish code * refine content * refine doc * fix web link * polish doc * fix code style * Refine dy2stat docs (#4103) * refine dy2stat docs * fix index_cn.rst * fix code review * modify the explanation for imgs * change title * 动转静概述更新 (#4099) * 动转静概述更新 更新动转静概述章节,补充两个Block,什么是动态图和静态图,什么场景下需要动态图转成静态图 * 动转静概述更新 增加动转静方案示意图 * update style update style * update style * Update index_cn.rst * 修复格式问题 * update codes Co-authored-by: Chen Long <[email protected]> * fix jit (#4128) * fix jit * fix jit * add jit example * fix style * fix style * update to 2.2.1 (#4133) Co-authored-by: Aurelius84 <[email protected]> Co-authored-by: 0x45f <[email protected]> Co-authored-by: moguguo <[email protected]> Co-authored-by: Chen Long <[email protected]>
Refine dy2stat docs
预览地址:http://10.136.157.23:8090/documentation/docs/zh/faq/index_cn.html?reviewVersion=jenkins-doc-review-1720