-
Notifications
You must be signed in to change notification settings - Fork 777
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
[Docathon][Update Doc No.10、20] Remove fluid APIs and update APIs in program.rst and program_en.rst #7077
base: develop
Are you sure you want to change the base?
Conversation
Update the document to align with the latest API changes
感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-7077.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html |
@Abosite 同学好,先按照如下指令修一下代码风格 2025-03-05 09:17:32 ************************************************************************************
2025-03-05 09:17:32 Your PR code style check failed.
2025-03-05 09:17:32 Please install pre-commit locally and set up git hook scripts:
2025-03-05 09:17:32
2025-03-05 09:17:32 pip install pre-commit==2.17.0
2025-03-05 09:17:32 pre-commit install
2025-03-05 09:17:32
2025-03-05 09:17:32 Then, run pre-commit to check codestyle issues in your PR:
2025-03-05 09:17:32
2025-03-05 09:17:32 pre-commit run --files docs/api_guides/low_level/program.rst docs/api_guides/low_level/program_en.rst
2025-03-05 09:17:32
2025-03-05 09:17:32 For more information, please refer to our codestyle check guide:
2025-03-05 09:17:32 https://www.paddlepaddle.org.cn/documentation/docs/zh/develop/dev_guides/git_guides/codestyle_check_guide_cn.html
2025-03-05 09:17:32 ************************************************************************************ |
感谢您的回复!我将进行修改 |
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.
这里很多概念的描述在 PIR 下已经过时,相关内容可能需要根据 https://github.com/PaddlePaddle/community/tree/master/pfcc/paddle-code-reading/IR_Dialect 修改下
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.
英文部分也相应改一下
|
||
新 IR 通过 :code:`Operation` 、:code:`Region` 、:code:`Block` 三者的循环嵌套来表示结构化控制流。 | ||
|
||
一个 Op 会包含 0 个或多个 :code:`Region` , 一个 :code:`Region` 会包含 0 个或多个 :code:`Block` , 一个 :code:`Block` 里面包含了 0 个或多个:code:`Operation` 。 三者循环嵌套包含,用来描述复杂的模型结构。 |
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.
``:code:` 左侧要加空格,否则不会渲染,可以参考 preview-pr-7077 修改下
:code:`Operation`
|
||
:code:`Paddle` 通过一种 IR(Intermediate Representation,中间表示形式)来表示计算图,并在此基础上借助编译器的理念、技术和工具对神经网络进行自动优化和代码生成。 | ||
|
||
新 IR 通过 :code:`Operation` 、:code:`Region` 、:code:`Block` 三者的循环嵌套来表示结构化控制流。 |
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.
把 新 IR 中的 新 删去
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.
这里改成 PIR 吧,前面需要介绍下我们使用的是 PIR
Region | ||
========= | ||
|
||
:code:`Region` 里面包含了一个:code:`Block`列表, 第一个:code:`Block` (如果存在的话),称为该 :code:`Region` 的入口块。 |
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.
前后要空格,可以参考 preview-pr-7077 修改下
:code:`Region`
============= | ||
|
||
在 Fluid 中,所有对数据的操作都由 :code:`Operator` 表示,为了便于用户使用,在 Python 端,Fluid 中的 :code:`Operator` 被一步封装入 :code:`paddle.fluid.layers` , :code:`paddle.fluid.nets` 等模块。 | ||
权重属性是一种特殊的属性,权重属性的数据量一般会非常大,:code:`Paddle` 将权重单独存储,在模型中通过权重名对权重值进行获取和保存。目前 :code:`Paddle` 所有模型的权重都是 ``Variable`` 类型。 |
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.
目前 :code:`Paddle` 所有模型的权重都是 ``Variable`` 类型。
这句修改为:
在 Paddle 动态图下对应 :code:`EagerParamBase` 类
|
||
模型中所有的可学习参数都以 :code:`Variable` 的形式保留在内存空间中,您在绝大多数情况下都不需要自己来创建网络中的可学习参数, Fluid 为几乎常见的神经网络基本计算模块都提供了封装。以最简单的全连接模型为例,调用 :code:`fluid.layers.fc` 会直接为全连接层创建连接权值( W )和偏置( bias )两个可学习参数,无需显示地调用 :code:`variable` 相关接口创建可学习参数。 | ||
模型中所有的可学习参数都以 :code:`Variable` 的形式保留在内存空间中,您在绝大多数情况下都不需要自己来创建网络中的可学习参数, :code:`Paddle` 为几乎常见的神经网络基本计算模块都提供了封装。以静态图中最简单的全连接模型为例,调用 :code:`paddle.static.nn.fc` 会直接为全连接层创建连接权值( W )和偏置( bias )两个可学习参数,无需显示地调用 :code:`variable` 相关接口创建可学习参数。 | ||
|
||
.. _api_guide_Name: | ||
|
||
========= | ||
Name |
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.
Name 这部分删掉吧,现在不这么用了
* 用户还可以使用 :ref:`cn_api_fluid_program_guard` 配合 :code:`with` 语句,修改配置好的 :ref:`cn_api_fluid_default_startup_program` 和 :ref:`cn_api_fluid_default_main_program` 。 | ||
|
||
* 在 Fluid 中,Block 内部执行顺序由控制流决定,如 :ref:`cn_api_fluid_layers_IfElse` , :ref:`cn_api_fluid_layers_While`, :ref:`cn_api_fluid_layers_Switch` 等,更多内容可参考: :ref:`api_guide_control_flow` | ||
.. code-block:: python |
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.
下面要空一行,否则渲染不了
看着预览链PR7077接改一下
Remove all fluid API references
Update the document to align with the latest API changes
@DrRyanHuang 和 @sunzhongkai588